public class TurbineUniqueIdService extends TurbineBaseService implements UniqueIdService
This is an implementation of UniqueIdService
.
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 appearance.
|
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
public TurbineUniqueIdService()
public void init() throws InitializationException
Initializes the service upon first Turbine.doGet() invocation.
init
in interface Initable
init
in class TurbineBaseService
InitializationException
- if 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 respectively, context and servlet name). There is an overwhelming probability 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 appearance.
getUniqueId
in interface UniqueIdService
public String getPseudorandomId()
Returns a unique identifier that looks like random data.
getPseudorandomId
in interface UniqueIdService
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.