public class EcsHostListProvider extends java.lang.Object implements HostListProvider
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT |
static java.lang.String |
DEFAULT_PROTOCOL |
protected java.text.SimpleDateFormat |
rfc822DateFormat |
| Constructor and Description |
|---|
EcsHostListProvider(com.sun.jersey.api.client.Client client,
LoadBalancer loadBalancer,
java.lang.String user,
java.lang.String secret) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this provider.
|
com.sun.jersey.api.client.Client |
getClient() |
protected java.util.List<Host> |
getDataNodes(Host host) |
java.util.List<Host> |
getHostList() |
LoadBalancer |
getLoadBalancer() |
int |
getPort() |
java.lang.String |
getProtocol() |
protected java.net.URI |
getRequestUri(Host host,
java.lang.String path) |
java.lang.String |
getSecret() |
protected java.lang.String |
getSignature(java.lang.String canonicalString,
java.lang.String secret) |
java.lang.String |
getUser() |
java.util.List<Vdc> |
getVdcs() |
void |
runHealthCheck(Host host)
If this completes without throwing an exception, the host is considered healthy
(
host.setHealthy(true) is called). |
void |
setPort(int port) |
void |
setProtocol(java.lang.String protocol) |
void |
setVdcs(java.util.List<Vdc> vdcs) |
protected void |
updateVdcNodes(Vdc vdc,
java.util.List<Host> nodeList) |
EcsHostListProvider |
withVdcs(Vdc... vdcs) |
public static final java.lang.String DEFAULT_PROTOCOL
public static final int DEFAULT_PORT
protected final java.text.SimpleDateFormat rfc822DateFormat
public EcsHostListProvider(com.sun.jersey.api.client.Client client,
LoadBalancer loadBalancer,
java.lang.String user,
java.lang.String secret)
public java.util.List<Host> getHostList()
getHostList in interface HostListProviderpublic void runHealthCheck(Host host)
HostListProviderhost.setHealthy(true) is called). Otherwise, the host is considered unhealthy/down
(host.setHealthy(false) is called).runHealthCheck in interface HostListProviderpublic void destroy()
HostListProviderThe provider must not be reused after this method is called otherwise undefined behavior will occur.
destroy in interface HostListProviderprotected java.net.URI getRequestUri(Host host, java.lang.String path)
protected java.lang.String getSignature(java.lang.String canonicalString,
java.lang.String secret)
throws java.lang.Exception
java.lang.Exceptionpublic com.sun.jersey.api.client.Client getClient()
public LoadBalancer getLoadBalancer()
public java.lang.String getUser()
public java.lang.String getSecret()
public java.lang.String getProtocol()
public void setProtocol(java.lang.String protocol)
public int getPort()
public void setPort(int port)
public java.util.List<Vdc> getVdcs()
public void setVdcs(java.util.List<Vdc> vdcs)
public EcsHostListProvider withVdcs(Vdc... vdcs)