org.apache.openjpa.lib.util
Class UUIDGenerator

java.lang.Object
  extended by org.apache.openjpa.lib.util.UUIDGenerator

public class UUIDGenerator
extends Object

UUID value generator. Based on the time-based generator in the Apache Commons Id project: http://jakarta.apache.org/commons/sandbox/id/uuid.html The code has been vastly simplified and modified to replace the ethernet address of the host machine with the IP, since we do not want to require native libs and Java cannot access the MAC address directly. In spirit, implements the IETF UUID draft specification, found here:
http://www1.ics.uci.edu/~ejw/authoring/uuid-guid/draft-leach-uuids-guids-01 .txt

Since:
0.3.3
Author:
Abe White, Kevin Sutter

Constructor Summary
UUIDGenerator()
           
 
Method Summary
static byte[] next()
          Return a unique UUID value.
static String nextHex()
          Return the next unique uuid value as a 32-character hex string.
static String nextString()
          Return the next unique uuid value as a 16-character string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UUIDGenerator

public UUIDGenerator()
Method Detail

next

public static byte[] next()
Return a unique UUID value.


nextString

public static String nextString()
Return the next unique uuid value as a 16-character string.


nextHex

public static String nextHex()
Return the next unique uuid value as a 32-character hex string.



Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.