Sun Adapter for TCP/IP HL7

com.stc.connector.tcpip.model.server
Class TCPIPServerApplicationImpl

java.lang.Object
  extended by com.stc.connector.tcpip.model.client.TCPIPClientApplicationImpl
      extended by com.stc.connector.tcpip.model.server.TCPIPServerApplicationImpl
All Implemented Interfaces:
TCPIPClientApplication, TCPIPServerApplication

public class TCPIPServerApplicationImpl
extends TCPIPClientApplicationImpl
implements TCPIPServerApplication

This class implements the TCPIP Server application interface.

Version:
cvs revision: $Revision: 1.15 $ Last Modified: $Date: 2008/04/23 07:15:21 $
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
TCPIPServerApplicationImpl()
          Default constructor for WSDL generation.
TCPIPServerApplicationImpl(TCPIPServerApplicationConnection serverAppConn, java.lang.String appName, TCPIPMonitorData aMonitorData)
          Creates a new instance of TCPIPServerApplicationImpl
 
Method Summary
protected  void checkIfClosed()
          Checks whether the application connection was closed.
 void closeConnection()
          Closes the existing connection physically (no matter it is good or bad).
 boolean getDedicatedSessionMode()
          Returns the dedicatedSessionMode.
 byte[] getLeftOverFromLastRead()
           
 int getMaxDataSize()
          Returns the maxDataSize.
 com.stc.connector.management.util.ObjectReference getMonitor()
           
 javax.resource.spi.ResourceAdapter getResourceAdapter()
          Method getResourceAdapter.
 TCPIPServerApplicationConnection getServerApplicationConnection()
          Gets the TCPIP server application connection which created this instance of TCPIPServerApplication.
 TCPIPServerGeneralInfo getServerGeneralInfo()
          Returns the TCPIPServerGeneralInfo instance.
 TCPIPServerScheduleInfo getServerScheduleInfo()
          Returns the TCPIPServerScheduleInfo instance.
 TCPIPServerSocketInfo getServerSocketInfo()
          Returns the TCPIPServerSocketInfo instance.
 java.net.Socket getSocket()
          Returns the underlying java.net.Socket instance which the e*Way relys on.
 java.lang.String getState()
          Returns the State which is set by user.
 StateHandler getStateHandler()
          Returns the stateHandler.
 TCPIPServerConfigInfoInterface getTCPIPInboundConfigInfo()
          Returns an object which represents the base TCP/IP inbound configuration information.
 boolean isClosed()
          Checks whether the connection is closed.
 boolean isServerCloseNotification(java.lang.String closeCommand)
          Returns true if the data which the server receives represents the close notification.
 void setDedicatedSessionMode(boolean dedicatedSessionMode)
          Sets the dedicatedSessionMode.
 void setLeftOverFromLastRead(byte[] bs)
           
 void setMaxDataSize(int maxDataSize)
          Sets the maxDataSize.
 void setServerApplicationConnection(TCPIPServerApplicationConnection serverAppConn)
          Sets the TCPIP application connection.
 void setServerGeneralInfo(TCPIPServerGeneralInfo serverGeneralInfo)
           
 void setServerScheduleInfo(TCPIPServerScheduleInfo serverScheduleInfo)
          Method setServerScheduleInfo.
 void setServerSocketInfo(TCPIPServerSocketInfo serverSocketInfo)
          Method setServerSocketInfo.
 void setState(java.lang.String stateValue)
          Sets State.
 void setTCPIPInboundConfigInfo(TCPIPServerConfigInfo inboundConfigInfo)
           
 void updateMBeanProperty(java.lang.String propertyName, java.lang.String propertyDisplayValue)
          Updates certain RA MBean property with the specified value.
 
Methods inherited from class com.stc.connector.tcpip.model.client.TCPIPClientApplicationImpl
getApplicationConnection, getApplicationName, getCallingAdapter, getClientGeneralInfo, getMaxEmptyReadRetry, getSocketInfo, getTCPIPOutboundConfigInfo, getTimeToWaitForAResponse, isCalledByInbound, isServerCloseNotification, isServerIdleTimeout, readFully, readFully, receiveBytes, receiveString, receiveString, sendBytes, sendString, sendString, setApplicationConnection, setApplicationName, setCalledByInbound, setCallingAdapter, setClientGeneralInfo, setSocketInfo, setTCPIPOutboundConfigInfo
 
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.model.TCPIPServerApplication
receiveBytes, receiveString, receiveString, sendBytes, sendString, sendString
 

Field Detail

version

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

TCPIPServerApplicationImpl

public TCPIPServerApplicationImpl()
Default constructor for WSDL generation.


TCPIPServerApplicationImpl

public TCPIPServerApplicationImpl(TCPIPServerApplicationConnection serverAppConn,
                                  java.lang.String appName,
                                  TCPIPMonitorData aMonitorData)
Creates a new instance of TCPIPServerApplicationImpl

