public class HttpCoreContext extends Object implements HttpContext
HttpContext
that provides convenience
setters for user assignable attributes and getter for readable attributes.Modifier and Type | Field and Description |
---|---|
static String |
CONNECTION_ENDPOINT
Attribute name of a
EndpointDetails object that
represents the actual connection endpoint details. |
static String |
HTTP_REQUEST
Attribute name of a
HttpRequest object that
represents the actual HTTP request. |
static String |
HTTP_RESPONSE
Attribute name of a
HttpResponse object that
represents the actual HTTP response. |
static String |
SSL_SESSION
Attribute name of a
SSLSession object that
represents the actual connection endpoint details. |
RESERVED_PREFIX
Constructor and Description |
---|
HttpCoreContext() |
HttpCoreContext(HttpContext context) |
Modifier and Type | Method and Description |
---|---|
static HttpCoreContext |
adapt(HttpContext context) |
static HttpCoreContext |
create() |
Object |
getAttribute(String id)
Obtains attribute with the given name.
|
<T> T |
getAttribute(String attribname,
Class<T> clazz) |
EndpointDetails |
getEndpointDetails() |
ProtocolVersion |
getProtocolVersion()
Returns protocol version used in this context.
|
HttpRequest |
getRequest() |
HttpResponse |
getResponse() |
SSLSession |
getSSLSession() |
Object |
removeAttribute(String id)
Removes attribute with the given name from the context.
|
Object |
setAttribute(String id,
Object obj)
Sets value of the attribute with the given name.
|
void |
setProtocolVersion(ProtocolVersion version)
Sets protocol version used in this context.
|
public static final String CONNECTION_ENDPOINT
EndpointDetails
object that
represents the actual connection endpoint details.public static final String SSL_SESSION
SSLSession
object that
represents the actual connection endpoint details.public static final String HTTP_REQUEST
HttpRequest
object that
represents the actual HTTP request.public static final String HTTP_RESPONSE
HttpResponse
object that
represents the actual HTTP response.public HttpCoreContext(HttpContext context)
public HttpCoreContext()
public static HttpCoreContext create()
public static HttpCoreContext adapt(HttpContext context)
public ProtocolVersion getProtocolVersion()
HttpContext
getProtocolVersion
in interface HttpContext
public void setProtocolVersion(ProtocolVersion version)
HttpContext
setProtocolVersion
in interface HttpContext
public Object getAttribute(String id)
HttpContext
getAttribute
in interface HttpContext
id
- the attribute name.null
if not set.public Object setAttribute(String id, Object obj)
HttpContext
setAttribute
in interface HttpContext
id
- the attribute name.obj
- the attribute value.id
, or
null
if there was no mapping for id
.public Object removeAttribute(String id)
HttpContext
removeAttribute
in interface HttpContext
id
- the attribute name.null
if not set.public SSLSession getSSLSession()
public EndpointDetails getEndpointDetails()
public HttpRequest getRequest()
public HttpResponse getResponse()
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.