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
20
21
22 import org.apache.turbine.services.Service;
23
24 /***
25 * <p> This service provides unique identifiers for the instance of
26 * Turbine, and for objects it creates.
27 *
28 * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
29 * @version $Id: UniqueIdService.java 534527 2007-05-02 16:10:59Z tv $
30 */
31 public interface UniqueIdService
32 extends Service
33 {
34 String SERVICE_NAME = "UniqueIdService";
35
36 /***
37 * <p> Returs an identifer of this Turbine instance that is unique
38 * both on the server and worldwide.
39 *
40 * @return A String with the instance identifier.
41 */
42 String getInstanceId();
43
44 /***
45 * <p> Returns an identifier that is unique within this turbine
46 * instance, but does not have random-like apearance.
47 *
48 * <p> This method is intended to work fast; it can be used for
49 * creating names of temporary files.
50 *
51 * @return A String with the non-random looking instance
52 * identifier.
53 * */
54 String getUniqueId();
55
56 /***
57 * <p> Returns a unique identifier that looks like random data.
58 *
59 * <p> This method provides indentifiers in a way that makes it
60 * hard to guess or count, but still ensures their uniqueness
61 * within this instance of Turbine. It can be used for generating
62 * cookies or other data that travels back and forth between
63 * server and browser, and is potentialy security sensitive.
64 *
65 * @return A String with the random looking instance identifier.
66 */
67 String getPseudorandomId();
68 }