AXL RADIUS Server API V3

com.theorem.radserver3
Class PersistentSession

Object
  extended byPersistentSession
All Implemented Interfaces:
Runnable

public final class PersistentSession
extends Object
implements Runnable

Class to keep persistent session data associated with a session identifier. The identifier is an integer and any object may be stored. A thread is created by this class to expire old session information.


Constructor Summary
PersistentSession(String threadName)
          Constructor.
 
Method Summary
 void close()
          Close the State session handler..
 Object get(int sessionId)
          See if the given entry is in a bucket.
 int getKey()
          Get a session key.
static void main(String[] arg)
          Main class to test PersistentSession.
 int put(int idKey, Object obj)
          Put an object into the State session.
 int put(Object obj)
          Put an object into the State session.
 void remove(int id)
          Remove an entry.
 void run()
          Cleaning thread.
 void setSinglePool()
          Us a single pool for all State objects.
 void setTTL(int seconds)
          Set the work data time to live in seconds.
 int size()
          Get a count of persistent sessions.
 void startThread()
          Start the cleaning thread.
 String toString()
          String representation of the PersistentSession object.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentSession

public PersistentSession(String threadName)
Constructor.

Parameters:
threadName - Name of the cleaning thread associated with the persistent session.
Method Detail

close

public void close()
Close the State session handler.. Further use of session handling is disabled.


get

public Object get(int sessionId)
                     throws RADIUSServerException
See if the given entry is in a bucket.

Parameters:
sessionId - Session identifier for the session.
Returns:
The object associated with the session id.
Throws:
RADIUSServerException - if the PersistentSession has been disabled or the sessionId cannot be found.

getKey

public int getKey()
Get a session key.


main

public static void main(String[] arg)
Main class to test PersistentSession.


put

public int put(int idKey,
               Object obj)
Put an object into the State session.

Parameters:
idKey - Identifier associating the State with the object.
obj - Object to associate with the id.
Returns:
identifier used to access this object.

put

public int put(Object obj)
Put an object into the State session.

Parameters:
obj - Object to associate with the id.
Returns:
identifier used to access this object.

remove

public void remove(int id)
Remove an entry.

Parameters:
id - Identifier value for this State attribute.

run

public void run()
Cleaning thread.

Specified by:
run in interface Runnable

setSinglePool

public void setSinglePool()
Us a single pool for all State objects. Only the maliciousness from a particular NAS would harm the pool of objects by requesting them without reason. This would generally cause them to be removed. However it would be possible for one NAS to do so when all State objects are in the same pool.

This wart is for those who need access to sessions from machines other than the one that requested it. This is not the normal mode of a RADIUS server's operation and can cause vulnerabilities.


setTTL

public void setTTL(int seconds)
Set the work data time to live in seconds. This affects all session data in this object.

The default is 30 seconds. If you system always has faster response times this value can be lowered. This should be set to a little more than the longest expected response time. The granularity of the system is such that the average time for a packet will be 1/2 second less than the given value.

This method destroys the existing cache of packet information.

Parameters:
seconds - The time to live in seconds.

size

public int size()
Get a count of persistent sessions.

Returns:
Count of sessions.

startThread

public void startThread()
Start the cleaning thread.


toString

public String toString()
String representation of the PersistentSession object.

Returns:
A listing of the buckets and entry counts.

AXL RADIUS Server API V3

Submit a bug report or feature request

Copyright 1998-2008 AXL Software. PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.