Top Description Fields Constructors Methods
org.apache.hc.core5.http.protocol

public Class HttpCoreContext

extends Object
implements HttpContext
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.protocol.HttpContext
Imports
java.util.Objects, javax.net.ssl.SSLSession, org.apache.hc.core5.http.EndpointDetails, .HttpRequest, .HttpResponse, .ProtocolVersion, org.apache.hc.core5.util.Args

Implementation of HttpContext that provides convenience setters for user assignable attributes and getter for readable attributes.
Since
4.3

Field Summary

Modifier and TypeField and Description
public static final String
CONNECTION_ENDPOINT

Attribute name of a EndpointDetails object that represents the actual connection endpoint details.

private final HttpContext
public static final String
HTTP_REQUEST

Attribute name of a HttpRequest object that represents the actual HTTP request.

public static final String
HTTP_RESPONSE

Attribute name of a HttpResponse object that represents the actual HTTP response.

public static final String
SSL_SESSION

Attribute name of a SSLSession object that represents the actual connection endpoint details.

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public static HttpCoreContext
adapt(final HttpContext context)

public static HttpCoreContext
public Object
getAttribute(final String
the attribute name.
id
)

Implements org.apache.hc.core5.http.protocol.HttpContext.getAttribute.

Obtains attribute with the given name.
public <T> T
getAttribute(final String attribname, final Class<T> clazz)

public EndpointDetails
public ProtocolVersion
getProtocolVersion()

Implements org.apache.hc.core5.http.protocol.HttpContext.getProtocolVersion.

Returns protocol version used in this context.
public HttpRequest
public HttpResponse
public SSLSession
public Object
removeAttribute(final String
the attribute name.
id
)

Implements org.apache.hc.core5.http.protocol.HttpContext.removeAttribute.

Removes attribute with the given name from the context.
public Object
setAttribute(final String
the attribute name.
id
,
final Object
the attribute value.
obj
)

Implements org.apache.hc.core5.http.protocol.HttpContext.setAttribute.

Sets value of the attribute with the given name.
public void
setProtocolVersion(final ProtocolVersion version)

Implements org.apache.hc.core5.http.protocol.HttpContext.setProtocolVersion.

Sets protocol version used in this context.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

CONNECTION_ENDPOINTback to summary
public static final String CONNECTION_ENDPOINT

Attribute name of a EndpointDetails object that represents the actual connection endpoint details.

contextback to summary
private final HttpContext context
HTTP_REQUESTback to summary
public static final String HTTP_REQUEST

Attribute name of a HttpRequest object that represents the actual HTTP request.

HTTP_RESPONSEback to summary
public static final String HTTP_RESPONSE

Attribute name of a HttpResponse object that represents the actual HTTP response.

SSL_SESSIONback to summary
public static final String SSL_SESSION

Attribute name of a SSLSession object that represents the actual connection endpoint details.

Constructor Detail

HttpCoreContextback to summary
public HttpCoreContext(final HttpContext context)
HttpCoreContextback to summary
public HttpCoreContext()

Method Detail

adaptback to summary
public static HttpCoreContext adapt(final HttpContext context)
createback to summary
public static HttpCoreContext create()
getAttributeback to summary
public Object getAttribute(final String id)

Implements org.apache.hc.core5.http.protocol.HttpContext.getAttribute.

Doc from org.apache.hc.core5.http.protocol.HttpContext.getAttribute.

Obtains attribute with the given name.

Parameters
id:String

the attribute name.

Returns:Object

attribute value, or null if not set.

Annotations
@Override
getAttributeback to summary
public <T> T getAttribute(final String attribname, final Class<T> clazz)
getEndpointDetailsback to summary
public EndpointDetails getEndpointDetails()
Since
5.0
getProtocolVersionback to summary
public ProtocolVersion getProtocolVersion()

Implements org.apache.hc.core5.http.protocol.HttpContext.getProtocolVersion.

Doc from org.apache.hc.core5.http.protocol.HttpContext.getProtocolVersion.

Returns protocol version used in this context.

Annotations
@Override
Since
5.0
getRequestback to summary
public HttpRequest getRequest()
getResponseback to summary
public HttpResponse getResponse()
getSSLSessionback to summary
public SSLSession getSSLSession()
Since
5.0
removeAttributeback to summary
public Object removeAttribute(final String id)

Implements org.apache.hc.core5.http.protocol.HttpContext.removeAttribute.

Doc from org.apache.hc.core5.http.protocol.HttpContext.removeAttribute.

Removes attribute with the given name from the context.

Parameters
id:String

the attribute name.

Returns:Object

attribute value, or null if not set.

Annotations
@Override
setAttributeback to summary
public Object setAttribute(final String id, final Object obj)

Implements org.apache.hc.core5.http.protocol.HttpContext.setAttribute.

Doc from org.apache.hc.core5.http.protocol.HttpContext.setAttribute.

Sets value of the attribute with the given name.

Parameters
id:String

the attribute name.

obj:Object

the attribute value.

Returns:Object

the previous value associated with id, or null if there was no mapping for id.

Annotations
@Override
setProtocolVersionback to summary
public void setProtocolVersion(final ProtocolVersion version)

Implements org.apache.hc.core5.http.protocol.HttpContext.setProtocolVersion.

Doc from org.apache.hc.core5.http.protocol.HttpContext.setProtocolVersion.

Sets protocol version used in this context.

Annotations
@Override
Since
5.0
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override