|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.util.CheckedIdGenerator
public class CheckedIdGenerator
This IDGenerator returns an ID unique across all Java virtual machines with a very high probability.
The id is based on java.util.UUID (type 4 of http://www.ietf.org/rfc/rfc4122.txt) plus an appended checksum.
Note: jakarta commons id could be used to create other UID types of RFC 4122.
This class is a singleton. The methods of this class are thread-safe.
| Method Summary | |
|---|---|
static boolean |
checksumOk(java.lang.String id)
Returns true, if the checksum of this id is ok. |
static byte |
getEmbeddedIdChecksum(java.lang.String id)
Returns the checksum embedded in the id. |
java.lang.String |
getID()
Returns a new ID (type 4 of http://www.ietf.org/rfc/rfc4122.txt with an additional checksum). |
static CheckedIdGenerator |
getInstance()
Gets the singleton instance of this class. |
static int |
getMaxLength()
Gets the maximum length of this type of id. |
static byte |
getNewIdChecksum(java.lang.String ids)
Returns the (newly calculated) checksum of the given id. |
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static CheckedIdGenerator getInstance()
public java.lang.String getID()
Examples:
public static final int getMaxLength()
public static boolean checksumOk(java.lang.String id)
id - Id to check
public static byte getEmbeddedIdChecksum(java.lang.String id)
id - It to check
public static byte getNewIdChecksum(java.lang.String ids)
ids - UUID w/o checksum as string
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||