All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.w3c.jigsaw.filters.HeaderFilter

java.lang.Object
   |
   +----org.w3c.tools.resources.AttributeHolder
           |
           +----org.w3c.tools.resources.Resource
                   |
                   +----org.w3c.tools.resources.FramedResource
                           |
                           +----org.w3c.tools.resources.ResourceFrame
                                   |
                                   +----org.w3c.tools.resources.ResourceFilter
                                           |
                                           +----org.w3c.jigsaw.filters.HeaderFilter

public class HeaderFilter
extends ResourceFilter
Enforces a specific header value on all replies. Usefull for testing.


Variable Index

 o ATTR_CONNECTION
Attribute index - Should we use connection on that header.
 o ATTR_HEADER_NAME
Attribute index - The header name to add to replies.
 o ATTR_HEADER_VALUE
Attribute index - The header value.
 o ATTR_NOCACHE
Attribute index - SHould we use no-cache on that header.

Constructor Index

 o HeaderFilter()

Method Index

 o checkConnection()
Should we add this header to the connection header.
 o checkNoCache()
Should we add this header's name to the no-cache directive.
 o getHeaderName()
Get the header to set, if any.
 o getHeaderValue()
Get the header value to set, if any.
 o ingoingFilter(RequestInterface)
 o outgoingFilter(RequestInterface, ReplyInterface)
The outgoing filter decorates the reply appropriately.

Variables

 o ATTR_HEADER_NAME
 protected static int ATTR_HEADER_NAME
Attribute index - The header name to add to replies.

 o ATTR_HEADER_VALUE
 protected static int ATTR_HEADER_VALUE
Attribute index - The header value.

 o ATTR_NOCACHE
 protected static int ATTR_NOCACHE
Attribute index - SHould we use no-cache on that header.

 o ATTR_CONNECTION
 protected static int ATTR_CONNECTION
Attribute index - Should we use connection on that header.

Constructors

 o HeaderFilter
 public HeaderFilter()

Methods

 o getHeaderName
 public String getHeaderName()
Get the header to set, if any.

Returns:
A String encoded header name, or null.
 o getHeaderValue
 public String getHeaderValue()
Get the header value to set, if any.

Returns:
A String encoded value for the header to set, or null.
 o checkNoCache
 public boolean checkNoCache()
Should we add this header's name to the no-cache directive.

Returns:
A boolean.
 o checkConnection
 public boolean checkConnection()
Should we add this header to the connection header.

Returns:
A boolean.
 o ingoingFilter
 public ReplyInterface ingoingFilter(RequestInterface request) throws ProtocolException
Returns:
A Reply instance, if the filter did know how to answer the request without further processing, null otherwise.
Throws: ProtocolException
If processing should be interrupted, because an abnormal situation occured.
Overrides:
ingoingFilter in class ResourceFilter
 o outgoingFilter
 public ReplyInterface outgoingFilter(RequestInterface req,
                                      ReplyInterface rep) throws ProtocolException
The outgoing filter decorates the reply appropriately.

Parameters:
request - The original request.
reply - The originial reply.
Returns:
Always null.
Throws: ProtocolException
If processing should be interrupted, because an abnormal situation occured.
Overrides:
outgoingFilter in class ResourceFilter

All Packages  Class Hierarchy  This Package  Previous  Next  Index