Class EurekaRegistryClient
- java.lang.Object
-
- org.kiwiproject.registry.eureka.client.EurekaRegistryClient
-
- All Implemented Interfaces:
RegistryClient
public class EurekaRegistryClient extends Object implements RegistryClient
RegistryClientimplementation for looking up services from Eureka registry server.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.kiwiproject.registry.client.RegistryClient
RegistryClient.InstanceQuery
-
-
Constructor Summary
Constructors Constructor Description EurekaRegistryClient(EurekaConfig config, EurekaRestClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.Optional<ServiceInstance>findServiceInstanceBy(RegistryClient.InstanceQuery query)Attempts to find a service instance from the givenRegistryClient.InstanceQuery.
-
-
-
Constructor Detail
-
EurekaRegistryClient
public EurekaRegistryClient(EurekaConfig config, EurekaRestClient client)
-
-
Method Detail
-
findServiceInstanceBy
public Optional<ServiceInstance> findServiceInstanceBy(String serviceName)
Description copied from interface:RegistryClientAttempts 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)
- Specified by:
findServiceInstanceByin interfaceRegistryClient- Parameters:
serviceName- The name of the service that is being requested- Returns:
- an
Optionalcontaining the found service orOptional.empty()
-
findServiceInstanceBy
public Optional<ServiceInstance> findServiceInstanceBy(String serviceName, String instanceId)
Description copied from interface:RegistryClientAttempts to find a service instance with the given service name and the given instance id.- Specified by:
findServiceInstanceByin interfaceRegistryClient- 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
public Optional<ServiceInstance> findServiceInstanceBy(RegistryClient.InstanceQuery query)
Description copied from interface:RegistryClientAttempts 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)
- Specified by:
findServiceInstanceByin interfaceRegistryClient- Parameters:
query- aRegistryClient.InstanceQuerycontaining the search parameters to find the instance- Returns:
- an
Optionalcontaining the found service orOptional.empty()
-
findAllServiceInstancesBy
public List<ServiceInstance> findAllServiceInstancesBy(String serviceName)
Description copied from interface:RegistryClientAttempts to find all service instances with the given service name.- Specified by:
findAllServiceInstancesByin interfaceRegistryClient- Parameters:
serviceName- The name of the service that is being requested- Returns:
- a
Listcontaining the found services
-
findAllServiceInstancesBy
public List<ServiceInstance> findAllServiceInstancesBy(RegistryClient.InstanceQuery query)
Description copied from interface:RegistryClientAttempts to find all service instances from the givenRegistryClient.InstanceQuery.- Specified by:
findAllServiceInstancesByin interfaceRegistryClient- Parameters:
query- aRegistryClient.InstanceQuerycontaining the search parameters to find the instance- Returns:
- a
Listcontaining the found services
-
-