Package io.micronaut.discovery
Class CompositeDiscoveryClient
- java.lang.Object
-
- io.micronaut.discovery.CompositeDiscoveryClient
-
- All Implemented Interfaces:
io.micronaut.core.naming.Described,DiscoveryClient,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
DefaultCompositeDiscoveryClient
public abstract class CompositeDiscoveryClient extends java.lang.Object implements DiscoveryClient
A composite implementation combining all registeredDiscoveryClientinstances.- Since:
- 1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCompositeDiscoveryClient(DiscoveryClient[] discoveryClients)Construct the CompositeDiscoveryClient from all discovery clients.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.lang.StringgetDescription()DiscoveryClient[]getDiscoveryClients()The underlying clients.org.reactivestreams.Publisher<java.util.List<ServiceInstance>>getInstances(java.lang.String serviceId)Obtain a list ofServiceInstancefor the given service id.org.reactivestreams.Publisher<java.util.List<java.lang.String>>getServiceIds()java.lang.StringtoString()
-
-
-
Constructor Detail
-
CompositeDiscoveryClient
protected CompositeDiscoveryClient(DiscoveryClient[] discoveryClients)
Construct the CompositeDiscoveryClient from all discovery clients.- Parameters:
discoveryClients- The service discovery clients
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescriptionin interfaceio.micronaut.core.naming.Described
-
getDiscoveryClients
public DiscoveryClient[] getDiscoveryClients()
The underlying clients.- Returns:
- The clients
-
getInstances
public org.reactivestreams.Publisher<java.util.List<ServiceInstance>> getInstances(java.lang.String serviceId)
Description copied from interface:DiscoveryClientObtain a list ofServiceInstancefor the given service id.- Specified by:
getInstancesin interfaceDiscoveryClient- Parameters:
serviceId- The service id- Returns:
- A
Publisherthat emits a list ofServiceInstance
-
getServiceIds
public org.reactivestreams.Publisher<java.util.List<java.lang.String>> getServiceIds()
- Specified by:
getServiceIdsin interfaceDiscoveryClient- Returns:
- The known service IDs
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-