|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zipxap.vfs.dal.utility.UniqueID
public class UniqueID
Represents a unique hexidecimal value that can be used to identify objects/records/etc. This class is conceptually similar to a UUID or GUID.
There are four variants;
| Variant | Size (Hexidecimal digits with/without dashes) | Common Form |
| Single User, Single Application | 26/22 | HH-HHHH-HHHH-HHHH-HHHHHHHH |
| Single User, Multi Application | 26/30 | HH-HHHH-HHHH-HHHH-HHHHHHHHHHHH |
| Multi User, Single Application | 28/32 | HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHH |
| Multi User, Multi Application | 32/36 | HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH |
| Milestone | Who | Date, Time |
|---|---|---|
| Initial Version | K Penrose | October 24, 2007, 8:47 PM |
** Note that this table is not intended as an exhaustive list of subtle changes. It is intended to list changes that break the compatibility of older code, or major enhancements/rewrites
| Field Summary | |
|---|---|
static java.lang.String |
INVALID_UNIQUE_ID
|
static java.lang.String |
NO_APP_ID_SPECIFIED
|
static java.lang.String |
NO_USER_ID_SPECIFIED
|
static java.lang.String |
UNIQUE_ID_DIFFERENT_VERSION
|
static java.lang.String |
UNKNOWN_APP_ID_DIFFERENT_VERSION
|
static java.lang.String |
UNKNOWN_APP_ID_INVALID_UNIQUEID
|
static java.lang.String |
UNKNOWN_IP_DIFFERENT_VERSION
|
static java.lang.String |
UNKNOWN_IP_INVALID_UNIQUEID
|
static java.lang.String |
UNKNOWN_USER_ID_DIFFERENT_VERSION
|
static java.lang.String |
UNKNOWN_USER_ID_INVALID_UNIQUEID
|
static int |
VERSION_OF_UNIQUEID
|
| Constructor Summary | |
|---|---|
UniqueID(java.lang.String uniqueIdString)
Acceptible Formats: FormatVariantSize (Hexidecimal digits) HHHHHHHHHHHHHHHHHHHHHHSingle User, Single Application22 HH-HHHH-HHHH-HHHH-HHHHHHHHSingle User, Single Application26 HHHHHHHHHHHHHHHHHHHHHHHHHHSingle User, Multi Application26 HH-HHHH-HHHH-HHHH-HHHHHHHHHHHHSingle User, Multi Application30 HHHHHHHHHHHHHHHHHHHHHHHHHHHHMulti User, Single Application28 HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHMulti User, Single Application32 HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHMulti User, Multi Application32 HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHHMulti User, Multi Application36 |
|
| Method Summary | |
|---|---|
static UniqueID |
createUniqueID()
Create a new UniqueID for single-user, multi-machine, single-application use. |
static UniqueID |
createUniqueID(int userId,
int appId)
Create a new UniqueID for multi-user, multi-machine, multi-application use. |
static UniqueID |
createUniqueID(java.lang.String userId)
Create a new UniqueID for multi-user, multi-machine, single-application use. |
static UniqueID |
createUniqueID(java.lang.String userId,
java.lang.String appId)
Create a new UniqueID for multi-user, multi-machine, multi-application use. |
java.lang.String |
getAppId()
Retrieve the Application ID of the application that created this UniqueID. |
java.lang.String |
getLast4HexDigitsOfServerIp()
Retrieve the last 4 hexidecimal digits of the IP address of the machine that created this UniqueID. |
java.lang.String |
getShortFormattedDate()
Retrieve the date when this UniqueID was created. |
java.util.Date |
getTimestamp()
Retrieve the Date when this UniqueID was created. |
java.lang.String |
getUserId()
Retrieve the User ID of the user who created this UniqueID. |
int |
getVersion()
Retrieve the version of this instance. |
static int |
getVersionOfUniqueId()
Get the version of this Class. |
boolean |
isValid()
Determine if this is a valid UniqueID. |
static boolean |
isValidUniqueId(java.lang.String uniqueIdString)
Determine if a string represents a valid Unique ID Be forewarned; given the nature of a UniqueID (UUID/GUID), this method is likely to give false positives. |
java.lang.String |
toCondensedString()
Retrieves the condensed string representation of this Unique ID, in one of the following forms; HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH, HHHHHHHHHHHHHHHHHHHHHHHHHHHH, HHHHHHHHHHHHHHHHHHHHHHHHHH, or HHHHHHHHHHHHHHHHHHHHHH, where each H represents a hexidecimal digit 0-9, A-F. |
java.lang.String |
toLegibleString()
Retrieves a human-legible string representation of this Unique ID, in the form { USERID='HHHHHH', Server IP='HHHH', Timestamp='MM/dd/yyyy hh:mm:ss aa' }, where each H represents a hexidecimal digit 0-9, A-F. |
java.lang.String |
toString()
Retrieves the un-condensed string representation of this Unique ID, in one of the following forms; HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH, HH-HHHH-HHHH-HHHH-HHHHHHHHHHHH, HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHH, or HH-HHHH-HHHH-HHHH-HHHHHHHH, where each H represents a hexidecimal digit 0-9, A-F. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int VERSION_OF_UNIQUEID
public static final java.lang.String NO_APP_ID_SPECIFIED
public static final java.lang.String NO_USER_ID_SPECIFIED
public static final java.lang.String UNKNOWN_APP_ID_DIFFERENT_VERSION
public static final java.lang.String UNKNOWN_USER_ID_DIFFERENT_VERSION
public static final java.lang.String UNKNOWN_APP_ID_INVALID_UNIQUEID
public static final java.lang.String UNKNOWN_USER_ID_INVALID_UNIQUEID
public static final java.lang.String UNKNOWN_IP_DIFFERENT_VERSION
public static final java.lang.String UNKNOWN_IP_INVALID_UNIQUEID
public static final java.lang.String INVALID_UNIQUE_ID
public static final java.lang.String UNIQUE_ID_DIFFERENT_VERSION
| Constructor Detail |
|---|
public UniqueID(java.lang.String uniqueIdString)
| Format | Variant | Size (Hexidecimal digits) |
| HHHHHHHHHHHHHHHHHHHHHH | Single User, Single Application | 22 |
| HH-HHHH-HHHH-HHHH-HHHHHHHH | Single User, Single Application | 26 |
| HHHHHHHHHHHHHHHHHHHHHHHHHH | Single User, Multi Application | 26 |
| HH-HHHH-HHHH-HHHH-HHHHHHHHHHHH | Single User, Multi Application | 30 |
| HHHHHHHHHHHHHHHHHHHHHHHHHHHH | Multi User, Single Application | 28 |
| HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHH | Multi User, Single Application | 32 |
| HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH | Multi User, Multi Application | 32 |
| HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH | Multi User, Multi Application | 36 |
uniqueIdString - | Method Detail |
|---|
public static UniqueID createUniqueID()
public static UniqueID createUniqueID(java.lang.String userId)
userId - the User ID of the user creating this UniqueID.
public static UniqueID createUniqueID(int userId,
int appId)
userId - a value between 0 and 2^24 (16777216) that represents the user creating this UniqueID.appId - a value between 0 and 2^16 (65536) that must be unique to
the host machine running the application.
public static UniqueID createUniqueID(java.lang.String userId,
java.lang.String appId)
userId - a 6 digit hexidecimal value that represents the user creating this UniqueID.appId - a 4 digit hexidecimal value that must be unique to
the host machine running the application.public static boolean isValidUniqueId(java.lang.String uniqueIdString)
uniqueIdString - public static int getVersionOfUniqueId()
public boolean isValid()
true if this is a valid UniqueID, else falsepublic java.lang.String getUserId()
NO_USER_ID_SPECIFIED if no User ID was specified
in the creation of this UniqueID, UNKNOWN_USER_ID_DIFFERENT_VERSION
if the UniqueID was created from a different version of the specification,
or UNKNOWN_USER_ID_INVALID_UNIQUEID if this is an invalid UniqueID.public java.lang.String getLast4HexDigitsOfServerIp()
UNKNOWN_IP_DIFFERENT_VERSION
if the UniqueID was created from a different version of the specification,
or UNKNOWN_IP_INVALID_UNIQUEID if this is an invalid UniqueID.public java.util.Date getTimestamp()
Date when this UniqueID was created.
Date when this UniqueID was created, else it returns
null.public int getVersion()
0 if the UniqueID is invalid.public java.lang.String getAppId()
NO_APP_ID_SPECIFIED if no Application ID was specified
in the creation of this UniqueID, UNKNOWN_APP_ID_DIFFERENT_VERSION
if the UniqueID was created from a different version of the specification,
or UNKNOWN_APP_ID_INVALID_UNIQUEID if this is an invalid UniqueID.public java.lang.String toString()
INVALID_UNIQUE_ID is returned.
Letter digits are always in uppercase.
toString in class java.lang.ObjectINVALID_UNIQUE_ID if invalid.public java.lang.String toCondensedString()
INVALID_UNIQUE_ID is returned.
Letter digits are always in uppercase.
public java.lang.String toLegibleString()
public java.lang.String getShortFormattedDate()
MM/dd/yyyy hh:mm:ss aa
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||