public interface EurekaClient extends LookupService
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.lang.String> |
getAllKnownRegions() |
ApplicationInfoManager |
getApplicationInfoManager() |
Applications |
getApplications(java.lang.String serviceUrl)
Get all applications registered with a specific eureka service.
|
Applications |
getApplicationsForARegion(java.lang.String region) |
java.util.List<java.lang.String> |
getDiscoveryServiceUrls(java.lang.String zone)
Deprecated.
see
EndpointUtils for replacement
Get the list of all eureka service urls for the eureka client to talk to. |
EurekaClientConfig |
getEurekaClientConfig() |
HealthCheckHandler |
getHealthCheckHandler() |
InstanceInfo.InstanceStatus |
getInstanceRemoteStatus() |
java.util.List<InstanceInfo> |
getInstancesByVipAddress(java.lang.String vipAddress,
boolean secure)
Gets the list of instances matching the given VIP Address.
|
java.util.List<InstanceInfo> |
getInstancesByVipAddress(java.lang.String vipAddress,
boolean secure,
java.lang.String region)
Gets the list of instances matching the given VIP Address in the passed region.
|
java.util.List<InstanceInfo> |
getInstancesByVipAddressAndAppName(java.lang.String vipAddress,
java.lang.String appName,
boolean secure)
Gets the list of instances matching the given VIP Address and the given
application name if both of them are not null.
|
java.util.List<java.lang.String> |
getServiceUrlsFromConfig(java.lang.String instanceZone,
boolean preferSameZone)
Deprecated.
see
EndpointUtils for replacement
Get the list of all eureka service urls from properties file for the eureka client to talk to. |
java.util.List<java.lang.String> |
getServiceUrlsFromDNS(java.lang.String instanceZone,
boolean preferSameZone)
Deprecated.
see
EndpointUtils for replacement
Get the list of all eureka service urls from DNS for the eureka client to
talk to. The client picks up the service url from its zone and then fails over to
other zones randomly. If there are multiple servers in the same zone, the client once
again picks one randomly. This way the traffic will be distributed in the case of failures. |
void |
registerEventListener(EurekaEventListener eventListener)
Register
EurekaEventListener with the eureka client. |
void |
registerHealthCheck(HealthCheckHandler healthCheckHandler)
Register
HealthCheckHandler with the eureka client. |
void |
registerHealthCheckCallback(HealthCheckCallback callback)
Deprecated.
Use
registerHealthCheck(com.netflix.appinfo.HealthCheckHandler) instead.
Register HealthCheckCallback with the eureka client.
Once registered, the eureka client will invoke the
HealthCheckCallback in intervals specified by
EurekaClientConfig.getInstanceInfoReplicationIntervalSeconds(). |
void |
shutdown()
Shuts down Eureka Client.
|
boolean |
unregisterEventListener(EurekaEventListener eventListener)
Unregister a
EurekaEventListener previous registered with registerEventListener(com.netflix.discovery.EurekaEventListener)
or injected into the constructor of DiscoveryClient |
getApplication, getApplications, getInstancesById, getNextServerFromEurekaApplications getApplicationsForARegion(@Nullable java.lang.String region)
region - the region that the Applications reside inApplications for the matching region. a Null value
is treated as the local region.Applications getApplications(java.lang.String serviceUrl)
serviceUrl - The string representation of the service url.java.util.List<InstanceInfo> getInstancesByVipAddress(java.lang.String vipAddress, boolean secure)
vipAddress - The VIP address to match the instances for.secure - true if it is a secure vip address, false otherwiseInstanceInfo objects matching the criteriajava.util.List<InstanceInfo> getInstancesByVipAddress(java.lang.String vipAddress, boolean secure, @Nullable java.lang.String region)
vipAddress - The VIP address to match the instances for.secure - true if it is a secure vip address, false otherwiseregion - region from which the instances are to be fetched. If null then local region is
assumed.InstanceInfo objects matching the criteria, empty list if not instances found.java.util.List<InstanceInfo> getInstancesByVipAddressAndAppName(java.lang.String vipAddress, java.lang.String appName, boolean secure)
vipAddress - The VIP address to match the instances for.appName - The applicationName to match the instances for.secure - true if it is a secure vip address, false otherwise.InstanceInfo objects matching the criteria.java.util.Set<java.lang.String> getAllKnownRegions()
InstanceInfo.InstanceStatus getInstanceRemoteStatus()
@Deprecated java.util.List<java.lang.String> getDiscoveryServiceUrls(java.lang.String zone)
EndpointUtils for replacement
Get the list of all eureka service urls for the eureka client to talk to.zone - the zone in which the client resides@Deprecated
java.util.List<java.lang.String> getServiceUrlsFromConfig(java.lang.String instanceZone,
boolean preferSameZone)
EndpointUtils for replacement
Get the list of all eureka service urls from properties file for the eureka client to talk to.instanceZone - The zone in which the client residespreferSameZone - true if we have to prefer the same zone as the client, false otherwise@Deprecated
java.util.List<java.lang.String> getServiceUrlsFromDNS(java.lang.String instanceZone,
boolean preferSameZone)
EndpointUtils for replacement
Get the list of all eureka service urls from DNS for the eureka client to
talk to. The client picks up the service url from its zone and then fails over to
other zones randomly. If there are multiple servers in the same zone, the client once
again picks one randomly. This way the traffic will be distributed in the case of failures.instanceZone - The zone in which the client resides.preferSameZone - true if we have to prefer the same zone as the client, false otherwise.@Deprecated void registerHealthCheckCallback(HealthCheckCallback callback)
registerHealthCheck(com.netflix.appinfo.HealthCheckHandler) instead.
Register HealthCheckCallback with the eureka client.
Once registered, the eureka client will invoke the
HealthCheckCallback in intervals specified by
EurekaClientConfig.getInstanceInfoReplicationIntervalSeconds().callback - app specific healthcheck.void registerHealthCheck(HealthCheckHandler healthCheckHandler)
HealthCheckHandler with the eureka client.
Once registered, the eureka client will first make an onDemand update of the
registering instanceInfo by calling the newly registered healthcheck handler,
and subsequently invoke the HealthCheckHandler in intervals specified
by EurekaClientConfig.getInstanceInfoReplicationIntervalSeconds().healthCheckHandler - app specific healthcheck handler.void registerEventListener(EurekaEventListener eventListener)
EurekaEventListener with the eureka client.
Once registered, the eureka client will invoke EurekaEventListener.onEvent(com.netflix.discovery.EurekaEvent)
whenever there is a change in eureka client's internal state. Use this instead of
polling the client for changes.
EurekaEventListener.onEvent(com.netflix.discovery.EurekaEvent) is called from the context of an internal thread
and must therefore return as quickly as possible without blocking.eventListener - boolean unregisterEventListener(EurekaEventListener eventListener)
EurekaEventListener previous registered with registerEventListener(com.netflix.discovery.EurekaEventListener)
or injected into the constructor of DiscoveryClienteventListener - HealthCheckHandler getHealthCheckHandler()
void shutdown()
EurekaClientConfig getEurekaClientConfig()
ApplicationInfoManager getApplicationInfoManager()