|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.uhn.hl7v2.util.MessageIDGenerator
public class MessageIDGenerator
Creates unique message IDs. IDs are stored in a file called hapi.home/id_file for persistence
across JVM sessions. Note that if one day you run the JVM with a new working directory,
you must move or copy id_file into this directory so that new ID numbers will begin
with the last one used, rather than starting over again.
Note that as of HAPI 2.0, by default this class will not fail even if the id_file can
not be read/written. In this case, HAPI will try to fail gracefully by simply generating
a numeric sequence starting at zero. This behaviour can be overwritten using
NEVER_FAIL_PROPERTY
| Field Summary | |
|---|---|
static String |
DEFAULT_ID_FILE
Contains the complete path to the default ID file, which is a plain text file containing the number corresponding to the last generated ID |
static String |
NEVER_FAIL_PROPERTY
System property key which indicates that this class should never fail. |
| Method Summary | |
|---|---|
static MessageIDGenerator |
getInstance()
Synchronized method used to return the single (static) instance of the class |
String |
getNewID()
Synchronized method used to return the incremented id value |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_ID_FILE
public static final String NEVER_FAIL_PROPERTY
System.setProperty(MessageIDGenerator.NEVER_FAIL_PROPERTY, Boolean.FALSE.toString());
| Method Detail |
|---|
public static MessageIDGenerator getInstance()
throws IOException
IOException
public String getNewID()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||