Package org.littleshoot.proxy.impl
Enum ConnectionState
- java.lang.Object
-
- java.lang.Enum<ConnectionState>
-
- org.littleshoot.proxy.impl.ConnectionState
-
- All Implemented Interfaces:
Serializable,Comparable<ConnectionState>
enum ConnectionState extends Enum<ConnectionState>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AWAITING_CHUNKConnected and awaiting HttpContent chunk.AWAITING_CONNECT_OKWhen forwarding a CONNECT to a chained proxy, we await the CONNECTION_OK message from the proxy.AWAITING_INITIALConnected and awaiting initial message (e.g.AWAITING_PROXY_AUTHENTICATIONConnected but waiting for proxy authentication.CONNECTINGConnection attempting to connect.DISCONNECT_REQUESTEDWe've asked the client to disconnect, but it hasn't yet.DISCONNECTEDDisconnectedHANDSHAKINGIn the middle of doing an SSL handshake.NEGOTIATING_CONNECTIn the process of negotiating an HTTP CONNECT from the client.
-
Field Summary
Fields Modifier and Type Field Description private booleanpartOfConnectionFlow
-
Constructor Summary
Constructors Modifier Constructor Description privateConnectionState()privateConnectionState(boolean partOfConnectionFlow)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisDisconnectingOrDisconnected()Indicates whether this ConnectionState is no longer waiting for messages and is either in the process of disconnecting or is already disconnected.booleanisPartOfConnectionFlow()Indicates whether this ConnectionState corresponds to a step in aConnectionFlow.static ConnectionStatevalueOf(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.
-
-
-
Enum Constant Detail
-
CONNECTING
public static final ConnectionState CONNECTING
Connection attempting to connect.
-
HANDSHAKING
public static final ConnectionState HANDSHAKING
In the middle of doing an SSL handshake.
-
NEGOTIATING_CONNECT
public static final ConnectionState NEGOTIATING_CONNECT
In the process of negotiating an HTTP CONNECT from the client.
-
AWAITING_CONNECT_OK
public static final ConnectionState AWAITING_CONNECT_OK
When forwarding a CONNECT to a chained proxy, we await the CONNECTION_OK message from the proxy.
-
AWAITING_PROXY_AUTHENTICATION
public static final ConnectionState AWAITING_PROXY_AUTHENTICATION
Connected but waiting for proxy authentication.
-
AWAITING_INITIAL
public static final ConnectionState AWAITING_INITIAL
Connected and awaiting initial message (e.g. HttpRequest or HttpResponse).
-
AWAITING_CHUNK
public static final ConnectionState AWAITING_CHUNK
Connected and awaiting HttpContent chunk.
-
DISCONNECT_REQUESTED
public static final ConnectionState DISCONNECT_REQUESTED
We've asked the client to disconnect, but it hasn't yet.
-
DISCONNECTED
public static final ConnectionState DISCONNECTED
Disconnected
-
-
Method Detail
-
values
public static ConnectionState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ConnectionState c : ConnectionState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConnectionState valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
isPartOfConnectionFlow
public boolean isPartOfConnectionFlow()
Indicates whether this ConnectionState corresponds to a step in aConnectionFlow. This is useful to distinguish so that we know whether or not we're in the process of establishing a connection.- Returns:
- true if part of connection flow, otherwise false
-
isDisconnectingOrDisconnected
public boolean isDisconnectingOrDisconnected()
Indicates whether this ConnectionState is no longer waiting for messages and is either in the process of disconnecting or is already disconnected.- Returns:
- true if the connection state is
DISCONNECT_REQUESTEDorDISCONNECTED, otherwise false
-
-