Sun Adapter for TCP/IP HL7

com.stc.connector.appconn.tcpip.hl7
Interface HL7v3ClientApplication

All Known Implementing Classes:
HL7v3ClientApplicationImpl, HL7v3ServerApplicationImpl

public interface HL7v3ClientApplication

This interface represents the HL7v3 client application upon TCP/IP connection.

Version:
cvs revision: $Revision: 1.1 $ Last Modified: $Date: 2007/12/14 10:20:11 $
Author:
Nageswara Samudrala

Field Summary
static java.lang.String version
           
 
Method Summary
 void closeConnection()
          Closes the existing connection physically (whether it is good or bad).
 HL7v3AppMessage getHL7Message()
          Returns an object which is used as a HL7v3.0 specific message/function holder.
 HL7v3MessageInfoInterface getHL7v3MessageInfo()
          Returns an object which represents the HL7v3.0 specific configuration information.
 int getMaxDataSize()
          Returns the maxDataSize.
 java.net.Socket getSocket()
          Returns the underlying java.net.Socket instance on which the eWay relys.
 java.lang.String getState()
          Returns the State that is set by user.
 TCPIPClientConfigInfoInterface getTCPIPOutboundConfigInfo()
          Returns an object which represents the base TCP/IP Outbound configuration information.
 boolean isClosed()
          Checks to see if the connection is closed.
 byte[] receiveBytes()
          Reads all available data on the TCP/IP connection.
 java.lang.String receiveString()
          Reads all of the available data on TCP/IP connection.
 java.lang.String receiveString(java.lang.String encoding)
          Reads all available data on the TCP/IP connection.
 void sendBytes(byte[] bytes)
          Sends a byte array through the TCP/IP connection.
 void sendString(java.lang.String str)
          Sends a String with JVM default encoding through the TCP/IP connection.
 void sendString(java.lang.String str, java.lang.String encoding)
          Sends a String with the specified encoding through the TCP/IP connection.
 void setMaxDataSize(int maxDataSize)
          Sets the maxDataSize.
 void setState(java.lang.String stateValue)
          Sets the State.
 

Field Detail

version

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

getHL7Message

HL7v3AppMessage getHL7Message()
                              throws HL7ApplicationException
Returns an object which is used as a HL7v3.0 specific message/function holder.

Parameters:
None.

Returns:
HL7v3AppMessage - Object.
Throws:
HL7ApplicationException - Thrown upon error.
HL7ApplicationException

getHL7v3MessageInfo

HL7v3MessageInfoInterface getHL7v3MessageInfo()
                                              throws HL7ApplicationException
Returns an object which represents the HL7v3.0 specific configuration information.

Parameters:
None.

Returns:
HL7v3MessageInfo - Object.
Throws:
HL7ApplicationException - Thrown upon error.
HL7ApplicationException

getTCPIPOutboundConfigInfo

TCPIPClientConfigInfoInterface getTCPIPOutboundConfigInfo()
Returns an object which represents the base TCP/IP Outbound configuration information.

Parameters:
None.

Returns:
TCPIPClientConfigInfo - Object.
Throws:
None.

isClosed

boolean isClosed()
                 throws TCPIPApplicationException,
                        java.io.IOException
Checks to see if the connection is closed.

Parameters:
None.

Returns:
Boolean - Represents the status of the connection.
Throws:
TCPIPApplicationException - Thrown upon error.
IOException - Thrown upon i/o error.
TCPIPApplicationException
java.io.IOException

closeConnection

void closeConnection()
                     throws TCPIPApplicationException,
                            java.io.IOException
Closes the existing connection physically (whether it is good or bad). Once the connection is closed, any action over this connection will be invalid and will get exception.

Parameters:
None.

Throws:
TCPIPApplicationException - Thrown upon error.
IOException - Thrown upon i/o error.
TCPIPApplicationException
java.io.IOException

getSocket

java.net.Socket getSocket()
                          throws TCPIPApplicationException,
                                 java.io.IOException
Returns the underlying java.net.Socket instance on which the eWay relys. Socket operations can be perform through the returned Socket instance. Also, you can query/change some socket options dynamically at runtime through the corresponding getters/setters of the returned Socket instance. For more details, please refer the JDK javedoc on java.net.*.

Parameters:
None.

Returns:
Socket - The java.net.Socket instance.
Throws:
TCPIPApplicationException - Thrown upon error.
IOException - Thrown upon i/o error.
TCPIPApplicationException
java.io.IOException

