Skip to content
Snippets Groups Projects
Commit df11508c authored by OZGCloud's avatar OZGCloud
Browse files

edit configuration

parent ed79ce10
No related branches found
No related tags found
No related merge requests found
package de.ozgcloud.archive;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ArchiveManagerConfiguration { //NOSONAR
public static final String VORGANG_REMOTE_MANAGER_SERVICE_NAME = "archive_VorgangRemoteService";
public static final String VORGANG_WITH_EINGANG_MAPPER_NAME = "archive_VorgangWithEingangMapper";
public static final String DOCUMENT_MAPPER_NAME = "archive_DocumentMapper";
public static final String USER_SERVICE_NAME = "archive_UserService";
public static final String USER_PROFILE_MAPPER_NAME = "archive_UserProfileMapper";
public static final String OZGCLOUD_USER_PROFILE_SERVICE_NAME = "archive_OzgCloudUserProfileService";
public static final String COMMAND_SERVICE_NAME = "archive_CommandService";
public static final String COMMAND_REMOTE_SERVICE_NAME = "archive_CommandRemoteService";
public static final String COMMAND_MAPPER_NAME = "archive_CommandMapper";
public static final String BINARY_FILE_SERVICE_NAME = "archive_BinaryFileService";
public static final String BINARY_FILE_REMOTE_SERVICE_NAME = "archive_BinaryFileRemoteService";
public static final String FILE_ID_MAPPER_NAME = "archive_FileIdMapper";
public static final String BESCHEID_REMOTE_SERVICE_NAME = "archive_BescheidRemoteService";
public static final String BESCHEID_MAPPER_NAME = "archive_BescheidMapper";
}
package de.ozgcloud.archive; package de.ozgcloud.archive;
import org.mapstruct.factory.Mappers;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
...@@ -11,13 +10,10 @@ import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextProvider; ...@@ -11,13 +10,10 @@ import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextProvider;
import de.ozgcloud.apilib.file.grpc.GrpcOzgCloudFileService; import de.ozgcloud.apilib.file.grpc.GrpcOzgCloudFileService;
import de.ozgcloud.apilib.file.grpc.OzgCloudFileMapper; import de.ozgcloud.apilib.file.grpc.OzgCloudFileMapper;
import de.ozgcloud.apilib.user.GrpcOzgCloudUserProfileService; import de.ozgcloud.apilib.user.GrpcOzgCloudUserProfileService;
import de.ozgcloud.apilib.user.OzgCloudUserProfileService;
import de.ozgcloud.apilib.user.UserProfileMapper; import de.ozgcloud.apilib.user.UserProfileMapper;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangIdMapper;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangService;
import de.ozgcloud.apilib.vorgang.grpc.GrpcOzgCloudVorgangService;
import de.ozgcloud.apilib.vorgang.grpc.OzgCloudVorgangMapper;
import de.ozgcloud.apilib.vorgang.grpc.OzgCloudVorgangStubMapper;
import de.ozgcloud.archive.common.GrpcUtil; import de.ozgcloud.archive.common.GrpcUtil;
import de.ozgcloud.archive.common.callcontext.CallContextProvider;
import de.ozgcloud.user.grpc.userprofile.UserProfileServiceGrpc.UserProfileServiceBlockingStub; import de.ozgcloud.user.grpc.userprofile.UserProfileServiceGrpc.UserProfileServiceBlockingStub;
import de.ozgcloud.vorgang.grpc.binaryFile.BinaryFileServiceGrpc.BinaryFileServiceBlockingStub; import de.ozgcloud.vorgang.grpc.binaryFile.BinaryFileServiceGrpc.BinaryFileServiceBlockingStub;
import de.ozgcloud.vorgang.grpc.binaryFile.BinaryFileServiceGrpc.BinaryFileServiceStub; import de.ozgcloud.vorgang.grpc.binaryFile.BinaryFileServiceGrpc.BinaryFileServiceStub;
...@@ -45,48 +41,14 @@ class OzgcloudConfiguration { ...@@ -45,48 +41,14 @@ class OzgcloudConfiguration {
return new DefaultOzgCloudCallContextProvider(ctxt); return new DefaultOzgCloudCallContextProvider(ctxt);
} }
OzgCloudVorgangService grpcOzgCloudVorgangService(OzgCloudVorgangMapper mapper, OzgCloudVorgangStubMapper stubMapper,
OzgCloudCallContextProvider contextProvider) {
return new GrpcOzgCloudVorgangService(vorgangServiceStub, mapper, stubMapper, contextProvider);
}
@Bean
OzgCloudVorgangMapper ozgCloudVorgangMapper() {
return Mappers.getMapper(OzgCloudVorgangMapper.class);
}
@Bean
OzgCloudVorgangStubMapper ozgCloudVorgangStubMapper() {
return Mappers.getMapper(OzgCloudVorgangStubMapper.class);
}
@Bean
OzgCloudVorgangIdMapper ozgCloudVorgangIdMapper() {
return Mappers.getMapper(OzgCloudVorgangIdMapper.class);
}
@Bean
UserProfileMapper ozgCloudUserProfileMapper() {
return Mappers.getMapper(UserProfileMapper.class);
}
@Bean
OzgCloudFileMapper fileMapper() {
return Mappers.getMapper(OzgCloudFileMapper.class);
}
@Bean @Bean
GrpcOzgCloudFileService grpcOzgCloudFileService(OzgCloudCallContextProvider contextProvider, OzgCloudFileMapper mapper) { GrpcOzgCloudFileService grpcOzgCloudFileService(OzgCloudCallContextProvider contextProvider, OzgCloudFileMapper mapper) {
return new GrpcOzgCloudFileService(binaryFileServiceBlockingStub, binaryFileServiceStub, contextProvider, mapper); return new GrpcOzgCloudFileService(binaryFileServiceBlockingStub, binaryFileServiceStub, contextProvider, mapper);
} }
@Bean @Bean(ArchiveManagerConfiguration.OZGCLOUD_USER_PROFILE_SERVICE_NAME) // NOSONAR
GrpcOzgCloudUserProfileService grpcOzgCloudUserProfileService(OzgCloudCallContextProvider ozgCloudCallContextProvider, OzgCloudUserProfileService grpcOzgCloudUserProfileService(CallContextProvider ozgCloudCallContextProvider, UserProfileMapper userProfileMapper) {
UserProfileMapper userProfileMapper) { return new GrpcOzgCloudUserProfileService(userProfileServiceBlockingStub, userProfileMapper, ozgCloudCallContextProvider);
return new GrpcOzgCloudUserProfileService(userProfileServiceBlockingStub,
userProfileMapper, ozgCloudCallContextProvider);
} }
} }
...@@ -3,8 +3,8 @@ package de.ozgcloud.archive.common.user; ...@@ -3,8 +3,8 @@ package de.ozgcloud.archive.common.user;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import de.ozgcloud.apilib.user.GrpcOzgCloudUserProfileService;
import de.ozgcloud.apilib.user.OzgCloudUserId; import de.ozgcloud.apilib.user.OzgCloudUserId;
import de.ozgcloud.apilib.user.OzgCloudUserProfileService;
import de.ozgcloud.archive.ArchiveManagerConfiguration; import de.ozgcloud.archive.ArchiveManagerConfiguration;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -13,7 +13,7 @@ import lombok.RequiredArgsConstructor; ...@@ -13,7 +13,7 @@ import lombok.RequiredArgsConstructor;
public class UserService { public class UserService {
@Qualifier(ArchiveManagerConfiguration.OZGCLOUD_USER_PROFILE_SERVICE_NAME) // NOSONAR @Qualifier(ArchiveManagerConfiguration.OZGCLOUD_USER_PROFILE_SERVICE_NAME) // NOSONAR
private final GrpcOzgCloudUserProfileService grpcOzgCloudUserProfileService; private final OzgCloudUserProfileService grpcOzgCloudUserProfileService;
@Qualifier(ArchiveManagerConfiguration.USER_PROFILE_MAPPER_NAME) // NOSONAR @Qualifier(ArchiveManagerConfiguration.USER_PROFILE_MAPPER_NAME) // NOSONAR
private final UserProfileMapper mapper; private final UserProfileMapper mapper;
......
package de.ozgcloud.archive;
import org.mapstruct.factory.Mappers;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import de.ozgcloud.apilib.file.grpc.OzgCloudFileMapper;
import de.ozgcloud.apilib.user.UserProfileMapper;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangIdMapper;
import de.ozgcloud.apilib.vorgang.grpc.OzgCloudVorgangMapper;
import de.ozgcloud.apilib.vorgang.grpc.OzgCloudVorgangStubMapper;
@Configuration
public class ArchiveManagerTestConfiguration {
@Bean
OzgCloudVorgangMapper ozgCloudVorgangMapper() {
return Mappers.getMapper(OzgCloudVorgangMapper.class);
}
@Bean
OzgCloudVorgangStubMapper ozgCloudVorgangStubMapper() {
return Mappers.getMapper(OzgCloudVorgangStubMapper.class);
}
@Bean
OzgCloudVorgangIdMapper ozgCloudVorgangIdMapper() {
return Mappers.getMapper(OzgCloudVorgangIdMapper.class);
}
@Bean
UserProfileMapper ozgCloudUserProfileMapper() {
return Mappers.getMapper(UserProfileMapper.class);
}
@Bean
OzgCloudFileMapper fileMapper() {
return Mappers.getMapper(OzgCloudFileMapper.class);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment