Sun Adapter for TCP/IP HL7

com.stc.connector.tcpip.ext.client
Class TCPIPEXTClientApplicationImpl

java.lang.Object
  extended by com.stc.connector.tcpip.model.client.TCPIPClientApplicationImpl
      extended by com.stc.connector.tcpip.ext.client.TCPIPEXTClientApplicationImpl
All Implemented Interfaces:
TCPIPEXTClientApplication, TCPIPClientApplication
Direct Known Subclasses:
HL7ClientApplicationImpl, HL7v3ClientApplicationImpl, TCPIPEXTServerApplicationImpl

public class TCPIPEXTClientApplicationImpl
extends TCPIPClientApplicationImpl
implements TCPIPEXTClientApplication, TCPIPClientApplication

This class implements the extended TCPIP client application interface.

Version:
cvs revision: $Revision: 1.23 $ Last Modified: $Date: 2008/04/23 07:18:13 $
Author:
Harry Liu

Field Summary
static java.lang.String version
           
 
Fields inherited from class com.stc.connector.tcpip.model.client.TCPIPClientApplicationImpl
defaultTimeout, mMonitorData
 
Constructor Summary
TCPIPEXTClientApplicationImpl()
          Default constructor for WSDL generation.
TCPIPEXTClientApplicationImpl(TCPIPApplicationConnection appConn, java.lang.String appName, TCPIPMonitorData aMonitorData)
          Constructor for TCPIPEXTClientApplicationImpl.
 
Method Summary
 AbstractMsg createBeginMarkerMsg()
          Creates a BeginMarkerMsg object based on the configuration information.
 AbstractMsg createEndMarkerMsg()
          Creates an EndMarkerMsg object based on the configuration information.
 NumberMsg createNumberMsg(byte[] number, int width)
          Creates a NumberMsg object which maybe used by the message sender and receiver.
 NumberMsg createNumberMsg(int number, int width)
          Creates a NumberMsg object which maybe used by the message sender and receiver.
 MessageInfoInterface getMessageInfo()
          Gets the message configuration information.
 byte[] readCertainLength(int len, boolean failOnTimeout)
          Read until certain length data is got.
 AbstractMsg readFixedLengthMsg(int len)
          Method readFixedLengthMsg.
 AbstractMsg readMsgBetweenMarkers(AbstractMsg beginMarker, AbstractMsg endMarker)
          Method readMsgBetweenMarkers.
 AbstractMsg readMsgUntilMarker_old(AbstractMsg marker)
          Method readMsgUntilMarker.
 AbstractMsg readMsgUntilMarker(AbstractMsg marker)
          Method readMsgUntilMarker.
 RepeatingMsg readRepeatingMsg(int occurs)
          Method readRepeatingMsg.
 AbstractMsg receiveAbstractMsg()
          receives an AbstractMsg
 BeginEndMarkedMsg receiveBeginEndMarkedMsg()
          receives a BeginEndMarkedMsg
 EnvelopedMsg receiveCustomEnvelopedMsg()
          receives a CustomEnvelopedMsg
 EndMarkedMsg receiveEndMarkedMsg()
          receives an EndMarkedMsg
 byte[] receiveEnvelopedMsg()
          Receives an EnvelopedMsg through the TCP/IP connection.
 FixedLengthMsg receiveFixedLengthMsg()
          receives a FixedLengthMsg
 LengthPrefixedMsg receiveLengthPrefixedMsg()
          receives a LengthPrefixedMsg
 MarkedAndFixedMsg receiveMarkedAndFixedMsg()
          receives a MarkedAndFixedMsg
 PerActiveConnectionMsg receivePerActiveConnectionMsg()
          receivesa PerActiveConnectionMsg
 void sendAbstractMsg(AbstractMsg msg)
          sends an AbstractMsg
 void sendBeginEndMarkedMsg(BeginEndMarkedMsg msg)
          sends a BeginEndMarkedMsg
 void sendCustomEnvelopedMsg(EnvelopedMsg msg)
          sends a CustomEnvelopedMsg
 void sendEndMarkedMsg(EndMarkedMsg msg)
          sends an EndMarkedMsg
 void sendEnvelopedMsg(byte[] msg)
          Sends an EnvelopedMsg through the TCP/IP connection.
 void sendFixedLengthMsg(FixedLengthMsg msg)
          sends a FixedLengthMsg
 void sendLengthPrefixedMsg(LengthPrefixedMsg msg)
          sends a LengthPrefixedMsg
 void sendMarkedAndFixedMsg(MarkedAndFixedMsg msg)
          sends a MarkedAndFixedMsg
 void sendPerActiveConnectionMsg(PerActiveConnectionMsg msg)
          sends a PerActiveConnectionMsg
 void setMessageInfo(MessageInfo messageInfo)
          Sets the messageInfo.
 
Methods inherited from class com.stc.connector.tcpip.model.client.TCPIPClientApplicationImpl
checkIfClosed, closeConnection, getApplicationConnection, getApplicationName, getCallingAdapter, getClientGeneralInfo, getLeftOverFromLastRead, getMaxDataSize, getMaxEmptyReadRetry, getMonitor, getResourceAdapter, getSocket, getSocketInfo, getState, getStateHandler, getTCPIPOutboundConfigInfo, getTimeToWaitForAResponse, isCalledByInbound, isClosed, isServerCloseNotification, isServerCloseNotification, isServerIdleTimeout, readFully, readFully, receiveBytes, receiveString, receiveString, sendBytes, sendString, sendString, setApplicationConnection, setApplicationName, setCalledByInbound, setCallingAdapter, setClientGeneralInfo, setLeftOverFromLastRead, setMaxDataSize, setSocketInfo, setState, setTCPIPOutboundConfigInfo, updateMBeanProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.stc.connector.appconn.tcpip.ext.TCPIPEXTClientApplication
closeConnection, getMaxDataSize, getSocket, getState, getTCPIPOutboundConfigInfo, isClosed, receiveBytes, receiveString, receiveString, sendBytes, sendString, sendString, setMaxDataSize, setState
 
Methods inherited from interface com.stc.connector.appconn.tcpip.model.TCPIPClientApplication
closeConnection, getMaxDataSize, getSocket, getState, getTCPIPOutboundConfigInfo, isClosed, receiveBytes, receiveString, receiveString, sendBytes, sendString, sendString, setMaxDataSize, setState
 

Field Detail

version

public static final java.lang.String version
See Also:
Constant Field Values
Constructor Detail

TCPIPEXTClientApplicationImpl

public TCPIPEXTClientApplicationImpl()
Default constructor for WSDL generation.


TCPIPEXTClientApplicationImpl

public TCPIPEXTClientApplicationImpl(TCPIPApplicationConnection appConn,
                                     java.lang.String appName,
                                     TCPIPMonitorData aMonitorData)
Constructor for TCPIPEXTClientApplicationImpl.

Parameters:
appConn - TCPIPApplicationConnection
appName - The applicatin name.
aMonitorData - The TCPIPMonitorData object
Method Detail

getMessageInfo

public MessageInfoInterface getMessageInfo()
                                    throws TCPIPApplicationException,
                                           java.io.IOException
Description copied from interface: TCPIPEXTClientApplication
Gets the message configuration information. You can change the message configuration dynamically at runtime through the returned instance.

Specified by:
getMessageInfo in interface TCPIPEXTClientApplication
Returns:
MessageInfo instance
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error
See Also:
TCPIPEXTClientApplication.getMessageInfo()

setMessageInfo

public void setMessageInfo(MessageInfo messageInfo)
Sets the messageInfo.

Parameters:
messageInfo - The messageInfo to set

receiveAbstractMsg

public AbstractMsg receiveAbstractMsg()
                               throws TCPIPApplicationException,
                                      java.io.IOException
receives an AbstractMsg

Throws:
TCPIPApplicationException
java.io.IOException

receiveEnvelopedMsg

public byte[] receiveEnvelopedMsg()
                           throws TCPIPApplicationException,
                                  java.io.IOException,
                                  TCPIPNoResponseException,
                                  TCPIPIncompleteDataException
Description copied from interface: TCPIPEXTClientApplication
Receives an EnvelopedMsg through the TCP/IP connection. The envelope settings (e.g. Envelope Type, Store Until Char, etc) will be from the configuration.
 This e*Way Can be configured to handle different kinds of
 envelopes. Each envelope needs to be configured according to its
 components.
 
 Supported Envelope Types:
 +-----------------------+---------------------------------------------------+
 | Length Prefixed       | {Data Length} {Data}                              |
 +-----------------------+---------------------------------------------------+
 | End Marked            | {Data} {End Block}                                |
 +-----------------------+---------------------------------------------------+
 | Begin-End Marked      | {Start Block} {Data} {End Block}                  |
 +-----------------------+---------------------------------------------------+
 | Fixed Length          | {Data}                                            |
 +-----------------------+---------------------------------------------------+
 | Per Active Connection | {Data}                                            |
 +-----------------------+---------------------------------------------------+
 | Marked & Fixed        | {Start Block} {Data} {Marker} {Fixed Length Data} |
 +-----------------------+---------------------------------------------------+
 | Custom                | Customer defines the structure                    |
 +-----------------------+---------------------------------------------------+
 
 
 Summary Of Envelopes And Their Dependencies:
 +-----------------------+---------------------------------------------------+
 | Length Prefixed       | Width Of Length                                   |
 |                       | Numeric Representation                            |
 +-----------------------+---------------------------------------------------+
 | End Marked            | Store Until Character                             |
 +-----------------------+---------------------------------------------------+
 | Begin-End Marked      | Store Until Character                             |
 |                       | Ignore Until Character                            |
 +-----------------------+---------------------------------------------------+
 | Fixed Length          | Bytes To Read                                     |
 +-----------------------+---------------------------------------------------+
 | Per Active Connection |                                                   |
 +-----------------------+---------------------------------------------------+
 | Marked & Fixed        | Store Until Character                             |
 |                       | Ignore Until Character                            |
 |                       | Bytes To Read                                     |
 +-----------------------+---------------------------------------------------+
 | Custom                | Customer Defined Property                         |
 +-----------------------+---------------------------------------------------+
 
 
 Length Prefixed
 ===============
 
 This envelope has the following structure:
 
         {Data Length} {Data}
 
 The Length component of this envelope indicates the length of the
 Data component. The length is represented in one of the allowed
 numeric representations.
 
 The Data component of the envelope is treated as a fixed length 
 Event.
 
 The 'Width Of Length' must also be specified for the e*Way to be
 able to understand the Length field.
 
 
 End Marked
 ==========
 
 This envelope has the following structure:
 
         {Data} {End Block}
 
 The End Block component of this envelope is the same as the Store
 Until configurable parameter.
 
 
 Begin-End Marked
 ================
 
 This envelope has the following structure:
 
         {Start Block} {Data} {End Block}
 
 The Start Block component of this envelope is the same as the 
 Ignore Until configurable parameter, and the End Block component 
 of this envelope is the same as the Store Until configurable 
 parameter.
 
 
 Fixed Length
 ============
 
 This envelope has the following structure:
 
         {Data} -------------------------------> Fixed Length
 
 This envelope is configured via the 'Bytes To Read' configurable
 parameter.  It is assumed that all the Events will be the same 
 length as specified in 'Bytes To Read'.
 
 
 Per Active Connection
 =====================
 
 This envelope has the following structure:
 
         {Data} -------------------------------> Per active connection
 
 The Event has no envelopes around it. The connection to the e*Way 
 is dropped by the external application after the Event has been 
 sent in entire.
 
 
 Marked & Fixed
 ==============
 
 This envelope has the following structure:
 
         {Start Block} {Data} {Marker} {Fixed Length Data}
 
 This envelope is similar to the Begin-End Marked envelope. it is
 configured via the Ignore Until, Store Until, and Bytes To Read
 configurable parameters.
 
 The Marker component in this envelope is the same as the Store 
 Until Configurable parameter. After reading the marker the e*Way 
 will read the rest of the envelope as specified in the Bytes To 
 Read parameter.
 
 
 Custom
 ======
 
 This envelope has not pre-defined structure. Customer is responsible for
 providing the structure and defining the behavior.
 
 

Specified by:
receiveEnvelopedMsg in interface TCPIPEXTClientApplication
Returns:
The message data.
 For following envelope types, only the message body without envelope will be returned:
     BeginEndMarked message
     EndMarked message
     FixedLength message
     LengthPrefixed message
     PerActiveConnection message
 
 For following envelope types, the entire message including body and envelope will be returned:
     MarkedAndFixed message
 
 
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error
TCPIPNoResponseException
TCPIPIncompleteDataException
See Also:
TCPIPEXTClientApplication.receiveEnvelopedMsg()

receiveBeginEndMarkedMsg

public BeginEndMarkedMsg receiveBeginEndMarkedMsg()
                                           throws TCPIPApplicationException,
                                                  java.io.IOException,
                                                  TCPIPNoResponseException,
                                                  TCPIPIncompleteDataException
receives a BeginEndMarkedMsg

Throws:
TCPIPApplicationException
java.io.IOException
TCPIPNoResponseException
TCPIPIncompleteDataException

receiveEndMarkedMsg

public EndMarkedMsg receiveEndMarkedMsg()
                                 throws TCPIPApplicationException,
                                        java.io.IOException,
                                        TCPIPNoResponseException,
                                        TCPIPIncompleteDataException
receives an EndMarkedMsg

Throws:
TCPIPApplicationException
java.io.IOException
TCPIPNoResponseException
TCPIPIncompleteDataException

receiveFixedLengthMsg

public FixedLengthMsg receiveFixedLengthMsg()
                                     throws TCPIPApplicationException,
                                            java.io.IOException,
                                            TCPIPNoResponseException,
                                            TCPIPIncompleteDataException
receives a FixedLengthMsg

Throws:
TCPIPApplicationException
java.io.IOException
TCPIPNoResponseException
TCPIPIncompleteDataException

receiveLengthPrefixedMsg

public LengthPrefixedMsg receiveLengthPrefixedMsg()
                                           throws TCPIPApplicationException,
                                                  java.io.IOException,
                                                  TCPIPNoResponseException,
                                                  TCPIPIncompleteDataException
receives a LengthPrefixedMsg

Throws:
TCPIPApplicationException
java.io.IOException
TCPIPNoResponseException
TCPIPIncompleteDataException

receiveMarkedAndFixedMsg

public MarkedAndFixedMsg receiveMarkedAndFixedMsg()
                                           throws TCPIPApplicationException,
                                                  java.io.IOException,
                                                  TCPIPNoResponseException,
                                                  TCPIPIncompleteDataException
receives a MarkedAndFixedMsg

Throws:
TCPIPApplicationException
java.io.IOException
TCPIPNoResponseException
TCPIPIncompleteDataException

receivePerActiveConnectionMsg

public PerActiveConnectionMsg receivePerActiveConnectionMsg()
                                                     throws TCPIPApplicationException,
                                                            java.io.IOException,
                                                            TCPIPNoResponseException,
                                                            TCPIPIncompleteDataException
receivesa PerActiveConnectionMsg

Throws:
TCPIPApplicationException
java.io.IOException
TCPIPNoResponseException
TCPIPIncompleteDataException

receiveCustomEnvelopedMsg

public EnvelopedMsg receiveCustomEnvelopedMsg()
                                       throws TCPIPApplicationException,
                                              java.io.IOException
receives a CustomEnvelopedMsg

Throws:
TCPIPApplicationException
java.io.IOException

sendAbstractMsg

public void sendAbstractMsg(AbstractMsg msg)
                     throws TCPIPApplicationException,
                            java.io.IOException
sends an AbstractMsg

Throws:
TCPIPApplicationException
java.io.IOException

sendEnvelopedMsg

public void sendEnvelopedMsg(byte[] msg)
                      throws TCPIPApplicationException,
                             java.io.IOException
Description copied from interface: TCPIPEXTClientApplication
Sends an EnvelopedMsg through the TCP/IP connection. The envelope settings (e.g. Envelope Type, Store Until Char, etc) will be from the configuration.
 This e*Way Can be configured to handle different kinds of
 envelopes. Each envelope needs to be configured according to its
 components.
 
 Supported Envelope Types:
 +-----------------------+---------------------------------------------------+
 | Length Prefixed       | {Data Length} {Data}                              |
 +-----------------------+---------------------------------------------------+
 | End Marked            | {Data} {End Block}                                |
 +-----------------------+---------------------------------------------------+
 | Begin-End Marked      | {Start Block} {Data} {End Block}                  |
 +-----------------------+---------------------------------------------------+
 | Fixed Length          | {Data}                                            |
 +-----------------------+---------------------------------------------------+
 | Per Active Connection | {Data}                                            |
 +-----------------------+---------------------------------------------------+
 | Marked & Fixed        | {Start Block} {Data} {Marker} {Fixed Length Data} |
 +-----------------------+---------------------------------------------------+
 | Custom                | Customer defines the structure                    |
 +-----------------------+---------------------------------------------------+
 
 
 Summary Of Envelopes And Their Dependencies:
 +-----------------------+---------------------------------------------------+
 | Length Prefixed       | Width Of Length                                   |
 |                       | Numeric Representation                            |
 +-----------------------+---------------------------------------------------+
 | End Marked            | Store Until Character                             |
 +-----------------------+---------------------------------------------------+
 | Begin-End Marked      | Store Until Character                             |
 |                       | Ignore Until Character                            |
 +-----------------------+---------------------------------------------------+
 | Fixed Length          | Bytes To Read                                     |
 +-----------------------+---------------------------------------------------+
 | Per Active Connection |                                                   |
 +-----------------------+---------------------------------------------------+
 | Marked & Fixed        | Store Until Character                             |
 |                       | Ignore Until Character                            |
 |                       | Bytes To Read                                     |
 +-----------------------+---------------------------------------------------+
 | Custom                | Customer Defined Property                         |
 +-----------------------+---------------------------------------------------+
 
 
 Length Prefixed
 ===============
 
 This envelope has the following structure:
 
         {Data Length} {Data}
 
 The Length component of this envelope indicates the length of the
 Data component. The length is represented in one of the allowed
 numeric representations.
 
 The Data component of the envelope is treated as a fixed length 
 Event.
 
 The 'Width Of Length' must also be specified for the e*Way to be
 able to understand the Length field.
 
 
 End Marked
 ==========
 
 This envelope has the following structure:
 
         {Data} {End Block}
 
 The End Block component of this envelope is the same as the Store
 Until configurable parameter.
 
 
 Begin-End Marked
 ================
 
 This envelope has the following structure:
 
         {Start Block} {Data} {End Block}
 
 The Start Block component of this envelope is the same as the 
 Ignore Until configurable parameter, and the End Block component 
 of this envelope is the same as the Store Until configurable 
 parameter.
 
 
 Fixed Length
 ============
 
 This envelope has the following structure:
 
         {Data} -------------------------------> Fixed Length
 
 This envelope is configured via the 'Bytes To Read' configurable
 parameter.  It is assumed that all the Events will be the same 
 length as specified in 'Bytes To Read'.
 
 
 Per Active Connection
 =====================
 
 This envelope has the following structure:
 
         {Data} -------------------------------> Per active connection
 
 The Event has no envelopes around it. The connection to the e*Way 
 is dropped by the external application after the Event has been 
 sent in entire.
 
 
 Marked & Fixed
 ==============
 
 This envelope has the following structure:
 
         {Start Block} {Data} {Marker} {Fixed Length Data}
 
 This envelope is similar to the Begin-End Marked envelope. it is
 configured via the Ignore Until, Store Until, and Bytes To Read
 configurable parameters.
 
 The Marker component in this envelope is the same as the Store 
 Until Configurable parameter. After reading the marker the e*Way 
 will read the rest of the envelope as specified in the Bytes To 
 Read parameter.
 
 
 Custom
 ======
 
 This envelope has not pre-defined structure. Customer is responsible for
 providing the structure and defining the behavior.
 
 

Specified by:
sendEnvelopedMsg in interface TCPIPEXTClientApplication
Parameters:
msg - The message to be sent
 For following envelope types, this byte array means message body without envelope:
     BeginEndMarked message
     EndMarked message
     FixedLength message
     LengthPrefixed message
     PerActiveConnection message
 
 For following envelope types, this byte array means the entire message including body and envelope:
     MarkedAndFixed message
 
 
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error
See Also:
TCPIPEXTClientApplication.sendEnvelopedMsg(byte[])

sendBeginEndMarkedMsg

public void sendBeginEndMarkedMsg(BeginEndMarkedMsg msg)
                           throws TCPIPApplicationException,
                                  java.io.IOException
sends a BeginEndMarkedMsg

Throws:
TCPIPApplicationException
java.io.IOException

sendEndMarkedMsg

public void sendEndMarkedMsg(EndMarkedMsg msg)
                      throws TCPIPApplicationException,
                             java.io.IOException
sends an EndMarkedMsg

Throws:
TCPIPApplicationException
java.io.IOException

sendFixedLengthMsg

public void sendFixedLengthMsg(FixedLengthMsg msg)
                        throws TCPIPApplicationException,
                               java.io.IOException
sends a FixedLengthMsg

Throws:
TCPIPApplicationException
java.io.IOException

sendLengthPrefixedMsg

public void sendLengthPrefixedMsg(LengthPrefixedMsg msg)
                           throws TCPIPApplicationException,
                                  java.io.IOException
sends a LengthPrefixedMsg

Throws:
TCPIPApplicationException
java.io.IOException

sendMarkedAndFixedMsg

public void sendMarkedAndFixedMsg(MarkedAndFixedMsg msg)
                           throws TCPIPApplicationException,
                                  java.io.IOException
sends a MarkedAndFixedMsg

Throws:
TCPIPApplicationException
java.io.IOException

sendPerActiveConnectionMsg

public void sendPerActiveConnectionMsg(PerActiveConnectionMsg msg)
                                throws TCPIPApplicationException,
                                       java.io.IOException
sends a PerActiveConnectionMsg

Throws:
TCPIPApplicationException
java.io.IOException

sendCustomEnvelopedMsg

public void sendCustomEnvelopedMsg(EnvelopedMsg msg)
                            throws TCPIPApplicationException,
                                   java.io.IOException
sends a CustomEnvelopedMsg

Throws:
TCPIPApplicationException
java.io.IOException

readFixedLengthMsg

public AbstractMsg readFixedLengthMsg(int len)
                               throws TCPIPApplicationException,
                                      java.io.IOException,
                                      TCPIPNoResponseException,
                                      TCPIPIncompleteDataException
Method readFixedLengthMsg.

Parameters:
len - The length
Returns:
AbstractMsg instance
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error
TCPIPNoResponseException
TCPIPIncompleteDataException

readCertainLength

public byte[] readCertainLength(int len,
                                boolean failOnTimeout)
                         throws TCPIPApplicationException,
                                java.io.IOException,
                                TCPIPNoResponseException,
                                TCPIPIncompleteDataException
Read until certain length data is got. If no enough data can be got, the exception will be thrown under one of the following conditions: - No more data (end of file) - Timeout As long as this method returns without exception, you actually get the certain length data. Note: If parameter failOnTimeout is false, it will continue to read even timeout happens; so the read will end with exception on condition of "no more data (EOF)"; otherwise, timeout may end the read with exception.

