1 package org.apache.turbine.services.uniqueid;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import org.apache.turbine.services.TurbineServices;
20
21 /***
22 * This is a facade class for {@link UniqueIdService}.
23 *
24 * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
25 * @version $Id: TurbineUniqueId.java 264148 2005-08-29 14:21:04Z henning $
26 */
27 public abstract class TurbineUniqueId
28 {
29 /***
30 * Utility method for accessing the service
31 * implementation
32 *
33 * @return a UniqueIdService implementation instance
34 */
35 protected static UniqueIdService getService()
36 {
37 return (UniqueIdService) TurbineServices
38 .getInstance().getService(UniqueIdService.SERVICE_NAME);
39 }
40
41 /***
42 * <p> Returs an identifer of this Turbine instance that is unique
43 * both on the server and worldwide.
44 *
45 * @return A String with the instance identifier.
46 */
47 public static String getInstanceId()
48 {
49 return getService().getInstanceId();
50 }
51
52 /***
53 * <p> Returns an identifier that is unique within this turbine
54 * instance, but does not have random-like apearance.
55 *
56 * @return A String with the non-random looking instance
57 * identifier.
58 */
59 public static String getUniqueId()
60 {
61 return getService().getUniqueId();
62 }
63
64 /***
65 * <p> Returns a unique identifier that looks like random data.
66 *
67 * @return A String with the random looking instance identifier.
68 */
69 public static String getPseudorandomId()
70 {
71 return getService().getPseudorandomId();
72 }
73 }