|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.uhn.hl7v2.validation.app.TestApplication
public abstract class TestApplication
An application intended for testing messages. The intended use is to route a copy of (selected) messages to a test application, which identifies and acts on problems independently of the normal error acknowledgement path (for example by notifying an administrator). This makes the most sense when used within an interface engine, for example if the sending nor receiving system use HAPI, but it is desired to route messages to HAPI in parallel so that they can be fully validated.
Constructor Summary | |
---|---|
TestApplication()
Creates a new instance of TestApplication |
Method Summary | |
---|---|
abstract boolean |
canProcess(Message in)
Returns true if this Application wishes to accept the message. |
Message |
processMessage(Message in)
Calls test(Message in), routes resulting exceptions to configured destinations, and returns an ack (which should not normally be used since the test app is intended to operate in parallel with system-to-system communication). |
abstract HL7Exception[] |
test(Message in)
Tests the message in some way (as defined by implementing class). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TestApplication()
Method Detail |
---|
public abstract boolean canProcess(Message in)
canProcess
in interface Application
public Message processMessage(Message in) throws HL7Exception
Calls test(Message in), routes resulting exceptions to configured destinations, and returns an ack (which should not normally be used since the test app is intended to operate in parallel with system-to-system communication).
Notification routing is performed using log4j, so you need appropriate settings in a log4j config file (by default, ./log4j.properties). Different types of exceptions are all given the same severity (ERROR) but they have different loggers, based on the exception class name. Specifically, the loggers will be named ca.uhn.hl7v2.validation.error.{exception class name}. For example: "ca.uhn.hl7v2.validation.error.DataTypeException". Note that this allows default settings for all validation errors using the logger "ca.uhn.hl7v2.validation.error". The intent is for different exceptions to result in different actions, e.g. a ProfileNotHL7CompliantException should probably just be logged or ignored, while a ProfileNotFollowedException should probably be emailed to an administrator.
processMessage
in interface Application
HL7Exception
public abstract HL7Exception[] test(Message in) throws HL7Exception
HL7Exception
- if the message can't be tested (not for errors disovered
during testing)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |