com.iwombat.foundation.uuid
Class UUIDFactory

java.lang.Object
  extended by com.iwombat.foundation.uuid.UUIDFactory

public final class UUIDFactory
extends java.lang.Object

Class responsible for creating unique identifiers specific to the DCE UUID implementation. This factory contains all the algorythms necessary to generate a UUID and place the value into the UUID value object. Universal object identifier.
16-byte Object identifier for use by all persistant objects based on DCE standard


Implementation notes: The DCE spec calls for MacAddress as part of the UUID algorythm. Since java supplies no mechanism for this ObjectId looks for a MACADDR system property consisting of a hex string of six bytes ( a 12 character hex string - no delimiters and no 0x token ). Failing to find said system property ObjectId generates a random MACADDR and uses the last octet of the ip address as the last octet in the MACADDR to guarantee unequeness on the same subnet. (If localhost is NOT 127.0.0.1)


Method Summary
static UUID createUUID()
           
static UUID createUUID(byte[] byteArray)
          Creates a new identifier from an existing (persisted) byte-array representation
static UUID createUUID(java.lang.String hexString)
          Creates Identifier from hex String representation of an existing Identifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createUUID

public static UUID createUUID()
Returns:
a new unique identifer.

createUUID

public static UUID createUUID(byte[] byteArray)
Creates a new identifier from an existing (persisted) byte-array representation

Parameters:
byteArray - persisted byte-array representation of an Identifier.
Returns:
new Identifier from the existing byte-array representation

createUUID

public static UUID createUUID(java.lang.String hexString)
Creates Identifier from hex String representation of an existing Identifier

Parameters:
hexString - The String version of an existing Identifier.
Returns:
New Identifier from the existing hex String representation