org.cdlib.xtf.dynaXML
Class Authenticator.IpListCache
Object
Cache<K,V>
GeneratingCache
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.
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 Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dependencyChecking
private boolean dependencyChecking
Authenticator.IpListCache
public Authenticator.IpListCache(int maxEntries,
int maxTime,
boolean dependencyChecking)
- Constructor - initializes the cache
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 actionvalue
- The value involved in the action