Parameters:
failOnTimeout - true or false
Returns:
A byte array.
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error
TCPIPNoResponseException
TCPIPIncompleteDataException

readRepeatingMsg

public RepeatingMsg readRepeatingMsg(int occurs)
                              throws TCPIPApplicationException,
                                     java.io.IOException,
                                     TCPIPNoResponseException,
                                     TCPIPIncompleteDataException
Method readRepeatingMsg.

Parameters:
occurs - The counter of repeating
Returns:
RepeatingMsg instance
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error
TCPIPNoResponseException
TCPIPIncompleteDataException

readMsgUntilMarker_old

public AbstractMsg readMsgUntilMarker_old(AbstractMsg marker)
                                   throws TCPIPApplicationException,
                                          java.io.IOException,
                                          TCPIPNoResponseException,
                                          TCPIPIncompleteDataException
Method readMsgUntilMarker. Read data until the marker is encountered. The data without the marker is returned as an AbstractMsg object. If it cannot reach the marker, the exception will be thrown.

Parameters:
marker - The marker AbstractMsg
Returns:
AbstractMsg The data without the marker
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error
TCPIPNoResponseException
TCPIPIncompleteDataException

readMsgUntilMarker

public AbstractMsg readMsgUntilMarker(AbstractMsg marker)
                               throws TCPIPApplicationException,
                                      java.io.IOException,
                                      TCPIPNoResponseException,
                                      TCPIPIncompleteDataException
Method readMsgUntilMarker. Read data until the marker is encountered. The data without the marker is returned as an AbstractMsg object. If it cannot reach the marker, the exception will be thrown.

Parameters:
marker - The marker AbstractMsg
Returns:
AbstractMsg The data without the marker
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error
TCPIPNoResponseException
TCPIPIncompleteDataException

readMsgBetweenMarkers

public AbstractMsg readMsgBetweenMarkers(AbstractMsg beginMarker,
                                         AbstractMsg endMarker)
                                  throws TCPIPApplicationException,
                                         java.io.IOException,
                                         TCPIPNoResponseException,
                                         TCPIPIncompleteDataException
Method readMsgBetweenMarkers. Read data between the begin marker and the end marker. If the begin marker is null, get the data until the end marker is encountered; If the begin marker is not null, get the data starting from the begin marker and until the end marker. The data without the marker is returned as an AbstractMsg object. If it cannot reach any of the markers, the exception will be thrown.

Parameters:
beginMarker - The begin marker (null means no begin marker).
endMarker - The end marker
Returns:
AbstractMsg The data without the marker(s)
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error
TCPIPNoResponseException
TCPIPIncompleteDataException

createBeginMarkerMsg

public AbstractMsg createBeginMarkerMsg()
                                 throws TCPIPApplicationException,
                                        java.io.IOException
Creates a BeginMarkerMsg object based on the configuration information.

Returns:
AbstractMsg object
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error

createEndMarkerMsg

public AbstractMsg createEndMarkerMsg()
                               throws TCPIPApplicationException,
                                      java.io.IOException
Creates an EndMarkerMsg object based on the configuration information.

Returns:
AbstractMsg object
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error

createNumberMsg

public NumberMsg createNumberMsg(int number,
                                 int width)
                          throws TCPIPApplicationException,
                                 java.io.IOException
Creates a NumberMsg object which maybe used by the message sender and receiver.

Parameters:
number - The number value
width - The width value
Returns:
NumberMsg object
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error

createNumberMsg

public NumberMsg createNumberMsg(byte[] number,
                                 int width)
                          throws TCPIPApplicationException,
                                 java.io.IOException
Creates a NumberMsg object which maybe used by the message sender and receiver.

Parameters:
number - The number value
width - The width value
Returns:
NumberMsg object
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error

Sun Adapter for TCP/IP HL7