Package org.kiwiproject.registry.client
Interface RegistryClient
- All Known Implementing Classes:
ConsulRegistryClient,EurekaRegistryClient,MultiRegistryClient,NoOpRegistryClient
public interface RegistryClient
Base of all registry client implementations in order to find running services
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classEncapsulates search parameters for finding service instances -
Method Summary
Modifier and TypeMethodDescriptiondefault List<ServiceInstance>findAllServiceInstancesBy(String serviceName) Attempts to find all service instances with the given service name.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.findServiceInstanceBy(String serviceName, String instanceId) Attempts to find a service instance with the given service name and the given instance id.default Optional<ServiceInstance>Attempts to find a service instance from the givenRegistryClient.InstanceQuery.Retrieves all registered service instances from the registry.
-
Method Details
-
findServiceInstanceBy
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
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
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
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
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
-