cgl.hpsearch.common
Class UIDGenerator
java.lang.Object
cgl.hpsearch.common.UIDGenerator
- public class UIDGenerator
- extends Object
Creates a unique ID for use by various components of the Workflow Streams and
Engine.
Current Implementation returns a String consisting of 3 parts separated by :.
The 3 parts are as follows
- Current System Time: System.currentTimeMillis()
- The Host address of the machine:
InetAddress.getLocalHost().getHostAddress()
- A random Double: Random.nextDouble()
NOTE: For development purposes the inclusion of Random Double
and current system time has been disabled.
TO_DO: Use a standard UID generator such as IETF's UUID.
- Author:
- Harshawardhan S. Gadgil
|
Field Summary |
static int |
inNo
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
inNo
public static int inNo
UIDGenerator
public UIDGenerator()
getUUID
public static String getUUID()
- Generates a time based UUID
- Returns:
- String representation of UUID in format
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
getUniqID
public static String getUniqID()
- Deprecated.
- Deprecated method. Use getUUID()
- Returns:
- UID string in the format
IP:CurrentTime:serialInt
getIntId
public static int getIntId()
main
public static void main(String[] args)