public class ClientNetworkState
extends java.lang.Object
Constructor and Description |
---|
ClientNetworkState(java.lang.String id,
long recoverTimeout) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the client
|
void |
completeConnection() |
void |
disable()
Disable the client.
|
void |
enable()
Enable the client.
|
java.lang.String |
getId()
Returns the user-readable id of the target server.
|
long |
getRecoverTimeout()
Return the max recover time.
|
java.lang.String |
getState()
Returns the lifecycle state.
|
boolean |
isActive()
Returns true if the server is active.
|
boolean |
isDead()
Returns true if the server is dead.
|
boolean |
isEnabled()
Return true if enabled.
|
void |
onFail()
Called when the connection fails.
|
void |
onSuccess()
Called when the server has a successful response
|
boolean |
startConnection()
Start a new connection.
|
java.lang.String |
toString() |
public ClientNetworkState(java.lang.String id, long recoverTimeout)
public java.lang.String getId()
public long getRecoverTimeout()
public final java.lang.String getState()
public final boolean isActive()
public boolean isEnabled()
public final boolean isDead()
public void enable()
public void disable()
public void onSuccess()
public void onFail()
public boolean startConnection()
public void completeConnection()
public void close()
public java.lang.String toString()
toString
in class java.lang.Object