|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.util.GenerateUniqueId
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.
Field Summary | |
static long |
maxRandomLen
|
static long |
maxSessionLifespanTics
|
static long |
ticDifference
|
Constructor Summary | |
GenerateUniqueId()
|
Method Summary | |
static java.lang.String |
getIdentifier()
Get the unique id. |
java.lang.String |
getIdentifier(java.lang.String jsIdent)
Get the unique id. |
static void |
main(java.lang.String[] args)
Simple test of the functionality. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final long maxRandomLen
public static final long maxSessionLifespanTics
public static final long ticDifference
Constructor Detail |
public GenerateUniqueId()
Method Detail |
public static java.lang.String getIdentifier()
NOTE: This must work together with get_jserv_session_balance() in jserv_balance.c
public java.lang.String getIdentifier(java.lang.String jsIdent)
jsIdent
- A String.
public static void main(java.lang.String[] args)
args
- A String[] with the command line arguments.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |