iiitAccessServer 1.0

de.iiit.access.common.rmi
Class RMIClient

java.lang.Object
  |
  +--de.iiit.access.common.rmi.RMIClient

public class RMIClient
extends Object

This class implements the client side of AccessServer's RMI interface. It incorporates its own caching for already requested expressions.

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

Method Summary
static RMIClient getSession(String user)
          Returns a new RMIClient object representing a session with the remote AccessServer
static void initialize(String[] server, int invalidationTimeout, int lruTimeout, int sleepTime)
          Initializes the RMI client system.
static void initLogSystem(String level, String logFile)
          Initializes the logging system.
 boolean resolveExpr(String expression)
          Evaluates one expression.
static void shutdown()
          Shuts down the cleaner thread of the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSession

public static RMIClient getSession(String user)
                            throws RMIClientException
Returns a new RMIClient object representing a session with the remote AccessServer

Parameters:
user - user the user for whom the session shall be used.
Returns:
the new session, or null if the user doesn't exist in the user database
Throws:
RMIClientException - if anything goes wrong

initLogSystem

public static void initLogSystem(String level,
                                 String logFile)
Initializes the logging system. If the application where this client is included already uses Log4J for logging, this method should not be called at all, otherwise it must be called before any other method of this class can be used.

Parameters:
level - the name of the log-level. Valid are values are ALL, DEBUG, INFO, WARN, ERROR, FATAL and OFF.
logFile - the name of the the log output shall be send to. If it is null or empty System.out will be used.

initialize

public static void initialize(String[] server,
                              int invalidationTimeout,
                              int lruTimeout,
                              int sleepTime)
Initializes the RMI client system. The time values (in milliseconds) are used to initialize the local cache.

Parameters:
server - A list of servers to be requested. Each entry must have the format :, for example localhost:54322. If the port number is ommited, RMIServerIf.DEFAULT_RMI_PORT will be used.
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.

shutdown

public static void shutdown()
Shuts down the cleaner thread of the cache. This method should be called when the surrounding application finishes.


resolveExpr

public boolean resolveExpr(String expression)
                    throws RMIClientException,
                           ParserException
Evaluates one expression.

Parameters:
expression - the expression to evaluate
Returns:
true if the user is member of the set described by the expression and false otherwise.
Throws:
RMIClientException - if anything goes wrong
RMIParserException - if a ParserException occurs on the server side.
ParserException

iiitAccessServer 1.0

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