cdac.medinfo.sdk.hl7282.hl7net.commons

## Interface ITransactionHandler

- All Known Implementing Classes:
    TransactionHandler

      public interface ITransactionHandler

  The implementor of this interface should provide all methods in it This interface should be implemented by classes for verification of message,batch and batch file while receiving and sending.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `processBatchTransaction(IHL7BatchFile objHL7BatchFile)` Processes the batch or batch file and verified each batch inside it.
    `void` | `processMessageTransaction(Message objMessage)` Initiates one operation.
    `void` | `processOnExceptionTransaction(java.lang.Exception ex, byte[] buffer)` Retrieves the controlId for Batch or Message and removes the data for The data for which exception is fetched.
    `void` | `setBatchAgent(IBatchProcessor objBatchProcessor)` Sets the batch agent on ITransactionhandler for the processing of batch and batch-file.

- - ### Method Detail

    - #### processMessageTransaction

          void processMessageTransaction(Message objMessage)

      Initiates one operation. An operation is completed when, 1]When sending Immediate or Deferred Query. 2]When sending event. 3]When sending ACK for Deferred Query. 4]When Accepting Response for Deferred or Immediate response. This method will keep Record for sending and receiving messages.
      Parameters:
        `objMessage` - Message for which verification to be done.
      Throws:
        `InvalidTransactionException` - Thrown when performs invalid transaction.

    - #### processBatchTransaction

          void processBatchTransaction(IHL7BatchFile objHL7BatchFile)

      Processes the batch or batch file and verified each batch inside it.
      Parameters:
        `objHL7BatchFile` - - Batch for which to initiate Operation.
      Throws:
        `InvalidTransactionException` - Thrown when performs invalid transaction.

    - #### processOnExceptionTransaction

          void processOnExceptionTransaction(java.lang.Exception ex,
                                           byte[] buffer)

      Retrieves the controlId for Batch or Message and removes the data for The data for which exception is fetched.
      Parameters:
        `ex` - Exception raised
        `buffer` - data containing error

    - #### setBatchAgent

          void setBatchAgent(IBatchProcessor objBatchProcessor)

      Sets the batch agent on ITransactionhandler for the processing of batch and batch-file.
      Parameters:
        `objHL7Batch` - Object of received batch.