com.ebmwebsourcing.easycommons.uuid
Class QualifiedUUIDGenerator

java.lang.Object
  extended by com.ebmwebsourcing.easycommons.uuid.SimpleUUIDGenerator
      extended by com.ebmwebsourcing.easycommons.uuid.QualifiedUUIDGenerator

public final class QualifiedUUIDGenerator
extends SimpleUUIDGenerator

A simple and fast qualified UUID generator.

The identifier is composed of two parts:

  1. a domain namespace,
  2. an UUID created according to the DCE Universal Token Identifier specification

Here is a generated UUID sample, based on a domain namespace called 'petalslink': petalslink:00000000-0000-002a-0000-00000000002a.

Author:
ofabre

Field Summary
static int UUID_GENERATED_PART_SIZE
          The max size of the UUID string.
 
Constructor Summary
QualifiedUUIDGenerator(java.lang.String domain)
           
 
Method Summary
 java.lang.String getDomain()
           
 java.lang.String getNewID()
           Generates an unique identifier.
static java.lang.String getSeparator()
           
 int getUuidMaxLength()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UUID_GENERATED_PART_SIZE

public static final int UUID_GENERATED_PART_SIZE
The max size of the UUID string.

Constructor Detail

QualifiedUUIDGenerator

public QualifiedUUIDGenerator(java.lang.String domain)
Parameters:
domain - The domain namespace of the unique identifier.
Method Detail

getNewID

public java.lang.String getNewID()

Generates an unique identifier. An identifier value has never been returned (existed) before its calculation.

The identifier is composed of two parts:

  1. a domain namespace,
  2. an UUID created according to the DCE Universal Token Identifier specification

This method is threadsafe.

Overrides:
getNewID in class SimpleUUIDGenerator
Parameters:
prefixNS - prefix or not the id
Returns:
A unique identifier

getDomain

public java.lang.String getDomain()

getUuidMaxLength

public int getUuidMaxLength()

getSeparator

public static java.lang.String getSeparator()


Copyright © 2012 Petals Link. All Rights Reserved.