cdac.medinfo.sdk.hl7282.hl7net.communication

## Class AuxAgent

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

- All Implemented Interfaces:
    IBufferReceiver, IBufferSender

      public class AuxAgent
      extends java.lang.Object
      implements IBufferReceiver, IBufferSender

  AuxAgent class deals with auxiliary protocols. When no auxiliary protocol is supported then also it performs basic sending and receiving operation for messages.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AuxAgent()` Instantiates Aux agent

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes the Auxiliary Protocol Agent
    `IFragmentProcessor` | `getFragmentProcessor()` Retrieves the Fragment Processor
    `LocalExtensionAgent` | `getLocalExtensionAgent()` Retrieves instance of LocalExtensionAgent.
    `boolean` | `onMessageBufferReceived(byte[] buffer)` Gets automatically invoked when Message is received from remote system.
    `void` | `sendData(ISegmentSet objSegmentSetToSend)` Gets automatically invoked when Message is to be sent to remote system.
    `void` | `setDataProcessor(IDataProcessor objIDataProcessor)` Sets IDataProcessor on MessageAgenet.
    `void` | `setExceptionReceiver(IExceptionReceiver objIExceptionReceiver)` Sets the IExceptionReceiver
    `void` | `setFragmentProcessor(IFragmentProcessor objIFragmentProcessor)` Sets the Fragment Processor
    `void` | `setLocalExtensionAgent(LocalExtensionAgent objAgent)` Sets LocalExtensionAgent to process locally extended segments
    `void` | `setMLLPProcessor(IMLLP objIMLLP)` Sets the MLLP Processor.
    `void` | `setNetworkAgent(INetworkAgent objINetworkAgent)` Sets NetworkAgent on INetworkAgent.
    `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

    - #### AuxAgent

          public AuxAgent()

      Instantiates Aux agent

  - ### Method Detail

    - #### setLocalExtensionAgent

          public void setLocalExtensionAgent(LocalExtensionAgent objAgent)

      Sets LocalExtensionAgent to process locally extended segments
      Specified by:
        `setLocalExtensionAgent` in interface `IBufferReceiver`
      Parameters:
        `objAgent` - instance of LocalExtensionAgent

    - #### getLocalExtensionAgent

          public LocalExtensionAgent getLocalExtensionAgent()

      Retrieves instance of LocalExtensionAgent.
      Specified by:
        `getLocalExtensionAgent` in interface `IBufferReceiver`
      Returns:
        LocalExtensionAgent - instance of LocalExtensionAgent

    - #### setExceptionReceiver

          public void setExceptionReceiver(IExceptionReceiver objIExceptionReceiver)

      Sets the IExceptionReceiver
      Parameters:
        `objIExceptionReceiver` - the objIExceptionReceiver to set

    - #### getFragmentProcessor

          public IFragmentProcessor getFragmentProcessor()

      Retrieves the Fragment Processor
      Returns:
        IFragmentProcessor-the object of IFragmentProcessor

    - #### setFragmentProcessor

          public void setFragmentProcessor(IFragmentProcessor objIFragmentProcessor)

      Sets the Fragment Processor
      Parameters:
        `objIFragmentProcessor` - the objIFragmentProcessor to set

    - #### setMLLPProcessor

          public void setMLLPProcessor(IMLLP objIMLLP)

      Sets the MLLP Processor.
      Parameters:
        `objIMLLP` - the MLLP processor to set.

    - #### setNetworkAgent

          public void setNetworkAgent(INetworkAgent objINetworkAgent)

      Sets NetworkAgent on INetworkAgent.
      Parameters:
        `objINetworkAgent-object` - of INetworkAgent

    - #### setWriteLength

          public void setWriteLength(int iWriteLength)

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

    - #### setDataProcessor

          public void setDataProcessor(IDataProcessor objIDataProcessor)

      Sets IDataProcessor on MessageAgenet.
      Parameters:
        `objIDataProcessor` - - object of IDataProcessor

    - #### onMessageBufferReceived

          public boolean onMessageBufferReceived(byte[] buffer)
                                          throws java.io.IOException

      Gets automatically invoked when Message is received from remote system.
      Specified by:
        `onMessageBufferReceived` in interface `IBufferReceiver`
      Parameters:
        `buffer` - message stream received in form of byte array
      Returns:
        boolean - status indicating reception of Message buffer from remote end.
      Throws:
        `java.io.IOException` - Signals that an IO Exception has occurred.

    - #### sendData

          public void sendData(ISegmentSet objSegmentSetToSend)
                        throws java.io.IOException

      Gets automatically invoked when Message is to be sent to remote system.
      Specified by:
        `sendData` in interface `IBufferSender`
      Parameters:
        `messageToSend` - Specified message
      Throws:
        `java.io.IOException` - Thrown when IO operation fails.
        `SerializeException` - Thrown when serialize operation fails.

    - #### close

          public void close()

      Closes the Auxiliary Protocol Agent