Package com.mastfrog.netty.http.client
Enum StateType
- All Implemented Interfaces:
Serializable,Comparable<StateType>,java.lang.constant.Constable
Enumeration of states a request can be in.
- Author:
- Tim Boudreau
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe request has been sent.The call was cancelled; useful for cleaning up resources.The connection was closed.A connection has been made.A connection has not been made yet.One chunk of content has been received - not necessarily the entire response, but some content.An exception was thrown.Similar to FullContentReceived, this event gives you a Netty FullHttpRequest with the entire response.The entire content of the response has arrived.The response headers have been received, but the response body has not yet (or there will not be one).The response was a 300-307 HTTP redirect and the redirect is being followed.About to send a requestCalled when a timeout occurs. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanClass<?>Get the type of the State object tied to this eventtype()Get the type of the data payload of this eventstatic StateTypeReturns the enum constant of this type with the specified name.static StateType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
Connecting
A connection has not been made yet. -
Connected
A connection has been made. -
SendRequest
About to send a request -
AwaitingResponse
The request has been sent. -
HeadersReceived
The response headers have been received, but the response body has not yet (or there will not be one). -
ContentReceived
One chunk of content has been received - not necessarily the entire response, but some content. -
Redirect
The response was a 300-307 HTTP redirect and the redirect is being followed. Note this event will only be seen if the HttpClient is set to follow redirects - otherwise, you will just see the redirect headers and body. -
FullContentReceived
The entire content of the response has arrived. -
Closed
The connection was closed. -
Finished
Similar to FullContentReceived, this event gives you a Netty FullHttpRequest with the entire response. -
Error
An exception was thrown. -
Timeout
Called when a timeout occurs. -
Cancelled
The call was cancelled; useful for cleaning up resources.
-
-
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
-
isResponseComplete
public boolean isResponseComplete() -
isFailure
public boolean isFailure() -
stateValueType
Get the type of the State object tied to this event- Returns:
- a type
-
type
Get the type of the data payload of this event- Returns:
- a type
-