getMaxDataSize

int getMaxDataSize()
Returns the maxDataSize. This size defines the maximum amount of data that the programs can hold internally. The valid range is from 1 to 2GB (the max value of the java integer).

Parameters:
None.

Returns:
int - The max size of data that can be held.
Throws:
None.

setMaxDataSize

void setMaxDataSize(int maxDataSize)
                    throws TCPIPApplicationException
Sets the maxDataSize. Defines the maximum amount of data that the programs can hold internally. The valid range is from 1 to 2GB (the max value of the java integer).

Parameters:
maxDataSize - The maxDataSize to set.
Throws:
TCPIPApplicationException - Thrown upon error.
TCPIPApplicationException

getState

java.lang.String getState()
                          throws TCPIPApplicationException
Returns the State that is set by user. The user uses this state to keep track of the progress of the Business Rules. The state has the same life cycle as the resource adapter; that is, it is attached with the resource adapter. Once you set the state, its value will be kept during the entire life cycle of the resource adapter.

Parameters:
None.

Returns:
String - The state value.
Throws:
TCPIPApplicationException - Thrown upon error.
TCPIPApplicationException

setState

void setState(java.lang.String stateValue)
              throws TCPIPApplicationException
Sets the State. The state is used to keep track of the progress of the Business Rules. The state has the same life cycle as the resource adapter; that is, it is attached with the resource adapter. Once you set the state, its value will be kept during the entire life cycle of the resource adapter.

Parameters:
stateValue - The state value to set.
Throws:
TCPIPApplicationException - Thrown upon error.
TCPIPApplicationException

receiveString

java.lang.String receiveString()
                               throws TCPIPApplicationException,
                                      java.io.IOException
Reads all of the available data on TCP/IP connection. Returns a String object with JVM default encoding.

The following are the end conditions of the read operation:

Once one of the above conditions are in effect, the attempted reading gracefully stops and all data is returned. An empty string "" is returned if no data is received.

Parameters:
None.

Returns:
String - Object.
Throws:
TCPIPApplicationException - Thrown upon error
IOException - Thrown upon i/o error
TCPIPApplicationException
java.io.IOException

receiveString

java.lang.String receiveString(java.lang.String encoding)
                               throws TCPIPApplicationException,
                                      java.io.IOException
Reads all available data on the TCP/IP connection. Returns a String object with specified encoding.

The following are the end conditions of the read operation:

Once one of the above conditions are in effect, the attempted reading gracefully stops and all data is returned. An empty string "" is returned if no data is received.

Parameters:
encoding - The encoding charset name.
Returns:
String Object.
Throws:
TCPIPApplicationException - Thrown upon error.
IOException - Thrown upon i/o error.
TCPIPApplicationException
java.io.IOException

receiveBytes

byte[] receiveBytes()
                    throws TCPIPApplicationException,
                           java.io.IOException
Reads all available data on the TCP/IP connection. Returns a byte array.

The following are the end conditions of the read operation:

Once one of the above conditions are in effect, the attempted reading gracefully stops and all data is returned. A zero-length byte array is returned if no data is received.

Parameters:
None.

Returns:
byte[] - A byte array.
Throws:
TCPIPApplicationException - Thrown upon error.
IOException - Thrown upon i/o error.
TCPIPApplicationException
java.io.IOException

sendString

void sendString(java.lang.String str)
                throws TCPIPApplicationException,
                       java.io.IOException
Sends a String with JVM default encoding through the TCP/IP connection.

Parameters:
str - A String to send.
Throws:
TCPIPApplicationException - Thrown upon error.
IOException - Thrown upon i/o error.
TCPIPApplicationException
java.io.IOException

sendString

void sendString(java.lang.String str,
                java.lang.String encoding)
                throws TCPIPApplicationException,
                       java.io.IOException
Sends a String with the specified encoding through the TCP/IP connection.

Parameters:
str - A String to send.
encoding - The encoding charset name.
Throws:
TCPIPApplicationException - Thrown upon error.
IOException - Thrown upon i/o error.
TCPIPApplicationException
java.io.IOException

sendBytes

void sendBytes(byte[] bytes)
               throws TCPIPApplicationException,
                      java.io.IOException
Sends a byte array through the TCP/IP connection.

Parameters:
bytes - A byte array to send.
Throws:
TCPIPApplicationException - Thrown upon error.
IOException - Thrown upon i/o error.
TCPIPApplicationException
java.io.IOException

Sun Adapter for TCP/IP HL7