uk.org.ogsadai.common.msgs
Class DAIUniqueID

java.lang.Object
  |
  +--uk.org.ogsadai.common.msgs.DAIUniqueID

public class DAIUniqueID
extends java.lang.Object

Represents a unique ID against which entries can be written to the server log.

This ID can also be given to clients alongside errors. This will allow system administrators to match up client errors with the corresponding messages in the server logs.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private static long mCounter
           
private  java.lang.String mId
           
 
Constructor Summary
private DAIUniqueID()
          Constructs a new server log ID.
 
Method Summary
private  java.lang.String getBaseStringFromDateTime()
          Used the current time to form a base of the server log ID.
private  long getNextCounter()
          Gets the next counter and increments the counter.
static DAIUniqueID newInstance()
          Used to obtain a new unique server log ID.
 java.lang.String toString()
          Returns server log ID as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mCounter

private static long mCounter

mId

private java.lang.String mId
Constructor Detail

DAIUniqueID

private DAIUniqueID()
Constructs a new server log ID.

Method Detail

toString

public java.lang.String toString()
Returns server log ID as a String.

Overrides:
toString in class java.lang.Object
Returns:
Server log ID.

getBaseStringFromDateTime

private java.lang.String getBaseStringFromDateTime()
Used the current time to form a base of the server log ID.

Returns:
A base formed from the current time.

getNextCounter

private long getNextCounter()
Gets the next counter and increments the counter.

Returns:
The next counter.

newInstance

public static DAIUniqueID newInstance()
Used to obtain a new unique server log ID.

Returns:
A new unique server log ID.