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