Package com.adaptris.util
Class PlainIdGenerator
- java.lang.Object
-
- com.adaptris.util.PlainIdGenerator
-
- All Implemented Interfaces:
IdGenerator
- Direct Known Subclasses:
SimpleIdGenerator
public class PlainIdGenerator extends java.lang.Object implements IdGenerator
Basic IdGenerator implementationThe ID is generated from the a combination of SecureRandom.nextBytes(byte[]), the hashcode of the object, and current timestamp. No guarantees are made for the uniqueness of the ID generated.
In the adapter configuration file this class is aliased as plain-id-generator which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Constructor Summary
Constructors Constructor Description PlainIdGenerator()
PlainIdGenerator(java.lang.String separator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
create(java.lang.Object msg)
Create a unique id based on the object.java.lang.String
getSeparator()
void
setSeparator(java.lang.String s)
-
-
-
Method Detail
-
create
public java.lang.String create(java.lang.Object msg)
Description copied from interface:IdGenerator
Create a unique id based on the object.- Specified by:
create
in interfaceIdGenerator
- Parameters:
msg
- the object to create an id around- Returns:
- a unique id for use.
-
getSeparator
public java.lang.String getSeparator()
- Returns:
- the separator
-
setSeparator
public void setSeparator(java.lang.String s)
- Parameters:
s
- the separator to set
-
-