cdac.medinfo.sdk.hl7282.hl7net.communication

## Class ServerSideMessageAgent

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

- All Implemented Interfaces:
    IDataProcessor

      public class ServerSideMessageAgent
      extends java.lang.Object
      implements IDataProcessor

  Server Side Message Agent validates received message according to Message Controller ID & other constants. It sends outgoing messages Messages to Auxiliary protocol Agent.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServerSideMessageAgent()` Constructs Server Side Message Agent

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDataNotoficationListener(IDataNotificationListener objIDataNotificationListener)` Sets IDataNotoficationListener on MessageAgent.
    `void` | `close()` Closes the Server Side Message Agent
    `IBatchProcessor` | `getBatchProcessor()` Retrieves the Batch Processor
    `Message` | `getMessage()` Retrieves Message from UserSession.
    `void` | `onDataReceived(ISegmentSet objSegmentSet)` Adds DataProcessors to Receive SegmentSet.
    `void` | `sendBatch(IHL7BatchFile objBatchFileToSend)` 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` | `setMessageFactory(MessageFactory objMessageFactory)` Sets Message Handler on Message Agent.
    `void` | `setPublishAgent(IPublishAgent objPublishAgent)` Sets instance of PublishAgent on ClientSession.
    `void` | `setSequenceAgent(ISequenceAgent objSequenceAgent)` Sets the Sequence Agent.
    `void` | `setServerSideQCNAgent(IServerQueryCancellation objServerSideQCNAgent)` Sets the Query Cancellation agent.
    `void` | `setServerSideQICAgent(IServerInteractiveContinuation objServerSideQICAgent)` Sets the Interactive Continuation Agent.

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

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

- - ### Constructor Detail

    - #### ServerSideMessageAgent

          public ServerSideMessageAgent()

      Constructs Server Side Message Agent

  - ### Method Detail

    - #### getBatchProcessor

          public IBatchProcessor getBatchProcessor()

      Retrieves the Batch Processor
      Returns:
        the objIBatchProcessor

    - #### setBatchProcessor

          public void setBatchProcessor(IBatchProcessor objIBatchProcessor)

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

    - #### 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.

    - #### addDataNotoficationListener

          public void addDataNotoficationListener(IDataNotificationListener objIDataNotificationListener)

      Sets IDataNotoficationListener on MessageAgent.
      Parameters:
        `objIDataNotificationListener` - Specifies Data Notification Listener on Message Agent.

    - #### setMessageFactory

          public void setMessageFactory(MessageFactory objMessageFactory)

      Sets Message Handler on Message Agent.
      Parameters:
        `objIMessageHandler` - Specifies Message Handler on Message Agent.

    - #### sendMessage

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

      Gets automatically invoked when Message is received from remote system.
      Parameters:
        `messageToSend` - Specified Message To send
      Throws:
        `java.io.IOException` - Thrown when IO operation fails.
        `ProcessFailedException` - Thrown when Process operation fails.
        `InvalidMessageException`
        `InvalidSequenceException`

    - #### sendBatch

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

      Gets automatically invoked when Batch is received from remote system.
      Parameters:
        `objBatchFileToSend` - Specifies object of batch file to send.
      Throws:
        `java.io.IOException` - Thrown when IO operation fails.
        `BatchException` - Thrown when Batch can not be read or created.

    - #### setBufferSender

          public void setBufferSender(IBufferSender objDataSender)

      Sets IBufferSender on MessageAgent.
      Parameters:
        `objDataSender` - Specifies object of Buffer Sender on Message Agent.

    - #### getMessage

          public Message getMessage()

      Retrieves Message from UserSession.
      Returns:
        Message Specifies Message from UserSession

    - #### setServerSideQCNAgent

          public void setServerSideQCNAgent(IServerQueryCancellation objServerSideQCNAgent)

      Sets the Query Cancellation agent.
      Parameters:
        `objServerSideQCNAgent` - Specifies Server side Query Cancellation agent.

    - #### setServerSideQICAgent

          public void setServerSideQICAgent(IServerInteractiveContinuation objServerSideQICAgent)

      Sets the Interactive Continuation Agent.
      Parameters:
        `objServerSideQICAgent` - Specifies Server Side Interactive Continuation Agent.

    - #### setPublishAgent

          public void setPublishAgent(IPublishAgent objPublishAgent)

      Sets instance of PublishAgent on ClientSession.
      Parameters:
        `objPublishAgent` - - instance of PublishAgent.

    - #### 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.

    - #### close

          public void close()

      Closes the Server Side Message Agent