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, serviceBrokerinitableBroker, isInitializedSERVICE_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, initgetConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBrokergetInit, getInitableBroker, setInit, setInitableBrokerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConfiguration, getName, getProperties, setName, setServiceBrokergetInit, init, setInitableBrokerprotected 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 Initableinit in class TurbineBaseServiceInitializationException - if initialization of this
class was not successful.public void shutdown()
Writes a message to the log upon system shutdown.
shutdown in interface Initableshutdown in class TurbineBaseServicepublic 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 UniqueIdServicepublic String getUniqueId()
Returns an identifier that is unique within this turbine instance, but does not have random-like apearance.
getUniqueId in interface UniqueIdServicepublic String getPseudorandomId()
Returns a unique identifier that looks like random data.
getPseudorandomId in interface UniqueIdServiceCopyright © 2000–2018 The Apache Software Foundation. All rights reserved.