Top Description Fields Constructors Methods
org.apache.http.protocol

public Class HttpCoreContext

extends Object
implements HttpContext
Class Inheritance
All Implemented Interfaces
org.apache.http.protocol.HttpContext
Imports
org.apache.http.HttpConnection, .HttpHost, .HttpRequest, .HttpResponse, org.apache.http.util.Args

Implementation of HttpContext that provides convenience setters for user assignable attributes and getter for readable attributes.
Since
4.3

Field Summary

Modifier and TypeField and Description
private final HttpContext
public static final String
HTTP_CONNECTION

Attribute name of a org.apache.http.HttpConnection object that represents the actual HTTP connection.

public static final 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.

public static final String
HTTP_REQUEST

Attribute name of a org.apache.http.HttpRequest object that represents the actual HTTP request.

public static final String
HTTP_RESPONSE

Attribute name of a org.apache.http.HttpResponse object that represents the actual HTTP response.

public static final String
HTTP_TARGET_HOST

Attribute name of a org.apache.http.HttpHost object that represents the connection target.

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public static HttpCoreContext
adapt(final HttpContext context)

public static HttpCoreContext
public Object
getAttribute(final String
the attribute name.
id
)

Implements org.apache.http.protocol.HttpContext.getAttribute.

Obtains attribute with the given name.
public <T> T
getAttribute(final String attribname, final Class<T> clazz)

public <T extends HttpConnection> T
getConnection(final Class<T> clazz)

public HttpConnection
public HttpRequest
public HttpResponse
public HttpHost
public boolean
public Object
removeAttribute(final String
the attribute name.
id
)

Implements org.apache.http.protocol.HttpContext.removeAttribute.

Removes attribute with the given name from the context.
public void
setAttribute(final String
the attribute name.
id
,
final Object
the attribute value.
obj
)

Implements org.apache.http.protocol.HttpContext.setAttribute.

Sets value of the attribute with the given name.
public void
setTargetHost(final HttpHost host)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
private final HttpContext context
HTTP_CONNECTIONback to summary
public static final String HTTP_CONNECTION

Attribute name of a org.apache.http.HttpConnection object that represents the actual HTTP connection.

HTTP_REQ_SENTback to summary
public static final 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.

HTTP_REQUESTback to summary
public static final String HTTP_REQUEST

Attribute name of a org.apache.http.HttpRequest object that represents the actual HTTP request.

HTTP_RESPONSEback to summary
public static final String HTTP_RESPONSE

Attribute name of a org.apache.http.HttpResponse object that represents the actual HTTP response.

HTTP_TARGET_HOSTback to summary
public static final String HTTP_TARGET_HOST

Attribute name of a org.apache.http.HttpHost object that represents the connection target.

Constructor Detail

HttpCoreContextback to summary
public HttpCoreContext(final HttpContext context)
HttpCoreContextback to summary
public HttpCoreContext()

Method Detail

adaptback to summary
public static HttpCoreContext adapt(final HttpContext context)
createback to summary
public static HttpCoreContext create()
getAttributeback to summary
public Object getAttribute(final String id)

Implements org.apache.http.protocol.HttpContext.getAttribute.

Doc from org.apache.http.protocol.HttpContext.getAttribute.

Obtains attribute with the given name.

Parameters
id:String

the attribute name.

Returns:Object

attribute value, or null if not set.

Annotations
@Override
getAttributeback to summary
public <T> T getAttribute(final String attribname, final Class<T> clazz)
getConnectionback to summary
public <T extends HttpConnection> T getConnection(final Class<T> clazz)
getConnectionback to summary
public HttpConnection getConnection()
getRequestback to summary
public HttpRequest getRequest()
getResponseback to summary
public HttpResponse getResponse()
getTargetHostback to summary
public HttpHost getTargetHost()
isRequestSentback to summary
public boolean isRequestSent()
removeAttributeback to summary
public Object removeAttribute(final String id)

Implements org.apache.http.protocol.HttpContext.removeAttribute.

Doc from org.apache.http.protocol.HttpContext.removeAttribute.

Removes attribute with the given name from the context.

Parameters
id:String

the attribute name.

Returns:Object

attribute value, or null if not set.

Annotations
@Override
setAttributeback to summary
public void setAttribute(final String id, final Object obj)

Implements org.apache.http.protocol.HttpContext.setAttribute.

Doc from org.apache.http.protocol.HttpContext.setAttribute.

Sets value of the attribute with the given name.

Parameters
id:String

the attribute name.

obj:Object

the attribute value.

Annotations
@Override
setTargetHostback to summary
public void setTargetHost(final HttpHost host)