org.apache.turbine.services.uniqueid
Interface UniqueIdService

All Superinterfaces:
Initable, Service
All Known Implementing Classes:
TurbineUniqueIdService

public interface UniqueIdService
extends Service

This service provides unique identifiers for the instance of Turbine, and for objects it creates.

Version:
$Id: UniqueIdService.java 534527 2007-05-02 16:10:59Z tv $
Author:
Rafal Krzewski

Field Summary
static java.lang.String SERVICE_NAME
           
 
Method Summary
 java.lang.String getInstanceId()
           Returs an identifer of this Turbine instance that is unique both on the server and worldwide.
 java.lang.String getPseudorandomId()
           Returns a unique identifier that looks like random data.
 java.lang.String getUniqueId()
           Returns an identifier that is unique within this turbine instance, but does not have random-like apearance.
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
See Also:
Constant Field Values
Method Detail

getInstanceId

public java.lang.String getInstanceId()

Returs an identifer of this Turbine instance that is unique both on the server and worldwide.

Returns:
A String with the instance identifier.

getUniqueId

public java.lang.String getUniqueId()

Returns an identifier that is unique within this turbine instance, but does not have random-like apearance.

This method is intended to work fast; it can be used for creating names of temporary files.

Returns:
A String with the non-random looking instance identifier.

getPseudorandomId

public java.lang.String getPseudorandomId()

Returns a unique identifier that looks like random data.

This method provides indentifiers in a way that makes it hard to guess or count, but still ensures their uniqueness within this instance of Turbine. It can be used for generating cookies or other data that travels back and forth between server and browser, and is potentialy security sensitive.

Returns:
A String with the random looking instance identifier.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.