Package org.kiwiproject.registry.client
Interface RegistryClient
-
- All Known Implementing Classes:
ConsulRegistryClient,EurekaRegistryClient
public interface RegistryClientBase of all registry client implementations in order to find running services
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classRegistryClient.InstanceQueryEncapsulates search parameters for finding service instances
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default List<ServiceInstance>findAllServiceInstancesBy(String serviceName)Attempts to find all service instances with the given service name.List<ServiceInstance>findAllServiceInstancesBy(RegistryClient.InstanceQuery query)Attempts to find all service instances from the givenRegistryClient.InstanceQuery.default Optional<ServiceInstance>findServiceInstanceBy(String serviceName)Attempts to find a service instance with the given service name.Optional<ServiceInstance>findServiceInstanceBy(String serviceName, String instanceId)Attempts to find a service instance with the given service name and the given instance id.default Optional<ServiceInstance>findServiceInstanceBy(RegistryClient.InstanceQuery query)Attempts to find a service instance from the givenRegistryClient.InstanceQuery.List<ServiceInstance>retrieveAllRegisteredInstances()Retrieves all registered service instances from the registry.
-
-
-
Method Detail
-
findServiceInstanceBy
default Optional<ServiceInstance> findServiceInstanceBy(String serviceName)
Attempts to find a service instance with the given service name.If there are more than one instance, the implementation should decide the order in which the service is returned (e.g. round-robin, random, LIFO, FIFO, etc.)
- Parameters:
serviceName- The name of the service that is being requested- Returns:
- an
Optionalcontaining the found service orOptional.empty()
-
findServiceInstanceBy
Optional<ServiceInstance> findServiceInstanceBy(String serviceName, String instanceId)
Attempts to find a service instance with the given service name and the given instance id.- Parameters:
serviceName- The name of the service that is being requestedinstanceId- The id of the instance that is wanted- Returns:
- an
Optionalcontaining the found service orOptional.empty()
-
findServiceInstanceBy
default Optional<ServiceInstance> findServiceInstanceBy(RegistryClient.InstanceQuery query)
Attempts to find a service instance from the givenRegistryClient.InstanceQuery.If there are more than one instance, the implementation should decide the order in which the service is returned (e.g. round-robin, random, LIFO, FIFO, etc.)
- Parameters:
query- aRegistryClient.InstanceQuerycontaining the search parameters to find the instance- Returns:
- an
Optionalcontaining the found service orOptional.empty()
-
findAllServiceInstancesBy
default List<ServiceInstance> findAllServiceInstancesBy(String serviceName)
Attempts to find all service instances with the given service name.- Parameters:
serviceName- The name of the service that is being requested- Returns:
- a
Listcontaining the found services
-
findAllServiceInstancesBy
List<ServiceInstance> findAllServiceInstancesBy(RegistryClient.InstanceQuery query)
Attempts to find all service instances from the givenRegistryClient.InstanceQuery.- Parameters:
query- aRegistryClient.InstanceQuerycontaining the search parameters to find the instance- Returns:
- a
Listcontaining the found services
-
retrieveAllRegisteredInstances
List<ServiceInstance> retrieveAllRegisteredInstances()
Retrieves all registered service instances from the registry.- Returns:
- a
Listcontaining all registered service instances
-
-