Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.turbine.util
Class GenerateUniqueId

    java.lang.Object
      org.apache.turbine.util.GenerateUniqueId

    public class GenerateUniqueId

extends 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.

Version:
  $Id: GenerateUniqueId.java 615328 2008-01-25 20:25:05Z tv $
Author:
  Jon S. Stevens, Neeme Praks

Field Summary
`static long` | `maxRandomLen`
`static long` | `maxSessionLifespanTics`
`static long` | `ticDifference`

Constructor Summary
`GenerateUniqueId()`

Method Summary
`static String` | `getIdentifier()` Get the unique id.
`String` | `getIdentifier(String jsIdent)` Get the unique id.
`static void` | `main(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

### 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

### GenerateUniqueId

    public GenerateUniqueId()

Method Detail

### getIdentifier

    public static String getIdentifier()

  Get the unique id.

  NOTE: This must work together with get_jserv_session_balance() in jserv_balance.c

  Returns:
    A String with the new unique id.

### getIdentifier

    public String getIdentifier(String jsIdent)

  Get the unique id.

  Parameters:
    `jsIdent` - A String.
  Returns:
    A String with the new unique id.

### main

    public static void main(String[] args)

  Simple test of the functionality.

  Parameters:
    `args` - A String[] with the command line arguments.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.