Class PlainIdGenerator

  • All Implemented Interfaces:
    IdGenerator
    Direct Known Subclasses:
    SimpleIdGenerator

    public class PlainIdGenerator
    extends java.lang.Object
    implements IdGenerator
    Basic IdGenerator implementation

    The 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.

    • 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PlainIdGenerator

        public PlainIdGenerator()
      • PlainIdGenerator

        public PlainIdGenerator​(java.lang.String separator)
    • 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 interface IdGenerator
        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