@NotThreadSafe public class HttpCoreContext extends java.lang.Object implements HttpContext
HttpContext that provides convenience
setters for user assignable attributes and getter for readable attributes.| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
HTTP_CONNECTION
Attribute name of a
HttpConnection object that
represents the actual HTTP connection. |
static java.lang.String |
HTTP_REQ_SENT
Attribute name of a
Boolean object that represents the
the flag indicating whether the actual request has been fully transmitted
to the target host. |
static java.lang.String |
HTTP_REQUEST
Attribute name of a
HttpRequest object that
represents the actual HTTP request. |
static java.lang.String |
HTTP_RESPONSE
Attribute name of a
HttpResponse object that
represents the actual HTTP response. |
static java.lang.String |
HTTP_TARGET_HOST
Attribute name of a
HttpHost object that
represents the connection target. |
RESERVED_PREFIX| 构造器和说明 |
|---|
HttpCoreContext() |
HttpCoreContext(HttpContext context) |
| 限定符和类型 | 方法和说明 |
|---|---|
static HttpCoreContext |
adapt(HttpContext context) |
static HttpCoreContext |
create() |
java.lang.Object |
getAttribute(java.lang.String id)
Obtains attribute with the given name.
|
<T> T |
getAttribute(java.lang.String attribname,
java.lang.Class<T> clazz) |
HttpConnection |
getConnection() |
<T extends HttpConnection> |
getConnection(java.lang.Class<T> clazz) |
HttpRequest |
getRequest() |
HttpResponse |
getResponse() |
HttpHost |
getTargetHost() |
boolean |
isRequestSent() |
java.lang.Object |
removeAttribute(java.lang.String id)
Removes attribute with the given name from the context.
|
void |
setAttribute(java.lang.String id,
java.lang.Object obj)
Sets value of the attribute with the given name.
|
void |
setTargetHost(HttpHost host) |
public static final java.lang.String HTTP_CONNECTION
HttpConnection object that
represents the actual HTTP connection.public static final java.lang.String HTTP_REQUEST
HttpRequest object that
represents the actual HTTP request.public static final java.lang.String HTTP_RESPONSE
HttpResponse object that
represents the actual HTTP response.public static final java.lang.String HTTP_TARGET_HOST
HttpHost object that
represents the connection target.public static final java.lang.String HTTP_REQ_SENT
Boolean object that represents the
the flag indicating whether the actual request has been fully transmitted
to the target host.public HttpCoreContext(HttpContext context)
public HttpCoreContext()
public static HttpCoreContext create()
public static HttpCoreContext adapt(HttpContext context)
public java.lang.Object getAttribute(java.lang.String id)
HttpContextgetAttribute 在接口中 HttpContextid - the attribute name.null if not set.public void setAttribute(java.lang.String id,
java.lang.Object obj)
HttpContextsetAttribute 在接口中 HttpContextid - the attribute name.obj - the attribute value.public java.lang.Object removeAttribute(java.lang.String id)
HttpContextremoveAttribute 在接口中 HttpContextid - the attribute name.null if not set.public <T> T getAttribute(java.lang.String attribname,
java.lang.Class<T> clazz)
public <T extends HttpConnection> T getConnection(java.lang.Class<T> clazz)
public HttpConnection getConnection()
public HttpRequest getRequest()
public boolean isRequestSent()
public HttpResponse getResponse()
public void setTargetHost(HttpHost host)
public HttpHost getTargetHost()