iiitAccessServer 1.0

de.iiit.access.server.plugins.cache
Class SimpleCache

java.lang.Object
  |
  +--de.iiit.access.server.plugins.cache.SimpleCache
All Implemented Interfaces:
AccessServerPluginIf, CachePluginIf, ThreadPluginIf

public class SimpleCache
extends Object
implements CachePluginIf

This cache can be loaded into the AccessServer as a plug-in to accelerate the evaluation of expressions.

Version:
$Revision: 1.10 $ $Date: 2003/04/13 20:28:01 $

Constructor Summary
SimpleCache()
          Creates a new instance of SimpleCachePlugin
 
Method Summary
 void addUserRight(String user, String expression, boolean isAllowed)
          Adds the result of one expression to the cache of the user.
 boolean getUserRight(String user, String expression)
          Retrieves the result of an expression from the cache.
 void initialize(Configuration config)
          Initializes the cache
 void shutdown()
          This method is called by the AccessServer when the background threads should stop because of a shutdown of the AccessServer itself.
 void start()
          Starts the cleaner thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCache

public SimpleCache()
Creates a new instance of SimpleCachePlugin

Method Detail

initialize

public void initialize(Configuration config)
Initializes the cache

Specified by:
initialize in interface AccessServerPluginIf
Parameters:
config - the configuration of the cache. Currently these parameters are recognized:
 InvalidationTimeout - after this period of time any elements in the cache will
                      be ignored to assure that changes in the rights will be recognized.
 LRUTimeout          - after this period of time an unused cache for a specific user will
                      be deleted. It does not make any sense to set this timeout
                      higher than the invalidation timeout.
 SleepTime           - The time to sleep between to runs of the cache cleaner.
 

start

public void start()
Starts the cleaner thread. This method is called by the AccessServer after the initialization of all sub-moduls.

Specified by:
start in interface ThreadPluginIf

addUserRight

public void addUserRight(String user,
                         String expression,
                         boolean isAllowed)
Adds the result of one expression to the cache of the user.

Specified by:
addUserRight in interface CachePluginIf
Parameters:
user - The name of the user
expression - The expression
isAllowed - The result of the expression

getUserRight

public boolean getUserRight(String user,
                            String expression)
                     throws CacheFaultException
Retrieves the result of an expression from the cache.

Specified by:
getUserRight in interface CachePluginIf
Parameters:
user - The name of the user for whom the result is needed.
expression - The expression
Returns:
the result of the expression
Throws:
CacheFaultException - if the result is not found in the cache

shutdown

public void shutdown()
This method is called by the AccessServer when the background threads should stop because of a shutdown of the AccessServer itself.

Specified by:
shutdown in interface ThreadPluginIf

iiitAccessServer 1.0

Copyright © 2002, 2003 ingeneurbuero fuer innovative informationstechnik, Dipl.-Ing. Joerg Beckmann, Dortmund, Germany. All Rights Reserved.
See Copyright statement