com.emarsys.ecommon.util
Class Identify

java.lang.Object
  extended by com.emarsys.ecommon.util.Identify

public class Identify
extends java.lang.Object

Creationdate: Apr 24, 2007

Author:
Matthias Marchart

Constructor Summary
Identify()
           
 
Method Summary
static java.lang.String host()
           
static int uid()
           
static long uniqueTimestamp()
          Synchronized method to get a unique timestamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Identify

public Identify()
Method Detail

uniqueTimestamp

public static long uniqueTimestamp()
Synchronized method to get a unique timestamp. This is implemented by waiting until System.currentTimeMillis() will return a new value. (the machine has has switched to the next timeslot ... )

See Also:
System.currentTimeMillis()

uid

public static int uid()
Returns:
a integer unique over host and time. The integer is guaranteed to be positive.

host

public static java.lang.String host()
Returns:
a String representation of the localhost in the form of hostname/hostaddress(canonicalhostname). iff the host returns a loopback-address or the method InetAddress.getLocalHost() throws an UnknownHostException the string App#UNKNOWN is returned. (this will depend on security-checks)


Copyright © 2010 emarsys AG. All Rights Reserved.