Package org.littleshoot.proxy.impl
Enum ConnectionState
- All Implemented Interfaces:
Serializable,Comparable<ConnectionState>,java.lang.constant.Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionConnected and awaiting HttpContent chunk.When forwarding a CONNECT to a chained proxy, we await the CONNECTION_OK message from the proxy.Connected and awaiting initial message (e.g.Connected but waiting for proxy authentication.Connection attempting to connect.We've asked the client to disconnect, but it hasn't yet.DisconnectedIn the middle of doing an SSL handshake.In the process of negotiating an HTTP CONNECT from the client. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether this ConnectionState is no longer waiting for messages and is either in the process of disconnecting or is already disconnected.booleanIndicates whether this ConnectionState corresponds to a step in aConnectionFlow.static ConnectionStateReturns 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 Details
-
CONNECTING
Connection attempting to connect. -
HANDSHAKING
In the middle of doing an SSL handshake. -
NEGOTIATING_CONNECT
In the process of negotiating an HTTP CONNECT from the client. -
AWAITING_CONNECT_OK
When forwarding a CONNECT to a chained proxy, we await the CONNECTION_OK message from the proxy. -
AWAITING_PROXY_AUTHENTICATION
Connected but waiting for proxy authentication. -
AWAITING_INITIAL
Connected and awaiting initial message (e.g. HttpRequest or HttpResponse). -
AWAITING_CHUNK
Connected and awaiting HttpContent chunk. -
DISCONNECT_REQUESTED
We've asked the client to disconnect, but it hasn't yet. -
DISCONNECTED
Disconnected
-
-
Field Details
-
partOfConnectionFlow
private final boolean partOfConnectionFlow
-
-
Constructor Details
-
ConnectionState
private ConnectionState(boolean partOfConnectionFlow) -
ConnectionState
private ConnectionState()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-