Class 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 the
    foo.bar.HelloYou
    Gloop API, then you can use methods here for an instance using
    foo.bar.HelloYou
    as the argument.
    • Constructor Detail

      • ServiceRegistryMethods

        public ServiceRegistryMethods​(io.toro.martini.service.ServiceRegistry serviceRegistry)
    • 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
      • getHostUri

        public static String getHostUri​(String serviceName)
        Returns a hostname or ip address of an instance that can be used to service the uri