Class ConsulRegistryClient
java.lang.Object
org.kiwiproject.registry.consul.client.ConsulRegistryClient
- All Implemented Interfaces:
RegistryClient
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.kiwiproject.registry.client.RegistryClient
RegistryClient.InstanceQuery
-
Constructor Summary
ConstructorDescriptionConsulRegistryClient
(org.kiwiproject.consul.Consul consul, ConsulConfig config) -
Method Summary
Modifier and TypeMethodDescriptionAttempts to find all service instances from the givenRegistryClient.InstanceQuery
.findServiceInstanceBy
(String serviceName, String instanceId) Attempts to find a service instance with the given service name and the given instance id.Returns all registered services in Consul.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 Details
-
ConsulRegistryClient
-
-
Method Details
-
findServiceInstanceBy
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
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
-
retrieveAllRegisteredInstances
Returns all registered services in Consul.- Specified by:
retrieveAllRegisteredInstances
in interfaceRegistryClient
- Returns:
- a
List
containing all registered service instances - Implementation Note:
- This will return ALL services in Consul (including Consul itself) and attempt to map it into a
ServiceInstance
object
-