org.apache.tomcat.util
Class SessionIdGenerator

java.lang.Object
  extended byorg.apache.tomcat.util.SessionIdGenerator

public class SessionIdGenerator
extends java.lang.Object

This class generates a unique 10+ character id. This is good for authenticating users or tracking users around.

This code was borrowed from Apache JServ.JServServletManager.java. It is what Apache JServ uses to generate session ids for users. Unfortunately, it was not included in Apache JServ as a class so I had to create one here in order to use it.

Author:
James Duncan Davidson [duncan@eng.sun.com], Jason Hunter [jhunter@acm.org], Jon S. Stevens jon@latchkey.com

Field Summary
static long maxRandomLen
           
static long maxSessionLifespanTics
           
static long ticDifference
           
 
Constructor Summary
SessionIdGenerator()
           
 
Method Summary
static java.lang.String getIdentifier(java.util.Random randomSource, java.lang.String jsIdent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxRandomLen

public static final long maxRandomLen
See Also:
Constant Field Values

maxSessionLifespanTics

public static final long maxSessionLifespanTics
See Also:
Constant Field Values

ticDifference

public static final long ticDifference
See Also:
Constant Field Values
Constructor Detail

SessionIdGenerator

public SessionIdGenerator()
Method Detail

getIdentifier

public static java.lang.String getIdentifier(java.util.Random randomSource,
                                             java.lang.String jsIdent)


Copyright © 2001 Apache Software Foundation. All Rights Reserved.