Interface DiscoveryService<A extends ServiceInstance,B,C extends TrafficPolicy<A,B>>
- Type Parameters:
A
- the type of service instanceB
- the type of service requestC
- the type of traffic policy
- All Known Subinterfaces:
HttpDiscoveryService
- All Known Implementing Classes:
AbstractConfigurationDiscoveryService
,AbstractDiscoveryService
,AbstractDnsDiscoveryService
,CachingDiscoveryService
,CompositeDiscoveryService
A discovery service is used to resolve Service
from a ServiceID
identifying a service and a TrafficPolicy
conveying local service configuration.
The service ID is nothing more than an absolute URI providing the information required by a compatible discovery service to resolve a specific service. The scheme of the URI is used to determine whether a service can be resolved by a given discovery service. How the service URI is interpreted during service resolution is implementation specific.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the list of schemes supported by the discovery service.Resolves a service.default boolean
Determines whether the discovery service can resolve the specified service ID.default boolean
Determines whether the discovery service supports the specified scheme.default boolean
Determines whether the discovery service supports the specified service URI.
-
Method Details
-
supports
Determines whether the discovery service supports the specified scheme.
- Parameters:
scheme
- a URI scheme- Returns:
- true if the discovery service can resolve service URI with the specified scheme, false otherwise
-
supports
Determines whether the discovery service supports the specified service URI.
- Parameters:
uri
- a service URI- Returns:
- true if the discovery service can resolve the specified service URI, false otherwise
-
supports
Determines whether the discovery service can resolve the specified service ID.
- Parameters:
serviceId
- a service ID- Returns:
- true if the discovery service can resolve the specified service ID, false otherwise
-
getSupportedSchemes
Returns the list of schemes supported by the discovery service.
- Returns:
- a set of lower cased schemes
-
resolve
Mono<? extends Service<A,B, resolveC>> (ServiceID serviceId, C trafficPolicy) throws IllegalArgumentException Resolves a service.
- 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
-