public enum ConnectorState extends Enum<ConnectorState>
IConnector.getState()
Enum Constant and Description |
---|
CONNECTED
Indicates that the
IConnector has successfully managed to establish and negotiate the underlying physical
connection and is ready now to perform actual communications. |
CONNECTING
Indicates that the
IConnector is currently trying to establish an underlying physical connection like a TCP
socket connection. |
DISCONNECTED
Indicates that the
IConnector has not been connected yet or has been disconnected after being connected
previously. |
NEGOTIATING
Indicates that the
IConnector has successfully managed to establish the underlying physical connection and
has currently delegated control over this connection to an INegotiator . |
Modifier and Type | Method and Description |
---|---|
static ConnectorState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ConnectorState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ConnectorState DISCONNECTED
IConnector
has not been connected yet or has been disconnected after being connected
previously.
A connector is DISCONNECTED
if and only if it is not
active
. A transition to CONNECTING
can be triggered by calling IConnector.connect(long)
or IConnector.connectAsync()
.
IConnector.getState()
,
ILifecycle.isActive()
public static final ConnectorState CONNECTING
IConnector
is currently trying to establish an underlying physical connection like a TCP
socket connection.
A connector can only be CONNECTING
if it is
active
. As soon as the underlying physical
connection is successfully established the state of the connector automatically transitions to NEGOTIATING
.
IConnector.getState()
,
ILifecycle.isActive()
public static final ConnectorState NEGOTIATING
IConnector
has successfully managed to establish the underlying physical connection and
has currently delegated control over this connection to an INegotiator
.
A connector can only be NEGOTIATING
if it is
active
and a negotiator has been supplied.
As soon as the negotiator has successfully negotiated both peers (or a negotiator has not been supplied) the state
of the connector automatically transitions to CONNECTED
.
Negotiators can implement arbitrary handshake protocols, challenge-response sequences or other authentication procedures. They can also be used to initially setup connection encryption if the connector implementation is not able to do so.
IConnector.getState()
,
ILifecycle.isActive()
public static final ConnectorState CONNECTED
IConnector
has successfully managed to establish and negotiate the underlying physical
connection and is ready now to perform actual communications.
A connector can only be CONNECTED
if it is
active
. A transition to
DISCONNECTED
can be triggered by calling Closeable.close()
.
IConnector.getState()
,
ILifecycle.isActive()
public static ConnectorState[] values()
for (ConnectorState c : ConnectorState.values()) System.out.println(c);
public static ConnectorState valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright (c) 2011-2014 Eike Stepper (Berlin, Germany) and others.