public class HttpCoreContext extends Object implements HttpContext
HttpContext that provides convenience
setters for user assignable attributes and getter for readable attributes.| 限定符和类型 | 字段和说明 |
|---|---|
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| 构造器和说明 |
|---|
HttpCoreContext() |
HttpCoreContext(HttpContext context) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
String |
toString() |
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()
HttpContextgetProtocolVersion 在接口中 HttpContextpublic void setProtocolVersion(ProtocolVersion version)
HttpContextsetProtocolVersion 在接口中 HttpContextpublic Object getAttribute(String id)
HttpContextgetAttribute 在接口中 HttpContextid - the attribute name.null if not set.public Object setAttribute(String id, Object obj)
HttpContextsetAttribute 在接口中 HttpContextid - the attribute name.obj - the attribute value.id, or
null if there was no mapping for id.public Object removeAttribute(String id)
HttpContextremoveAttribute 在接口中 HttpContextid - the attribute name.null if not set.public SSLSession getSSLSession()
public EndpointDetails getEndpointDetails()
public HttpRequest getRequest()
public HttpResponse getResponse()
Copyright © 2023. All rights reserved.