uPortal 2.4.1
API Documentation

org.jasig.portal.utils
Class GuidGenerator

java.lang.Object
  extended byorg.jasig.portal.utils.GuidGenerator

public class GuidGenerator
extends java.lang.Object

Creates a Global/Universal Unique ID, per DCE RPC specification. Requires seed of MAC address/node identifier (12-digit hex string) for uniqueness. Specification found at the OpenGroup.Org web site.

Version:
$Revision: 1.4 $
Author:
Michael Ivanov

Constructor Summary
GuidGenerator()
          GuidGenerator() - default constructor
GuidGenerator(java.lang.String newMAC)
          GuidGenerator(String) - seeded constructor
 
Method Summary
 java.lang.String getNewGuid()
          getNewGuid calls set to generate a new GUID
static void main(java.lang.String[] args)
          main is the unit testing interface that creates a new Guid instance and prints result of getNewGuid to System.out
 void set()
          set is where all the work is done
 java.lang.String toString()
          toString returns the current values as a single string per RFC
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GuidGenerator

public GuidGenerator()
              throws java.lang.Exception
GuidGenerator() - default constructor


GuidGenerator

public GuidGenerator(java.lang.String newMAC)
              throws java.lang.IllegalArgumentException
GuidGenerator(String) - seeded constructor

Parameters:
newMAC - as the seed value for fifth element of string GUID
Throws:
java.lang.IllegalArgumentException
Method Detail

getNewGuid

public java.lang.String getNewGuid()
getNewGuid calls set to generate a new GUID

Returns:
the latest GUID

toString

public java.lang.String toString()
toString returns the current values as a single string per RFC

Returns:
the timebase from set() concatenated to the initialization string

set

public void set()
set is where all the work is done


main

public static void main(java.lang.String[] args)
main is the unit testing interface that creates a new Guid instance and prints result of getNewGuid to System.out

Parameters:
args - array for input arguments

uPortal 2.4.1
API Documentation