Enum Class TransportClient.State
java.lang.Object
java.lang.Enum<TransportClient.State>
com.levigo.jadice.web.transport.client.networking.TransportClient.State
- All Implemented Interfaces:
Serializable
,Comparable<TransportClient.State>
,Constable
- Enclosing interface:
TransportClient
Represents the connection state of the client.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionState indicating that the client has an active server connection.State that indicates that the server connection fails.State indicating that the client was never connected to a server or disconnected on purpose (by calling the disconnect method).State indicating that the client tries to reconnect to the server using the backoff algorithm.State indicating that the client tries to reconnect to the server using longtime reconnects. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal boolean
final boolean
Whether the state is an active one, i.e. it is justified to send calls to the server. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether pending service calls should be aborted if the connection changes to the given state.static TransportClient.State
Returns the enum constant of this class with the specified name.static TransportClient.State[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NOT_CONNECTED
State indicating that the client was never connected to a server or disconnected on purpose (by calling the disconnect method). -
CONNECTED
State indicating that the client has an active server connection. -
RECONNECTING_BACKOFF
State indicating that the client tries to reconnect to the server using the backoff algorithm. The connection might have been lost because of an unexpected loss of the server connection (losing the server connection because of failed request/unexpected close of the event stream/unexpected close of the WebSockets connection instead of losing it after calling the disconnect method). -
RECONNECTING_LONGTIME
State indicating that the client tries to reconnect to the server using longtime reconnects. The connection might have been lost because of an unexpected loss of the server connection (losing the server connection because of failed request/unexpected close of the event stream/unexpected close of the WebSockets connection instead of losing it after calling the disconnect method). -
FAILED
State that indicates that the server connection fails. Possible reasons:- The reconnect with backoff and longtime failed because the server is not reachable for too long
- The only configured transport methods are not supported either by the client or the server
-
-
Field Details
-
abortPendingCalls
public final boolean abortPendingCalls -
isActiveState
public final boolean isActiveStateWhether the state is an active one, i.e. it is justified to send calls to the server.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
abortPendingCalls
public boolean abortPendingCalls()Whether pending service calls should be aborted if the connection changes to the given state.- Returns:
- whether pending service calls should be aborted
-