Class UuidV1IdGenerator

java.lang.Object
io.ebeaninternal.server.idgen.UuidV1RndIdGenerator
io.ebeaninternal.server.idgen.UuidV1IdGenerator
All Implemented Interfaces:
PlatformIdGenerator

public class UuidV1IdGenerator extends UuidV1RndIdGenerator
IdGenerator for java util UUID.

It extends the UuidV1RndIdGenerator so that it can generate rfc4122 compliant Type 1 UUIDs.

This generator produces real Type 1 UUIDs (best for sqlserver) - You should use this generator only, if you can guarantee, that mac addess is uniqe or specify 'ebean.uuidNodeId' in your config file.

  • Method Details

    • getInstance

      public static UuidV1IdGenerator getInstance(String file, String nodeId)
      Returns an instance for given file.
    • getInstance

      public static UuidV1IdGenerator getInstance(File file, String nodeId)
      Returns an instance for given file.
    • getNodeIdentifier

      public String getNodeIdentifier()
      Returns the Node-identifier (=MAC address) as string
    • saveState

      protected void saveState()
      Saves the state to the state file;
      Overrides:
      saveState in class UuidV1RndIdGenerator
    • getNodeIdBytes

      protected byte[] getNodeIdBytes()
      Description copied from class: UuidV1RndIdGenerator
      returns a random 47 bit value according to https://tools.ietf.org/html/rfc4122.html#section-4.5
      Overrides:
      getNodeIdBytes in class UuidV1RndIdGenerator