public interface

HttpContext

org.apache.http.protocol.HttpContext
Known Indirect Subclasses

Class Overview

HttpContext represents execution state of an HTTP process. It is a structure that can be used to map an attribute name to an attribute value. Internally HTTP context implementations are usually backed by a HashMap.

The primary purpose of the HTTP context is to facilitate information sharing among various logically related components. HTTP context can be used to store a processing state for one message or several consecutive messages. Multiple logically related messages can participate in a logical session if the same context is reused between consecutive messages.

Summary

Constants
String RESERVED_PREFIX The prefix reserved for use by HTTP components.
Public Methods
abstract Object getAttribute(String id)
Obtains attribute with the given name.
abstract Object removeAttribute(String id)
Removes attribute with the given name from the context.
abstract void setAttribute(String id, Object obj)
Sets value of the attribute with the given name.

Constants

public static final String RESERVED_PREFIX

The prefix reserved for use by HTTP components. "http."

Constant Value: "http."

Public Methods

public abstract Object getAttribute (String id)

Obtains attribute with the given name.

Parameters
id the attribute name.
Returns
  • attribute value, or null if not set.

public abstract Object removeAttribute (String id)

Removes attribute with the given name from the context.

Parameters
id the attribute name.
Returns
  • attribute value, or null if not set.

public abstract void setAttribute (String id, Object obj)

Sets value of the attribute with the given name.

Parameters
id the attribute name.
obj the attribute value.