org.apache.http.protocol
Class HttpCoreContext

java.lang.Object
  extended by org.apache.http.protocol.HttpCoreContext
All Implemented Interfaces:
org.apache.http.protocol.HttpContext
Direct Known Subclasses:
HttpClientContext

@NotThreadSafe
public class HttpCoreContext
extends java.lang.Object
implements org.apache.http.protocol.HttpContext

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

Since:
4.3

Field Summary
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.
 
Fields inherited from interface org.apache.http.protocol.HttpContext
RESERVED_PREFIX
 
Constructor Summary
HttpCoreContext()
           
HttpCoreContext(org.apache.http.protocol.HttpContext context)
           
 
Method Summary
static HttpCoreContext adapt(org.apache.http.protocol.HttpContext context)
           
static HttpCoreContext create()
           
 java.lang.Object getAttribute(java.lang.String id)
           
<T> T
getAttribute(java.lang.String attribname, java.lang.Class<T> clazz)
           
 org.apache.http.HttpConnection getConnection()
           
<T extends org.apache.http.HttpConnection>
T
getConnection(java.lang.Class<T> clazz)
           
 org.apache.http.HttpRequest getRequest()
           
 org.apache.http.HttpResponse getResponse()
           
 org.apache.http.HttpHost getTargetHost()
           
 boolean isRequestSent()
           
 java.lang.Object removeAttribute(java.lang.String id)
           
 void setAttribute(java.lang.String id, java.lang.Object obj)
           
 void setTargetHost(org.apache.http.HttpHost host)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_CONNECTION

public static final java.lang.String HTTP_CONNECTION
Attribute name of a HttpConnection object that represents the actual HTTP connection.

See Also:
Constant Field Values

HTTP_REQUEST

public static final java.lang.String HTTP_REQUEST
Attribute name of a HttpRequest object that represents the actual HTTP request.

See Also:
Constant Field Values

HTTP_RESPONSE

public static final java.lang.String HTTP_RESPONSE
Attribute name of a HttpResponse object that represents the actual HTTP response.

See Also:
Constant Field Values

HTTP_TARGET_HOST

public static final java.lang.String HTTP_TARGET_HOST
Attribute name of a HttpHost object that represents the connection target.

See Also:
Constant Field Values

HTTP_REQ_SENT

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

See Also:
Constant Field Values
Constructor Detail

HttpCoreContext

public HttpCoreContext(org.apache.http.protocol.HttpContext context)

HttpCoreContext

public HttpCoreContext()
Method Detail

create

public static HttpCoreContext create()

adapt

public static HttpCoreContext adapt(org.apache.http.protocol.HttpContext context)

getAttribute

public java.lang.Object getAttribute(java.lang.String id)
Specified by:
getAttribute in interface org.apache.http.protocol.HttpContext

setAttribute

public void setAttribute(java.lang.String id,
                         java.lang.Object obj)
Specified by:
setAttribute in interface org.apache.http.protocol.HttpContext

removeAttribute

public java.lang.Object removeAttribute(java.lang.String id)
Specified by:
removeAttribute in interface org.apache.http.protocol.HttpContext

getAttribute

public <T> T getAttribute(java.lang.String attribname,
                          java.lang.Class<T> clazz)

getConnection

public <T extends org.apache.http.HttpConnection> T getConnection(java.lang.Class<T> clazz)

getConnection

public org.apache.http.HttpConnection getConnection()

getRequest

public org.apache.http.HttpRequest getRequest()

isRequestSent

public boolean isRequestSent()

getResponse

public org.apache.http.HttpResponse getResponse()

setTargetHost

public void setTargetHost(org.apache.http.HttpHost host)

getTargetHost

public org.apache.http.HttpHost getTargetHost()