Class HttpCoreContext.Delegate
- java.lang.Object
-
- org.apache.hc.core5.http.protocol.HttpCoreContext
-
- org.apache.hc.core5.http.protocol.HttpCoreContext.Delegate
-
- All Implemented Interfaces:
HttpContext
- Enclosing class:
- HttpCoreContext
@Internal static class HttpCoreContext.Delegate extends HttpCoreContext
Internal adaptor class that delegates all its method calls to a plainHttpContext. To be removed in the future.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.hc.core5.http.protocol.HttpCoreContext
HttpCoreContext.Delegate
-
-
Field Summary
Fields Modifier and Type Field Description private HttpContexthttpContext-
Fields inherited from class org.apache.hc.core5.http.protocol.HttpCoreContext
CONNECTION_ENDPOINT, HTTP_REQUEST, HTTP_RESPONSE, SSL_SESSION
-
Fields inherited from interface org.apache.hc.core5.http.protocol.HttpContext
RESERVED_PREFIX
-
-
Constructor Summary
Constructors Constructor Description Delegate(HttpContext httpContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) <T> TgetAttr(java.lang.String id, java.lang.Class<T> clazz)java.lang.ObjectgetAttribute(java.lang.String id)Obtains attribute with the given name.<T> TgetAttribute(java.lang.String id, java.lang.Class<T> clazz)EndpointDetailsgetEndpointDetails()Represents current connection endpoint details.ProtocolVersiongetProtocolVersion()Represents the protocol version used by the message exchange.HttpRequestgetRequest()Represents current request message head.HttpResponsegetResponse()Represents current response message head.javax.net.ssl.SSLSessiongetSSLSession()Represents current TLS session details.java.lang.ObjectremoveAttribute(java.lang.String id)Removes attribute with the given name from the context.java.lang.ObjectsetAttribute(java.lang.String id, java.lang.Object obj)Sets value of the attribute with the given name.voidsetEndpointDetails(EndpointDetails endpointDetails)voidsetProtocolVersion(ProtocolVersion version)Sets protocol version used in this context.voidsetRequest(HttpRequest request)voidsetResponse(HttpResponse response)voidsetSSLSession(javax.net.ssl.SSLSession sslSession)java.lang.StringtoString()-
Methods inherited from class org.apache.hc.core5.http.protocol.HttpCoreContext
adapt, cast, castOrCreate, create
-
-
-
-
Field Detail
-
httpContext
private final HttpContext httpContext
-
-
Constructor Detail
-
Delegate
Delegate(HttpContext httpContext)
-
-
Method Detail
-
getAttr
<T> T getAttr(java.lang.String id, java.lang.Class<T> clazz)
-
getRequest
public HttpRequest getRequest()
Description copied from class:HttpCoreContextRepresents current request message head.This context attribute is expected to be populated by the protocol handler in the course of request execution.
- Overrides:
getRequestin classHttpCoreContext
-
setRequest
public void setRequest(HttpRequest request)
- Overrides:
setRequestin classHttpCoreContext
-
getResponse
public HttpResponse getResponse()
Description copied from class:HttpCoreContextRepresents current response message head.This context attribute is expected to be populated by the protocol handler in the course of request execution.
- Overrides:
getResponsein classHttpCoreContext
-
setResponse
public void setResponse(HttpResponse response)
- Overrides:
setResponsein classHttpCoreContext
-
getEndpointDetails
public EndpointDetails getEndpointDetails()
Description copied from class:HttpCoreContextRepresents current connection endpoint details.This context attribute is expected to be populated by the protocol handler in the course of request execution.
- Overrides:
getEndpointDetailsin classHttpCoreContext
-
setEndpointDetails
public void setEndpointDetails(EndpointDetails endpointDetails)
- Overrides:
setEndpointDetailsin classHttpCoreContext
-
getSSLSession
public javax.net.ssl.SSLSession getSSLSession()
Description copied from class:HttpCoreContextRepresents current TLS session details.This context attribute is expected to be populated by the protocol handler in the course of request execution.
- Overrides:
getSSLSessionin classHttpCoreContext
-
setSSLSession
public void setSSLSession(javax.net.ssl.SSLSession sslSession)
- Overrides:
setSSLSessionin classHttpCoreContext
-
getProtocolVersion
public ProtocolVersion getProtocolVersion()
Description copied from class:HttpCoreContextRepresents 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:
getProtocolVersionin interfaceHttpContext- Overrides:
getProtocolVersionin classHttpCoreContext
-
setProtocolVersion
public void setProtocolVersion(ProtocolVersion version)
Description copied from interface:HttpContextSets protocol version used in this context.- Specified by:
setProtocolVersionin interfaceHttpContext- Overrides:
setProtocolVersionin classHttpCoreContext
-
getAttribute
public java.lang.Object getAttribute(java.lang.String id)
Description copied from interface:HttpContextObtains attribute with the given name.- Specified by:
getAttributein interfaceHttpContext- Overrides:
getAttributein classHttpCoreContext- Parameters:
id- the attribute name.- Returns:
- attribute value, or
nullif not set.
-
setAttribute
public java.lang.Object setAttribute(java.lang.String id, java.lang.Object obj)Description copied from interface:HttpContextSets value of the attribute with the given name.- Specified by:
setAttributein interfaceHttpContext- Overrides:
setAttributein classHttpCoreContext- Parameters:
id- the attribute name.obj- the attribute value.- Returns:
- the previous value associated with
id, ornullif there was no mapping forid.
-
removeAttribute
public java.lang.Object removeAttribute(java.lang.String id)
Description copied from interface:HttpContextRemoves attribute with the given name from the context.- Specified by:
removeAttributein interfaceHttpContext- Overrides:
removeAttributein classHttpCoreContext- Parameters:
id- the attribute name.- Returns:
- attribute value, or
nullif not set.
-
getAttribute
public <T> T getAttribute(java.lang.String id, java.lang.Class<T> clazz)- Overrides:
getAttributein classHttpCoreContext
-
toString
public java.lang.String toString()
- Overrides:
toStringin classHttpCoreContext
-
-