Package org.microproxy
Enum Class ProxyFailure.ConnectFailed.Reason
- All Implemented Interfaces:
Serializable,Comparable<ProxyFailure.ConnectFailed.Reason>,Constable
- Enclosing class:
ProxyFailure.ConnectFailed
public static enum ProxyFailure.ConnectFailed.Reason
extends Enum<ProxyFailure.ConnectFailed.Reason>
How a connection attempt failed, read from the exception's cause chain: what a chained
HTTP proxy did with the proxy's
CONNECT (ChainedProxyConnectException),
or anything else. code() is the reason's snake_case name.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe chained proxy closed the connection before its answer to theCONNECTwas complete.The chained proxy answered theCONNECTwith a status other than2xx(ProxyFailure.ConnectFailed.chainedProxyStatus()).The connection to the chained proxy was reset (or failed otherwise) before its answer to theCONNECT.Anything else: the connection refused, unreachable or timed out, a name that did not resolve, ... -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the reason's name in lower case:chained_proxy_refused, ....Classifies a failed connection attempt by its exception's cause chain.Returns the enum constant of this class with the specified name.static ProxyFailure.ConnectFailed.Reason[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CHAINED_PROXY_REFUSED
The chained proxy answered theCONNECTwith a status other than2xx(ProxyFailure.ConnectFailed.chainedProxyStatus()). -
CHAINED_PROXY_CLOSED
The chained proxy closed the connection before its answer to theCONNECTwas complete. -
CHAINED_PROXY_RESET
The connection to the chained proxy was reset (or failed otherwise) before its answer to theCONNECT. -
OTHER
Anything else: the connection refused, unreachable or timed out, a name that did not resolve, ...
-
-
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
-
code
Returns the reason's name in lower case:chained_proxy_refused, ....- Returns:
- the reason's name in lower case:
chained_proxy_refused, ...
-
of
Classifies a failed connection attempt by its exception's cause chain.- Parameters:
failure- the attempt's exception, or null- Returns:
- the reason,
OTHERwhen none is recognized
-