public enum ConnectionState extends java.lang.Enum<ConnectionState>
Connection object states.| Enum Constant and Description |
|---|
closed
The connection has been explicitly closed by the client.
|
closing
An explicit request by the developer to close the connection has been sent to the Ably service.
|
connected
A connection exists and is active.
|
connecting
A connection attempt has been initiated.
|
disconnected
A temporary failure condition.
|
failed
This state is entered if the client library encounters a failure condition that it cannot recover from.
|
initialized
A connection with this state has been initialized but no connection has yet been attempted.
|
suspended
A long term failure condition.
|
| Modifier and Type | Method and Description |
|---|---|
ConnectionEvent |
getConnectionEvent() |
static ConnectionState |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ConnectionState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ConnectionState initialized
public static final ConnectionState connecting
public static final ConnectionState connected
public static final ConnectionState disconnected
public static final ConnectionState suspended
Connection.connect().
Once the connection has been re-established, channels will be automatically re-attached.
The client has been disconnected for too long for them to resume from where they left off,
so if it wants to catch up on messages published by other clients while it was disconnected,
it needs to use the History API.public static final ConnectionState closing
public static final ConnectionState closed
Connection.connect(), which results in a new connection.public static final ConnectionState failed
Connection.connect().public static ConnectionState[] values()
for (ConnectionState c : ConnectionState.values()) System.out.println(c);
public static ConnectionState valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic ConnectionEvent getConnectionEvent()