org.eclipse.ecf.provider.rss.channel
Class RandomIDGenerator

java.lang.Object
  extended by org.eclipse.ecf.provider.rss.channel.RandomIDGenerator

public class RandomIDGenerator
extends java.lang.Object

Identity generator implemented as singleton for generating truly random GUIDs in the standard format.

Author:
Sergey Yakovlev

Constructor Summary
RandomIDGenerator(boolean secure)
          Creates a new random ID generator.
 
Method Summary
 java.lang.String createGUID()
          Creates GUID
 java.lang.String createMD5GUID()
          Creates MD5 GUID
static RandomIDGenerator getInstance()
          Generates a RandomIDGenerator object as a Random generator.
static RandomIDGenerator getSecureInstance()
          Generates a RandomIDGenerator object as a SecureRandom generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomIDGenerator

public RandomIDGenerator(boolean secure)
Creates a new random ID generator. If the secure flag is true, then the secure random generator is created. If the flag is false, the random generator is created.

Parameters:
secure - - flag indicating whether to create the secure random generator.
Method Detail

getInstance

public static RandomIDGenerator getInstance()
Generates a RandomIDGenerator object as a Random generator.

Returns:
a RandomIDGenerator object.

getSecureInstance

public static RandomIDGenerator getSecureInstance()
Generates a RandomIDGenerator object as a SecureRandom generator.

Returns:
a RandomIDGenerator object.

createMD5GUID

public java.lang.String createMD5GUID()
Creates MD5 GUID

Returns:
a string representation of the GUID.

createGUID

public java.lang.String createGUID()
Creates GUID

Returns:
a string representation of the GUID.