org.apache.jackrabbit.uuid
Class VersionFourGenerator

java.lang.Object
  extended byorg.apache.jackrabbit.uuid.VersionFourGenerator
All Implemented Interfaces:
Constants

public final class VersionFourGenerator
extends Object
implements Constants

XXX begin modification by stefan@apache.org


Field Summary
 
Fields inherited from interface org.apache.jackrabbit.uuid.Constants
CLOCK_SEQ_HI_AND_RESERVED_BYTE_8, FORMAT_POSITION1, FORMAT_POSITION2, FORMAT_POSITION3, FORMAT_POSITION4, hexDigits, TIME_HI_AND_VERSION_BYTE_6, TIME_HI_BYTE_LEN, TIME_HI_START_POS, TIME_HI_TS_POS, TIME_LOW_BYTE_LEN, TIME_LOW_START_POS, TIME_LOW_TS_POS, TIME_MID_BYTE_LEN, TIME_MID_START_POS, TIME_MID_TS_POS, TOKEN_LENGTHS, TOKENS_IN_UUID, URN_PREFIX, UUID_BIT_LENGTH, UUID_BYTE_LENGTH, UUID_FORMATTED_LENGTH, UUID_UNFORMATTED_LENGTH, VARIANT_FUTURE, VARIANT_IETF_DRAFT, VARIANT_MS, VARIANT_NCS_COMPAT, VERSION_FOUR, VERSION_ONE, VERSION_THREE, VERSION_TWO, WRONG_VAR_VER_MSG
 
Constructor Summary
VersionFourGenerator()
          Constructs a new VersionFourGenerator.
 
Method Summary
 Object nextIdentifier()
          Returns a new version four UUID.
 Object nextIdentifier(boolean secure)
          Returns a new version four UUID.
static void setPRNGProvider(String prngName, String packageName)
          Allows clients to set the pseudo-random number generator implementation used when generating a version four uuid with the secure option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionFourGenerator

public VersionFourGenerator()

Constructs a new VersionFourGenerator.

Method Detail

nextIdentifier

public Object nextIdentifier()

Returns a new version four UUID.

Returns:
Object a new version 4 UUID.

nextIdentifier

public Object nextIdentifier(boolean secure)

Returns a new version four UUID.

This overloaded method may produce both UUID's using a SecureRandom as well as using normal Random

Parameters:
secure - indicates whether or not to use SecureRandom in generating the random bits.
Returns:
a new version four UUID that was generated by either a Random or SecureRandom.

setPRNGProvider

public static void setPRNGProvider(String prngName,
                                   String packageName)

Allows clients to set the pseudo-random number generator implementation used when generating a version four uuid with the secure option. The secure option uses a SecureRandom. The packageName string may be null to specify no preferred package.

Parameters:
prngName - the pseudo-random number generator implementation name. For example "SHA1PRNG".
packageName - the package name for the PRNG provider. For example "SUN".


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.