public class Hosts
extends java.lang.Object
| Constructor and Description |
|---|
Hosts(java.lang.String primaryHost,
java.lang.String defaultHost,
ClientOptions options)
Create Hosts object
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFallback(java.lang.String lastHost)
Get next fallback host if any
|
java.lang.String |
getHost()
Get primary host name
|
void |
setHost(java.lang.String primaryHost)
set primary hostname
This gets called when the Hosts object is being used by an Http that is
the http connection for a ConnectionManager.
|
public Hosts(java.lang.String primaryHost,
java.lang.String defaultHost,
ClientOptions options)
throws AblyException
primaryHost - the primary hostname, null if not configureddefaultHost - the default hostname that the primary hostname must
match for fallback to occuroptions - ClientOptions to get environment and fallbackHosts from
The fallback and environment processing here is used when the Hosts
object is used by a ConnectionManager (for a realtime connection) or by
an Http for a rest connection. The case where the Hosts object is used
by an Http that is being used by a ConnectionManager goes through this
code, but the results are ignored because ConnectionManager then calls
setHost() and fallback is not used.AblyExceptionpublic void setHost(java.lang.String primaryHost)
public java.lang.String getHost()
public java.lang.String getFallback(java.lang.String lastHost)
lastHost -