Class HttpCoreContext

  • All Implemented Interfaces:
    HttpContext
    Direct Known Subclasses:
    HttpCoreContext.Delegate

    public class HttpCoreContext
    extends java.lang.Object
    implements HttpContext
    Core execution HttpContext.

    IMPORTANT: This class is NOT thread-safe and MUST NOT be used concurrently by multiple message exchanges.

    Since:
    4.3
    • Field Detail

      • CONNECTION_ENDPOINT

        @Deprecated
        public static final java.lang.String CONNECTION_ENDPOINT
        Deprecated.
        Use getter methods
        See Also:
        Constant Field Values
      • SSL_SESSION

        @Deprecated
        public static final java.lang.String SSL_SESSION
        Deprecated.
        Use getter methods
        See Also:
        Constant Field Values
      • HTTP_REQUEST

        @Deprecated
        public static final java.lang.String HTTP_REQUEST
        Deprecated.
        Use getter methods
        See Also:
        Constant Field Values
      • HTTP_RESPONSE

        @Deprecated
        public static final java.lang.String HTTP_RESPONSE
        Deprecated.
        Use getter methods
        See Also:
        Constant Field Values
      • parentContext

        private final HttpContext parentContext
      • map

        private java.util.Map<java.lang.String,​java.lang.Object> map
      • sslSession

        private javax.net.ssl.SSLSession sslSession
    • Constructor Detail

      • HttpCoreContext

        public HttpCoreContext​(HttpContext parentContext)
      • HttpCoreContext

        public HttpCoreContext()
    • Method Detail

      • getProtocolVersion

        public ProtocolVersion getProtocolVersion()
        Represents the protocol version used by the message exchange.

        This context attribute is expected to be populated by the protocol handler in the course of request execution.

        Specified by:
        getProtocolVersion in interface HttpContext
        Since:
        5.0
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String id)
        Description copied from interface: HttpContext
        Obtains attribute with the given name.
        Specified by:
        getAttribute in interface HttpContext
        Parameters:
        id - the attribute name.
        Returns:
        attribute value, or null if not set.
      • setAttribute

        public java.lang.Object setAttribute​(java.lang.String id,
                                             java.lang.Object obj)
        Description copied from interface: HttpContext
        Sets value of the attribute with the given name.
        Specified by:
        setAttribute in interface HttpContext
        Parameters:
        id - the attribute name.
        obj - the attribute value.
        Returns:
        the previous value associated with id, or null if there was no mapping for id.
      • removeAttribute

        public java.lang.Object removeAttribute​(java.lang.String id)
        Description copied from interface: HttpContext
        Removes attribute with the given name from the context.
        Specified by:
        removeAttribute in interface HttpContext
        Parameters:
        id - the attribute name.
        Returns:
        attribute value, or null if not set.
      • getAttribute

        public <T> T getAttribute​(java.lang.String id,
                                  java.lang.Class<T> clazz)
      • getRequest

        public HttpRequest getRequest()
        Represents current request message head.

        This context attribute is expected to be populated by the protocol handler in the course of request execution.

      • getResponse

        public HttpResponse getResponse()
        Represents current response message head.

        This context attribute is expected to be populated by the protocol handler in the course of request execution.

      • getEndpointDetails

        public EndpointDetails getEndpointDetails()
        Represents current connection endpoint details.

        This context attribute is expected to be populated by the protocol handler in the course of request execution.

        Since:
        5.0
      • getSSLSession

        public javax.net.ssl.SSLSession getSSLSession()
        Represents current TLS session details.

        This context attribute is expected to be populated by the protocol handler in the course of request execution.

        Since:
        5.0
      • setSSLSession

        @Internal
        public void setSSLSession​(javax.net.ssl.SSLSession sslSession)
        Since:
        5.3
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object