org.apache.camel.util
Class UuidGenerator

java.lang.Object
  extended by org.apache.camel.util.UuidGenerator

public class UuidGenerator
extends Object

Generator for Globally unique Strings.


Constructor Summary
UuidGenerator()
           
UuidGenerator(String prefix)
           
 
Method Summary
 String generateId()
          Generate a unqiue id
 String generateSanitizedId()
          Generate a unique ID - that is friendly for a URL or file system
static String generateSanitizedId(String id)
          Ensures that the id is friendly for a URL or file system
static String getHostName()
          As we have to find the hostname as a side-affect of generating a unique stub, we allow it's easy retrevial here
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UuidGenerator

public UuidGenerator(String prefix)

UuidGenerator

public UuidGenerator()
Method Detail

getHostName

public static String getHostName()
As we have to find the hostname as a side-affect of generating a unique stub, we allow it's easy retrevial here

Returns:
the local host name

generateId

public String generateId()
Generate a unqiue id


generateSanitizedId

public String generateSanitizedId()
Generate a unique ID - that is friendly for a URL or file system

Returns:
a unique id

generateSanitizedId

public static String generateSanitizedId(String id)
Ensures that the id is friendly for a URL or file system

Parameters:
id - the unique id
Returns:
the id as file friendly id


Copyright © 2009 Apache Software Foundation. All Rights Reserved.