Class CmsUUID

java.lang.Object
org.opencms.util.CmsUUID
All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Comparable<CmsUUID>

public final class CmsUUID extends Object implements Cloneable, Comparable<CmsUUID>, Externalizable
Generates a UUID using spatial and temporal uniqueness.

Spatial uniqueness is derived from ethernet address (MAC, 802.1); temporal from system clock.

For more information about the algorithm used, please see draft-leach-uuids-guids-01.txt.

Because Java is unable to read the MAC address of the machine (without using JNI), the MAC address has to be provided first by using the static init(String) method.

This class is just a facade wrapper for the "real" UUID implementation.

Since:
6.0.0
See Also:
  • Field Details

  • Constructor Details

    • CmsUUID

      public CmsUUID()
      Creates a new UUID.

      Please note that the static init() method has to be called first to initialize the internet address of the machine.

    • CmsUUID

      public CmsUUID(byte[] data)
      Create a UUID based on a binary data array.

      Parameters:
      data - a binary data array representing a UUID
    • CmsUUID

      public CmsUUID(String uuid) throws NumberFormatException
      Create a UUID based on a String.

      Parameters:
      uuid - a String representing a UUID
      Throws:
      NumberFormatException - in case uuid is not a valid UUID
  • Method Details