org.iges.anagram.filter
Class Filter

java.lang.Object
  |
  +--org.iges.anagram.AbstractModule
        |
        +--org.iges.anagram.filter.Filter
All Implemented Interfaces:
Module
Direct Known Subclasses:
AbuseFilter, AnalysisFilter, DispatchFilter, OverloadFilter

public abstract class Filter
extends AbstractModule

A module that performs a step in the handling of a client request.


Field Summary
protected  boolean enabled
           
protected  java.lang.String filterName
           
protected  java.lang.String moduleID
           
protected  Filter next
           
 
Fields inherited from class org.iges.anagram.AbstractModule
log, moduleName, parent, server
 
Constructor Summary
Filter()
           
 
Method Summary
 void configure(Setting setting)
          Configures the module according to the settings provided.
protected abstract  void doFilter(ClientRequest request)
           
abstract  java.lang.String getFilterName()
          The name of this filter.
 java.lang.String getModuleID()
          Returns an ID for this module.
 void handle(ClientRequest request)
          Handles a client request.
 boolean isEnabled()
          Indicates whether this filter is enabled.
 void setEnabled(boolean enabled)
          Sets whether this filter is enabled
 void setNext(Filter next)
          Sets the filter that this filter should pass requests to
 
Methods inherited from class org.iges.anagram.AbstractModule
configModule, debug, debug, error, fail, fail, fail, getModuleName, info, init, toString, verbose, verbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

next

protected Filter next

filterName

protected java.lang.String filterName

moduleID

protected java.lang.String moduleID

enabled

protected boolean enabled
Constructor Detail

Filter

public Filter()
Method Detail

getModuleID

public java.lang.String getModuleID()
Description copied from interface: Module
Returns an ID for this module. This ID should be a legal XML tag name. It has two uses: as a tag name in the server's configuration file, and as the final element of the complete module name.

Specified by:
getModuleID in interface Module
Specified by:
getModuleID in class AbstractModule

configure

public void configure(Setting setting)
               throws ConfigException
Description copied from class: AbstractModule
Configures the module according to the settings provided. The server supports dynamic reconfiguration. Thus this method may be called at any time in the life of the module. If the module cannot be reconfigured, it should throw an exception.

Specified by:
configure in interface Module
Specified by:
configure in class AbstractModule
ConfigException

getFilterName

public abstract java.lang.String getFilterName()
The name of this filter. Used to build the module ID


setNext

public void setNext(Filter next)
Sets the filter that this filter should pass requests to


setEnabled

public void setEnabled(boolean enabled)
Sets whether this filter is enabled


isEnabled

public boolean isEnabled()
Indicates whether this filter is enabled. Requests should not be sent to a filter that is not enabled.


handle

public void handle(ClientRequest request)
            throws ModuleException
Handles a client request. Unless the filter is throwing an exception it should pass the request on to next.handle(). If the enabled property is set to false, this method should perform no action, and always pass requests directly to next.handle().

ModuleException

doFilter

protected abstract void doFilter(ClientRequest request)
                          throws ModuleException
ModuleException