vc.util
Class IdGenerator

java.lang.Object
  |
  +--vc.util.IdGenerator

public class IdGenerator
extends java.lang.Object

IdGenerator is the utility class to generate the unique IDs for different requiremnts


Constructor Summary
IdGenerator()
           
 
Method Summary
static long getNextConnectionId()
          Method to get the a unique ID for using as a connection ID.
static java.lang.String getUniqueID()
          Method to get the a unique ID for using as a generic unique ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdGenerator

public IdGenerator()
Method Detail

getNextConnectionId

public static long getNextConnectionId()
Method to get the a unique ID for using as a connection ID. Here it generates a unique ID by incrementing the counter variable
Returns:
Returns a unique connection ID as a long number

getUniqueID

public static java.lang.String getUniqueID()
Method to get the a unique ID for using as a generic unique ID. Here it generates a unique ID by incrementing the taking the current system time in milliseconds and applying the counter variable to it so that it can generate 1000000 unique IDs in a millisecond time
Returns:
Returns a unique ID as a string