|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ode.utils.GUID
public final class GUID
This class is used to generate globally unique IDs. The requirements for global uniqueness are as follows:
1) The time on any machine is never set back. 2) Each machine has a unique IP address. 3) Each process has the 'org.apache.ode.uid.port' property set to the same non-zero value. byte: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 [ IPADDRESS ] [ START TIME IN MS ] [ count] This format allow more compact string representation. Persistence mechanism maps 6 bits to a number-char mapping. Byte 0-5 (48 bits, 6 bits per char => 8 chars) Since the current time typically has zeros for many of its most significant digits, all leading zeros are truncated from the string representation. The following 6 bit to char mapping is used: 0-9 -> 0-9 10-35 -> A-Z 36-60 -> a-y 61 -> za 62 -> zb 63 -> zc
Nested Class Summary | |
---|---|
static class |
GUID.MalformedGuidException
|
Constructor Summary | |
---|---|
GUID()
Create a new unique GUID |
|
GUID(java.lang.String str)
Reconstitute a GUID from it's string representation |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object o)
|
byte[] |
getGuid()
Get the GUID bytes. |
static GUID |
getVMGUID()
|
int |
hashCode()
|
static void |
main(java.lang.String[] argv)
|
java.lang.String |
toString()
Convert a GUID to it's string representation. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GUID()
public GUID(java.lang.String str) throws GUID.MalformedGuidException
str
- DOCUMENTME
GUID.MalformedGuidException
- DOCUMENTMEMethod Detail |
---|
public byte[] getGuid()
public static GUID getVMGUID()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |