Package org.apache.http.protocol
Class HttpCoreContext
java.lang.Object
org.apache.http.protocol.HttpCoreContext
- All Implemented Interfaces:
HttpContext
- Direct Known Subclasses:
HttpClientContext
Implementation of
HttpContext that provides convenience
setters for user assignable attributes and getter for readable attributes.- Since:
- 4.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAttribute name of aHttpConnectionobject that represents the actual HTTP connection.static final StringAttribute name of aBooleanobject that represents the the flag indicating whether the actual request has been fully transmitted to the target host.static final StringAttribute name of aHttpRequestobject that represents the actual HTTP request.static final StringAttribute name of aHttpResponseobject that represents the actual HTTP response.static final StringAttribute name of aHttpHostobject that represents the connection target.Fields inherited from interface org.apache.http.protocol.HttpContext
RESERVED_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpCoreContextadapt(HttpContext context) static HttpCoreContextcreate()getAttribute(String id) Obtains attribute with the given name.<T> TgetAttribute(String attribname, Class<T> clazz) <T extends HttpConnection>
TgetConnection(Class<T> clazz) booleanRemoves attribute with the given name from the context.voidsetAttribute(String id, Object obj) Sets value of the attribute with the given name.voidsetTargetHost(HttpHost host)
-
Field Details
-
HTTP_CONNECTION
Attribute name of aHttpConnectionobject that represents the actual HTTP connection.- See Also:
-
HTTP_REQUEST
Attribute name of aHttpRequestobject that represents the actual HTTP request.- See Also:
-
HTTP_RESPONSE
Attribute name of aHttpResponseobject that represents the actual HTTP response.- See Also:
-
HTTP_TARGET_HOST
Attribute name of aHttpHostobject that represents the connection target.- See Also:
-
HTTP_REQ_SENT
Attribute name of aBooleanobject that represents the the flag indicating whether the actual request has been fully transmitted to the target host.- See Also:
-
-
Constructor Details
-
HttpCoreContext
-
HttpCoreContext
public HttpCoreContext()
-
-
Method Details
-
create
-
adapt
-
getAttribute
Description copied from interface:HttpContextObtains attribute with the given name.- Specified by:
getAttributein interfaceHttpContext- Parameters:
id- the attribute name.- Returns:
- attribute value, or
nullif not set.
-
setAttribute
Description copied from interface:HttpContextSets value of the attribute with the given name.- Specified by:
setAttributein interfaceHttpContext- Parameters:
id- the attribute name.obj- the attribute value.
-
removeAttribute
Description copied from interface:HttpContextRemoves attribute with the given name from the context.- Specified by:
removeAttributein interfaceHttpContext- Parameters:
id- the attribute name.- Returns:
- attribute value, or
nullif not set.
-
getAttribute
-
getConnection
-
getConnection
-
getRequest
-
isRequestSent
public boolean isRequestSent() -
getResponse
-
setTargetHost
-
getTargetHost
-