Sun Adapter for TCP/IP HL7

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

java.lang.Object
  extended by com.stc.connector.tcpip.model.server.TCPIPServerSocketInfo
All Implemented Interfaces:
TCPIPServerSocketInfoInterface

public class TCPIPServerSocketInfo
extends java.lang.Object
implements TCPIPServerSocketInfoInterface

This class represents TCPIP ServerSocket configuration information. Basically, it represents the options of java ServerSocket and Socket. Note: Once the ServerSocket connection is established, the port and socketFactoryImplClassName are not allowed to change.

Version:
cvs revision: $Revision: 1.15 $ Last Modified: $Date: 2008/04/23 07:15:26 $
Author:
Harry Liu

Field Summary
static java.lang.String CONNECTION_TYPE_CLIENT
           
static java.lang.String CONNECTION_TYPE_SERVER
           
static java.lang.String INBOUND_TRIGGER_EVENT_ON_CONNECTION
           
static java.lang.String INBOUND_TRIGGER_EVENT_ON_MESSAGE
           
static java.lang.String version
           
 
Constructor Summary
TCPIPServerSocketInfo()
          Constructor for TCPIPServerSocketInfo.
TCPIPServerSocketInfo(com.stc.connector.framework.util.ConfigurationHelper aConfiguration)
          Constructor for TCPIPServerSocketInfo.
 
Method Summary
 void attachServerSocket(java.net.ServerSocket attachedServerSocket)
          Attach a serverSocket object so the serverSocket options can be refreshed along with serverSocketInfo changes.
 void attachSocket(java.net.Socket attachedSocket)
          Attach a socket object so the socket options can be refreshed along with socketInfo changes.
 java.net.ServerSocket getAttachedServerSocket()
          Returns the attachedServerSocket.
 java.net.Socket getAttachedSocket()
          Returns the attachedSocket.
 int getBacklog()
          Returns the backlog which is the maximum length of the queue.
 TCPIPSocketEstablishmentInfoInterface getClientConnectionEstablishmentInfo()
           
 java.lang.String getConnectionID()
          Returns the connectionID.
 java.lang.String getConnectionType()
           
 boolean getCreateConnection()
          Returns the createConnection setting (true or false).
 java.lang.String getHost()
          Returns the host.
 TCPIPServerConnectionManagementInfoInterface getInboundConnectionManagementInfo()
           
 java.lang.String getInboundTriggerEvent()
           
 com.stc.connector.framework.util.ConfigurationHelper getInitPropertiesInfo()
          Returns the initial configuration.
 int getReceiveBufferSize()
          Returns the receiveBufferSize.
 int getSendBufferSize()
          Returns the sendBufferSize.
 int getServerPort()
          Returns the serverPort.
 TCPIPServerPortBindingInfoInterface getServerPortBindingInfo()
           
 java.lang.String getServerSocketFactoryImplClassName()
          Returns the serverSocketFactoryImplClassName.
 int getServerSoTimeout()
          Returns the server soTimeout.
 java.lang.String getServerWelcomeMessage()
           
 int getSoLingerTimeout()
          Returns the soLingerTimeout.
 int getSoTimeout()
          Returns the soTimeout.
 boolean isClientConnectionType()
           
 boolean isKeepAlive()
          Checks whether the keepAlive option is on.
 boolean isOnConnectionInboundTriggerEvent()
           
 boolean isOnMessageInboundTriggerEvent()
           
 boolean isServerConnectionType()
           
 boolean isSocketConnected()
          Returns the socketConnected.
 boolean isSoLinger()
          Checks whether the SoLinger option is on.
 boolean isTcpNoDelay()
          Checks whether the TcpNoDelay option is on.
 boolean isThereAttachedServerSocket()
          Method isThereAttachedServerSocket.
 boolean isThereAttachedSocket()
          Method isThereAttachedSocket.
 void setBacklog(int backlog)
          Sets the backlog which is the maximum length of the queue.
 void setClientConnectionEstablishmentInfo(TCPIPSocketEstablishmentInfo info)
           
 void setConnectionID(java.lang.String connectionID)
          Sets the connectionID.
 void setConnectionType(java.lang.String connectionType)
           
 void setCreateConnection(boolean createConnection)
          Sets the createConnection.
 void setHost(java.lang.String host)
          Sets the host.
 void setInboundConnectionManagementInfo(TCPIPServerConnectionManagementInfo info)
           
 void setInboundTriggerEvent(java.lang.String inboundTriggerEvent)
           
 void setKeepAlive(boolean keepAlive)
          Sets the keepAlive.
 void setReceiveBufferSize(int receiveBufferSize)
          Sets the receiveBufferSize.
 void setSendBufferSize(int sendBufferSize)
          Sets the sendBufferSize.
 void setServerPort(int port)
          Sets the server port.
 void setServerPortBindingInfo(TCPIPServerPortBindingInfo info)
           
 void setServerSocketFactoryImplClassName(java.lang.String serverSocketFactoryImplClassName)
          Sets the serverSocketFactoryImplClassName.
 void setServerSoTimeout(int soTimeout)
          Sets the server soTimeout.
 void setServerWelcomeMessage(java.lang.String string)
           
 void setSocketConnected()
          Sets the socketConnected to true.
 void setSoLinger(boolean soLinger)
          Sets the soLinger.
 void setSoLingerTimeout(int soLingerTimeout)
          Sets the soLingerTimeout.
 void setSoTimeout(int soTimeout)
          Sets the soTimeout.
 void setTcpNoDelay(boolean tcpNoDelay)
          Sets the tcpNoDelay.
 void validate()
          Validates the socket configuration settings.
 void validate(java.lang.String integrationServerType)
          Validates the socket configuration settings against the integrationServerType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

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

CONNECTION_TYPE_SERVER

public static final java.lang.String CONNECTION_TYPE_SERVER
See Also:
Constant Field Values

CONNECTION_TYPE_CLIENT

public static final java.lang.String CONNECTION_TYPE_CLIENT
See Also:
Constant Field Values

INBOUND_TRIGGER_EVENT_ON_CONNECTION

public static final java.lang.String INBOUND_TRIGGER_EVENT_ON_CONNECTION
See Also:
Constant Field Values

INBOUND_TRIGGER_EVENT_ON_MESSAGE

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

TCPIPServerSocketInfo

public TCPIPServerSocketInfo()
                      throws TCPIPApplicationException
Constructor for TCPIPServerSocketInfo.

Throws:
TCPIPApplicationException - on error.

TCPIPServerSocketInfo

public TCPIPServerSocketInfo(com.stc.connector.framework.util.ConfigurationHelper aConfiguration)
                      throws TCPIPApplicationException
Constructor for TCPIPServerSocketInfo.

Parameters:
aConfiguration - The initial properties into.
Throws:
TCPIPApplicationException - on error.
Method Detail

getConnectionType

public java.lang.String getConnectionType()
Specified by:
getConnectionType in interface TCPIPServerSocketInfoInterface
Returns:
String

isServerConnectionType

public boolean isServerConnectionType()
Specified by:
isServerConnectionType in interface TCPIPServerSocketInfoInterface
Returns:
boolean

isClientConnectionType

public boolean isClientConnectionType()
Specified by:
isClientConnectionType in interface TCPIPServerSocketInfoInterface
Returns:
boolean

setConnectionType

public void setConnectionType(java.lang.String connectionType)
                       throws TCPIPApplicationException
Parameters:
connectionType - the value to set
Throws:
TCPIPApplicationException

getInboundTriggerEvent

public java.lang.String getInboundTriggerEvent()
Specified by:
getInboundTriggerEvent in interface TCPIPServerSocketInfoInterface
Returns:
String

isOnConnectionInboundTriggerEvent

public boolean isOnConnectionInboundTriggerEvent()
Specified by:
isOnConnectionInboundTriggerEvent in interface TCPIPServerSocketInfoInterface
Returns:
boolean

isOnMessageInboundTriggerEvent

public boolean isOnMessageInboundTriggerEvent()
Specified by:
isOnMessageInboundTriggerEvent in interface TCPIPServerSocketInfoInterface
Returns:
boolean

getServerWelcomeMessage

public java.lang.String getServerWelcomeMessage()
Specified by:
getServerWelcomeMessage in interface TCPIPServerSocketInfoInterface
Returns:
String

setInboundTriggerEvent

public void setInboundTriggerEvent(java.lang.String inboundTriggerEvent)
                            throws TCPIPApplicationException
Parameters:
inboundTriggerEvent - the value to set
Throws:
TCPIPApplicationException

setServerWelcomeMessage

public void setServerWelcomeMessage(java.lang.String string)
Parameters:
string - the value to set

getHost

public java.lang.String getHost()
Returns the host. It is for inbound client.

Specified by:
getHost in interface TCPIPServerSocketInfoInterface
Returns:
The host.

getServerPort

public int getServerPort()
Returns the serverPort.

Specified by:
getServerPort in interface TCPIPServerSocketInfoInterface
Returns:
The serverPort.

getBacklog

public int getBacklog()
Returns the backlog which is the maximum length of the queue.

Specified by:
getBacklog in interface TCPIPServerSocketInfoInterface
Returns:
The backlog.

getServerSoTimeout

public int getServerSoTimeout()
Returns the server soTimeout.

Specified by:
getServerSoTimeout in interface TCPIPServerSocketInfoInterface
Returns:
The server soTimeout.

isKeepAlive

public boolean isKeepAlive()
Checks whether the keepAlive option is on.

Specified by:
isKeepAlive in interface TCPIPServerSocketInfoInterface
Returns:
boolean

getReceiveBufferSize

public int getReceiveBufferSize()
Returns the receiveBufferSize.

Specified by:
getReceiveBufferSize in interface TCPIPServerSocketInfoInterface
Returns:
The receive buffer size

getSendBufferSize

public int getSendBufferSize()
Returns the sendBufferSize.

Specified by:
getSendBufferSize in interface TCPIPServerSocketInfoInterface
Returns:
The send buffer size.

isSoLinger

public boolean isSoLinger()
Checks whether the SoLinger option is on.

Specified by:
isSoLinger in interface TCPIPServerSocketInfoInterface
Returns:
boolean

getSoLingerTimeout

public int getSoLingerTimeout()
Returns the soLingerTimeout.

Specified by:
getSoLingerTimeout in interface TCPIPServerSocketInfoInterface
Returns:
The soLinger timeout

getSoTimeout

public int getSoTimeout()
Returns the soTimeout.

Specified by:
getSoTimeout in interface TCPIPServerSocketInfoInterface
Returns:
The soTimeout.

isTcpNoDelay

public boolean isTcpNoDelay()
Checks whether the TcpNoDelay option is on.

Specified by:
isTcpNoDelay in interface TCPIPServerSocketInfoInterface
Returns:
boolean

getServerSocketFactoryImplClassName

public java.lang.String getServerSocketFactoryImplClassName()
Returns the serverSocketFactoryImplClassName.

Specified by:
getServerSocketFactoryImplClassName in interface TCPIPServerSocketInfoInterface
Returns:
String

setHost

public void setHost(java.lang.String host)
             throws TCPIPApplicationException
Sets the host. It is for inbound client.

Parameters:
host - The host to set
Throws:
TCPIPApplicationException - on error

setServerPort

public void setServerPort(int port)
                   throws TCPIPApplicationException
Sets the server port.

Parameters:
port - The server port to set
Throws:
TCPIPApplicationException - on error

setBacklog

public void setBacklog(int backlog)
                throws TCPIPApplicationException
Sets the backlog which is the maximum length of the queue.

Parameters:
backlog - The backLog to set
Throws:
TCPIPApplicationException - on error

setServerSoTimeout

public void setServerSoTimeout(int soTimeout)
                        throws TCPIPApplicationException,
                               java.io.IOException
Sets the server soTimeout.

Specified by:
setServerSoTimeout in interface TCPIPServerSocketInfoInterface
Parameters:
soTimeout - The server soTimeout to set
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error.

setKeepAlive

public void setKeepAlive(boolean keepAlive)
                  throws java.io.IOException
Sets the keepAlive.

Specified by:
setKeepAlive in interface TCPIPServerSocketInfoInterface
Parameters:
keepAlive - The keepAlive to set
Throws:
java.io.IOException - on i/o error.

setReceiveBufferSize

public void setReceiveBufferSize(int receiveBufferSize)
                          throws TCPIPApplicationException,
                                 java.io.IOException
Sets the receiveBufferSize.

Specified by:
setReceiveBufferSize in interface TCPIPServerSocketInfoInterface
Parameters:
receiveBufferSize - The receiveBufferSize to set
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error.

setSendBufferSize

public void setSendBufferSize(int sendBufferSize)
                       throws TCPIPApplicationException,
                              java.io.IOException
Sets the sendBufferSize.

Specified by:
setSendBufferSize in interface TCPIPServerSocketInfoInterface
Parameters:
sendBufferSize - The sendBufferSize to set
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error.

setSoLinger

public void setSoLinger(boolean soLinger)
                 throws java.io.IOException
Sets the soLinger.

Specified by:
setSoLinger in interface TCPIPServerSocketInfoInterface
Parameters:
soLinger - The soLinger to set
Throws:
java.io.IOException - on i/o error.

setSoLingerTimeout

public void setSoLingerTimeout(int soLingerTimeout)
                        throws java.io.IOException
Sets the soLingerTimeout.

Specified by:
setSoLingerTimeout in interface TCPIPServerSocketInfoInterface
Parameters:
soLingerTimeout - The soLingerTimeout to set
Throws:
java.io.IOException - on i/o error.

setSoTimeout

public void setSoTimeout(int soTimeout)
                  throws TCPIPApplicationException,
                         java.io.IOException
Sets the soTimeout.

Specified by:
setSoTimeout in interface TCPIPServerSocketInfoInterface
Parameters:
soTimeout - The soTimeout to set
Throws:
TCPIPApplicationException - on error
java.io.IOException - on i/o error.

