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 registeredDiscoveryClient
instances.- Since:
- 1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CompositeDiscoveryClient(DiscoveryClient[] discoveryClients)
Construct the CompositeDiscoveryClient from all discovery clients.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.lang.String
getDescription()
DiscoveryClient[]
getDiscoveryClients()
The underlying clients.org.reactivestreams.Publisher<java.util.List<ServiceInstance>>
getInstances(java.lang.String serviceId)
Obtain a list ofServiceInstance
for the given service id.org.reactivestreams.Publisher<java.util.List<java.lang.String>>
getServiceIds()
java.lang.String
toString()
-
-
-
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:
getDescription
in 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:DiscoveryClient
Obtain a list ofServiceInstance
for the given service id.- Specified by:
getInstances
in interfaceDiscoveryClient
- Parameters:
serviceId
- The service id- Returns:
- A
Publisher
that emits a list ofServiceInstance
-
getServiceIds
public org.reactivestreams.Publisher<java.util.List<java.lang.String>> getServiceIds()
- Specified by:
getServiceIds
in interfaceDiscoveryClient
- Returns:
- The known service IDs
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-