Enhydra 5.1 API

org.enhydra.servlet.filter
Class FilterManager

java.lang.Object
  |
  +--org.enhydra.servlet.filter.FilterManager

public class FilterManager
extends java.lang.Object

This class maintains a set of Filters. Each filter is associated with an identification string (symbolic name). This ID string is used to retrieve a filter.

This class does not monitor the creation of filters. If you create one, you are responsible for adding it to this class. These public methods are the only things that modify the set of filters managed by this class.

Author:
Andy John
, Shawn McMurdo
See Also:
Filter

Constructor Summary
FilterManager()
          Create a new, empty, FilterManager.
 
Method Summary
 void add(java.lang.String filterID, Filter filter, java.lang.String description)
          Add a Filter to the set.
 void delete(java.lang.String filterID)
          Remove a Filter from the set.
 Filter get(java.lang.String filterID)
          Look up a Filter by its identifier string.
 java.lang.String getDescription(java.lang.String filterID)
          Look up a filter's description by its identifier string.
 java.lang.String[] getIDs()
          Get all the names of the Filters currently being stored.
 java.lang.String getUniqueID(java.lang.String baseName)
          Generate a unique filter id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterManager

public FilterManager()
Create a new, empty, FilterManager.

Method Detail

add

public void add(java.lang.String filterID,
                Filter filter,
                java.lang.String description)
Add a Filter to the set. It will be referred to by the given identifier string. If a filter already being stored has the same filterID, the new filter will replace the old filter.

Parameters:
filterID - The name to use to refer to the filter.
filter - The Filter to store.
description - A human readable description of this filter.

get

public Filter get(java.lang.String filterID)
Look up a Filter by its identifier string.

Parameters:
filterID - The symbolic name to look up.
Returns:
The Filter, or null if the name is not found.

getDescription

public java.lang.String getDescription(java.lang.String filterID)
Look up a filter's description by its identifier string.

Parameters:
filterID - The symbolic name to look up.
Returns:
The human readable description, or null if the name is not found.

getIDs

public java.lang.String[] getIDs()
Get all the names of the Filters currently being stored.

Returns:
All the filterIDs

delete

public void delete(java.lang.String filterID)
Remove a Filter from the set. Silently ignores errors.

Parameters:
filterID - The name of the Filter to remove.

getUniqueID

public java.lang.String getUniqueID(java.lang.String baseName)
Generate a unique filter id. Given the base name, a number is appended onto the end. The resulting string is guarenteed to not currently exist as a filter id. If the base name is not already being used, it is returned unchanged.

Parameters:
baseName - The initial name to use.
Returns:
A filter ID not currently in use.

Enhydra 5.1 API