Trispark JDT
2.50.13

com.archimed.dicom.uid
Class UIDGenerator

java.lang.Object
  extended by com.archimed.dicom.uid.UIDGenerator

public class UIDGenerator
extends java.lang.Object

A class for generating globally unique UIDs, based on the combination of the MAC address of the primary ethernet card, a timestamp and a counter.

The retrieval of MAC addresses requires a native library. Please contact us at info@trispark.com in order to obtain the library for different platforms.


Constructor Summary
UIDGenerator()
           
 
Method Summary
static java.lang.String generate(java.lang.String prefix, boolean useMacAddress)
          Generates a dicom UID.
static void main(java.lang.String[] args)
          generates and prints a UID to stdout with prefix 1.2.3.4.5.6.7.8.9
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIDGenerator

public UIDGenerator()
Method Detail

generate

public static java.lang.String generate(java.lang.String prefix,
                                        boolean useMacAddress)
Generates a dicom UID. If the MAC address is not used to generate a UID, the prefix argument should ensure spatial uniqueness in order to have a global unique UID.

Parameters:
prefix - organizational prefix optionally including a spatial identifier. The prefix should follow dicom UID formatting rules and cannot exceed 31 bytes including the trailing '.'
useMacAddress - when set to true the method will incorporate the MAC address of the primary ethernet card in order to ensure spatial uniqueness in the generated UID.
Returns:
a dicom formatted UID
Throws:
java.lang.IllegalArgumentException - when the prefix is in the wrong format or exceeds 31 bytes.

main

public static void main(java.lang.String[] args)
generates and prints a UID to stdout with prefix 1.2.3.4.5.6.7.8.9

Parameters:
args - String[]

Trispark JDT
2.50.13

Copyright © 1999-2008 Trispark. All Rights Reserved.