    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.

##

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

##

HeaderFilter()

##

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

##

ATTR_HEADER_NAME

     protected static int ATTR_HEADER_NAME

  Attribute index - The header name to add to replies.

ATTR_HEADER_VALUE

     protected static int ATTR_HEADER_VALUE

  Attribute index - The header value.

ATTR_NOCACHE

     protected static int ATTR_NOCACHE

  Attribute index - SHould we use no-cache on that header.

ATTR_CONNECTION

     protected static int ATTR_CONNECTION

  Attribute index - Should we use connection on that header.

##

HeaderFilter

     public HeaderFilter()

##

getHeaderName

     public String getHeaderName()

  Get the header to set, if any.

  Returns:
    A String encoded header name, or null.

getHeaderValue

     public String getHeaderValue()

  Get the header value to set, if any.

  Returns:
    A String encoded value for the header to set, or null.

checkNoCache

     public boolean checkNoCache()

  Should we add this header's name to the `no-cache` directive.

  Returns:
    A boolean.

checkConnection

     public boolean checkConnection()

  Should we add this header to the connection header.

  Returns:
    A boolean.

ingoingFilter

     public ReplyInterface ingoingFilter(RequestInterface request) throws ProtocolException

  Simplified ingoingFilter API.

  Overrides:
    ingoingFilter in class ResourceFilter

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.
  Overrides:
    outgoingFilter in class ResourceFilter

    All Packages  Class Hierarchy  This Package  Previous  Next  Index