ActionCode (Apache Tomcat 11.0.23 API Documentation)
Description: declaration: package: org.apache.coyote, enum: ActionCode

# Enum Class ActionCode

java.lang.Object
java.lang.Enum<ActionCode>
org.apache.coyote.ActionCode

All Implemented Interfaces:
  `Serializable, Comparable<ActionCode>, Constable`

public enum ActionCode extends Enum<ActionCode>
ActionCodes represent callbacks from the servlet container to the coyote connector. Actions are implemented by ProtocolHandler, using the ActionHook interface.

See Also:
  - `ProtocolHandler`
  - `ActionHook`

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class Enum

  `Enum.EnumDesc<E>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `ACK`
  Acknowledge request, most often used for HTTP expectations.
  `ASYNC_COMPLETE`
  Callback for an async call to `AsyncContext.complete()`.
  `ASYNC_DISPATCH`
  Callback for an async call to `AsyncContext.dispatch()`.
  `ASYNC_DISPATCHED`
  Callback to indicate the actual dispatch has started and that the async state needs change.
  `ASYNC_ERROR`
  Callback to trigger the error processing.
  `ASYNC_IS_ASYNC`
  Callback to determine if async processing is in progress.
  `ASYNC_IS_COMPLETING`
  Call back to determine if async complete is in progress.
  `ASYNC_IS_DISPATCHING`
  Callback to determine if async dispatch is in progress.
  `ASYNC_IS_ERROR`
  Callback to determine if async is in error.
  `ASYNC_IS_STARTED`
  Callback to determine if async dispatch is in progress.
  `ASYNC_IS_TIMINGOUT`
  Callback to determine if async is timing out.
  `ASYNC_POST_PROCESS`
  Callback to trigger post processing.
  `ASYNC_RUN`
  Callback for an async call to `AsyncContext.start(Runnable)`.
  `ASYNC_SETTIMEOUT`
  Callback for an async call to `AsyncContext.setTimeout(long)`
  `ASYNC_START`
  Callback for an async request.
  `ASYNC_TIMEOUT`
  Callback to trigger the processing of an async timeout.
  `AVAILABLE`
  Callback for getting the amount of available bytes.
  `CLIENT_FLUSH`
  A flush() operation originated by the client ( i.e. a flush() on the servlet output stream or writer, called by a servlet ).
  `CLOSE`
  Regular close.
  `CLOSE_NOW`
  A serious error occurred from which it is not possible to recover safely.
  `COMMIT`
  Response commit, which means any initial bytes part of the response are going to be sent.
  `DISABLE_SWALLOW_INPUT`
  Hook called if swallowing request input should be disabled.
  `DISPATCH_ERROR`
  Indicates that the container needs to trigger a call to onError() for the registered non-blocking write and/or read listener(s).
  `DISPATCH_EXECUTE`
  Execute any non-blocking dispatches that have been registered via `DISPATCH_READ` or `DISPATCH_WRITE`.
  `DISPATCH_READ`
  Indicates that the container needs to trigger a call to onDataAvailable() for the registered non-blocking read listener.
  `DISPATCH_WRITE`
  Indicates that the container needs to trigger a call to onWritePossible() for the registered non-blocking write listener.
  `EARLY_HINTS`
  Send an RFC 8297 Early Hints informational response.
  `IS_ERROR`
  Has the processor been placed into the error state?
  `IS_IO_ALLOWED`
  The processor may have been placed into an error state and some error states do not permit any further I/O.
  `IS_TRAILER_FIELDS_READY`
  Are the request trailer fields ready to be read?
  `IS_TRAILER_FIELDS_SUPPORTED`
  Are HTTP trailer fields supported for the current response?
  `NB_READ_INTEREST`
  Indicator that Servlet is interested in being notified when data is available to be read.
  `NB_WRITE_INTEREST`
  Used with non-blocking writes to determine if a write is currently allowed (sets passed parameter to `true`) or not (sets passed parameter to `false`).
  `PROTOCOL_REQUEST_ID`
  Obtain the request identifier for this request as defined by the protocol in use.
  `REQ_HOST_ADDR_ATTRIBUTE`
  Callback for lazy evaluation - extract the remote host address.
  `REQ_HOST_ATTRIBUTE`
  Callback for lazy evaluation - extract the remote host name and address.
  `REQ_LOCAL_ADDR_ATTRIBUTE`
  Callback for lazy evaluation - local address.
  `REQ_LOCAL_NAME_ATTRIBUTE`
  Callback for lazy evaluation - local address.
  `REQ_LOCALPORT_ATTRIBUTE`
  Callback for lazy evaluation - socket local port.
  `REQ_PEER_ADDR_ATTRIBUTE`
  Callback for lazy evaluation - extract the connection peer address.
  `REQ_REMOTEPORT_ATTRIBUTE`
  Callback for lazy evaluation - socket remote port.
  `REQ_SET_BODY_REPLAY`
  Callback for setting FORM auth body replay
  `REQ_SSL_ATTRIBUTE`
  Callback for lazy evaluation - extract the SSL-related attributes including the client certificate if present.
  `REQ_SSL_CERTIFICATE`
  Force a TLS re-handshake and make the resulting client certificate (if any) available as a request attribute.
  `REQUEST_BODY_FULLY_READ`
  Indicates if the request body has been fully read.
  `SERVLET_CONNECTION`
  Obtain the servlet connection instance for the network connection supporting the current request.
  `UPGRADE`
  Callback to trigger the HTTP upgrade process.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static ActionCode`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static ActionCode[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### ACK

    public static final ActionCode ACK
    Acknowledge request, most often used for HTTP expectations.

  - ### CLOSE

    public static final ActionCode CLOSE
    Regular close.

  - ### COMMIT

    public static final ActionCode COMMIT
    Response commit, which means any initial bytes part of the response are going to be sent.

  - ### CLOSE_NOW

    public static final ActionCode CLOSE_NOW
    A serious error occurred from which it is not possible to recover safely. Further attempts to write to the response should be ignored and the connection needs to be closed as soon as possible. This can also be used to forcibly close a connection if an error occurs after the response has been committed.

  - ### CLIENT_FLUSH

    public static final ActionCode CLIENT_FLUSH
    A flush() operation originated by the client ( i.e. a flush() on the servlet output stream or writer, called by a servlet ). Argument is the Response.

  - ### IS_ERROR

    public static final ActionCode IS_ERROR
    Has the processor been placed into the error state? Note that the response may not have an appropriate error code set.

  - ### IS_IO_ALLOWED

    public static final ActionCode IS_IO_ALLOWED
    The processor may have been placed into an error state and some error states do not permit any further I/O. Is I/O currently allowed?

  - ### DISABLE_SWALLOW_INPUT

    public static final ActionCode DISABLE_SWALLOW_INPUT
    Hook called if swallowing request input should be disabled. Example: Cancel a large file upload.

  - ### REQ_HOST_ATTRIBUTE

    public static final ActionCode REQ_HOST_ATTRIBUTE
    Callback for lazy evaluation - extract the remote host name and address.

  - ### REQ_HOST_ADDR_ATTRIBUTE

    public static final ActionCode REQ_HOST_ADDR_ATTRIBUTE
    Callback for lazy evaluation - extract the remote host address.

  - ### REQ_PEER_ADDR_ATTRIBUTE

    public static final ActionCode REQ_PEER_ADDR_ATTRIBUTE
    Callback for lazy evaluation - extract the connection peer address.

  - ### REQ_SSL_ATTRIBUTE

    public static final ActionCode REQ_SSL_ATTRIBUTE
    Callback for lazy evaluation - extract the SSL-related attributes including the client certificate if present.

  - ### REQ_SSL_CERTIFICATE

    public static final ActionCode REQ_SSL_CERTIFICATE
    Force a TLS re-handshake and make the resulting client certificate (if any) available as a request attribute.

  - ### REQ_REMOTEPORT_ATTRIBUTE

    public static final ActionCode REQ_REMOTEPORT_ATTRIBUTE
    Callback for lazy evaluation - socket remote port.

  - ### REQ_LOCALPORT_ATTRIBUTE

    public static final ActionCode REQ_LOCALPORT_ATTRIBUTE
    Callback for lazy evaluation - socket local port.

  - ### REQ_LOCAL_ADDR_ATTRIBUTE

    public static final ActionCode REQ_LOCAL_ADDR_ATTRIBUTE
    Callback for lazy evaluation - local address.

  - ### REQ_LOCAL_NAME_ATTRIBUTE

    public static final ActionCode REQ_LOCAL_NAME_ATTRIBUTE
    Callback for lazy evaluation - local address.

  - ### REQ_SET_BODY_REPLAY

    public static final ActionCode REQ_SET_BODY_REPLAY
    Callback for setting FORM auth body replay

  - ### AVAILABLE

    public static final ActionCode AVAILABLE
    Callback for getting the amount of available bytes.

  - ### ASYNC_START

    public static final ActionCode ASYNC_START
    Callback for an async request.

  - ### ASYNC_DISPATCH

    public static final ActionCode ASYNC_DISPATCH
    Callback for an async call to `AsyncContext.dispatch()`.

  - ### ASYNC_DISPATCHED

    public static final ActionCode ASYNC_DISPATCHED
    Callback to indicate the actual dispatch has started and that the async state needs change.

  - ### ASYNC_RUN

    public static final ActionCode ASYNC_RUN
    Callback for an async call to `AsyncContext.start(Runnable)`.

  - ### ASYNC_COMPLETE

    public static final ActionCode ASYNC_COMPLETE
    Callback for an async call to `AsyncContext.complete()`.

  - ### ASYNC_TIMEOUT

    public static final ActionCode ASYNC_TIMEOUT
    Callback to trigger the processing of an async timeout.

  - ### ASYNC_ERROR

    public static final ActionCode ASYNC_ERROR
    Callback to trigger the error processing.

  - ### ASYNC_SETTIMEOUT

    public static final ActionCode ASYNC_SETTIMEOUT
    Callback for an async call to `AsyncContext.setTimeout(long)`

  - ### ASYNC_IS_ASYNC

    public static final ActionCode ASYNC_IS_ASYNC
    Callback to determine if async processing is in progress.

  - ### ASYNC_IS_STARTED

    public static final ActionCode ASYNC_IS_STARTED
    Callback to determine if async dispatch is in progress.

  - ### ASYNC_IS_COMPLETING

    public static final ActionCode ASYNC_IS_COMPLETING
    Call back to determine if async complete is in progress.

  - ### ASYNC_IS_DISPATCHING

    public static final ActionCode ASYNC_IS_DISPATCHING
    Callback to determine if async dispatch is in progress.

  - ### ASYNC_IS_TIMINGOUT

    public static final ActionCode ASYNC_IS_TIMINGOUT
    Callback to determine if async is timing out.

  - ### ASYNC_IS_ERROR

    public static final ActionCode ASYNC_IS_ERROR
    Callback to determine if async is in error.

  - ### ASYNC_POST_PROCESS

    public static final ActionCode ASYNC_POST_PROCESS
    Callback to trigger post processing. Typically only used during error handling to trigger essential processing that otherwise would be skipped.

  - ### UPGRADE

    public static final ActionCode UPGRADE
    Callback to trigger the HTTP upgrade process.

  - ### NB_READ_INTEREST

    public static final ActionCode NB_READ_INTEREST
    Indicator that Servlet is interested in being notified when data is available to be read.

  - ### NB_WRITE_INTEREST

    public static final ActionCode NB_WRITE_INTEREST
    Used with non-blocking writes to determine if a write is currently allowed (sets passed parameter to `true`) or not (sets passed parameter to `false`). If a write is not allowed then callback will be triggered at some future point when write becomes possible again.

  - ### REQUEST_BODY_FULLY_READ

    public static final ActionCode REQUEST_BODY_FULLY_READ
    Indicates if the request body has been fully read.

  - ### DISPATCH_READ

    public static final ActionCode DISPATCH_READ
    Indicates that the container needs to trigger a call to onDataAvailable() for the registered non-blocking read listener.

  - ### DISPATCH_WRITE

    public static final ActionCode DISPATCH_WRITE
    Indicates that the container needs to trigger a call to onWritePossible() for the registered non-blocking write listener.

  - ### DISPATCH_ERROR

    public static final ActionCode DISPATCH_ERROR
    Indicates that the container needs to trigger a call to onError() for the registered non-blocking write and/or read listener(s).

  - ### DISPATCH_EXECUTE

    public static final ActionCode DISPATCH_EXECUTE
    Execute any non-blocking dispatches that have been registered via `DISPATCH_READ` or `DISPATCH_WRITE`. Typically required when the non-blocking listeners are configured on a thread where the processing wasn't triggered by a read or write event on the socket.

  - ### IS_TRAILER_FIELDS_READY

    public static final ActionCode IS_TRAILER_FIELDS_READY
    Are the request trailer fields ready to be read? Note that this returns true if it is known that request trailer fields are not supported so an empty collection of trailers can then be read.

  - ### IS_TRAILER_FIELDS_SUPPORTED

    public static final ActionCode IS_TRAILER_FIELDS_SUPPORTED
    Are HTTP trailer fields supported for the current response? Note that once an HTTP/1.1 response has been committed, it will no longer support trailer fields.

  - ### PROTOCOL_REQUEST_ID

    public static final ActionCode PROTOCOL_REQUEST_ID
    Obtain the request identifier for this request as defined by the protocol in use. Note that some protocols do not define such an identifier. E.g. this will be Stream ID for HTTP/2.

  - ### SERVLET_CONNECTION

    public static final ActionCode SERVLET_CONNECTION
    Obtain the servlet connection instance for the network connection supporting the current request.

  - ### EARLY_HINTS

    public static final ActionCode EARLY_HINTS
    Send an RFC 8297 Early Hints informational response.

- ## Method Details

  - ### values

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

    public static ActionCode valueOf(String name)
    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 name
      `NullPointerException` - if the argument is null