Constants (Apache Tomcat 11.0.23 API Documentation)
Description: declaration: package: org.apache.coyote.ajp, class: Constants

# Class Constants

java.lang.Object
org.apache.coyote.ajp.Constants

public final class Constants extends Object
Constants.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DEFAULT_CONNECTION_TIMEOUT`
  Default connection timeout value.
  `static final int`
  `H_SIZE`
  Size of basic packet header.
  `static final byte`
  `JK_AJP13_CPING_REQUEST`
  AJP13 cping request message prefix code.
  `static final byte`
  `JK_AJP13_CPONG_REPLY`
  AJP13 cpong reply message prefix code.
  `static final byte`
  `JK_AJP13_END_RESPONSE`
  AJP13 end response message prefix code.
  `static final byte`
  `JK_AJP13_FORWARD_REQUEST`
  AJP13 forward request message prefix code.
  `static final byte`
  `JK_AJP13_GET_BODY_CHUNK`
  AJP13 get body chunk message prefix code.
  `static final byte`
  `JK_AJP13_PING_REQUEST`
  AJP13 ping request message prefix code.
  `static final byte`
  `JK_AJP13_SEND_BODY_CHUNK`
  AJP13 send body chunk message prefix code.
  `static final byte`
  `JK_AJP13_SEND_HEADERS`
  AJP13 send headers message prefix code.
  `static final byte`
  `JK_AJP13_SHUTDOWN`
  AJP13 shutdown message prefix code.
  `static final int`
  `MAX_PACKET_SIZE`
  Default maximum total byte size for an AJP packet.
  `static final int`
  `MAX_READ_SIZE`
  Default maximum size of data that can be read in one packet.
  `static final int`
  `MAX_SEND_SIZE`
  Default maximum size of data that can be sent in one packet.
  `static final int`
  `READ_HEAD_LEN`
  Size of the read header metadata.
  `static final byte`
  `SC_A_ARE_DONE`
  Terminator byte for the list of attributes.
  `static final byte`
  `SC_A_AUTH_TYPE`
  Attribute code for authentication type.
  `static final byte`
  `SC_A_CONTEXT`
  Attribute code for context.
  `static final byte`
  `SC_A_JVM_ROUTE`
  Attribute code for JVM route.
  `static final byte`
  `SC_A_QUERY_STRING`
  Attribute code for query string.
  `static final byte`
  `SC_A_REMOTE_USER`
  Attribute code for remote user.
  `static final byte`
  `SC_A_REQ_ATTRIBUTE`
  Attribute code for request attributes not in the predefined list.
  `static final String`
  `SC_A_REQ_LOCAL_ADDR`
  AJP private request attribute for local address.
  `static final String`
  `SC_A_REQ_REMOTE_PORT`
  AJP private request attribute for remote port.
  `static final byte`
  `SC_A_SECRET`
  Attribute code for secret.
  `static final byte`
  `SC_A_SERVLET_PATH`
  Attribute code for servlet path.
  `static final byte`
  `SC_A_SSL_CERT`
  Attribute code for SSL certificate.
  `static final byte`
  `SC_A_SSL_CIPHER`
  Attribute code for SSL cipher.
  `static final byte`
  `SC_A_SSL_KEY_SIZE`
  Attribute code for SSL key size.
  `static final String`
  `SC_A_SSL_PROTOCOL`
  AJP private request attribute for SSL protocol.
  `static final byte`
  `SC_A_SSL_SESSION`
  Attribute code for SSL session.
  `static final byte`
  `SC_A_STORED_METHOD`
  Attribute code for stored method.
  `static final int`
  `SC_M_JK_STORED`
  Stored method code value.
  `static final int`
  `SC_REQ_ACCEPT`
  Request header code for Accept.
  `static final int`
  `SC_REQ_ACCEPT_CHARSET`
  Request header code for Accept-Charset.
  `static final int`
  `SC_REQ_ACCEPT_ENCODING`
  Request header code for Accept-Encoding.
  `static final int`
  `SC_REQ_ACCEPT_LANGUAGE`
  Request header code for Accept-Language.
  `static final int`
  `SC_REQ_AUTHORIZATION`
  Request header code for Authorization.
  `static final int`
  `SC_REQ_CONNECTION`
  Request header code for Connection.
  `static final int`
  `SC_REQ_CONTENT_LENGTH`
  Request header code for Content-Length.
  `static final int`
  `SC_REQ_CONTENT_TYPE`
  Request header code for Content-Type.
  `static final int`
  `SC_REQ_COOKIE`
  Request header code for Cookie.
  `static final int`
  `SC_REQ_COOKIE2`
  Request header code for Cookie2.
  `static final int`
  `SC_REQ_HOST`
  Request header code for Host.
  `static final int`
  `SC_REQ_PRAGMA`
  Request header code for Pragma.
  `static final int`
  `SC_REQ_REFERER`
  Request header code for Referer.
  `static final int`
  `SC_REQ_USER_AGENT`
  Request header code for User-Agent.
  `static final int`
  `SC_RESP_AJP13_MAX`
  Maximum number of response header codes.
  `static final int`
  `SC_RESP_CONTENT_LANGUAGE`
  Response code for Content-Language header.
  `static final int`
  `SC_RESP_CONTENT_LENGTH`
  Response code for Content-Length header.
  `static final int`
  `SC_RESP_CONTENT_TYPE`
  Response code for Content-Type header.
  `static final int`
  `SC_RESP_DATE`
  Response code for Date header.
  `static final int`
  `SC_RESP_LAST_MODIFIED`
  Response code for Last-Modified header.
  `static final int`
  `SC_RESP_LOCATION`
  Response code for Location header.
  `static final int`
  `SC_RESP_SERVLET_ENGINE`
  Response code for Servlet-Engine header.
  `static final int`
  `SC_RESP_SET_COOKIE`
  Response code for Set-Cookie header.
  `static final int`
  `SC_RESP_SET_COOKIE2`
  Response code for Set-Cookie2 header.
  `static final int`
  `SC_RESP_STATUS`
  Response code for Status header.
  `static final int`
  `SC_RESP_WWW_AUTHENTICATE`
  Response code for WWW-Authenticate header.
  `static final int`
  `SEND_HEAD_LEN`
  Size of the send header metadata.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `getHeaderForCode(int code)`
  Converts an AJP coded HTTP request header to the header name.
  `static String`
  `getMethodForCode(int code)`
  Converts an AJP coded HTTP method to the method name.
  `static int`
  `getResponseAjpIndex(String header)`
  Get the AJP response header index for the given header name.
  `static String`
  `getResponseHeaderForCode(int code)`
  Converts an AJP coded response header name to the HTTP response header name.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DEFAULT_CONNECTION_TIMEOUT

    public static final int DEFAULT_CONNECTION_TIMEOUT
    Default connection timeout value.
    See Also:
      - Constant Field Values

  - ### JK_AJP13_FORWARD_REQUEST

    public static final byte JK_AJP13_FORWARD_REQUEST
    AJP13 forward request message prefix code.
    See Also:
      - Constant Field Values

  - ### JK_AJP13_SHUTDOWN

    public static final byte JK_AJP13_SHUTDOWN
    AJP13 shutdown message prefix code.
    See Also:
      - Constant Field Values

  - ### JK_AJP13_PING_REQUEST

    public static final byte JK_AJP13_PING_REQUEST
    AJP13 ping request message prefix code.
    See Also:
      - Constant Field Values

  - ### JK_AJP13_CPING_REQUEST

    public static final byte JK_AJP13_CPING_REQUEST
    AJP13 cping request message prefix code.
    See Also:
      - Constant Field Values

  - ### JK_AJP13_SEND_BODY_CHUNK

    public static final byte JK_AJP13_SEND_BODY_CHUNK
    AJP13 send body chunk message prefix code.
    See Also:
      - Constant Field Values

  - ### JK_AJP13_SEND_HEADERS

    public static final byte JK_AJP13_SEND_HEADERS
    AJP13 send headers message prefix code.
    See Also:
      - Constant Field Values

  - ### JK_AJP13_END_RESPONSE

    public static final byte JK_AJP13_END_RESPONSE
    AJP13 end response message prefix code.
    See Also:
      - Constant Field Values

  - ### JK_AJP13_GET_BODY_CHUNK

    public static final byte JK_AJP13_GET_BODY_CHUNK
    AJP13 get body chunk message prefix code.
    See Also:
      - Constant Field Values

  - ### JK_AJP13_CPONG_REPLY

    public static final byte JK_AJP13_CPONG_REPLY
    AJP13 cpong reply message prefix code.
    See Also:
      - Constant Field Values

  - ### SC_RESP_CONTENT_TYPE

    public static final int SC_RESP_CONTENT_TYPE
    Response code for Content-Type header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_CONTENT_LANGUAGE

    public static final int SC_RESP_CONTENT_LANGUAGE
    Response code for Content-Language header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_CONTENT_LENGTH

    public static final int SC_RESP_CONTENT_LENGTH
    Response code for Content-Length header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_DATE

    public static final int SC_RESP_DATE
    Response code for Date header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_LAST_MODIFIED

    public static final int SC_RESP_LAST_MODIFIED
    Response code for Last-Modified header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_LOCATION

    public static final int SC_RESP_LOCATION
    Response code for Location header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_SET_COOKIE

    public static final int SC_RESP_SET_COOKIE
    Response code for Set-Cookie header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_SET_COOKIE2

    public static final int SC_RESP_SET_COOKIE2
    Response code for Set-Cookie2 header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_SERVLET_ENGINE

    public static final int SC_RESP_SERVLET_ENGINE
    Response code for Servlet-Engine header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_STATUS

    public static final int SC_RESP_STATUS
    Response code for Status header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_WWW_AUTHENTICATE

    public static final int SC_RESP_WWW_AUTHENTICATE
    Response code for WWW-Authenticate header.
    See Also:
      - Constant Field Values

  - ### SC_RESP_AJP13_MAX

    public static final int SC_RESP_AJP13_MAX
    Maximum number of response header codes.
    See Also:
      - Constant Field Values

  - ### SC_A_CONTEXT

    public static final byte SC_A_CONTEXT
    Attribute code for context.
    See Also:
      - Constant Field Values

  - ### SC_A_SERVLET_PATH

    public static final byte SC_A_SERVLET_PATH
    Attribute code for servlet path.
    See Also:
      - Constant Field Values

  - ### SC_A_REMOTE_USER

    public static final byte SC_A_REMOTE_USER
    Attribute code for remote user.
    See Also:
      - Constant Field Values

  - ### SC_A_AUTH_TYPE

    public static final byte SC_A_AUTH_TYPE
    Attribute code for authentication type.
    See Also:
      - Constant Field Values

  - ### SC_A_QUERY_STRING

    public static final byte SC_A_QUERY_STRING
    Attribute code for query string.
    See Also:
      - Constant Field Values

  - ### SC_A_JVM_ROUTE

    public static final byte SC_A_JVM_ROUTE
    Attribute code for JVM route.
    See Also:
      - Constant Field Values

  - ### SC_A_SSL_CERT

    public static final byte SC_A_SSL_CERT
    Attribute code for SSL certificate.
    See Also:
      - Constant Field Values

  - ### SC_A_SSL_CIPHER

    public static final byte SC_A_SSL_CIPHER
    Attribute code for SSL cipher.
    See Also:
      - Constant Field Values

  - ### SC_A_SSL_SESSION

    public static final byte SC_A_SSL_SESSION
    Attribute code for SSL session.
    See Also:
      - Constant Field Values

  - ### SC_A_SSL_KEY_SIZE

    public static final byte SC_A_SSL_KEY_SIZE
    Attribute code for SSL key size.
    See Also:
      - Constant Field Values

  - ### SC_A_SECRET

    public static final byte SC_A_SECRET
    Attribute code for secret.
    See Also:
      - Constant Field Values

  - ### SC_A_STORED_METHOD

    public static final byte SC_A_STORED_METHOD
    Attribute code for stored method.
    See Also:
      - Constant Field Values

  - ### SC_A_REQ_ATTRIBUTE

    public static final byte SC_A_REQ_ATTRIBUTE
    Attribute code for request attributes not in the predefined list.
    See Also:
      - Constant Field Values

  - ### SC_A_REQ_LOCAL_ADDR

    public static final String SC_A_REQ_LOCAL_ADDR
    AJP private request attribute for local address.
    See Also:
      - Constant Field Values

  - ### SC_A_REQ_REMOTE_PORT

    public static final String SC_A_REQ_REMOTE_PORT
    AJP private request attribute for remote port.
    See Also:
      - Constant Field Values

  - ### SC_A_SSL_PROTOCOL

    public static final String SC_A_SSL_PROTOCOL
    AJP private request attribute for SSL protocol.
    See Also:
      - Constant Field Values

  - ### SC_A_ARE_DONE

    public static final byte SC_A_ARE_DONE
    Terminator byte for the list of attributes.
    See Also:
      - Constant Field Values

  - ### MAX_PACKET_SIZE

    public static final int MAX_PACKET_SIZE
    Default maximum total byte size for an AJP packet.
    See Also:
      - Constant Field Values

  - ### H_SIZE

    public static final int H_SIZE
    Size of basic packet header.
    See Also:
      - Constant Field Values

  - ### READ_HEAD_LEN

    public static final int READ_HEAD_LEN
    Size of the read header metadata.
    See Also:
      - Constant Field Values

  - ### SEND_HEAD_LEN

    public static final int SEND_HEAD_LEN
    Size of the send header metadata.
    See Also:
      - Constant Field Values

  - ### MAX_READ_SIZE

    public static final int MAX_READ_SIZE
    Default maximum size of data that can be read in one packet.
    See Also:
      - Constant Field Values

  - ### MAX_SEND_SIZE

    public static final int MAX_SEND_SIZE
    Default maximum size of data that can be sent in one packet.
    See Also:
      - Constant Field Values

  - ### SC_M_JK_STORED

    public static final int SC_M_JK_STORED
    Stored method code value.
    See Also:
      - Constant Field Values

  - ### SC_REQ_ACCEPT

    public static final int SC_REQ_ACCEPT
    Request header code for Accept.
    See Also:
      - Constant Field Values

  - ### SC_REQ_ACCEPT_CHARSET

    public static final int SC_REQ_ACCEPT_CHARSET
    Request header code for Accept-Charset.
    See Also:
      - Constant Field Values

  - ### SC_REQ_ACCEPT_ENCODING

    public static final int SC_REQ_ACCEPT_ENCODING
    Request header code for Accept-Encoding.
    See Also:
      - Constant Field Values

  - ### SC_REQ_ACCEPT_LANGUAGE

    public static final int SC_REQ_ACCEPT_LANGUAGE
    Request header code for Accept-Language.
    See Also:
      - Constant Field Values

  - ### SC_REQ_AUTHORIZATION

    public static final int SC_REQ_AUTHORIZATION
    Request header code for Authorization.
    See Also:
      - Constant Field Values

  - ### SC_REQ_CONNECTION

    public static final int SC_REQ_CONNECTION
    Request header code for Connection.
    See Also:
      - Constant Field Values

  - ### SC_REQ_CONTENT_TYPE

    public static final int SC_REQ_CONTENT_TYPE
    Request header code for Content-Type.
    See Also:
      - Constant Field Values

  - ### SC_REQ_CONTENT_LENGTH

    public static final int SC_REQ_CONTENT_LENGTH
    Request header code for Content-Length.
    See Also:
      - Constant Field Values

  - ### SC_REQ_COOKIE

    public static final int SC_REQ_COOKIE
    Request header code for Cookie.
    See Also:
      - Constant Field Values

  - ### SC_REQ_COOKIE2

    public static final int SC_REQ_COOKIE2
    Request header code for Cookie2.
    See Also:
      - Constant Field Values

  - ### SC_REQ_HOST

    public static final int SC_REQ_HOST
    Request header code for Host.
    See Also:
      - Constant Field Values

  - ### SC_REQ_PRAGMA

    public static final int SC_REQ_PRAGMA
    Request header code for Pragma.
    See Also:
      - Constant Field Values

  - ### SC_REQ_REFERER

    public static final int SC_REQ_REFERER
    Request header code for Referer.
    See Also:
      - Constant Field Values

  - ### SC_REQ_USER_AGENT

    public static final int SC_REQ_USER_AGENT
    Request header code for User-Agent.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getMethodForCode

    public static String getMethodForCode(int code)
    Converts an AJP coded HTTP method to the method name.
    Parameters:
      `code` - the coded value
    Returns:
      the string value of the method

  - ### getHeaderForCode

    public static String getHeaderForCode(int code)
    Converts an AJP coded HTTP request header to the header name.
    Parameters:
      `code` - the coded value
    Returns:
      the string value of the header name

  - ### getResponseHeaderForCode

    public static String getResponseHeaderForCode(int code)
    Converts an AJP coded response header name to the HTTP response header name.
    Parameters:
      `code` - the coded value
    Returns:
      the string value of the header

  - ### getResponseAjpIndex

    public static int getResponseAjpIndex(String header)
    Get the AJP response header index for the given header name.
    Parameters:
      `header` - The HTTP response header name
    Returns:
      the AJP integer code for the header, or 0 if not found