|
Sun Adapter for TCP/IP HL7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stc.connector.tcpip.model.client.TCPIPClientApplicationImpl
public class TCPIPClientApplicationImpl
This class implements the TCPIP client application interface.
Field Summary | |
---|---|
protected int |
defaultTimeout
A default timeout value. |
protected TCPIPMonitorData |
mMonitorData
|
static java.lang.String |
version
|
Constructor Summary | |
---|---|
TCPIPClientApplicationImpl()
Default constructor for WSDL generation. |
|
TCPIPClientApplicationImpl(TCPIPApplicationConnection appConn,
java.lang.String appName,
TCPIPMonitorData aMonitorData)
Creates a new instance of TCPIPClientApplicationImpl |
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). |
TCPIPApplicationConnection |
getApplicationConnection()
Gets the TCPIP application connection which created this instance of TCPIPClientApplication. |
java.lang.String |
getApplicationName()
|
java.lang.String |
getCallingAdapter()
Returns the callingAdapter. |
TCPIPClientGeneralInfo |
getClientGeneralInfo()
Returns the TCPIPClientGeneralInfo instance. |
byte[] |
getLeftOverFromLastRead()
|
int |
getMaxDataSize()
Returns the maxDataSize. |
protected long |
getMaxEmptyReadRetry()
|
com.stc.connector.management.util.ObjectReference |
getMonitor()
|
javax.resource.spi.ResourceAdapter |
getResourceAdapter()
Method getResourceAdapter. |
java.net.Socket |
getSocket()
Returns the underlying java.net.Socket instance which the e*Way relys on. |
TCPIPSocketInfo |
getSocketInfo()
Returns the TCPIPSocketInfo instance. |
java.lang.String |
getState()
Returns the State which is set by user. |
StateHandler |
getStateHandler()
Returns the stateHandler. |
TCPIPClientConfigInfoInterface |
getTCPIPOutboundConfigInfo()
Returns an object which represents the base TCP/IP Outbound configuration information. |
protected int |
getTimeToWaitForAResponse()
|
boolean |
isCalledByInbound()
Returns the calledByInbound. |
boolean |
isClosed()
Checks whether the connection is closed. |
boolean |
isServerCloseNotification(byte[] closeCommand)
Returns true if the data which the server receives represents the close notification. |
boolean |
isServerCloseNotification(java.lang.String closeCommand)
Returns true if the data which the server receives represents the close notification. |
boolean |
isServerIdleTimeout()
Returns true if the server detects that the client has no actual activity (idle) for certain time. |
protected byte[] |
readFully()
Read until no more data (end of file) or timeout occurs. |
protected byte[] |
readFully(boolean endOnTimeout)
Read until no more data (end of file), or timeout occurs (if the parameter endOnTimeout is true). |
byte[] |
receiveBytes()
Reads all data which is available on 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 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 |
setApplicationConnection(TCPIPApplicationConnection appConn)
Sets the TCPIP application connection. |
void |
setApplicationName(java.lang.String name)
|
protected void |
setCalledByInbound(boolean calledByInbound)
Sets the calledByInbound. |
protected void |
setCallingAdapter(java.lang.String callingAdapter)
Sets the callingAdapter. |
void |
setClientGeneralInfo(TCPIPClientGeneralInfo clientGeneralInfo)
|
void |
setLeftOverFromLastRead(byte[] bs)
|
void |
setMaxDataSize(int maxDataSize)
Sets the maxDataSize. |
void |
setSocketInfo(TCPIPSocketInfo socketInfo)
Method setSocketInfo. |
void |
setState(java.lang.String stateValue)
Sets State. |
void |
setTCPIPOutboundConfigInfo(TCPIPClientConfigInfo outboundConfigInfo)
|
void |
updateMBeanProperty(java.lang.String propertyName,
java.lang.String propertyDisplayValue)
Updates certain RA MBean property with the specified value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String version
protected int defaultTimeout
protected TCPIPMonitorData mMonitorData
Constructor Detail |
---|
public TCPIPClientApplicationImpl()
public TCPIPClientApplicationImpl(TCPIPApplicationConnection appConn, java.lang.String appName, TCPIPMonitorData aMonitorData)
appConn
- The application connection which created this instance of
application.appName
- The applicatin name.aMonitorData
- The TCPIPMonitorData objectMethod Detail |
---|
public java.net.Socket getSocket() throws TCPIPApplicationException, java.io.IOException
TCPIPClientApplication
getSocket
in interface TCPIPClientApplication
TCPIPApplicationException
- on error
java.io.IOException
- on i/o errorTCPIPClientApplication.getSocket()
public boolean isClosed() throws TCPIPApplicationException, java.io.IOException
TCPIPClientApplication
isClosed
in interface TCPIPClientApplication
TCPIPApplicationException
- on error
java.io.IOException
- on i/o errorTCPIPClientApplication.isClosed()
public void closeConnection() throws TCPIPApplicationException, java.io.IOException
TCPIPClientApplication
closeConnection
in interface TCPIPClientApplication
TCPIPApplicationException
- on error
java.io.IOException
- on i/o errorTCPIPClientApplication.closeConnection()
public byte[] receiveBytes() throws TCPIPApplicationException, java.io.IOException, TCPIPNoResponseException
TCPIPClientApplication
Followings are the end conditions of the read operation: - No more data in the socket stream (end of file) - Timeout occurs (note: here timeout is treated as an indication instead of error)Once one of the above conditions stands, the reading attempt will gracefully stop and all data will be returned. A zero-length byte array will be returned if no any data is received.
receiveBytes
in interface TCPIPClientApplication
TCPIPApplicationException
- on error
java.io.IOException
- on i/o error
TCPIPNoResponseException
TCPIPClientApplication.receiveBytes()
public java.lang.String receiveString() throws TCPIPApplicationException, java.io.IOException, TCPIPNoResponseException
TCPIPClientApplication
Followings are the end conditions of the read operation: - No more data in the socket stream (end of file) - Timeout occurs (note: here timeout is treated as an indication instead of error)Once one of the above conditions stands, the reading attempt will gracefully stop and all data will be returned. An empty string "" will be returned if no any data is received.
receiveString
in interface TCPIPClientApplication
TCPIPApplicationException
- on error
java.io.IOException
- on i/o error
TCPIPNoResponseException
TCPIPClientApplication.receiveString()
public java.lang.String receiveString(java.lang.String encoding) throws TCPIPApplicationException, java.io.IOException, TCPIPNoResponseException
TCPIPClientApplication
Followings are the end conditions of the read operation: - No more data in the socket stream (end of file) - Timeout occurs (note: here timeout is treated as an indication instead of error)Once one of the above conditions stands, the reading attempt will gracefully stop and all data will be returned. An empty string "" will be returned if no any data is received.
receiveString
in interface TCPIPClientApplication
encoding
- The encoding charset name.
TCPIPApplicationException
- on error
java.io.IOException
- on i/o error
TCPIPNoResponseException
TCPIPClientApplication.receiveString(String)
public void sendBytes(byte[] bytes) throws TCPIPApplicationException, java.io.IOException
TCPIPClientApplication
sendBytes
in interface TCPIPClientApplication
bytes
- A byte array to send
TCPIPApplicationException
- on error
java.io.IOException
- on i/o errorTCPIPClientApplication.sendBytes(byte[])
public void sendString(java.lang.String str) throws TCPIPApplicationException, java.io.IOException
TCPIPClientApplication
sendString
in interface TCPIPClientApplication
str
- A String to send
TCPIPApplicationException
- on error
java.io.IOException
- on i/o errorTCPIPClientApplication.sendString(String)
public void sendString(java.lang.String str, java.lang.String encoding) throws TCPIPApplicationException, java.io.IOException
TCPIPClientApplication
sendString
in interface TCPIPClientApplication
str
- A String to sendencoding
- The encoding charset name.
TCPIPApplicationException
- on error
java.io.IOException
- on i/o errorTCPIPClientApplication.sendString(String, String)
public TCPIPClientConfigInfoInterface getTCPIPOutboundConfigInfo()
TCPIPClientApplication
getTCPIPOutboundConfigInfo
in interface TCPIPClientApplication
TCPIPClientApplication.getTCPIPOutboundConfigInfo()
public void setTCPIPOutboundConfigInfo(TCPIPClientConfigInfo outboundConfigInfo)
outboundConfigInfo
- public TCPIPClientGeneralInfo getClientGeneralInfo()
public void setClientGeneralInfo(TCPIPClientGeneralInfo clientGeneralInfo)
clientGeneralInfo
- TCPIPClientGeneralInfo to be setpublic TCPIPSocketInfo getSocketInfo()
public void setSocketInfo(TCPIPSocketInfo socketInfo)
socketInfo
- TCPIPSocketInfo to be setpublic int getMaxDataSize()
TCPIPClientApplication
getMaxDataSize
in interface TCPIPClientApplication
TCPIPClientApplication.getMaxDataSize()
public void setMaxDataSize(int maxDataSize) throws TCPIPApplicationException
TCPIPClientApplication
setMaxDataSize
in interface TCPIPClientApplication
maxDataSize
- The maxDataSize to set
TCPIPApplicationException
- on errorTCPIPClientApplication.setMaxDataSize(int)
protected int getTimeToWaitForAResponse()
protected long getMaxEmptyReadRetry()
protected byte[] readFully() throws TCPIPApplicationException, java.io.IOException, TCPIPNoResponseException
TCPIPApplicationException
- on error
java.io.IOException
- on i/o error
TCPIPNoResponseException
protected byte[] readFully(boolean endOnTimeout) throws TCPIPApplicationException, java.io.IOException, TCPIPNoResponseException
endOnTimeout
- true or false
TCPIPApplicationException
- on error
java.io.IOException
- on i/o error
TCPIPNoResponseException
protected void checkIfClosed() throws TCPIPApplicationException
TCPIPApplicationException
- if the Application Connection
associated with this application was already closed.public TCPIPApplicationConnection getApplicationConnection()
public void setApplicationConnection(TCPIPApplicationConnection appConn)
public javax.resource.spi.ResourceAdapter getResourceAdapter()
public StateHandler getStateHandler() throws TCPIPApplicationException
TCPIPApplicationException
- up on errorpublic java.lang.String getState() throws TCPIPApplicationException
TCPIPClientApplication
getState
in interface TCPIPClientApplication
TCPIPApplicationException
- on errorTCPIPClientApplication.getState()
public void setState(java.lang.String stateValue) throws TCPIPApplicationException
TCPIPClientApplication
setState
in interface TCPIPClientApplication
stateValue
- The state value to set
TCPIPApplicationException
- on errorcom.stc.connector.appconn.tcpip.model.TCPIPClientApplication#setState()
public java.lang.String getApplicationName()
com.stc.connector.appconn.tcpip.model.TCPIPClientApplication#getApplicationName()
public void setApplicationName(java.lang.String name)
com.stc.connector.appconn.tcpip.model.TCPIPClientApplication#setApplicationName(String)
public boolean isCalledByInbound()
protected void setCalledByInbound(boolean calledByInbound)
calledByInbound
- The calledByInbound to setpublic java.lang.String getCallingAdapter()
protected void setCallingAdapter(java.lang.String callingAdapter)
callingAdapter
- The callingAdapter to setpublic boolean isServerCloseNotification(java.lang.String closeCommand) throws TCPIPApplicationException
closeCommand
-
TCPIPApplicationException
public boolean isServerCloseNotification(byte[] closeCommand) throws TCPIPApplicationException
closeCommand
-
TCPIPApplicationException
public boolean isServerIdleTimeout() throws TCPIPApplicationException
TCPIPApplicationException
public byte[] getLeftOverFromLastRead()
public void setLeftOverFromLastRead(byte[] bs)
bs
- public void updateMBeanProperty(java.lang.String propertyName, java.lang.String propertyDisplayValue)
propertyName
- propertyDisplayValue
- public com.stc.connector.management.util.ObjectReference getMonitor()
|
Sun Adapter for TCP/IP HL7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |