Package ca.uhn.hl7v2.util
Class MessageIDGenerator
java.lang.Object
ca.uhn.hl7v2.util.MessageIDGenerator
Deprecated.
use one of the IDGenerator implementations
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
FileBasedHiLoGenerator which provides better performance- Author:
- Neal Acharya
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Contains the complete path to the default ID file, which is a plain text file containing the number corresponding to the last generated IDstatic final StringDeprecated.System property key which indicates that this class should never fail. -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageIDGeneratorDeprecated.Synchronized method used to return the single (static) instance of the classgetNewID()Deprecated.Synchronized method used to return the incremented id value
-
Field Details
-
DEFAULT_ID_FILE
Deprecated.Contains the complete path to the default ID file, which is a plain text file containing the number corresponding to the last generated ID -
NEVER_FAIL_PROPERTY
Deprecated.System property key which indicates that this class should never fail. If this system property is set to false (default is true), as in the following code:
System.setProperty(MessageIDGenerator.NEVER_FAIL_PROPERTY, Boolean.FALSE.toString());
this class will fail if the underlying disk file can not be read or written. This means you are roughly guaranteed a unique ID number between JVM sessions (barring the file getting lost or corrupted).
-
-
Method Details
-
getInstance
Deprecated.Synchronized method used to return the single (static) instance of the class- Throws:
IOException
-
getNewID
Deprecated.Synchronized method used to return the incremented id value- Throws:
IOException
-