Parameters:
serverAppConn - The TCPIPServerApplicationConnection which created this instance of application.
appName - The applicatin name.
aMonitorData - The TCPIPMonitorData object
Method Detail

isClosed

public boolean isClosed()
                 throws TCPIPApplicationException
Description copied from interface: TCPIPClientApplication
Checks whether the connection is closed.

Specified by:
isClosed in interface TCPIPClientApplication
Specified by:
isClosed in interface TCPIPServerApplication
Overrides:
isClosed in class TCPIPClientApplicationImpl
Returns:
boolean Represents the status of the connection
Throws:
TCPIPApplicationException - on error
See Also:
TCPIPClientApplication.isClosed()

closeConnection

public void closeConnection()
                     throws TCPIPApplicationException
Description copied from interface: TCPIPClientApplication
Closes the existing connection physically (no matter it is good or bad). Once the connection is closed, any action over this connection will be invalid and will get exception.

Specified by:
closeConnection in interface TCPIPClientApplication
Specified by:
closeConnection in interface TCPIPServerApplication
Overrides:
closeConnection in class TCPIPClientApplicationImpl
Throws:
TCPIPApplicationException - on error
See Also:
TCPIPClientApplication.closeConnection()

getSocket

public java.net.Socket getSocket()
                          throws TCPIPApplicationException,
                                 java.io.IOException
Description copied from interface: TCPIPClientApplication
Returns the underlying java.net.Socket instance which the e*Way relys on. 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.*.

Specified by:
getSocket in interface TCPIPClientApplication
Specified by:
getSocket in interface TCPIPServerApplication
Overrides:
getSocket in class TCPIPClientApplicationImpl
Returns:
Socket instance
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error
See Also:
TCPIPClientApplication.getSocket()

getTCPIPInboundConfigInfo

public TCPIPServerConfigInfoInterface getTCPIPInboundConfigInfo()
Description copied from interface: TCPIPServerApplication
Returns an object which represents the base TCP/IP inbound configuration information.

Specified by:
getTCPIPInboundConfigInfo in interface TCPIPServerApplication
Returns:
TCPIPServerConfigInfo object
See Also:
TCPIPServerApplication.getTCPIPInboundConfigInfo()

setTCPIPInboundConfigInfo

public void setTCPIPInboundConfigInfo(TCPIPServerConfigInfo inboundConfigInfo)
Parameters:
inboundConfigInfo -

getServerGeneralInfo

public TCPIPServerGeneralInfo getServerGeneralInfo()
Returns the TCPIPServerGeneralInfo instance.

Returns:
TCPIPServerGeneralInfo instance

setServerGeneralInfo

public void setServerGeneralInfo(TCPIPServerGeneralInfo serverGeneralInfo)
Parameters:
serverGeneralInfo - the value to be set

getServerSocketInfo

public TCPIPServerSocketInfo getServerSocketInfo()
Returns the TCPIPServerSocketInfo instance.

Returns:
TCPIPServerSocketInfo instance

setServerSocketInfo

public void setServerSocketInfo(TCPIPServerSocketInfo serverSocketInfo)
Method setServerSocketInfo.

Parameters:
serverSocketInfo - the value to be set

getServerScheduleInfo

public TCPIPServerScheduleInfo getServerScheduleInfo()
Returns the TCPIPServerScheduleInfo instance.

Returns:
TCPIPServerScheduleInfo instance

setServerScheduleInfo

public void setServerScheduleInfo(TCPIPServerScheduleInfo serverScheduleInfo)
Method setServerScheduleInfo.

Parameters:
serverScheduleInfo - the value to be set

checkIfClosed

protected void checkIfClosed()
                      throws TCPIPApplicationException
Description copied from class: TCPIPClientApplicationImpl
Checks whether the application connection was closed. If closed then an TCPIPApplicationException is thrown.

Overrides:
checkIfClosed in class TCPIPClientApplicationImpl
Throws:
TCPIPApplicationException - if the Application Connection associated with this application was already closed.
See Also:
TCPIPClientApplicationImpl.checkIfClosed()

getServerApplicationConnection

public TCPIPServerApplicationConnection getServerApplicationConnection()
Gets the TCPIP server application connection which created this instance of TCPIPServerApplication.

Returns:
TCPIPServerApplicationConnection instance.

setServerApplicationConnection

public void setServerApplicationConnection(TCPIPServerApplicationConnection serverAppConn)
Sets the TCPIP application connection.


getResourceAdapter

public javax.resource.spi.ResourceAdapter getResourceAdapter()
Description copied from class: TCPIPClientApplicationImpl
Method getResourceAdapter.

Overrides:
getResourceAdapter in class TCPIPClientApplicationImpl
Returns:
ResourceAdapter
See Also:
TCPIPClientApplicationImpl.getResourceAdapter()

getStateHandler

public StateHandler getStateHandler()
                             throws TCPIPApplicationException
Description copied from class: TCPIPClientApplicationImpl
Returns the stateHandler.

Overrides:
getStateHandler in class TCPIPClientApplicationImpl
Returns:
StateHandler
Throws:
TCPIPApplicationException - up on error
See Also:
TCPIPClientApplicationImpl.getStateHandler()

getState

public java.lang.String getState()
                          throws TCPIPApplicationException
Description copied from interface: TCPIPClientApplication
Returns the State which is set by user. 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.

Specified by:
getState in interface TCPIPClientApplication
Specified by:
getState in interface TCPIPServerApplication
Overrides:
getState in class TCPIPClientApplicationImpl
Returns:
The state value.
Throws:
TCPIPApplicationException - on error
See Also:
TCPIPClientApplication.getState()

setState

public void setState(java.lang.String stateValue)
              throws TCPIPApplicationException
Description copied from interface: TCPIPClientApplication
Sets State. 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.

Specified by:
setState in interface TCPIPClientApplication
Specified by:
setState in interface TCPIPServerApplication
Overrides:
setState in class TCPIPClientApplicationImpl
Parameters:
stateValue - The state value to set
Throws:
TCPIPApplicationException - on error
See Also:
com.stc.connector.appconn.tcpip.model.TCPIPClientApplication#setState()

getMaxDataSize

public int getMaxDataSize()
Description copied from interface: TCPIPClientApplication
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).

Specified by:
getMaxDataSize in interface TCPIPClientApplication
Specified by:
getMaxDataSize in interface TCPIPServerApplication
Overrides:
getMaxDataSize in class TCPIPClientApplicationImpl
Returns:
The max size of data that can be held.
See Also:
TCPIPClientApplication.getMaxDataSize()

setMaxDataSize

public void setMaxDataSize(int maxDataSize)
                    throws TCPIPApplicationException
Description copied from interface: TCPIPClientApplication
Sets 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).

Specified by:
setMaxDataSize in interface TCPIPClientApplication
Specified by:
setMaxDataSize in interface TCPIPServerApplication
Overrides:
setMaxDataSize in class TCPIPClientApplicationImpl
Parameters:
maxDataSize - The maxDataSize to set
Throws:
TCPIPApplicationException - on error
See Also:
TCPIPClientApplication.setMaxDataSize(int)

getDedicatedSessionMode

public boolean getDedicatedSessionMode()
Description copied from interface: TCPIPServerApplication
Returns the dedicatedSessionMode. The dedicatedSessionMode means that the server socket (on some port) may serve single client request (the first one connected) at the same time. See documentation for detail.

Specified by:
getDedicatedSessionMode in interface TCPIPServerApplication
Returns:
true or false
See Also:
TCPIPServerApplication.getDedicatedSessionMode()

setDedicatedSessionMode

public void setDedicatedSessionMode(boolean dedicatedSessionMode)
Description copied from interface: TCPIPServerApplication
Sets the dedicatedSessionMode. The dedicatedSessionMode means that the server socket (on some port) may serve single client request (the first one connected) at the same time. See documentation for detail.

Specified by:
setDedicatedSessionMode in interface TCPIPServerApplication
Parameters:
dedicatedSessionMode - The dedicatedSessionMode to set
See Also:
TCPIPServerApplication.setDedicatedSessionMode(boolean)

isServerCloseNotification

public boolean isServerCloseNotification(java.lang.String closeCommand)
                                  throws TCPIPApplicationException
Description copied from class: TCPIPClientApplicationImpl
Returns true if the data which the server receives represents the close notification.

Overrides:
isServerCloseNotification in class TCPIPClientApplicationImpl
Returns:
Throws:
TCPIPApplicationException
See Also:
TCPIPClientApplicationImpl.isServerCloseNotification(String)

getLeftOverFromLastRead

public byte[] getLeftOverFromLastRead()
Overrides:
getLeftOverFromLastRead in class TCPIPClientApplicationImpl
Returns:
See Also:
TCPIPClientApplicationImpl.getLeftOverFromLastRead()

setLeftOverFromLastRead

public void setLeftOverFromLastRead(byte[] bs)
Overrides:
setLeftOverFromLastRead in class TCPIPClientApplicationImpl
See Also:
TCPIPClientApplicationImpl.setLeftOverFromLastRead(byte[])

updateMBeanProperty

public void updateMBeanProperty(java.lang.String propertyName,
                                java.lang.String propertyDisplayValue)
Description copied from class: TCPIPClientApplicationImpl
Updates certain RA MBean property with the specified value.

Overrides:
updateMBeanProperty in class TCPIPClientApplicationImpl
See Also:
TCPIPClientApplicationImpl.updateMBeanProperty(java.lang.String, java.lang.String)

getMonitor

public com.stc.connector.management.util.ObjectReference getMonitor()
Overrides:
getMonitor in class TCPIPClientApplicationImpl
Returns:
EwayConnection's Monitor
See Also:
TCPIPClientApplicationImpl.getMonitor()

Sun Adapter for TCP/IP HL7