Class HttpCoreContext
java.lang.Object
org.apache.hc.core5.http.protocol.HttpCoreContext
- All Implemented Interfaces:
HttpContext
Implementation of
HttpContext that provides convenience
setters for user assignable attributes and getter for readable attributes.- Since:
- 4.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAttribute name of aEndpointDetailsobject that represents the actual connection endpoint details.private final HttpContextstatic final StringAttribute name of aHttpRequestobject that represents the actual HTTP request.static final StringAttribute name of aHttpResponseobject that represents the actual HTTP response.static final StringAttribute name of aSSLSessionobject that represents the actual connection endpoint details.Fields inherited from interface org.apache.hc.core5.http.protocol.HttpContext
RESERVED_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpCoreContextadapt(HttpContext context) static HttpCoreContextcreate()getAttribute(String id) Obtains attribute with the given name.<T> TgetAttribute(String attribname, Class<T> clazz) Returns protocol version used in this context.Removes attribute with the given name from the context.setAttribute(String id, Object obj) Sets value of the attribute with the given name.voidsetProtocolVersion(ProtocolVersion version) Sets protocol version used in this context.toString()
-
Field Details
-
CONNECTION_ENDPOINT
Attribute name of aEndpointDetailsobject that represents the actual connection endpoint details.- See Also:
-
SSL_SESSION
Attribute name of aSSLSessionobject that represents the actual connection endpoint details.- See Also:
-
HTTP_REQUEST
Attribute name of aHttpRequestobject that represents the actual HTTP request.- See Also:
-
HTTP_RESPONSE
Attribute name of aHttpResponseobject that represents the actual HTTP response.- See Also:
-
context
-
-
Constructor Details
-
HttpCoreContext
-
HttpCoreContext
public HttpCoreContext()
-
-
Method Details
-
create
-
adapt
-
getProtocolVersion
Description copied from interface:HttpContextReturns protocol version used in this context.- Specified by:
getProtocolVersionin interfaceHttpContext- Since:
- 5.0
-
setProtocolVersion
Description copied from interface:HttpContextSets protocol version used in this context.- Specified by:
setProtocolVersionin interfaceHttpContext- Since:
- 5.0
-
getAttribute
Description copied from interface:HttpContextObtains attribute with the given name.- Specified by:
getAttributein interfaceHttpContext- Parameters:
id- the attribute name.- Returns:
- attribute value, or
nullif not set.
-
setAttribute
Description copied from interface:HttpContextSets value of the attribute with the given name.- Specified by:
setAttributein interfaceHttpContext- Parameters:
id- the attribute name.obj- the attribute value.- Returns:
- the previous value associated with
id, ornullif there was no mapping forid.
-
removeAttribute
Description copied from interface:HttpContextRemoves attribute with the given name from the context.- Specified by:
removeAttributein interfaceHttpContext- Parameters:
id- the attribute name.- Returns:
- attribute value, or
nullif not set.
-
getAttribute
-
getSSLSession
- Since:
- 5.0
-
getEndpointDetails
- Since:
- 5.0
-
getRequest
-
getResponse
-
toString
-