public class TurbineUniqueIdService extends TurbineBaseService implements UniqueIdService
This is an implementation of UniqueIdService
.
Modifier and Type | Field and Description |
---|---|
protected static int |
counter |
protected static String |
turbineId
The identifier of this instance of turbine.
|
protected static String |
turbineURL |
configuration, name, serviceBroker
initableBroker, isInitialized
SERVICE_NAME
Constructor and Description |
---|
TurbineUniqueIdService() |
Modifier and Type | Method and Description |
---|---|
String |
getInstanceId()
Returns an identifier of this Turbine instance that is unique
both on the server and worldwide.
|
String |
getPseudorandomId()
Returns a unique identifier that looks like random data.
|
String |
getUniqueId()
Returns an identifier that is unique within this turbine
instance, but does not have random-like apearance.
|
void |
init()
Initializes the service upon first Turbine.doGet()
invocation.
|
void |
shutdown()
Writes a message to the log upon system shutdown.
|
init, init
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
getInit, getInitableBroker, setInit, setInitableBroker
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfiguration, getName, getProperties, setName, setServiceBroker
getInit, init, setInitableBroker
protected static String turbineURL
protected static int counter
public TurbineUniqueIdService()
public void init() throws InitializationException
Initializes the service upon first Turbine.doGet() invocation.
init
in interface Initable
init
in class TurbineBaseService
InitializationException
- Initialization of this
class was not successful.public void shutdown()
Writes a message to the log upon system shutdown.
shutdown
in interface Initable
shutdown
in class TurbineBaseService
public String getInstanceId()
Returns an identifier of this Turbine instance that is unique both on the server and worldwide. This identifier is computed as an MD5 sum of the URL (including schema, address, port if different that 80/443 respecively, context and servlet name). There is an overwhelming probalility that this id will be different that all other Turbine instances online.
getInstanceId
in interface UniqueIdService
public String getUniqueId()
Returns an identifier that is unique within this turbine instance, but does not have random-like apearance.
getUniqueId
in interface UniqueIdService
public String getPseudorandomId()
Returns a unique identifier that looks like random data.
getPseudorandomId
in interface UniqueIdService
Copyright © 2000-2015 The Apache Software Foundation. All Rights Reserved.