com.ibm.wbi.protocol.http
Class HttpBase

java.lang.Object
  |
  +--com.ibm.wbi.protocol.http.HttpBase
Direct Known Subclasses:
HttpRequest, HttpResponse

Deprecated. Use the new HTTP header classes instead (HttpRequestHeader, HttpResponseHeader, HttpHeaderAscii).

public abstract class HttpBase
extends java.lang.Object

This abstract class is the base class for HTTP 1.0 requests/responses.

See Also:
HttpHeaderAscii, HttpRequestHeader, HttpResponseHeader

Field Summary
protected  java.lang.String content
          Deprecated.  
static java.lang.String COPYRIGHT
          Deprecated.  
protected  HttpHeaderAscii header
          Deprecated.  
 
Constructor Summary
protected HttpBase()
          Deprecated. Default constructor.
 
Method Summary
 void add(java.lang.String key, java.lang.String value)
          Deprecated. Add an arbitrary key/value pair to the header.
 boolean change(java.lang.String key, java.lang.String oldValue, java.lang.String newValue)
          Deprecated. Change an arbitrary header field.
 java.lang.String get(java.lang.String key)
          Deprecated. Access the value of a header field.
 java.util.Vector getAll(java.lang.String key)
          Deprecated. Access all values from the header fields that correspond The search for the a value is case insensitive.
 java.lang.String getContent()
          Deprecated. Access the HTTP request/response content.
 long getContentLength()
          Deprecated. Access the HTTP request content length.
 java.lang.String getContentType()
          Deprecated. Access the HTTP content type.
 java.util.Enumeration getKeys()
          Deprecated. Retrieve an enumeration of the keys of all header fields in this Http request/response.
 java.lang.String getProtocolVersion()
          Deprecated. Access the HTTP protocol version.
protected  void initialize()
          Deprecated. Initialize the header field list and access objects.
 boolean remove(java.lang.String key)
          Deprecated. Remove a header field specified by its name.
 boolean remove(java.lang.String key, java.lang.String value)
          Deprecated. Remove the first header field that matches the specified key/value pair.
 boolean removeAll(java.lang.String key)
          Deprecated. Remove header fields specified by name.
 void set(java.lang.String key, java.lang.String value)
          Deprecated. Set an arbitrary key/value pair for the header.
 void setContent(java.lang.String c)
          Deprecated. Set the request content.
 void setContentLength(long cl)
          Deprecated. Set the content length.
 void setContentType(java.lang.String ct)
          Deprecated. Set the content type.
 void setProtocolVersion(java.lang.String pv)
          Deprecated. Set the HTTP protocol version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Deprecated. 

header

protected HttpHeaderAscii header
Deprecated. 

content

protected java.lang.String content
Deprecated. 
Constructor Detail

HttpBase

protected HttpBase()
Deprecated. 
Default constructor.
Method Detail

initialize

protected void initialize()
Deprecated. 
Initialize the header field list and access objects.

setProtocolVersion

public void setProtocolVersion(java.lang.String pv)
Deprecated. 
Set the HTTP protocol version.
Parameters:
pv - The protocol version (e.g. "HTTP/1.0")

setContent

public void setContent(java.lang.String c)
Deprecated. 
Set the request content. Automatically sets the "content-length" header field.
Parameters:
c - The content of the request (i.e. the form information that goes along with a "POST" request)

setContentLength

public void setContentLength(long cl)
Deprecated. 
Set the content length.
Parameters:
cl - The content length.

setContentType

public void setContentType(java.lang.String ct)
Deprecated. 
Set the content type.
Parameters:
ct - The content type.

getProtocolVersion

public java.lang.String getProtocolVersion()
Deprecated. 
Access the HTTP protocol version.
Returns:
The protocol version.

getContentType

public java.lang.String getContentType()
Deprecated. 
Access the HTTP content type.
Returns:
The content type field value.

getContentLength

public long getContentLength()
Deprecated. 
Access the HTTP request content length.
Returns:
The contexnt length field value; -1 if not specified.

getContent

public java.lang.String getContent()
Deprecated. 
Access the HTTP request/response content.
Returns:
String containing the request/response content.

add

public void add(java.lang.String key,
                java.lang.String value)
Deprecated. 
Add an arbitrary key/value pair to the header. Header fields with the same key may occur multiple times. The actual header field will be written as key: value
Parameters:
key - The header field (e.g. "content-type")
value - The header value (e.g. "text/html")

set

public void set(java.lang.String key,
                java.lang.String value)
Deprecated. 
Set an arbitrary key/value pair for the header. Duplicate values for this key are removed. The actual header field will be written as key: value
Parameters:
key - The header field (e.g. "content-type")
value - The header value (e.g. "text/html")

getKeys

public java.util.Enumeration getKeys()
Deprecated. 
Retrieve an enumeration of the keys of all header fields in this Http request/response.
Returns:
Enumeration containing all the keys as IgnoreCaseComparableStrings. BUGBUG

get

public java.lang.String get(java.lang.String key)
Deprecated. 
Access the value of a header field. The search for the a value is case insensitive.
Parameters:
key - The key to retrieve the value. (e.g. "content-type")
Returns:
A value from the specified key. If there are multiple header fields with the same key, the value of the first header field will be returned. If no header field with this key exist, null is returned.

getAll

public java.util.Vector getAll(java.lang.String key)
Deprecated. 
Access all values from the header fields that correspond The search for the a value is case insensitive.
Parameters:
key - The key to retrieve the value. (e.g. "content-type")
Returns:
A vector containing all values, even if there is only one value, or null if there are none.

remove

public boolean remove(java.lang.String key)
Deprecated. 
Remove a header field specified by its name. An HTTP request/response contains of a list of header fields. The first header field matching (case insensitive) the key is removed.
Parameters:
key - The key of the header field to be removed. (e.g. "content-type")
Returns:
true if a header field was removed, false if no field was removed.

remove

public boolean remove(java.lang.String key,
                      java.lang.String value)
Deprecated. 
Remove the first header field that matches the specified key/value pair. The key is matched case insensitive, the value case sensitive.
Parameters:
key - The key of the header field to be removed. (e.g. "content-type")
key - The value of the header field to be removed. (e.g. "text/html")
Returns:
true if a header field was removed, false otherwise.

removeAll

public boolean removeAll(java.lang.String key)
Deprecated. 
Remove header fields specified by name. All header fields matching (case insensitive) the key are removed.
Parameters:
key - The key of the header fields to be removed. (e.g. "content-type")
Returns:
true if all of the header fields were removed, false if no fields were removed.

change

public boolean change(java.lang.String key,
                      java.lang.String oldValue,
                      java.lang.String newValue)
Deprecated. 
Change an arbitrary header field. The search for matching header fields is case insensitive for the names (keys) and case sensitive for the values.
Parameters:
key - Key of the header field.
olValue - Old values of the header fields. Needs to be matched case sensitive.
newValue - String to replace the old value if a matching header field was found.
Returns:
true if an entry was changed, false otherwise.