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 |
HTTP_CONNECTION
Attribute name of a
HttpConnection object that
represents the actual HTTP connection. |
static 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 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 |
HTTP_TARGET_HOST
Attribute name of a
HttpHost object that
represents the connection target. |
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) |
HttpConnection |
getConnection() |
<T extends HttpConnection> |
getConnection(Class<T> clazz) |
HttpRequest |
getRequest() |
HttpResponse |
getResponse() |
HttpHost |
getTargetHost() |
boolean |
isRequestSent() |
Object |
removeAttribute(String id)
Removes attribute with the given name from the context.
|
void |
setAttribute(String id,
Object obj)
Sets value of the attribute with the given name.
|
void |
setTargetHost(HttpHost host) |
public static final String HTTP_CONNECTION
HttpConnection object that
represents the actual HTTP connection.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 static final String HTTP_TARGET_HOST
HttpHost object that
represents the connection target.public static final 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 Object getAttribute(String id)
HttpContextgetAttribute in interface HttpContextid - the attribute name.null if not set.public void setAttribute(String id, Object obj)
HttpContextsetAttribute in interface HttpContextid - the attribute name.obj - the attribute value.public Object removeAttribute(String id)
HttpContextremoveAttribute in interface HttpContextid - the attribute name.null if not set.public <T extends HttpConnection> T getConnection(Class<T> clazz)
public HttpConnection getConnection()
public HttpRequest getRequest()
public boolean isRequestSent()
public HttpResponse getResponse()
public void setTargetHost(HttpHost host)
public HttpHost getTargetHost()
Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.