    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.jigsaw.contrib.HeaderFilter

    java.lang.Object
       |
       +----w3c.jigsaw.resources.AttributeHolder
               |
               +----w3c.jigsaw.resources.Resource
                       |
                       +----w3c.jigsaw.resources.ResourceFilter
                               |
                               +----w3c.jigsaw.contrib.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(Request)
  Simplified ingoingFilter API.
outgoingFilter(Request, Reply)
  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 Reply ingoingFilter(Request request)

  Simplified ingoingFilter API.
  Overrides:
    ingoingFilter in class ResourceFilter

outgoingFilter

      public Reply outgoingFilter(Request request,
                                  Reply reply)

  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