Project JXTA

net.jxta.impl.id.UUID
Class UUIDFactory

java.lang.Object
  extended by net.jxta.impl.id.UUID.UUIDFactory

public final class UUIDFactory
extends Object

A Factory for generating random UUIDs.

See Also:
UUID

Field Summary
(package private) static long GREGORIAN_MILLIS_OFFSET
          The point at which the Gregorian calendar rules are used, measured in milliseconds from the standard epoch.
 
Method Summary
static UUID newHashUUID(long mostSig, long leastSig)
          Generate a new UUID value.
static UUID newSeqUUID()
          Generate a new UUID value.
static UUID newUUID()
          Generate a new random UUID value.
static UUID newUUID(byte[] bytes)
          Generate a new UUID value.
static UUID newUUID(long mostSig, long leastSig)
          Generate a new UUID value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GREGORIAN_MILLIS_OFFSET

static final long GREGORIAN_MILLIS_OFFSET
The point at which the Gregorian calendar rules are used, measured in milliseconds from the standard epoch. Default is October 15, 1582 (Gregorian) 00:00:00 UTC or -12219292800000L.

See Also:
Constant Field Values
Method Detail

newUUID

public static UUID newUUID()
Generate a new random UUID value. The UUID returned is a version 4 IETF varient random UUID.

This member must be synchronized because it makes use of shared internal state.

Returns:
UUID returns a version 4 IETF varient random UUID.

newSeqUUID

public static UUID newSeqUUID()
Generate a new UUID value. The UUID returned is a version 1 IETF varient UUID.

The node value used is currently a random value rather than the normal ethernet MAC address because the MAC address is not directly accessible in to java.

Returns:
UUID returns a version 1 IETF varient UUID.

newUUID

public static UUID newUUID(byte[] bytes)
Generate a new UUID value. The values provided are masked to produce a version 4 IETF varient random UUID.

Parameters:
bytes - the 128 bits of the UUID
Returns:
UUID returns a version 4 IETF varient random UUID.

newHashUUID

public static UUID newHashUUID(long mostSig,
                               long leastSig)
Generate a new UUID value. The values provided are masked to produce a version 3 IETF varient UUID.

Parameters:
mostSig - High-long of UUID value.
leastSig - Low-long of UUID value.
Returns:
UUID returns a version 3 IETF varient random UUID.

newUUID

public static UUID newUUID(long mostSig,
                           long leastSig)
Generate a new UUID value. The values provided are masked to produce a version 4 IETF varient random UUID.

Parameters:
mostSig - High-long of UUID value.
leastSig - Low-long of UUID value.
Returns:
UUID returns a version 4 IETF varient random UUID.

JXTA J2SE