cdac.medinfo.sdk.hl7282.hl7net.communication

## Class ClientSideMessageAgent

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.hl7net.communication.ClientSideMessageAgent

- All Implemented Interfaces:
    IDataProcessor

      public class ClientSideMessageAgent
      extends java.lang.Object
      implements IDataProcessor

  Client Side Message Agent validates received message . It sends outgoing messages Messages to Auxiliary protocol Agent.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientSideMessageAgent()` Creates a new instance of ClientSideMessageAgent.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDataNotoficationListener(IDataNotificationListener objIDataNotificationListener)` Sets IDataNotoficationListener on MessageAgenet.
    `void` | `close()` Closes the Client Side Message Agent
    `IBatchProcessor` | `getBatchProcessor()` Retrieves the Batch Processor.
    `void` | `onDataReceived(ISegmentSet objSegmentSet)` Adds DataProcessors to Receive SegmentSet.
    `void` | `sendBatch(IHL7BatchFile objHl7BatchFile)` Gets automatically invoked when Batch is received from remote system.
    `void` | `sendMessage(Message messageToSend)` Gets automatically invoked when Message is received from remote system.
    `void` | `setBatchProcessor(IBatchProcessor objIBatchProcessor)` Sets the Batch Processor.
    `void` | `setBufferSender(IBufferSender objDataSender)` Sets IBufferSender on MessageAgent.
    `void` | `setClientSideQCNAgent(IClientQueryCancellation objClientSideQCNAgent)` This will set the Client Side Query Cancellation agent.
    `void` | `setInteractiveContinuation(IClientInteractiveContinuation objClientSideQICAgent)` Sets IInteractiveContinuation on MessageAgent.
    `void` | `setMessageFactory(MessageFactory objMessageFactory)` Sets Message Handler on Message Agent.
    `void` | `setSequenceAgent(ISequenceAgent objSequenceAgent)` Sets the Sequence Agent.Sequence Agent is required to enable Sequence Numbering in the message transactions.
    `void` | `setWriteLength(int iWriteLength)` Sets max length limit of writing.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ClientSideMessageAgent

          public ClientSideMessageAgent()

      Creates a new instance of ClientSideMessageAgent.

  - ### Method Detail

    - #### getBatchProcessor

          public IBatchProcessor getBatchProcessor()

      Retrieves the Batch Processor.
      Returns:
        objIBatchProcessor The Batch Processor.

    - #### setBatchProcessor

          public void setBatchProcessor(IBatchProcessor objIBatchProcessor)

      Sets the Batch Processor.
      Parameters:
        `objIBatchProcessor` - The objIBatchProcessor to set

    - #### setBufferSender

          public void setBufferSender(IBufferSender objDataSender)

      Sets IBufferSender on MessageAgent.
      Parameters:
        `objDataSender` - Specifies Buffer Sender on Message agent.

    - #### setInteractiveContinuation

          public void setInteractiveContinuation(IClientInteractiveContinuation objClientSideQICAgent)

      Sets IInteractiveContinuation on MessageAgent.
      Parameters:
        `objClientSideQICAgent` - Specifies Client Side Interactive Continuation Agent.

    - #### setSequenceAgent

          public void setSequenceAgent(ISequenceAgent objSequenceAgent)

      Sets the Sequence Agent.Sequence Agent is required to enable Sequence Numbering in the message transactions.
      Parameters:
        `objSequenceAgent` - Sequence Agent to be set on UserSession.

    - #### addDataNotoficationListener

          public void addDataNotoficationListener(IDataNotificationListener objIDataNotificationListener)

      Sets IDataNotoficationListener on MessageAgenet.
      Parameters:
        `objIDataNotificationListener` - Specifies Object of Data Notification Listener on Message Agent.

    - #### setMessageFactory

          public void setMessageFactory(MessageFactory objMessageFactory)

      Sets Message Handler on Message Agent.
      Parameters:
        `objMessageHandler` - Message handler to be set on Client Side Message Agent

    - #### setWriteLength

          public void setWriteLength(int iWriteLength)

      Sets max length limit of writing.
      Parameters:
        `iWriteLength` - value of Writing max length.

    - #### onDataReceived

          public void onDataReceived(ISegmentSet objSegmentSet)
                              throws java.io.IOException

      Adds DataProcessors to Receive SegmentSet.
      Specified by:
        `onDataReceived` in interface `IDataProcessor`
      Parameters:
        `objSegmentSet` - SegmentSet that is received as Data.
      Throws:
        `java.io.IOException` - Thrown when IO operation fails.

    - #### sendMessage

          public void sendMessage(Message messageToSend)
                           throws java.io.IOException,
                                  ProcessFailedException,
                                  InvalidSequenceException

      Gets automatically invoked when Message is received from remote system.
      Parameters:
        `messageToSend` - Specified message to be sent
      Throws:
        `java.io.IOException` - Thrown when IO Operation fails.
        `ProcessFailedException`
        `InvalidSequenceException`

    - #### sendBatch

          public void sendBatch(IHL7BatchFile objHl7BatchFile)
                         throws java.io.IOException,
                                BatchException,
                                AuxillaryProtocolException

      Gets automatically invoked when Batch is received from remote system.
      Parameters:
        `objHl7BatchFile` - object of Batch File.
      Throws:
        `java.io.IOException` - - if IO exception fails.
        `BatchException` - Thrown when Batch can not be read or created.
        `AuxillaryProtocolException` - Thrown when Auxillary Processing Fails.

    - #### close

          public void close()

      Closes the Client Side Message Agent

    - #### setClientSideQCNAgent

          public void setClientSideQCNAgent(IClientQueryCancellation objClientSideQCNAgent)

      This will set the Client Side Query Cancellation agent.
      Parameters:
        `objClientSideQCNAgent` - Specifies Client side Query Cancellation agent.