Package com.netflix.discovery.shared
Interface LookupService<T>
-
- Type Parameters:
T- for backward compatibility
- All Known Subinterfaces:
EurekaClient
- All Known Implementing Classes:
DiscoveryClient
public interface LookupService<T>Lookup service for finding active instances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ApplicationgetApplication(java.lang.String appName)Returns the correspondingApplicationobject which is basically a container of all registeredappNameInstanceInfos.ApplicationsgetApplications()Returns theApplicationsobject which is basically a container of all currently registeredApplications.java.util.List<InstanceInfo>getInstancesById(java.lang.String id)Returns theListofInstanceInfos matching the the passed in id.InstanceInfogetNextServerFromEureka(java.lang.String virtualHostname, boolean secure)Gets the next possible server to process the requests from the registry information received from eureka.
-
-
-
Method Detail
-
getApplication
Application getApplication(java.lang.String appName)
Returns the correspondingApplicationobject which is basically a container of all registeredappNameInstanceInfos.- Parameters:
appName-- Returns:
- a
Applicationor null if we couldn't locate any app of the requested appName
-
getApplications
Applications getApplications()
Returns theApplicationsobject which is basically a container of all currently registeredApplications.- Returns:
Applications
-
getInstancesById
java.util.List<InstanceInfo> getInstancesById(java.lang.String id)
Returns theListofInstanceInfos matching the the passed in id. A singleInstanceInfocan possibly be registered w/ more than oneApplications- Parameters:
id-- Returns:
ListofInstanceInfos orCollections.emptyList()
-
getNextServerFromEureka
InstanceInfo getNextServerFromEureka(java.lang.String virtualHostname, boolean secure)
Gets the next possible server to process the requests from the registry information received from eureka.The next server is picked on a round-robin fashion. By default, this method just returns the servers that are currently with
InstanceInfo.InstanceStatus.UPstatus. This configuration can be controlled by overriding theEurekaClientConfig.shouldFilterOnlyUpInstances(). Note that in some cases (Eureka emergency mode situation), the instances that are returned may not be unreachable, it is solely up to the client at that point to timeout quickly and retry the next server.- Parameters:
virtualHostname- the virtual host name that is associated to the servers.secure- indicates whether this is a HTTP or a HTTPS request - secure means HTTPS.- Returns:
- the
InstanceInfoinformation which contains the public host name of the next server in line to process the request based on the round-robin algorithm. - Throws:
java.lang.RuntimeException- if the virtualHostname does not exist
-
-