989261001bf1924d1b66a7f97402bcfd3cef987d
[jSite2.git] / src / net / pterodactylus / util / fcp / FcpUtils.java
1 /**
2  * © 2008 INA Service GmbH
3  */
4 package net.pterodactylus.util.fcp;
5
6 import java.util.concurrent.atomic.AtomicLong;
7
8 /**
9  * Helper class with utility methods for the FCP protocol.
10  * 
11  * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
12  * @version $Id$
13  */
14 public class FcpUtils {
15
16         /** Counter for unique identifiers. */
17         private static AtomicLong counter = new AtomicLong();
18
19         /**
20          * Returns a unique identifier.
21          * 
22          * @return A unique identifier
23          */
24         public static String getUniqueIdentifier() {
25                 return new StringBuilder().append(System.currentTimeMillis()).append('-').append(counter.getAndIncrement()).toString();
26         }
27
28 }