Sun Adapter for TCP/IP HL7

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

All Known Implementing Classes:
HL7ServerApplicationImpl

public interface HL7ServerApplication

This interface represents the HL7 server application upon TCP/IP connection.

Version:
cvs revision: $Revision: 1.8 $ Last Modified: $Date: 2005/09/03 06:28:19 $
Author:
Harry Liu

Field Summary
static java.lang.String version
           
 
Method Summary
 void closeConnection()
          Closes the server application connection.
 boolean getDedicatedSessionMode()
          Returns the dedicatedSessionMode.
 HL7AppMessage getHL7Message()
          Returns an object used as an HL7 specific message/function holder.
 HL7MessageInfoInterface getHL7MessageInfo()
          Returns an object which represents the HL7 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 which is set by user.
 TCPIPServerConfigInfoInterface getTCPIPInboundConfigInfo()
          Returns an object that represents the base TCP/IP Inbound configuration information.
 boolean isClosed()
          Checks whether the connection is closed.
 byte[] receiveBytes()
          Reads all data available on the TCP/IP connection.
 java.lang.String receiveString()
          Reads all data which is available on TCP/IP connection.
 java.lang.String receiveString(java.lang.String encoding)
          Reads all data which is available on 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 the 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 setDedicatedSessionMode(boolean dedicatedSessionMode)
          Sets the dedicatedSessionMode.
 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

HL7AppMessage getHL7Message()
                            throws HL7ApplicationException
Returns an object used as an HL7 specific message/function holder.

Parameters:
None.

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

getHL7MessageInfo

HL7MessageInfoInterface getHL7MessageInfo()
                                          throws HL7ApplicationException
Returns an object which represents the HL7 specific configuration information.

Parameters:
None.

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

getSocket

java.net.Socket getSocket()
                          throws TCPIPApplicationException,
                                 java.io.IOException
Returns the underlying java.net.Socket instance on which the eWay relys. You can perform Socket operations 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 max size of data which the programs can hold internally. The valid range is from 1 to 2GB (the max value of 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.. This size defines the max size of data that the programs can hold internally. The valid range is from 1 to 2GB (the max value of java integer).

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

getState

java.lang.String getState()
                          throws TCPIPApplicationException
Returns the State which is set by user. The user can use this state to keep track the progress of the Business Rules. This state has 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 whole 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 user can use this state to keep track the progress of the Business Rules. This state has 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 whole 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 data which is available 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 is in effect, the reading attempt gracefully stops and all data is returned. An empty string "" is returned if no any 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 data which is available on 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 is in effect, the reading attempt gracefully stops and all data is returned. An empty string "" is returned if no any 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 data available 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 reading attempt gracefully stops and all data is returned. A zero-length byte array will be returned if no any 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 the 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

isClosed

boolean isClosed()
                 throws TCPIPApplicationException
Checks whether the connection is closed.

Parameters:
None.

Returns:
Boolean - Represents the status of the connection.
Throws:
TCPIPApplicationException - Thrown upon error.
TCPIPApplicationException

closeConnection

void closeConnection()
                     throws TCPIPApplicationException
Closes the server application connection. Once the connection is closed, any action over this connection is invalid and throws an exception.

Parameters:
None.

Throws:
TCPIPApplicationException - Thrown upon error.
TCPIPApplicationException

getDedicatedSessionMode

boolean getDedicatedSessionMode()
Returns the dedicatedSessionMode. The dedicatedSessionMode means that the server socket (on some port) may serve a single client request (the first one connected) at the same time. See the eWay documentation for detail.

Parameters:
None.

Returns:
Boolean - Returns true or false.
Throws:
None.

setDedicatedSessionMode

void setDedicatedSessionMode(boolean dedicatedSessionMode)
Sets the dedicatedSessionMode. The dedicatedSessionMode means that the server socket (on some port) may serve a single client request (the first one connected) at the same time. See the eWay documentation for detail.

Parameters:
dedicatedSessionMode - The dedicatedSessionMode to set.

getTCPIPInboundConfigInfo

TCPIPServerConfigInfoInterface getTCPIPInboundConfigInfo()
Returns an object that represents the base TCP/IP Inbound configuration information.

Parameters:
None.

Returns:
TCPIPServerConfigInfo - Object.
Throws:
None.

Sun Adapter for TCP/IP HL7