Module io.inverno.mod.discovery
Package io.inverno.mod.discovery
Class CompositeDiscoveryService<A extends ServiceInstance,B,C extends TrafficPolicy<A,B>>
java.lang.Object
io.inverno.mod.discovery.CompositeDiscoveryService<A,B,C>
- Type Parameters:
A
- the type of service instanceB
- the type of service requestC
- the type of traffic policy
- All Implemented Interfaces:
DiscoveryService<A,
B, C>
public class CompositeDiscoveryService<A extends ServiceInstance,B,C extends TrafficPolicy<A,B>>
extends Object
implements DiscoveryService<A,B,C>
A composite discovery service composing multiple discovery services.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
-
Constructor Summary
ConstructorDescriptionCompositeDiscoveryService
(List<? extends DiscoveryService<? extends A, ? super B, ? super C>> discoveryServices) Creates a composite discovery service. -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of schemes supported by the discovery service.Resolves a service.boolean
Determines whether the discovery service supports the specified scheme.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.discovery.DiscoveryService
supports, supports
-
Constructor Details
-
CompositeDiscoveryService
public CompositeDiscoveryService(List<? extends DiscoveryService<? extends A, ? super B, throws IllegalArgumentException? super C>> discoveryServices) Creates a composite discovery service.
- Parameters:
discoveryServices
- a list of discovery services to compose- Throws:
IllegalArgumentException
- if the same scheme is supported by multiple discovery services
-
-
Method Details
-
supports
Description copied from interface:DiscoveryService
Determines whether the discovery service supports the specified scheme.
- Specified by:
supports
in interfaceDiscoveryService<A extends ServiceInstance,
B, C extends TrafficPolicy<A, B>> - Parameters:
scheme
- a URI scheme- Returns:
- true if the discovery service can resolve service URI with the specified scheme, false otherwise
-
getSupportedSchemes
Description copied from interface:DiscoveryService
Returns the list of schemes supported by the discovery service.
- Specified by:
getSupportedSchemes
in interfaceDiscoveryService<A extends ServiceInstance,
B, C extends TrafficPolicy<A, B>> - Returns:
- a set of lower cased schemes
-
resolve
Description copied from interface:DiscoveryService
Resolves a service.
- Specified by:
resolve
in interfaceDiscoveryService<A extends ServiceInstance,
B, C extends TrafficPolicy<A, B>> - Parameters:
serviceId
- a service IDtrafficPolicy
- a traffic policy- Returns:
- a
Mono
emitting the resolved service or an emptyMono
if no service could be resolved
-