org.resoa.util
Class IDGenerator

java.lang.Object
  extended by org.resoa.util.IDGenerator

public class IDGenerator
extends java.lang.Object

Used for generation random/unique byte sequence IDs. Used for Resoa internal applications: SessionIDs and TransactionIDs. This is a singleton, threadsafe implementation.


Field Summary
static int SESSIONID_LENGHT
          The internal length of session ID's
 
Method Summary
 java.lang.String extendID(java.lang.String id)
          Extend an existing ID
 java.lang.String getBase32ID(int length)
          Returns a web safe base32 encoded ID
 java.lang.String getBase32UUID()
          Returns a web safe base32 encoded ID
 java.lang.String getID(int bytes)
          Returns a new ID.
static IDGenerator getInstance()
          Instance getter
 java.lang.String getResoaID()
          Get Resoa conformID sessionID
 java.lang.String getTransactionID()
          Get Resoa conform transaction ID
 java.lang.String newLicenseKey()
          Create a new LicenseKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSIONID_LENGHT

public static final int SESSIONID_LENGHT
The internal length of session ID's

See Also:
Constant Field Values
Method Detail

getInstance

public static IDGenerator getInstance()
Instance getter

Returns:
Returns the singleton instance.

getID

public java.lang.String getID(int bytes)
Returns a new ID. ID is byte sequence of minimum 6 bytes length.

Parameters:
bytes - number of random bytes used for generation
Returns:
the UUID string

getResoaID

public java.lang.String getResoaID()
Get Resoa conformID sessionID

Returns:
new sessionID used within Resoa

getTransactionID

public java.lang.String getTransactionID()
Get Resoa conform transaction ID

Returns:
new transactionID used within Resoa

extendID

public java.lang.String extendID(java.lang.String id)
Extend an existing ID

Returns:
new extended ID

newLicenseKey

public java.lang.String newLicenseKey()
Create a new LicenseKey

Returns:
a license key

getBase32UUID

public java.lang.String getBase32UUID()
Returns a web safe base32 encoded ID

Returns:

getBase32ID

public java.lang.String getBase32ID(int length)
Returns a web safe base32 encoded ID

Returns:


Copyright © 2005-2011 The Resoa Project, resoa.org. All Rights Reserved.