Enum StateType

java.lang.Object
java.lang.Enum<StateType>
com.mastfrog.netty.http.client.StateType
All Implemented Interfaces:
Serializable, Comparable<StateType>, java.lang.constant.Constable

public enum StateType extends Enum<StateType>
Enumeration of states a request can be in.
Author:
Tim Boudreau
  • Enum Constant Details

    • Connecting

      public static final StateType Connecting
      A connection has not been made yet.
    • Connected

      public static final StateType Connected
      A connection has been made.
    • SendRequest

      public static final StateType SendRequest
      About to send a request
    • AwaitingResponse

      public static final StateType AwaitingResponse
      The request has been sent.
    • HeadersReceived

      public static final StateType HeadersReceived
      The response headers have been received, but the response body has not yet (or there will not be one).
    • ContentReceived

      public static final StateType ContentReceived
      One chunk of content has been received - not necessarily the entire response, but some content.
    • Redirect

      public static final StateType 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

      public static final StateType FullContentReceived
      The entire content of the response has arrived.
    • Closed

      public static final StateType Closed
      The connection was closed.
    • Finished

      public static final StateType Finished
      Similar to FullContentReceived, this event gives you a Netty FullHttpRequest with the entire response.
    • Error

      public static final StateType Error
      An exception was thrown.
    • Timeout

      public static final StateType Timeout
      Called when a timeout occurs.
    • Cancelled

      public static final StateType Cancelled
      The call was cancelled; useful for cleaning up resources.
  • Method Details

    • values

      public static StateType[] 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

      public static StateType 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 name
      NullPointerException - if the argument is null
    • isResponseComplete

      public boolean isResponseComplete()
    • isFailure

      public boolean isFailure()
    • stateValueType

      public Class<?> stateValueType()
      Get the type of the State object tied to this event
      Returns:
      a type
    • type

      public Class<? extends State<?>> type()
      Get the type of the data payload of this event
      Returns:
      a type