View Javadoc
1   package ca.uhn.hl7v2.protocol;
2   
3   import java.util.Map;
4   
5   /**
6    * The Interface ReceivingApplicationExceptionHandler. Allow applications to handle
7    * parsing and handling errors.
8    *
9    * @author Gabriel Landais
10   */
11  public interface ReceivingApplicationExceptionHandler {
12  
13  	/**
14  	 * Process an exception.
15  	 * 
16  	 * @param incomingMessage
17  	 *            the incoming message. This is the raw message which was
18  	 *            received from the external system
19  	 * @param incomingMetadata
20  	 *            Any metadata that accompanies the incoming message. See {@link ca.uhn.hl7v2.protocol.Transportable#getMetadata()}
21  	 * @param outgoingMessage
22  	 *            the outgoing message. The response NAK message generated by
23  	 *            HAPI.
24  	 * @param e
25  	 *            the exception which was received
26  	 * @return The new outgoing message. This can be set to the value provided
27  	 *         by HAPI in <code>outgoingMessage</code>, or may be replaced with
28  	 *         another message. <b>This method may not return <code>null</code></b>.
29  	 */
30  	// ********************************
31  	// Note, if you update the JavaDoc here, also update it in the hapi-example
32  	// file SendAndReceiveAMessage.java as it's duplicated there!
33  	// ********************************
34      String processException(String incomingMessage, Map<String, Object> incomingMetadata, String outgoingMessage, Exception e);
35  
36  }