Package io.toro.martini
Class ServiceRegistryMethods
- java.lang.Object
-
- io.toro.martini.ServiceRegistryMethods
-
public class ServiceRegistryMethods extends Object
A Martini Service registry is used to keep track of services that are available in a cluster. For example, if you have a cluster of Martini instances that host thefoo.bar.HelloYou
Gloop API, then you can use methods here for an instance usingfoo.bar.HelloYou
as the argument.
-
-
Constructor Summary
Constructors Constructor Description ServiceRegistryMethods(io.toro.martini.service.ServiceRegistry serviceRegistry)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getHostUri(String serviceName)
Returns a hostname or ip address of an instance that can be used to service the uristatic GloopModel
getServiceInstance(String serviceName)
Returns an Optional potentially containing information about an instance that can service the uristatic Optional<org.springframework.cloud.client.ServiceInstance>
getServiceInstanceOptional(String serviceName)
Returns an Optional potentially containing information about an instance that can service the namestatic GloopModel
getServiceInstances(String serviceName)
Returns a list of all supporting instances, containing information about these instances that can service the uristatic Set<org.springframework.cloud.client.ServiceInstance>
getServiceInstancesSet(String serviceName)
Returns a list of all supporting instances, containing information about these instances that can service the uristatic Set<String>
getServices()
Returns a list of services currently known to the service registry
-
-
-
Method Detail
-
getServices
public static Set<String> getServices()
Returns a list of services currently known to the service registry- Returns:
- list of services currently known to the service registry
-
getServiceInstanceOptional
public static Optional<org.springframework.cloud.client.ServiceInstance> getServiceInstanceOptional(String serviceName)
Returns an Optional potentially containing information about an instance that can service the name
-
getServiceInstancesSet
public static Set<org.springframework.cloud.client.ServiceInstance> getServiceInstancesSet(String serviceName)
Returns a list of all supporting instances, containing information about these instances that can service the uri
-
getServiceInstance
@GloopObjectParameter("serviceInstance{\nserviceInstance#io.toro.martini.service.ServiceInstance{\n}\n}\n") public static GloopModel getServiceInstance(String serviceName)
Returns an Optional potentially containing information about an instance that can service the uri
-
getServiceInstances
@GloopObjectParameter("serviceInstances{\nserviceInstances#io.toro.martini.service.ServiceInstance[]{\n}\n}\n") public static GloopModel getServiceInstances(String serviceName)
Returns a list of all supporting instances, containing information about these instances that can service the uri
-
-