    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Interface org.w3c.jigsaw.http.HTTPFilter

public interface HTTPFilter

##

exceptionFilter(Request, ProtocolException, HTTPFilter[], int)
ingoingFilter(Request, HTTPFilter[], int)
  The filter's ingoing method is called before any request processing is done by the target resource.
lookup(LookupState, LookupResult)
  The lookup stage filtering.
outgoingFilter(Request, Reply, HTTPFilter[], int)
  The filter's outgoing method is called once the target resource has computed a reply.
outputFilter(Request, Reply, OutputStream)

##

lookup

     public abstract boolean lookup(LookupState ls,
                                    LookupResult lr) throws ProtocolException

  The lookup stage filtering. This filter is invoked during lookup, it can cancel the lookup operation in progress, by either throwing an exception (in case of error), or by returning true, in which case, the filter has perform the whole lookup operation itself.

  Parameters:
    ls - The current lookup state, describing the state of the lookup operation in progress.
    lr - The current lookup result, describing the already computed part of the lookup operation.
  Returns:
    A boolean, true if lookup has been completed by the filter, and nothing else need to be done to complete it. Otherwise lookup should continue normally, and the filter returns false.
  Throws: ProtocolException
    If some error occurs, and the whole lookup operation cannot be continued normally.

ingoingFilter

     public abstract Reply ingoingFilter(Request request,
                                         HTTPFilter filters[],
                                         int fidx) throws ProtocolException

  The filter's ingoing method is called before any request processing is done by the target resource.

  This method can (if able) compute the whole request's reply, and return it. If processing should continue normally, then the filter must return null.

  If a filter's `ingoingFilter` method gets called, then it is guaranteed that either its `outgoingFilter` method or its `exceptionFilter` method gets called.

  Parameters:
    request - The request being processed.
    filters - The whole array of filters to be applied before actually continuing the process.
    fidx - The index in the above array of the filter being called.
  Returns:
    A Reply instance, if the filter knows how to compute it, or null if the request processing should continue normally.
  Throws: ProtocolException
    If the filter fails.

outgoingFilter

     public abstract Reply outgoingFilter(Request request,
                                          Reply reply,
                                          HTTPFilter filters[],
                                          int fidx) throws ProtocolException

  The filter's outgoing method is called once the target resource has computed a reply.

  This method can return a Reply instance, in which case, the processing should be aborted, and the returned reply should be emited back to the client. Otherwise, if the filter returns null the processing continues normally.

  Parameters:
    request - The request being processed.
    reply - The original reply, as emited by the target resource, and which has already been processed by the first filters.
    filters - The whole array of filters to be applied before actually continuing the process.
    fidx - The index in the above array of the filter being called.
  Throws: ProtocolException
    If the filter fails.

outputFilter

     public abstract OutputStream outputFilter(Request request,
                                               Reply reply,
                                               OutputStream output) throws IOException

exceptionFilter

     public abstract Reply exceptionFilter(Request request,
                                           ProtocolException ex,
                                           HTTPFilter filters[],
                                           int fidx)

  Parameters:
    request - The request being processed.
    ex - The exception that occured during processing the request. and which has already been processed by the first filters.
    filters - The whole array of filters to be applied before actually continuing the process.
    fidx - The index in the above array of the filter being called.
  Throws: ProtocolException
    If the filter fails.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index