Package io.micronaut.discovery
Class StaticServiceInstanceList
- java.lang.Object
-
- io.micronaut.discovery.StaticServiceInstanceList
-
- All Implemented Interfaces:
ServiceInstanceList
public class StaticServiceInstanceList extends java.lang.Object implements ServiceInstanceList
AServiceInstanceList
using a static list of URLs. This class doesn't support health checking.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description StaticServiceInstanceList(java.lang.String id, java.util.Collection<java.net.URI> loadBalancedURIs)
Default constructor.StaticServiceInstanceList(java.lang.String id, java.util.Collection<java.net.URI> loadBalancedURIs, java.lang.String contextPath)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
getContextPath()
java.lang.String
getID()
java.util.List<ServiceInstance>
getInstances()
Returns the current list of services.java.util.Collection<java.net.URI>
getLoadBalancedURIs()
-
-
-
Constructor Detail
-
StaticServiceInstanceList
public StaticServiceInstanceList(java.lang.String id, java.util.Collection<java.net.URI> loadBalancedURIs)
Default constructor.- Parameters:
id
- The idloadBalancedURIs
- The URIs
-
StaticServiceInstanceList
public StaticServiceInstanceList(java.lang.String id, java.util.Collection<java.net.URI> loadBalancedURIs, @Nullable java.lang.String contextPath)
Default constructor.- Parameters:
id
- The idloadBalancedURIs
- The URIscontextPath
- The context path
-
-
Method Detail
-
getID
public java.lang.String getID()
- Specified by:
getID
in interfaceServiceInstanceList
- Returns:
- The service ID
-
getInstances
public java.util.List<ServiceInstance> getInstances()
Description copied from interface:ServiceInstanceList
Returns the current list of services. Note: This method should NEVER block.- Specified by:
getInstances
in interfaceServiceInstanceList
- Returns:
- The instances
-
getLoadBalancedURIs
public java.util.Collection<java.net.URI> getLoadBalancedURIs()
- Returns:
- The URIs that are load balanced
-
getContextPath
public java.util.Optional<java.lang.String> getContextPath()
- Specified by:
getContextPath
in interfaceServiceInstanceList
- Returns:
- The context path to use for requests to the service.
-
-