Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
api-lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
lib
api-lib
Commits
64b82f5c
Commit
64b82f5c
authored
1 year ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
remove orig file
parent
de8c2522
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ozg-cloud-spring-boot-starter/src/main/java/de/ozgcloud/client/autoconfigure/OzgCloudClientAutoConfiguration.java.orig
+0
-180
0 additions, 180 deletions
...t/autoconfigure/OzgCloudClientAutoConfiguration.java.orig
with
0 additions
and
180 deletions
ozg-cloud-spring-boot-starter/src/main/java/de/ozgcloud/client/autoconfigure/OzgCloudClientAutoConfiguration.java.orig
deleted
100644 → 0
+
0
−
180
View file @
de8c2522
package de.ozgcloud.client.autoconfigure;
import java.util.Map;
import org.mapstruct.factory.Mappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import de.ozgcloud.apilib.alfa.AlfaService;
import de.ozgcloud.apilib.alfa.CommandAlfaService;
import de.ozgcloud.apilib.alfa.dummy.DummyAlfaService;
import de.ozgcloud.apilib.common.callcontext.DefaultOzgCloudCallContextProvider;
import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextAttachingInterceptor;
import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextProvider;
import de.ozgcloud.apilib.common.command.OzgCloudCommandService;
import de.ozgcloud.apilib.common.command.grpc.CommandMapper;
import de.ozgcloud.apilib.common.command.grpc.GrpcOzgCloudCommandService;
import de.ozgcloud.apilib.file.dummy.DummyOzgCloudFileService;
import de.ozgcloud.apilib.file.grpc.GrpcOzgCloudFileService;
import de.ozgcloud.apilib.user.GrpcOzgCloudUserProfileService;
import de.ozgcloud.apilib.user.OzgCloudUserProfileService;
import de.ozgcloud.apilib.user.UserProfileMapper;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangIdMapper;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangService;
import de.ozgcloud.apilib.vorgang.dummy.DummyVorgangService;
import de.ozgcloud.apilib.vorgang.grpc.GrpcOzgCloudVorgangService;
import de.ozgcloud.apilib.vorgang.grpc.OzgCloudVorgangMapper;
import de.ozgcloud.apilib.vorgang.grpc.OzgCloudVorgangStubMapper;
<<<<<<< HEAD
import de.ozgcloud.user.grpc.userprofile.UserProfileServiceGrpc.UserProfileServiceBlockingStub;
=======
import de.ozgcloud.vorgang.grpc.command.CommandServiceGrpc.CommandServiceBlockingStub;
import de.ozgcloud.vorgang.vorgang.VorgangServiceGrpc.VorgangServiceBlockingStub;
>>>>>>> master
import net.devh.boot.grpc.client.autoconfigure.GrpcClientAutoConfiguration;
import net.devh.boot.grpc.client.config.GrpcChannelProperties;
import net.devh.boot.grpc.client.config.GrpcChannelsProperties;
import net.devh.boot.grpc.client.inject.GrpcClient;
@AutoConfiguration(before = GrpcClientAutoConfiguration.class)
@ComponentScan("de.ozgcloud.client.autoconfigure")
@Import({
GrpcOzgCloudFileService.class, DummyOzgCloudFileService.class,
OzgCloudCallContextAttachingInterceptor.class
})
public class OzgCloudClientAutoConfiguration {
private static final String CLIENT_NAME_VORGANG_MANAGER = "vorgang-manager";
private static final String CLIENT_NAME_FILE_MANAGER = "file-manager";
private static final String CLIENT_NAME_COMMAND_MANAGER = "command-manager";
@Autowired
private OzgCloudVorgangManagerProperties vorgangManagerProperties;
@Autowired
private OzgCloudFileManagerProperties fileManagerProperties;
@Autowired
private OzgCloudCommandManagerProperties commandManagerProperties;
// @Bean
// @ConditionalOnProperty("ozgcloud.vorgang-manager.address")
GrpcChannelsProperties channelProperties(GrpcChannelsProperties properties) {
// var properties = new GrpcChannelsProperties();
var clientMap = properties.getClient();
addVorgangManager(clientMap);
addFileManager(clientMap);
addCommandManager(clientMap);
return properties;
}
@Bean
@ConditionalOnProperty("ozgcloud.command-manager.address")
GrpcChannelsProperties commandProperties() {
var properties = new GrpcChannelsProperties();
var clientMap = properties.getClient();
addCommandManager(clientMap);
return properties;
}
private void addVorgangManager(Map<String, GrpcChannelProperties> clientMap) {
var channelProps = new GrpcChannelProperties();
channelProps.setAddress(vorgangManagerProperties.getAddress());
channelProps.setNegotiationType(vorgangManagerProperties.getNegotiationType());
clientMap.put(CLIENT_NAME_VORGANG_MANAGER, channelProps);
}
private void addFileManager(Map<String, GrpcChannelProperties> clientMap) {
var channelProps = new GrpcChannelProperties();
channelProps.setAddress(fileManagerProperties.getAddress());
channelProps.setNegotiationType(fileManagerProperties.getNegotiationType());
clientMap.put(CLIENT_NAME_FILE_MANAGER, channelProps);
}
private void addCommandManager(Map<String, GrpcChannelProperties> clientMap) {
var channelProps = new GrpcChannelProperties();
channelProps.setAddress(commandManagerProperties.getAddress());
channelProps.setNegotiationType(commandManagerProperties.getNegotiationType());
clientMap.put(CLIENT_NAME_COMMAND_MANAGER, channelProps);
}
@Bean
@ConditionalOnMissingBean
OzgCloudCallContextProvider callContextProvider(ApplicationContext ctxt) {
return new DefaultOzgCloudCallContextProvider(ctxt);
}
@Bean("ozgCloudVorgangService")
@ConditionalOnProperty("ozgcloud.vorgang-manager.address")
OzgCloudVorgangService grpcOzgCloudVorgangService(VorgangServiceBlockingStub vorgangServiceStub,
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("ozgCloudVorgangService")
@ConditionalOnMissingBean(OzgCloudVorgangService.class)
OzgCloudVorgangService dummyOzgCloudVorgangService() {
return new DummyVorgangService();
}
@Bean
OzgCloudVorgangIdMapper ozgCloudVorgangIdMapper() {
return Mappers.getMapper(OzgCloudVorgangIdMapper.class);
}
@Bean
@ConditionalOnProperty("ozgcloud.command-manager.address")
OzgCloudCommandService grpcOzgCloudCommandService(@GrpcClient("command-manager") CommandServiceBlockingStub commandServiceStub,
CommandMapper commandMapper, OzgCloudCallContextProvider contextProvider) {
return new GrpcOzgCloudCommandService(commandServiceStub, commandMapper, contextProvider,
GrpcOzgCloudCommandService.DEFAULT_COMMAND_REQUEST_THRESHOLD_MILLIS);
}
@Bean
@ConditionalOnProperty("ozgcloud.command-manager.address")
CommandMapper commandMapper() {
return Mappers.getMapper(CommandMapper.class);
}
@Bean
@ConditionalOnProperty("ozgcloud.command-manager.address")
AlfaService commandAlfaService(OzgCloudCommandService commandService) {
return new CommandAlfaService(commandService);
}
@Bean
@ConditionalOnMissingBean
AlfaService alfaService() {
return new DummyAlfaService();
}
@Bean
@ConditionalOnProperty("ozgcloud.user-manager.address")
OzgCloudUserProfileService grpcOzgCloudUserProfileService(@GrpcClient("user-manager") UserProfileServiceBlockingStub grpcStub,
UserProfileMapper mapper) {
return new GrpcOzgCloudUserProfileService(grpcStub, mapper);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment