de.codecentric.boot.admin.server.services.InstanceRegistry Java Examples

The following examples show how to use de.codecentric.boot.admin.server.services.InstanceRegistry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractInstancesProxyController.java    From Moss with Apache License 2.0 5 votes vote down vote up
/**
 *
 * 扩展的构造函数
 * @param adminContextPath
 * @param ignoredHeaders
 * @param registry
 * @param instanceWebClient
 */
public AbstractInstancesProxyController(String adminContextPath,
                                        Set<String> ignoredHeaders,
                                        InstanceRegistry registry, InstanceWebClient instanceWebClient,String requestMappingPath ) {
    this.ignoredHeaders = Stream.concat(ignoredHeaders.stream(), Arrays.stream(HOP_BY_HOP_HEADERS))
            .map(String::toLowerCase)
            .collect(Collectors.toSet());
    this.registry = registry;
    this.instanceWebClient = instanceWebClient;
    this.realRequestMappingPath = adminContextPath + requestMappingPath;
}
 
Example #2
Source File: AdminServerWebConfiguration.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public de.codecentric.boot.admin.server.web.servlet.InstancesProxyController instancesProxyController(
		InstanceRegistry instanceRegistry, InstanceWebClient.Builder instanceWebClientBuilder) {
	return new de.codecentric.boot.admin.server.web.servlet.InstancesProxyController(
			this.adminServerProperties.getContextPath(),
			this.adminServerProperties.getInstanceProxy().getIgnoredHeaders(), instanceRegistry,
			instanceWebClientBuilder.build());
}
 
Example #3
Source File: AdminServerWebConfiguration.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public de.codecentric.boot.admin.server.web.reactive.InstancesProxyController instancesProxyController(
		InstanceRegistry instanceRegistry, InstanceWebClient.Builder instanceWebClientBuilder) {
	return new de.codecentric.boot.admin.server.web.reactive.InstancesProxyController(
			this.adminServerProperties.getContextPath(),
			this.adminServerProperties.getInstanceProxy().getIgnoredHeaders(), instanceRegistry,
			instanceWebClientBuilder.build());
}
 
Example #4
Source File: InstancesProxyController.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
public InstancesProxyController(String adminContextPath, Set<String> ignoredHeaders, InstanceRegistry registry,
		InstanceWebClient instanceWebClient) {
	this.adminContextPath = adminContextPath;
	this.registry = registry;
	this.httpHeadersFilter = new HttpHeaderFilter(ignoredHeaders);
	this.instanceWebProxy = new InstanceWebProxy(instanceWebClient);
}
 
Example #5
Source File: InstancesProxyController.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
public InstancesProxyController(String adminContextPath, Set<String> ignoredHeaders, InstanceRegistry registry,
		InstanceWebClient instanceWebClient) {
	this.adminContextPath = adminContextPath;
	this.registry = registry;
	this.httpHeadersFilter = new HttpHeaderFilter(ignoredHeaders);
	this.instanceWebProxy = new InstanceWebProxy(instanceWebClient);
}
 
Example #6
Source File: InstanceDiscoveryListenerTest.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@BeforeEach
public void setup() {
	this.discovery = mock(DiscoveryClient.class);
	InstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore());
	this.registry = spy(new InstanceRegistry(repository, new HashingInstanceUrlIdGenerator()));
	this.listener = new InstanceDiscoveryListener(this.discovery, this.registry, repository);
}
 
Example #7
Source File: AdminServerDiscoveryAutoConfiguration.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = "spring.boot.admin.discovery")
public InstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
		DiscoveryClient discoveryClient, InstanceRegistry registry, InstanceRepository repository) {
	InstanceDiscoveryListener listener = new InstanceDiscoveryListener(discoveryClient, registry, repository);
	listener.setConverter(serviceInstanceConverter);
	return listener;
}
 
Example #8
Source File: MossServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public MossInstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
                                                               InstanceRegistry registry,
                                                               InstanceRepository repository,
                                                               ZookeeperDiscoveryClient zookeeperDiscoveryClient) {
    MossInstanceDiscoveryListener listener = new MossInstanceDiscoveryListener(zookeeperDiscoveryClient, registry, repository);
    listener.setConverter(serviceInstanceConverter);
    return listener;
}
 
Example #9
Source File: MossInstanceDiscoveryListener.java    From Moss with Apache License 2.0 5 votes vote down vote up
public MossInstanceDiscoveryListener(DiscoveryClient discoveryClient,
                                 InstanceRegistry registry,
                                 InstanceRepository repository) {
    this.discoveryClient = discoveryClient;
    this.registry = registry;
    this.repository = repository;
}
 
Example #10
Source File: MossServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public MossInstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
                                                           InstanceRegistry registry,
                                                           InstanceRepository repository) {
    MossInstanceDiscoveryListener listener = new MossInstanceDiscoveryListener(registry, repository);
    listener.setConverter(serviceInstanceConverter);
    return listener;
}
 
Example #11
Source File: MossServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public MossInstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
                                                               InstanceRegistry registry,
                                                               InstanceRepository repository) {
    MossInstanceDiscoveryListener listener = new MossInstanceDiscoveryListener(registry, repository);
    listener.setConverter(serviceInstanceConverter);
    return listener;
}
 
Example #12
Source File: MossServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public MossInstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
                                                               InstanceRegistry registry,
                                                               InstanceRepository repository) {
    MossInstanceDiscoveryListener listener = new MossInstanceDiscoveryListener(registry, repository);
    listener.setConverter(serviceInstanceConverter);
    listener.setIgnoredServices(Sets.newHashSet("consul"));
    return listener;
}
 
Example #13
Source File: InstanceDiscoveryListenerTest.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
    discovery = mock(DiscoveryClient.class);
    InstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore());
    registry = spy(new InstanceRegistry(repository, new HashingInstanceUrlIdGenerator()));
    listener = new InstanceDiscoveryListener(discovery, registry, repository);
}
 
Example #14
Source File: InstanceDiscoveryListener.java    From Moss with Apache License 2.0 5 votes vote down vote up
public InstanceDiscoveryListener(DiscoveryClient discoveryClient,
                                 InstanceRegistry registry,
                                 InstanceRepository repository) {
    this.discoveryClient = discoveryClient;
    this.registry = registry;
    this.repository = repository;
}
 
Example #15
Source File: AbstractInstancesProxyController.java    From Moss with Apache License 2.0 5 votes vote down vote up
public AbstractInstancesProxyController(String adminContextPath,
                                        Set<String> ignoredHeaders,
                                        InstanceRegistry registry, InstanceWebClient instanceWebClient) {
    this.ignoredHeaders = Stream.concat(ignoredHeaders.stream(), Arrays.stream(HOP_BY_HOP_HEADERS))
                                .map(String::toLowerCase)
                                .collect(Collectors.toSet());
    this.registry = registry;
    this.instanceWebClient = instanceWebClient;
    this.realRequestMappingPath = adminContextPath + REQUEST_MAPPING_PATH;
}
 
Example #16
Source File: AdminServerWebConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public de.codecentric.boot.admin.server.web.reactive.InstancesProxyController instancesProxyController(
    InstanceRegistry instanceRegistry,
    InstanceWebClient instanceWebClient) {
    return new de.codecentric.boot.admin.server.web.reactive.InstancesProxyController(
        adminServerProperties.getContextPath(),
        adminServerProperties.getInstanceProxy().getIgnoredHeaders(),
        instanceRegistry,
        instanceWebClient
    );
}
 
Example #17
Source File: AdminServerWebConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public InstancesProxyController instancesProxyController(InstanceRegistry instanceRegistry,
                                                         InstanceWebClient instanceWebClient) {
    return new InstancesProxyController(
        adminServerProperties.getContextPath(),
        adminServerProperties.getInstanceProxy().getIgnoredHeaders(),
        instanceRegistry,
        instanceWebClient
    );
}
 
Example #18
Source File: AdminServerWebConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
/**
 * 扩展初始化自己的代理Controller
 * @author xujin
 * @param instanceRegistry
 * @param instanceWebClient
 * @return
 */
@Bean
@ConditionalOnMissingBean
public MossInstancesProxyController HaloInstancesProxyController(InstanceRegistry instanceRegistry,
                                                                 InstanceWebClient instanceWebClient) {
    return new MossInstancesProxyController(
            adminServerProperties.getContextPath(),
            adminServerProperties.getInstanceProxy().getIgnoredHeaders(),
            instanceRegistry,
            instanceWebClient
    );
}
 
Example #19
Source File: AdminServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = "spring.boot.admin.discovery")
public InstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
                                                           DiscoveryClient discoveryClient,
                                                           InstanceRegistry registry,
                                                           InstanceRepository repository) {
    InstanceDiscoveryListener listener = new InstanceDiscoveryListener(discoveryClient, registry, repository);
    listener.setConverter(serviceInstanceConverter);
    return listener;
}
 
Example #20
Source File: ApplicationsController.java    From Moss with Apache License 2.0 4 votes vote down vote up
public ApplicationsController(InstanceRegistry registry, InstanceEventPublisher eventPublisher) {
    this.registry = registry;
    this.eventPublisher = eventPublisher;
}
 
Example #21
Source File: InstancesProxyController.java    From Moss with Apache License 2.0 4 votes vote down vote up
public InstancesProxyController(String adminContextPath,
                                Set<String> ignoredHeaders,
                                InstanceRegistry registry,
                                InstanceWebClient instanceWebClient) {
    super(adminContextPath, ignoredHeaders, registry, instanceWebClient);
}
 
Example #22
Source File: AdminServerWebConfiguration.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public InstancesController instancesController(InstanceRegistry instanceRegistry, InstanceEventStore eventStore) {
	return new InstancesController(instanceRegistry, eventStore);
}
 
Example #23
Source File: AdminServerAutoConfiguration.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public ApplicationRegistry applicationRegistry(InstanceRegistry instanceRegistry,
		InstanceEventPublisher instanceEventPublisher) {
	return new ApplicationRegistry(instanceRegistry, instanceEventPublisher);
}
 
Example #24
Source File: AdminServerAutoConfiguration.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public InstanceRegistry instanceRegistry(InstanceRepository instanceRepository,
		InstanceIdGenerator instanceIdGenerator) {
	return new InstanceRegistry(instanceRepository, instanceIdGenerator);
}
 
Example #25
Source File: InstancesController.java    From Moss with Apache License 2.0 4 votes vote down vote up
public InstancesController(InstanceRegistry registry, InstanceEventStore eventStore) {
    this.registry = registry;
    this.eventStore = eventStore;
}
 
Example #26
Source File: InstancesController.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
public InstancesController(InstanceRegistry registry, InstanceEventStore eventStore) {
	this.registry = registry;
	this.eventStore = eventStore;
}
 
Example #27
Source File: InstancesProxyController.java    From Moss with Apache License 2.0 4 votes vote down vote up
public InstancesProxyController(String adminContextPath,
                                Set<String> ignoredHeaders,
                                InstanceRegistry registry, InstanceWebClient instanceWebClient) {
    super(adminContextPath, ignoredHeaders, registry, instanceWebClient);
}
 
Example #28
Source File: MultRegisterCenterServerMgmtConfig.java    From Moss with Apache License 2.0 4 votes vote down vote up
public MultRegisterCenterServerMgmtConfig(InstanceRegistry registry, SnapshottingInstanceRepository snapshottingInstanceRepository, ConsulDiscoveryProperties consulDiscoveryProperties) {
    this.registry = registry;
    this.snapshottingInstanceRepository = snapshottingInstanceRepository;
    this.consulDiscoveryProperties = consulDiscoveryProperties;
}
 
Example #29
Source File: AdminServerWebConfiguration.java    From Moss with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public InstancesController instancesController(InstanceRegistry instanceRegistry, InstanceEventStore eventStore) {
    return new InstancesController(instanceRegistry, eventStore);
}
 
Example #30
Source File: InstanceDiscoveryListener.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
public InstanceDiscoveryListener(DiscoveryClient discoveryClient, InstanceRegistry registry,
		InstanceRepository repository) {
	this.discoveryClient = discoveryClient;
	this.registry = registry;
	this.repository = repository;
}