org.cdlib.xtf.dynaXML
Class Authenticator.IpListCache

Object
  extended by Cache<K,V>
      extended by GeneratingCache
          extended by Authenticator.IpListCache
Enclosing class:
Authenticator

private class Authenticator.IpListCache
extends GeneratingCache

This class is used to cache IP maps so we don't have to load the same ones over and over.


Nested Class Summary
 
Nested classes/interfaces inherited from class Cache
Cache.ListEntry, Cache.NullIterator
 
Field Summary
private  boolean dependencyChecking
           
 
Fields inherited from class Cache
ageList, keyMap
 
Constructor Summary
Authenticator.IpListCache(int maxEntries, int maxTime, boolean dependencyChecking)
          Constructor - initializes the cache
 
Method Summary
 IpList find(String path)
          Locate the IP list for the given path.
protected  Object generate(Object key)
          Load an IP list from the filesystem.
protected  void logAction(String action, Object key, Object value)
          Prints out useful debugging info
 
Methods inherited from class GeneratingCache
addDependency, find
 
Methods inherited from class Cache
cleanup, clear, dependenciesValid, getDependencies, has, lastSet, remove, size
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dependencyChecking

private boolean dependencyChecking
Constructor Detail

Authenticator.IpListCache

public Authenticator.IpListCache(int maxEntries,
                                 int maxTime,
                                 boolean dependencyChecking)
Constructor - initializes the cache

Method Detail

find

public IpList find(String path)
            throws Exception
Locate the IP list for the given path.

Parameters:
path - The full filesystem path of the IP list to load.
Throws:
Exception - If not found or invalid format

generate

protected Object generate(Object key)
                   throws Exception
Load an IP list from the filesystem.

Specified by:
generate in class GeneratingCache
Parameters:
key - Full path of the file to load
Returns:
The value for that key
Throws:
Exception - If not found or bad format.

logAction

protected void logAction(String action,
                         Object key,
                         Object value)
Prints out useful debugging info

Overrides:
logAction in class Cache
Parameters:
action - What happened ("Added", "Removed", etc.)
key - The key involved in the action
value - The value involved in the action