setTcpNoDelay

public void setTcpNoDelay(boolean tcpNoDelay)
                   throws java.io.IOException
Sets the tcpNoDelay.

Specified by:
setTcpNoDelay in interface TCPIPServerSocketInfoInterface
Parameters:
tcpNoDelay - The tcpNoDelay to set
Throws:
java.io.IOException - on i/o error.

getConnectionID

public java.lang.String getConnectionID()
Returns the connectionID.

Returns:
The connectionID.

getCreateConnection

public boolean getCreateConnection()
Returns the createConnection setting (true or false).

Specified by:
getCreateConnection in interface TCPIPServerSocketInfoInterface
Returns:
The createConnection flag.

setConnectionID

public void setConnectionID(java.lang.String connectionID)
Sets the connectionID.

Parameters:
connectionID - The connectionID to set

setCreateConnection

public void setCreateConnection(boolean createConnection)
Sets the createConnection.

Parameters:
createConnection - The createConnection flag to set

setServerSocketFactoryImplClassName

public void setServerSocketFactoryImplClassName(java.lang.String serverSocketFactoryImplClassName)
                                         throws TCPIPApplicationException
Sets the serverSocketFactoryImplClassName.

Specified by:
setServerSocketFactoryImplClassName in interface TCPIPServerSocketInfoInterface
Parameters:
serverSocketFactoryImplClassName - The serverSocketFactoryImplClassName to set
Throws:
TCPIPApplicationException - on error

getInitPropertiesInfo

public com.stc.connector.framework.util.ConfigurationHelper getInitPropertiesInfo()
Returns the initial configuration.

Returns:
ConfigurationHelper

isSocketConnected

public boolean isSocketConnected()
Returns the socketConnected.

Returns:
boolean

setSocketConnected

public void setSocketConnected()
Sets the socketConnected to true. This method should be called right after the socket is created.


validate

public void validate()
              throws TCPIPApplicationException
Validates the socket configuration settings.

Throws:
TCPIPApplicationException - on error

validate

public void validate(java.lang.String integrationServerType)
              throws TCPIPApplicationException
Validates the socket configuration settings against the integrationServerType.

Parameters:
integrationServerType - The integrationServerType to validate
Throws:
TCPIPApplicationException - on error

getAttachedServerSocket

public java.net.ServerSocket getAttachedServerSocket()
Returns the attachedServerSocket.

Returns:
ServerSocket

getAttachedSocket

public java.net.Socket getAttachedSocket()
Returns the attachedSocket.

Returns:
Socket

attachServerSocket

public void attachServerSocket(java.net.ServerSocket attachedServerSocket)
Attach a serverSocket object so the serverSocket options can be refreshed along with serverSocketInfo changes.

Parameters:
attachedServerSocket - The attachedServerSocket to set

attachSocket

public void attachSocket(java.net.Socket attachedSocket)
Attach a socket object so the socket options can be refreshed along with socketInfo changes.

Parameters:
attachedSocket - The attachedSocket to set

isThereAttachedSocket

public boolean isThereAttachedSocket()
Method isThereAttachedSocket.

Returns:
boolean

isThereAttachedServerSocket

public boolean isThereAttachedServerSocket()
Method isThereAttachedServerSocket.

Returns:
boolean

getServerPortBindingInfo

public TCPIPServerPortBindingInfoInterface getServerPortBindingInfo()
Specified by:
getServerPortBindingInfo in interface TCPIPServerSocketInfoInterface
Returns:
TCPIPServerPortBindingInfoInterface

setServerPortBindingInfo

public void setServerPortBindingInfo(TCPIPServerPortBindingInfo info)
Parameters:
info - the value to set

getInboundConnectionManagementInfo

public TCPIPServerConnectionManagementInfoInterface getInboundConnectionManagementInfo()
Specified by:
getInboundConnectionManagementInfo in interface TCPIPServerSocketInfoInterface
Returns:
TCPIPServerConnectionManagementInfoInterface

setInboundConnectionManagementInfo

public void setInboundConnectionManagementInfo(TCPIPServerConnectionManagementInfo info)
Parameters:
info - the value to set

getClientConnectionEstablishmentInfo

public TCPIPSocketEstablishmentInfoInterface getClientConnectionEstablishmentInfo()
Specified by:
getClientConnectionEstablishmentInfo in interface TCPIPServerSocketInfoInterface
Returns:
TCPIPSocketEstablishmentInfoInterface

setClientConnectionEstablishmentInfo

public void setClientConnectionEstablishmentInfo(TCPIPSocketEstablishmentInfo info)
Parameters:
info - the value to set

Sun Adapter for TCP/IP HL7