wt.httpgw
Class HTTPResponseHeaders

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended bywt.httpgw.HTTPResponseHeaders
All Implemented Interfaces:
Cloneable, Map, Serializable

public class HTTPResponseHeaders
extends Hashtable

Class to facilitate holding and processing HTTP response headers. These headers could be destine for either the standard java.io.PrintStream of the CGI wrapper, or the HttpServletResponse from our HTTPGatewayServlet. The later had methods to perform most of the needed sets.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Field Summary
 boolean invalidateSession
           
(package private) static long serialVersionUID
           
private static String versionID
           
 
Fields inherited from class java.util.Hashtable
 
Constructor Summary
HTTPResponseHeaders()
          public noarg Constructor.
 
Method Summary
 boolean containsHeader(String s)
          Checks if the response header is present.
 Object get(String s)
          Gets the value of this response header key.
 Enumeration keys()
          Gets the response header keys.
 void setDateHeader(String s1, long date)
          Sets a date type response header.
 void setHeader(String s1, String s2)
          Sets a string type response header.
 void setIntHeader(String s1, int v1)
          Sets a int type response header.
 void setStatus(int v1)
          Sets a simple Status response header.
 void setStatus(int v1, String s1)
          Sets a Status response header.
 void writeHeaders(javax.servlet.http.HttpServletResponse response)
          Causes all response headers presently set to be writen as appropriate using the servlet's header methods.
 void writeHeaders(OutputStream outputStream)
          Causes all response headers presently set to be writen as appropriate to the output stream of the CGI.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

invalidateSession

public boolean invalidateSession
Constructor Detail

HTTPResponseHeaders

public HTTPResponseHeaders()
public noarg Constructor.

Method Detail

containsHeader

public boolean containsHeader(String s)
Checks if the response header is present.

Parameters:
s - String the header to search for.
Returns:
A boolean if the header is set.

keys

public Enumeration keys()
Gets the response header keys.

Returns:
An Enumeration of the header keys.

get

public Object get(String s)
Gets the value of this response header key.

Parameters:
s - the key, as a string, to get the value of.
Returns:
the value of this key as an Object.

setHeader

public void setHeader(String s1,
                      String s2)
Sets a string type response header.

Parameters:
s1 - String name of the header
s2 - String value to which header is set

setDateHeader

public void setDateHeader(String s1,
                          long date)
Sets a date type response header.

Parameters:
s1 - String name of the header
date - long value to which header is set value is milliseconds since the epoch.

setIntHeader

public void setIntHeader(String s1,
                         int v1)
Sets a int type response header.

Parameters:
s1 - String name of the header
v1 - int value to which header is set

setStatus

public void setStatus(int v1)
Sets a simple Status response header.

Parameters:
v1 - Integer Status code

setStatus

public void setStatus(int v1,
                      String s1)
Sets a Status response header.

Parameters:
v1 - Integer Status code
s1 - String Status reason code

writeHeaders

public void writeHeaders(javax.servlet.http.HttpServletResponse response)
Causes all response headers presently set to be writen as appropriate using the servlet's header methods.


writeHeaders

public void writeHeaders(OutputStream outputStream)
Causes all response headers presently set to be writen as appropriate to the output stream of the CGI.