iiitAccessServer 1.0

de.iiit.access.common.cache
Class UserRightsCache

java.lang.Object
  |
  +--de.iiit.cache.GenericCache
        |
        +--de.iiit.cache.GenericTimeoutCache
              |
              +--de.iiit.access.common.cache.UserRightsCache

public class UserRightsCache
extends GenericTimeoutCache

This cache is used by the CachePlugin

Version:
$Revision: 1.5 $ $Date: 2003/04/13 21:13:38 $

Constructor Summary
UserRightsCache()
          Creates a new instance of UserRightsCache
UserRightsCache(int lruTimeout)
          Creates a new instance of UserRightsCache
UserRightsCache(int lruTimeout, int invalidationTimeout, int sleeptime)
          Creates a new instance of UserRightsCache
 
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.
 
Methods inherited from class de.iiit.cache.GenericTimeoutCache
addElement, getElement, getElementTimeout, shutdown
 
Methods inherited from class de.iiit.cache.GenericCache
clear, getKeys, removeElement, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserRightsCache

public UserRightsCache()
Creates a new instance of UserRightsCache


UserRightsCache

public UserRightsCache(int lruTimeout)
Creates a new instance of UserRightsCache

Parameters:
lruTimeout - after this period of time an unused cache for a specific user will be deleted.

UserRightsCache

public UserRightsCache(int lruTimeout,
                       int invalidationTimeout,
                       int sleeptime)
Creates a new instance of UserRightsCache

Parameters:
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.
invalidationTimeout - after this period of time any elements in the cache will be ignored to assure that changes in the rights will be recognized.
sleeptime - The time to sleep between to runs of the cache cleaner.
Method Detail

addUserRight

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

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.

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

iiitAccessServer 1.0

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