Module io.inverno.mod.discovery
Package io.inverno.mod.discovery
Class AbstractDiscoveryService<A extends ServiceInstance,B,C extends TrafficPolicy<A,B>>
java.lang.Object
io.inverno.mod.discovery.AbstractDiscoveryService<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>
- Direct Known Subclasses:
AbstractConfigurationDiscoveryService
,AbstractDnsDiscoveryService
public abstract class AbstractDiscoveryService<A extends ServiceInstance,B,C extends TrafficPolicy<A,B>>
extends Object
implements DiscoveryService<A,B,C>
Base DiscoveryService
implementation.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
-
Constructor Summary
ConstructorDescriptionAbstractDiscoveryService
(Set<String> supportedSchemes) Creates a discovery service supporting the specified set of schemes. -
Method Summary
Modifier and TypeMethodDescriptionResolves a service.Returns the list of schemes supported by the discovery service.Resolves a service.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, supports
-
Constructor Details
-
AbstractDiscoveryService
Creates a discovery service supporting the specified set of schemes.
- Parameters:
supportedSchemes
- the set of supported schemes
-
-
Method Details
-
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
public final Mono<? extends Service<A,B, resolveC>> (ServiceID serviceId, C trafficPolicy) throws IllegalArgumentException 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 - Throws:
IllegalArgumentException
- if the specified service ID is not supported
-
doResolve
Resolves a service.
This is basically invoked by
resolve(ServiceID, TrafficPolicy)
after validating that the service ID scheme is supported.- Parameters:
serviceId
- a service IDtrafficPolicy
- a traffic policy- Returns:
- a
Mono
emitting the resolved service or an emptyMono
if no service could be resolved
-