Class EurekaRegistryClient
- java.lang.Object
-
- org.kiwiproject.registry.eureka.client.EurekaRegistryClient
-
- All Implemented Interfaces:
RegistryClient
public class EurekaRegistryClient extends Object implements RegistryClient
RegistryClient
implementation 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(RegistryClient.InstanceQuery query)
Attempts to find all service instances from the givenRegistryClient.InstanceQuery
.Optional<ServiceInstance>
findServiceInstanceBy(String serviceName, String instanceId)
Attempts to find a service instance with the given service name and the given instance id.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.kiwiproject.registry.client.RegistryClient
findAllServiceInstancesBy, findServiceInstanceBy, findServiceInstanceBy
-
-
-
-
Constructor Detail
-
EurekaRegistryClient
public EurekaRegistryClient(EurekaConfig config, EurekaRestClient client)
-
-
Method Detail
-
findServiceInstanceBy
public Optional<ServiceInstance> findServiceInstanceBy(String serviceName, String instanceId)
Description copied from interface:RegistryClient
Attempts to find a service instance with the given service name and the given instance id.- Specified by:
findServiceInstanceBy
in interfaceRegistryClient
- Parameters:
serviceName
- The name of the service that is being requestedinstanceId
- The id of the instance that is wanted- Returns:
- an
Optional
containing the found service orOptional.empty()
-
findAllServiceInstancesBy
public List<ServiceInstance> findAllServiceInstancesBy(RegistryClient.InstanceQuery query)
Description copied from interface:RegistryClient
Attempts to find all service instances from the givenRegistryClient.InstanceQuery
.- Specified by:
findAllServiceInstancesBy
in interfaceRegistryClient
- Parameters:
query
- aRegistryClient.InstanceQuery
containing the search parameters to find the instance- Returns:
- a
List
containing the found services
-
-