IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.cs.servlet
Class CSClient

java.lang.Object
  extended bycom.ibm.dse.base.DSENotifier
      extended bycom.ibm.dse.base.Service
          extended bycom.ibm.dse.cs.servlet.CSClient
All Implemented Interfaces:
CSAsynchronousReplyListener, CSClientService, java.util.EventListener, Externalizable, java.io.Externalizable, Notifier, java.io.Serializable

public class CSClient
extends Service
implements CSAsynchronousReplyListener, CSClientService

The CSClient class provides the C/S service on the client side.

See Also:
Serialized Form

Field Summary
protected  CSNotificationListener aCSNotificationListener
          Contains the listeners of the CSNotificationEvent events.
protected  CSReplyListener aCSReplyListener
          Contains the listeners of the CSReplyEvent events.
protected  CSSessionStatusChangedListener aCSSessionStatusChangedListener
          Contains the listeners of the CSSessionStatusChangedEvent events.
protected  java.lang.String charEncoding
          Character encoding used in the HTTP message body sent in C/S requests.
protected  HttpURLConnectionThin csAssignConnection
          Connection used to establish session with the server.
protected  java.lang.String csAssignServletName
          Name of the servlet used to establish session with the server.
protected  HttpURLConnectionThin csNotifClToSrvConnection
          Connection used to send events to the server.
protected  java.lang.String csNotifClToSrvServletName
          Name of the servlet used to send events to the server.
protected  HttpURLConnectionThin csNotifSrvToClConnection
          Connection used to receive events from the server.
protected  java.lang.String csNotifSrvToClServletName
          Name of the servlet used to receive events from the server.
protected  HttpURLConnectionThin csReqProtocolConnection
          Connection used to execute operation in the server side.
protected  java.lang.String csReqProtocolServletName
          Name of the servlet used to connect to the server for executing operations.
protected  boolean enableSSL
          SSL enabled or not
protected  boolean isCsNotifClToSrvConnectionFree
          Specifies if the connection csNotifClToSrvConnection can be used.
protected  boolean isCsReqProtocolConnectionFree
          Specifies if the connection csReqProtocolConnection can be used.
protected  boolean receiveReplyAfterSynchronousSendTimeout
          Specifies if the Client/Server will trigger a CSReplyEvent when the reply is received after a synchronous send timeout.
protected  int ReconnectionAttemptsForSMNotification
          Number of attempts to reestablish the session.
protected  boolean retryOnError
          Specifies if the Client/Server must try to send a request when there has been communication problems.
protected  SSLEnabler sslEnabler
          SSLEnabler
protected  Hashtable terminateThreads
          List of threads that must be stopped when csclient terminates.
protected  long TimeBetweenReconnectionAttempts
          Time between reconnection attempts when the session is down.
protected  Vector timeoutedSynchronousRequests
          Identifiers for synchronous requests that have timeouted and the CSReplyEvent has not still been triggered.
 
Fields inherited from class com.ibm.dse.base.Service
externalizer
 
Fields inherited from class com.ibm.dse.base.DSENotifier
handlersList, name
 
Fields inherited from interface com.ibm.dse.clientserver.CSClientService
CS_REPLY_EVENT, CS_REQUEST_ID, CS_SESSION_STATUS, CS_STATUS_CHANGED_EVENT, DOWN, ENABLESSL, NOT_ESTABLISHED, OK, RESET, SSLENABLER
 
Constructor Summary
CSClient()
          This constructor creates a CSClient object.
CSClient(java.lang.String aName)
          This constructor creates a CSClient object.
 
Method Summary
 void addCSConnectionCookies(java.lang.String clientCookieStr)
          Adds a client cookie for the connection.
 void addCSConnectionCookies(java.util.Vector clientCookiesVector)
          Adds client cookies for the connection.
 void addCSNotificationListener(CSNotificationListener newListener)
          Adds the specified CSNotificationListener to recieve CSNotificationEvents from this class.
 void addCSReplyListener(CSReplyListener newListener)
          Adds the specified CSReplyListener to recieve CSReplyEvents from this class.
 void addCSSessionStatusChangedListener(CSSessionStatusChangedListener newListener)
          Adds the specified CSSessionStatusChangedListener to recieve CSSessionStatusChangedEvents from this class.
 void closeSession()
          Closes the session.
 void closeSessionAndDeleteCookies()
          Method closeSessionAndDeleteCookies.
 void establishSession()
          Establishes a session with the server.
 void establishSession(boolean newSession)
          Establishes a session with the server.
 void finalize()
          Called by the garbage collector.
protected  void fireAndSignalCSReplyEvent(CSReplyEvent anEvent, java.lang.String eventName)
          Method to support listener events.
protected  void fireAndSignalCSStatusChangedEvent(CSSessionStatusChangedEvent anEvent, java.lang.String eventName)
          Method to support listener events.
protected  void fireHandleCSNotificationEvent(CSNotificationEvent event)
          Method to support listener events.
protected  void fireHandleCSReplyEvent(CSReplyEvent event)
          Method to support listener events.
protected  void fireHandleCSSessionStatusChangedEvent(CSSessionStatusChangedEvent event)
          Method to support listener events.
protected  boolean firstDown()
          Returns true if the sesion is not down yet.
protected  void freeCsNotifClToSrvConnection(HttpURLConnectionThin aHttpURLConnectionThin)
          Allows to use the CsNotifClToSrvConnection again.
protected  void freeCsReqProtocolConnection(HttpURLConnectionThin aHttpURLConnectionThin)
          Allows to use the CsReqProtocolConnection again.
 java.lang.String getCharEncoding()
          Obtains the charEncoding attribute.
 boolean getCreateSession()
          Gets the fieldCreateSession property (boolean) value.
protected  HttpURLConnectionThin getCsAssignConnection()
          Returns a connection used to establish a session with the server.
 java.lang.String getCsAssignServletName()
          Gets the csAssignServletName value.
protected  HttpURLConnectionThin getCsNotifClToSrvConnection()
          Returns a connection used to send events to the server.
 java.lang.String getCsNotifClToSrvServletName()
          Gets the csNotifClToSrvServletName value.
protected  HttpURLConnectionThin getCsNotifSrvToClConnection()
          Returns a connection used to receive events from the server.
 java.lang.String getCsNotifSrvToClServletName()
          Gets the csNotifSrvToClServletName value.
protected  HttpURLConnectionThin getCsReqProtocolConnection()
          Returns a connection used to execute operation in the server side.
 java.lang.String getCsReqProtocolServletName()
          Gets the csReqProtocolServletName value.
 long getDefaultOperationTimeout()
          Returns the timeout used in the methods: sendAndWait(ClientOperation), receive(ClientOperation, Integer), receive (Context, Integer)
 int getEventsPort()
          Obtains the events port.
protected static java.lang.Integer getIdRequest()
          Gets the _idRequestCounter property (Integer) value.
 boolean getKeepAliveConnection()
          Gets the keepAliveConnection property (boolean) value.
protected  HttpURLConnectionThin getNewCsNotifClToSrvConnection()
          Returns a connection used to send events to the server.
protected  HttpURLConnectionThin getNewCsReqProtocolConnection()
          Returns a connection used to execute operation in the server side.
 boolean getPermanentConnectionForEvents()
          Obtains the permanentConnectionForEvents attribute.
 java.lang.String getProxyCredentials()
          Gets the proxyCredentials property (java.lang.String) value.
 java.lang.String getProxyHost()
          Gets the proxyHost property (java.lang.String) value.
 int getProxyPort()
          Gets the proxyPort property (int) value.
 boolean getReceiveReplyAfterSynchronousSendTimeout()
          Obtains the receiveReplyAfterSynchronousSendTimeout attribute.
 int getReconnectionAttempts()
          Gets the ReconnectionAttemptsForSMNotification property (int) value.
 boolean getRunInSession()
          Returns the field runInSession, wich indicates whether the application must run under session management or not.
protected  SendEventsBuffer getSendEventsBuffer()
          Gets the _sendEventsBuffer property (com.ibm.dse.clientserver.SendEventsBuffer) value.
 java.lang.String getServerCredentials()
          Gets the serverCredentials property (java.lang.String) value.
protected  java.lang.Long getServerId()
          Gets the serverId property (java.lang.Long) value.
 java.lang.String getServerName()
          Gets the _serverName property (java.lang.String) value.
 java.net.ServerSocket getServerSocket()
          Obtains the socket.
 java.lang.String getServerTID()
          Gets the _serverTID property (java.lang.String) value.
protected  java.lang.String getServiceId()
          Gets the _serviceId property (java.lang.String) value.
 java.lang.String getSessionId()
          Gets the _serviceId property (java.lang.String) value.
 int getSessionStatus()
          Gets the _sessionStatus property (int) value.
 SSLEnabler getSSLEnabler()
          Returns the sslEnabler.
 long getTimeBetweenReconnectionAttempts()
          Gets the TimeBetweenReconnectionAttempts property (long) value.
protected  long getTimeout()
          Gets the timeout property (long) value.
 Vector getTimeoutedSynchronousRequests()
          Gets timeoutedSynchronousRequests value
 boolean getUsedForSrvToClEventsNotif()
          Gets the _usedForSrvToClEventNotif property (boolean) value.
 boolean getUseProxy()
          Gets the useProxy property (boolean) value.
 java.lang.String getUserAgent()
          Gets the fieldUserAgent property (java.lang.String) value.
 void handleCSAsynchronousReplyEvent(CSAsynchronousReplyEvent event)
          Contains the appropriate actions to be executed when CSAsynchronousReplyEvent has been triggered.
 java.lang.Object initializeFrom(Tag aTag)
          Sets all attributes that are defined in dse.ini file.
protected  void initializeServerSocket()
          Creates a socket
 boolean isEnableSSL()
          Returns the enableSSL.
 boolean isRetryOnError()
          Gets the retryOnError property (boolean) value.
protected  void manageCaseConnectionDown(java.lang.String who)
          Tries to establish the session with the server when the sesion goes down.
 void receive(ClientOperation aClientOperation, java.lang.Integer requestId)
          Used together with the asynchronous send(...) method.
 void receive(ClientOperation aClientOperation, java.lang.Integer requestId, long timeout)
          Used together with the asynchronous send(...) method.
 void receive(Context aContext, java.lang.Integer requestId)
          Used together with the asynchronous send(...) method.
 void receive(Context aContext, java.lang.Integer requestId, long timeout)
          Used together with the asynchronous send(...) method.
 void removeCSNotificationListener(CSNotificationListener newListener)
          Removes the specified CSNotificationListener so that it no longer receives CSNotificationEvents from this class.
 void removeCSReplyListener(CSReplyListener newListener)
          Removes the specified CSReplyListener so that it no longer receives CSReplyEvents from this class.
 void removeCSSessionStatusChangedListener(CSSessionStatusChangedListener newListener)
          Removes the specified CSSessionStatusChangedListener so that it no longer receives CSSessionStatusChangedEvents from this class.
 java.lang.Integer send(ClientOperation aClientOperation)
          Instantiates the remote execution of the operation on the server side.
 void sendAndWait(ClientOperation aClientOperation)
          Initiates the remote execution of the operation on the server side and waits.
 void sendAndWait(ClientOperation aClientOperation, long timeout)
          Initiates the remote execution of the operation on the server side and waits for a timeout.
 void sendEvent(java.util.EventObject myEvent)
          Sends an event to the server.
 void setCharEncoding(java.lang.String c)
          Sets the charEncoding attribute.
 void setCreateSession(boolean value)
          Sets the fieldCreateSession property (boolean) value.
protected  void setCsAssignConnection(HttpURLConnectionThin aCsAssignConnection)
          Sets the csAssignConnection property (com.ibm.dse.clientserver.servlet.HttpURLConnectionThin) value.
 void setCsAssignServletName(java.lang.String newCsAssignServletName)
          Sets the csAssignServletName value.
protected  void setCsNotifClToSrvConnection(HttpURLConnectionThin aCsNotifClToSrvConnection)
          Sets the csNotifClToSrvConnection property (com.ibm.dse.clientserver.servlet.HttpURLConnectionThin) value.
 void setCsNotifClToSrvServletName(java.lang.String newCsNotifClToSrvServletName)
          Sets the csNotifClToSrvServletName value.
protected  void setCsNotifSrvToClConnection(HttpURLConnectionThin aCsNotifSrvToClConnection)
          Sets the csNotifSrvToClConnection property (com.ibm.dse.clientserver.servlet.HttpURLConnectionThin) value.
 void setCsNotifSrvToClServletName(java.lang.String newCsNotifSrvToClServletName)
          Sets the csNotifSrvToClServletName value.
protected  void setCsReqProtocolConnection(HttpURLConnectionThin aCsReqProtocolConnection)
          Sets the csReqProtocolConnection property (com.ibm.dse.clientserver.servlet.HttpURLConnectionThin) value.
 void setCsReqProtocolServletName(java.lang.String newCsReqProtocolServletName)
          Sets the csReqProtocolServletName value.
 void setDefaultOperationTimeout(long aTimeout)
          Sets the defaultOperationTimeout property (long) value.
 void setEnableSSL(boolean enableSSL)
          Sets the enableSSL.
 void setEventsPort(int aPort)
          Sets the events port.
 void setKeepAliveConnection(boolean value)
          Sets the keepAliveConnection property (boolean) value.
 void setPermanentConnectionForEvents(boolean permConnection)
          Sets the permanentConnectionForEvents attribute.
 void setProxyCredentials(java.lang.String aProxyCredentials)
          Sets the proxyCredentials property (String) value.
 void setProxyHost(java.lang.String value)
          Sets the proxyHost property (String) value.
 void setProxyPort(int value)
          Sets the proxyPort property (int) value.
 void setReceiveReplyAfterSynchronousSendTimeout(boolean receiveReply)
          Sets the receiveReplyAfterSynchronousSendTimeout attribute.
 void setReconnectionAttempts(int value)
          Sets the ReconnectionAttemptsForSMNotification property (int) value.
 void setRetryOnError(boolean newRetryOnError)
          Sets the retryOnError property (boolean) value.
 void setRunInSession(boolean newRunInSession)
          Sets the runInSession property (boolean) value.
 void setServerCredentials(java.lang.String aServerCredentials)
          Sets the serverCredentials property (String) value.
protected  void setServerId(java.lang.Long aServerId)
          Sets the serverId property (Long) value.
 void setServerName(java.lang.String serverName)
          Sets the _serverName property (java.lang.String) value.
 void setServerSocket(java.net.ServerSocket aSocket)
          Sets the value of the server socket attribute.
 void setSSLEnabler(SSLEnabler sslEnabler)
          Sets the sslEnabler.
 void setTimeBetweenReconnectionAttempts(long value)
          Sets the TimeBetweenReconnectionAttempts property (long) value.
protected  void setTimeout(long aTimeout)
          Sets the timeout property (long) value.
 void setUsedForSrvToClEventNotif(boolean used)
          Sets the _usedForSrvToClEventNotif property (boolean) value.
 void setUseProxy(boolean value)
          Sets the useProxy property (boolean) value.
 void setUserAgent(java.lang.String userAgent)
          Sets the fieldUserAgent property (java.lang.String) value.
 void startListen()
          Creates a server socket and starts CSNotifInDynamicModeProtocolThread
 void terminate()
          This is called either from the application or from the context when it is destroyed or unchained.
 java.lang.String toString()
          Returns an SGML representation.
 
Methods inherited from class com.ibm.dse.base.Service
externalizer, getExternalizer, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, toStrings, toTags, writeExternal, writeExternal
 
Methods inherited from class com.ibm.dse.base.DSENotifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent, signalEvent
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.dse.base.Notifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent
 
Methods inherited from interface com.ibm.dse.base.Externalizable
getName, setName
 

Field Detail

TimeBetweenReconnectionAttempts

protected long TimeBetweenReconnectionAttempts
Time between reconnection attempts when the session is down.


ReconnectionAttemptsForSMNotification

protected int ReconnectionAttemptsForSMNotification
Number of attempts to reestablish the session.


enableSSL

protected boolean enableSSL
SSL enabled or not


sslEnabler

protected SSLEnabler sslEnabler
SSLEnabler


aCSNotificationListener

protected transient CSNotificationListener aCSNotificationListener
Contains the listeners of the CSNotificationEvent events.


aCSReplyListener

protected transient CSReplyListener aCSReplyListener
Contains the listeners of the CSReplyEvent events.


aCSSessionStatusChangedListener

protected transient CSSessionStatusChangedListener aCSSessionStatusChangedListener
Contains the listeners of the CSSessionStatusChangedEvent events.


csReqProtocolConnection

protected HttpURLConnectionThin csReqProtocolConnection
Connection used to execute operation in the server side.


csReqProtocolServletName

protected java.lang.String csReqProtocolServletName
Name of the servlet used to connect to the server for executing operations. By default is the name of the class.


csAssignConnection

protected HttpURLConnectionThin csAssignConnection
Connection used to establish session with the server.


csAssignServletName

protected java.lang.String csAssignServletName
Name of the servlet used to establish session with the server. By default is the name of the class.


csNotifClToSrvConnection

protected HttpURLConnectionThin csNotifClToSrvConnection
Connection used to send events to the server.


csNotifClToSrvServletName

protected java.lang.String csNotifClToSrvServletName
Name of the servlet used to send events to the server. By default is the name of the class.


csNotifSrvToClConnection

protected HttpURLConnectionThin csNotifSrvToClConnection
Connection used to receive events from the server.


csNotifSrvToClServletName

protected java.lang.String csNotifSrvToClServletName
Name of the servlet used to receive events from the server. By default is the name of the class.


terminateThreads

protected Hashtable terminateThreads
List of threads that must be stopped when csclient terminates.


isCsReqProtocolConnectionFree

protected boolean isCsReqProtocolConnectionFree
Specifies if the connection csReqProtocolConnection can be used.


isCsNotifClToSrvConnectionFree

protected boolean isCsNotifClToSrvConnectionFree
Specifies if the connection csNotifClToSrvConnection can be used.


retryOnError

protected boolean retryOnError
Specifies if the Client/Server must try to send a request when there has been communication problems. By default is true (initializeFrom).


timeoutedSynchronousRequests

protected Vector timeoutedSynchronousRequests
Identifiers for synchronous requests that have timeouted and the CSReplyEvent has not still been triggered.


receiveReplyAfterSynchronousSendTimeout

protected boolean receiveReplyAfterSynchronousSendTimeout
Specifies if the Client/Server will trigger a CSReplyEvent when the reply is received after a synchronous send timeout.


charEncoding

protected java.lang.String charEncoding
Character encoding used in the HTTP message body sent in C/S requests.

Constructor Detail

CSClient

public CSClient()
This constructor creates a CSClient object.


CSClient

public CSClient(java.lang.String aName)
This constructor creates a CSClient object. Gets the field's values from the Settings.

Parameters:
aName - java.lang.String
Method Detail

addCSConnectionCookies

public void addCSConnectionCookies(java.util.Vector clientCookiesVector)
Adds client cookies for the connection.

Specified by:
addCSConnectionCookies in interface CSClientService
Parameters:
clientCookiesVector - java.util.Vector

addCSConnectionCookies

public void addCSConnectionCookies(java.lang.String clientCookieStr)
Adds a client cookie for the connection.

Specified by:
addCSConnectionCookies in interface CSClientService
Parameters:
clientCookieStr - java.lang.String

addCSNotificationListener

public void addCSNotificationListener(CSNotificationListener newListener)
Adds the specified CSNotificationListener to recieve CSNotificationEvents from this class.

Specified by:
addCSNotificationListener in interface CSClientService
Parameters:
newListener - com.ibm.dse.clientserver.CSNotificationListener

addCSReplyListener

public void addCSReplyListener(CSReplyListener newListener)
Adds the specified CSReplyListener to recieve CSReplyEvents from this class.

Specified by:
addCSReplyListener in interface CSClientService
Parameters:
newListener - com.ibm.dse.clientserver.CSReplyListener

addCSSessionStatusChangedListener

public void addCSSessionStatusChangedListener(CSSessionStatusChangedListener newListener)
Adds the specified CSSessionStatusChangedListener to recieve CSSessionStatusChangedEvents from this class.

Specified by:
addCSSessionStatusChangedListener in interface CSClientService
Parameters:
newListener - com.ibm.dse.clientserver.CSSessionStatusChangedListener

closeSession

public void closeSession()
                  throws DSECSInvalidRequestException
Closes the session.

Specified by:
closeSession in interface CSClientService
Throws:
DSECSInvalidRequestException

establishSession

public void establishSession()
                      throws DSECSInvalidRequestException,
                             DSECSSessionNotEstablishedException
Establishes a session with the server.

Specified by:
establishSession in interface CSClientService
Throws:
DSECSInvalidRequestException
DSECSSessionNotEstablishedException

establishSession

public void establishSession(boolean newSession)
                      throws DSECSInvalidRequestException,
                             DSECSSessionNotEstablishedException
Establishes a session with the server. The boolean value is used to determine if the request is to establish a new or existing session. It may generate the following error code during the process: CSS11.

Specified by:
establishSession in interface CSClientService
Parameters:
newSession - boolean
Throws:
DSECSInvalidRequestException
DSECSSessionNotEstablishedException

finalize

public void finalize()
Called by the garbage collector.


fireAndSignalCSReplyEvent

protected void fireAndSignalCSReplyEvent(CSReplyEvent anEvent,
                                         java.lang.String eventName)
Method to support listener events.

Parameters:
anEvent - com.ibm.dse.clientserver.CSReplyEvent
eventName - java.lang.String

fireAndSignalCSStatusChangedEvent

protected void fireAndSignalCSStatusChangedEvent(CSSessionStatusChangedEvent anEvent,
                                                 java.lang.String eventName)
Method to support listener events.

Parameters:
anEvent - com.ibm.dse.clientserver.CSReplyEvent
eventName - java.lang.String

fireHandleCSNotificationEvent

protected void fireHandleCSNotificationEvent(CSNotificationEvent event)
Method to support listener events.

Parameters:
event - com.ibm.dse.clientserver.CSNotificationEvent

fireHandleCSReplyEvent

protected void fireHandleCSReplyEvent(CSReplyEvent event)
Method to support listener events.

Parameters:
event - com.ibm.dse.clientserver.CSReplyEvent

fireHandleCSSessionStatusChangedEvent

protected void fireHandleCSSessionStatusChangedEvent(CSSessionStatusChangedEvent event)
Method to support listener events.

Parameters:
event - com.ibm.dse.clientserver.CSSessionStatusChangedEvent

firstDown

protected boolean firstDown()
Returns true if the sesion is not down yet.

Returns:
boolean

freeCsNotifClToSrvConnection

protected void freeCsNotifClToSrvConnection(HttpURLConnectionThin aHttpURLConnectionThin)
Allows to use the CsNotifClToSrvConnection again.

Parameters:
aHttpURLConnectionThin - com.ibm.dse.clientserver.servlet.HttpURLConnectionThin

freeCsReqProtocolConnection

protected void freeCsReqProtocolConnection(HttpURLConnectionThin aHttpURLConnectionThin)
Allows to use the CsReqProtocolConnection again.

Parameters:
aHttpURLConnectionThin - com.ibm.dse.clientserver.servlet.HttpURLConnectionThin

getCreateSession

public boolean getCreateSession()
Gets the fieldCreateSession property (boolean) value.

Returns:
boolean

getCsAssignConnection

protected HttpURLConnectionThin getCsAssignConnection()
                                               throws java.lang.Exception
Returns a connection used to establish a session with the server.

Returns:
com.ibm.dse.clientserver.servlet.HttpURLConnectionThin
Throws:
java.lang.Exception

getCsAssignServletName

public java.lang.String getCsAssignServletName()
Gets the csAssignServletName value.

Returns:
java.lang.String

getCsNotifClToSrvConnection

protected HttpURLConnectionThin getCsNotifClToSrvConnection()
                                                     throws java.lang.Exception
Returns a connection used to send events to the server.

Returns:
com.ibm.dse.clientserver.servlet.HttpURLConnectionThin
Throws:
java.lang.Exception

getCsNotifClToSrvServletName

public java.lang.String getCsNotifClToSrvServletName()
Gets the csNotifClToSrvServletName value.

Returns:
java.lang.String

getCsNotifSrvToClConnection

protected HttpURLConnectionThin getCsNotifSrvToClConnection()
                                                     throws java.lang.Exception
Returns a connection used to receive events from the server.

Returns:
com.ibm.dse.clientserver.servlet.HttpURLConnectionThin
Throws:
java.lang.Exception

getCsNotifSrvToClServletName

public java.lang.String getCsNotifSrvToClServletName()
Gets the csNotifSrvToClServletName value.

Returns:
java.lang.String

getCsReqProtocolConnection

protected HttpURLConnectionThin getCsReqProtocolConnection()
                                                    throws java.lang.Exception
Returns a connection used to execute operation in the server side.

Returns:
com.ibm.dse.clientserver.servlet.HttpURLConnectionThin
Throws:
java.lang.Exception

getCsReqProtocolServletName

public java.lang.String getCsReqProtocolServletName()
Gets the csReqProtocolServletName value.

Returns:
java.lang.String

getDefaultOperationTimeout

public long getDefaultOperationTimeout()
Returns the timeout used in the methods: sendAndWait(ClientOperation), receive(ClientOperation, Integer), receive (Context, Integer)

Specified by:
getDefaultOperationTimeout in interface CSClientService
Returns:
long

getIdRequest

protected static java.lang.Integer getIdRequest()
Gets the _idRequestCounter property (Integer) value.

Returns:
Integer

getKeepAliveConnection

public boolean getKeepAliveConnection()
Gets the keepAliveConnection property (boolean) value.

Specified by:
getKeepAliveConnection in interface CSClientService
Returns:
boolean

getNewCsNotifClToSrvConnection

protected HttpURLConnectionThin getNewCsNotifClToSrvConnection()
                                                        throws java.lang.Exception
Returns a connection used to send events to the server.

Returns:
com.ibm.dse.clientserver.servlet.HttpURLConnectionThin
Throws:
java.lang.Exception

getNewCsReqProtocolConnection

protected HttpURLConnectionThin getNewCsReqProtocolConnection()
                                                       throws java.lang.Exception
Returns a connection used to execute operation in the server side.

Returns:
com.ibm.dse.clientserver.servlet.HttpURLConnectionThin
Throws:
java.lang.Exception

getProxyCredentials

public java.lang.String getProxyCredentials()
Gets the proxyCredentials property (java.lang.String) value.

Specified by:
getProxyCredentials in interface CSClientService
Returns:
java.lang.String

getProxyHost

public java.lang.String getProxyHost()
Gets the proxyHost property (java.lang.String) value.

Specified by:
getProxyHost in interface CSClientService
Returns:
java.lang.String

getProxyPort

public int getProxyPort()
Gets the proxyPort property (int) value.

Specified by:
getProxyPort in interface CSClientService
Returns:
int

getReconnectionAttempts

public int getReconnectionAttempts()
Gets the ReconnectionAttemptsForSMNotification property (int) value.

Specified by:
getReconnectionAttempts in interface CSClientService
Returns:
int

getRunInSession

public boolean getRunInSession()
Returns the field runInSession, wich indicates whether the application must run under session management or not.

Returns:
boolean

getSendEventsBuffer

protected SendEventsBuffer getSendEventsBuffer()
Gets the _sendEventsBuffer property (com.ibm.dse.clientserver.SendEventsBuffer) value.

Returns:
com.ibm.dse.clientserver.SendEventsBuffer

getServerCredentials

public java.lang.String getServerCredentials()
Gets the serverCredentials property (java.lang.String) value.

Specified by:
getServerCredentials in interface CSClientService
Returns:
java.lang.String

getServerId

protected java.lang.Long getServerId()
Gets the serverId property (java.lang.Long) value.

Returns:
java.lang.Long

getServerName

public java.lang.String getServerName()
Gets the _serverName property (java.lang.String) value.

Specified by:
getServerName in interface CSClientService
Returns:
java.lang.String

getServerTID

public java.lang.String getServerTID()
Gets the _serverTID property (java.lang.String) value.

Specified by:
getServerTID in interface CSClientService
Returns:
java.lang.String

getServiceId

protected java.lang.String getServiceId()
Gets the _serviceId property (java.lang.String) value.

Returns:
java.lang.String

getSessionId

public java.lang.String getSessionId()
Gets the _serviceId property (java.lang.String) value.

Specified by:
getSessionId in interface CSClientService
Returns:
java.lang.String

getSessionStatus

public int getSessionStatus()
Gets the _sessionStatus property (int) value.

Specified by:
getSessionStatus in interface CSClientService
Returns:
int

getTimeBetweenReconnectionAttempts

public long getTimeBetweenReconnectionAttempts()
Gets the TimeBetweenReconnectionAttempts property (long) value.

Specified by:
getTimeBetweenReconnectionAttempts in interface CSClientService
Returns:
long

getTimeout

protected long getTimeout()
Gets the timeout property (long) value.

Returns:
long

getUsedForSrvToClEventsNotif

public boolean getUsedForSrvToClEventsNotif()
Gets the _usedForSrvToClEventNotif property (boolean) value.

Specified by:
getUsedForSrvToClEventsNotif in interface CSClientService
Returns:
boolean

getUseProxy

public boolean getUseProxy()
Gets the useProxy property (boolean) value.

Specified by:
getUseProxy in interface CSClientService
Returns:
boolean

getUserAgent

public java.lang.String getUserAgent()
Gets the fieldUserAgent property (java.lang.String) value.

Returns:
java.lang.String

handleCSAsynchronousReplyEvent

public void handleCSAsynchronousReplyEvent(CSAsynchronousReplyEvent event)
Contains the appropriate actions to be executed when CSAsynchronousReplyEvent has been triggered.

Specified by:
handleCSAsynchronousReplyEvent in interface CSAsynchronousReplyListener
Parameters:
event - com.ibm.dse.clientserver.CSAsynchronousReplyEvent

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
Sets all attributes that are defined in dse.ini file.

Specified by:
initializeFrom in interface Externalizable
Overrides:
initializeFrom in class Service
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

isRetryOnError

public boolean isRetryOnError()
Gets the retryOnError property (boolean) value.

Returns:
boolean

manageCaseConnectionDown

protected void manageCaseConnectionDown(java.lang.String who)
Tries to establish the session with the server when the sesion goes down.


receive

public void receive(ClientOperation aClientOperation,
                    java.lang.Integer requestId)
             throws DSECSInvalidRequestException,
                    DSECSTimeoutException,
                    DSECSRemoteOperationException
Used together with the asynchronous send(...) method. The RequestId identifies which request owns the answer. The timeout of this method must be specified in the defaultOperationTimeout property

Specified by:
receive in interface CSClientService
Parameters:
aClientOperation - ClientOperation
Throws:
DSECSInvalidRequestException
DSECSTimeoutException
DSECSRemoteOperationException

receive

public void receive(ClientOperation aClientOperation,
                    java.lang.Integer requestId,
                    long timeout)
             throws DSECSInvalidRequestException,
                    DSECSTimeoutException,
                    DSECSRemoteOperationException
Used together with the asynchronous send(...) method. The RequestId identifies which request owns the answer. The Timeout must be specified in milliseconds. A value equal to zero means to wait forever.

Specified by:
receive in interface CSClientService
Parameters:
aClientOperation - ClientOperation
timeout - long
Throws:
DSECSInvalidRequestException
DSECSTimeoutException
DSECSRemoteOperationException

receive

public void receive(Context aContext,
                    java.lang.Integer requestId)
             throws DSECSInvalidRequestException,
                    DSECSTimeoutException,
                    DSECSRemoteOperationException
Used together with the asynchronous send(...) method. The RequestId identifies which request owns the answer. The timeout of this method must be specified in the defaultOperationTimeout property

Specified by:
receive in interface CSClientService
Parameters:
aContext - Context
Throws:
DSECSInvalidRequestException
DSECSTimeoutException
DSECSRemoteOperationException

receive

public void receive(Context aContext,
                    java.lang.Integer requestId,
                    long timeout)
             throws DSECSInvalidRequestException,
                    DSECSTimeoutException,
                    DSECSRemoteOperationException
Used together with the asynchronous send(...) method. The RequestId identifies which request owns the answer. The Timeout must be specified in milliseconds. A value equal to zero means to wait forever.

Specified by:
receive in interface CSClientService
Parameters:
aContext - Context
timeout - long
Throws:
DSECSInvalidRequestException
DSECSTimeoutException
DSECSRemoteOperationException

removeCSNotificationListener

public void removeCSNotificationListener(CSNotificationListener newListener)
Removes the specified CSNotificationListener so that it no longer receives CSNotificationEvents from this class.

Specified by:
removeCSNotificationListener in interface CSClientService
Parameters:
newListener - com.ibm.dse.clientserver.CSNotificationListener

removeCSReplyListener

public void removeCSReplyListener(CSReplyListener newListener)
Removes the specified CSReplyListener so that it no longer receives CSReplyEvents from this class.

Specified by:
removeCSReplyListener in interface CSClientService
Parameters:
newListener - com.ibm.dse.clientserver.CSReplyListener

removeCSSessionStatusChangedListener

public void removeCSSessionStatusChangedListener(CSSessionStatusChangedListener newListener)
Removes the specified CSSessionStatusChangedListener so that it no longer receives CSSessionStatusChangedEvents from this class.

Specified by:
removeCSSessionStatusChangedListener in interface CSClientService
Parameters:
newListener - com.ibm.dse.clientserver.CSSessionStatusChangedListener

send

public java.lang.Integer send(ClientOperation aClientOperation)
                       throws DSECSInvalidRequestException
Instantiates the remote execution of the operation on the server side. It is an asynchcronous method.

Specified by:
send in interface CSClientService
Parameters:
aClientOperation - ClientOperation
Returns:
Integer
Throws:
DSECSInvalidRequestException

sendAndWait

public void sendAndWait(ClientOperation aClientOperation)
                 throws DSECSTimeoutException,
                        DSECSInvalidRequestException,
                        DSECSRemoteOperationException
Initiates the remote execution of the operation on the server side and waits. It is a synchronous method. The timeout of this method must be specified in the defaultOperationTimeout property

Specified by:
sendAndWait in interface CSClientService
Parameters:
aClientOperation - ClientOperation
Throws:
DSECSTimeoutException
DSECSInvalidRequestException
DSECSRemoteOperationException

sendAndWait

public void sendAndWait(ClientOperation aClientOperation,
                        long timeout)
                 throws DSECSTimeoutException,
                        DSECSInvalidRequestException,
                        DSECSRemoteOperationException
Initiates the remote execution of the operation on the server side and waits for a timeout. It is a synchronous method. The timeout must be specified in milliseconds. A value equal to zero means it will wait forever. It may resend an error code.

Specified by:
sendAndWait in interface CSClientService
Parameters:
aClientOperation - ClientOperation
timeout - long
Throws:
DSECSTimeoutException
DSECSInvalidRequestException
DSECSRemoteOperationException

sendEvent

public void sendEvent(java.util.EventObject myEvent)
               throws DSECSInvalidRequestException
Sends an event to the server.

Specified by:
sendEvent in interface CSClientService
Throws:
DSECSInvalidRequestException

setCreateSession

public void setCreateSession(boolean value)
Sets the fieldCreateSession property (boolean) value.


setCsAssignConnection

protected void setCsAssignConnection(HttpURLConnectionThin aCsAssignConnection)
Sets the csAssignConnection property (com.ibm.dse.clientserver.servlet.HttpURLConnectionThin) value.

Parameters:
aCsAssignConnection - com.ibm.dse.clientserver.servlet.HttpURLConnectionThin

setCsAssignServletName

public void setCsAssignServletName(java.lang.String newCsAssignServletName)
Sets the csAssignServletName value.

Parameters:
newCsAssignServletName - java.lang.String

setCsNotifClToSrvConnection

protected void setCsNotifClToSrvConnection(HttpURLConnectionThin aCsNotifClToSrvConnection)
Sets the csNotifClToSrvConnection property (com.ibm.dse.clientserver.servlet.HttpURLConnectionThin) value.

Parameters:
aCsNotifClToSrvConnection - com.ibm.dse.clientserver.servlet.HttpURLConnectionThin

setCsNotifClToSrvServletName

public void setCsNotifClToSrvServletName(java.lang.String newCsNotifClToSrvServletName)
Sets the csNotifClToSrvServletName value.

Parameters:
newCsNotifClToSrvServletName - java.lang.String

setCsNotifSrvToClConnection

protected void setCsNotifSrvToClConnection(HttpURLConnectionThin aCsNotifSrvToClConnection)
Sets the csNotifSrvToClConnection property (com.ibm.dse.clientserver.servlet.HttpURLConnectionThin) value.

Parameters:
aCsNotifSrvToClConnection - com.ibm.dse.clientserver.servlet.HttpURLConnectionThin

setCsNotifSrvToClServletName

public void setCsNotifSrvToClServletName(java.lang.String newCsNotifSrvToClServletName)
Sets the csNotifSrvToClServletName value.

Parameters:
newCsNotifSrvToClServletName - java.lang.String

setCsReqProtocolConnection

protected void setCsReqProtocolConnection(HttpURLConnectionThin aCsReqProtocolConnection)
Sets the csReqProtocolConnection property (com.ibm.dse.clientserver.servlet.HttpURLConnectionThin) value.

Parameters:
aCsReqProtocolConnection - com.ibm.dse.clientserver.servlet.HttpURLConnectionThin

setCsReqProtocolServletName

public void setCsReqProtocolServletName(java.lang.String newCsReqProtocolServletName)
Sets the csReqProtocolServletName value.

Parameters:
newCsReqProtocolServletName - java.lang.String

setDefaultOperationTimeout

public void setDefaultOperationTimeout(long aTimeout)
Sets the defaultOperationTimeout property (long) value. This timeout is used in the methods: sendAndWait(ClientOperation), receive(ClientOperation, Integer), receive (Context, Integer)

Specified by:
setDefaultOperationTimeout in interface CSClientService
Parameters:
aTimeout - long

setKeepAliveConnection

public void setKeepAliveConnection(boolean value)
Sets the keepAliveConnection property (boolean) value.

Specified by:
setKeepAliveConnection in interface CSClientService
Parameters:
value - boolean

setProxyCredentials

public void setProxyCredentials(java.lang.String aProxyCredentials)
Sets the proxyCredentials property (String) value.

Specified by:
setProxyCredentials in interface CSClientService
Parameters:
aProxyCredentials - String

setProxyHost

public void setProxyHost(java.lang.String value)
Sets the proxyHost property (String) value.

Specified by:
setProxyHost in interface CSClientService
Parameters:
value - String

setProxyPort

public void setProxyPort(int value)
Sets the proxyPort property (int) value.

Specified by:
setProxyPort in interface CSClientService
Parameters:
value - int

setReconnectionAttempts

public void setReconnectionAttempts(int value)
Sets the ReconnectionAttemptsForSMNotification property (int) value.

Specified by:
setReconnectionAttempts in interface CSClientService
Parameters:
value - int

setRetryOnError

public void setRetryOnError(boolean newRetryOnError)
Sets the retryOnError property (boolean) value.

Parameters:
newRetryOnError - boolean

setRunInSession

public void setRunInSession(boolean newRunInSession)
Sets the runInSession property (boolean) value.

Parameters:
newRunInSession - boolean

setServerCredentials

public void setServerCredentials(java.lang.String aServerCredentials)
Sets the serverCredentials property (String) value.

Specified by:
setServerCredentials in interface CSClientService
Parameters:
aServerCredentials - String

setServerId

protected void setServerId(java.lang.Long aServerId)
Sets the serverId property (Long) value.

Parameters:
aServerId - Long

setServerName

public void setServerName(java.lang.String serverName)
Sets the _serverName property (java.lang.String) value.

Specified by:
setServerName in interface CSClientService
Parameters:
serverName - java.lang.String

setTimeBetweenReconnectionAttempts

public void setTimeBetweenReconnectionAttempts(long value)
Sets the TimeBetweenReconnectionAttempts property (long) value.

Specified by:
setTimeBetweenReconnectionAttempts in interface CSClientService
Parameters:
value - long

setTimeout

protected void setTimeout(long aTimeout)
Sets the timeout property (long) value.

Parameters:
aTimeout - long

setUsedForSrvToClEventNotif

public void setUsedForSrvToClEventNotif(boolean used)
Sets the _usedForSrvToClEventNotif property (boolean) value.

Specified by:
setUsedForSrvToClEventNotif in interface CSClientService
Parameters:
used - boolean

setUseProxy

public void setUseProxy(boolean value)
Sets the useProxy property (boolean) value.

Specified by:
setUseProxy in interface CSClientService
Parameters:
value - boolean

setUserAgent

public void setUserAgent(java.lang.String userAgent)
Sets the fieldUserAgent property (java.lang.String) value.


startListen

public void startListen()
Creates a server socket and starts CSNotifInDynamicModeProtocolThread


terminate

public void terminate()
               throws DSEException
This is called either from the application or from the context when it is destroyed or unchained.

Specified by:
terminate in interface Notifier
Overrides:
terminate in class Service
Throws:
DSEException

toString

public java.lang.String toString()
Returns an SGML representation.

Overrides:
toString in class Service
Returns:
java.lang.String

getServerSocket

public java.net.ServerSocket getServerSocket()
Obtains the socket.

Specified by:
getServerSocket in interface CSClientService
Returns:
java.net.ServerSocket

setServerSocket

public void setServerSocket(java.net.ServerSocket aSocket)
Sets the value of the server socket attribute.

Specified by:
setServerSocket in interface CSClientService
Parameters:
aSocket - ServerSocket used to receive events

getEventsPort

public int getEventsPort()
Obtains the events port.

Specified by:
getEventsPort in interface CSClientService
Returns:
int

setEventsPort

public void setEventsPort(int aPort)
Sets the events port.

Specified by:
setEventsPort in interface CSClientService
Parameters:
aPort - int

setPermanentConnectionForEvents

public void setPermanentConnectionForEvents(boolean permConnection)
Sets the permanentConnectionForEvents attribute.

Specified by:
setPermanentConnectionForEvents in interface CSClientService
Parameters:
permConnection - boolean

getPermanentConnectionForEvents

public boolean getPermanentConnectionForEvents()
Obtains the permanentConnectionForEvents attribute.

Specified by:
getPermanentConnectionForEvents in interface CSClientService
Returns:
boolean

setReceiveReplyAfterSynchronousSendTimeout

public void setReceiveReplyAfterSynchronousSendTimeout(boolean receiveReply)
Sets the receiveReplyAfterSynchronousSendTimeout attribute.

Parameters:
receiveReply - boolean

getReceiveReplyAfterSynchronousSendTimeout

public boolean getReceiveReplyAfterSynchronousSendTimeout()
Obtains the receiveReplyAfterSynchronousSendTimeout attribute.

Returns:
boolean

initializeServerSocket

protected void initializeServerSocket()
                               throws java.io.IOException
Creates a socket

Throws:
java.io.IOException - I/O error occurs when opening the socket.

getTimeoutedSynchronousRequests

public Vector getTimeoutedSynchronousRequests()
Gets timeoutedSynchronousRequests value

Returns:
Vector

isEnableSSL

public boolean isEnableSSL()
Returns the enableSSL.

Specified by:
isEnableSSL in interface CSClientService
Returns:
boolean

setEnableSSL

public void setEnableSSL(boolean enableSSL)
Sets the enableSSL.

Specified by:
setEnableSSL in interface CSClientService
Parameters:
enableSSL - The enableSSL to set

getSSLEnabler

public SSLEnabler getSSLEnabler()
Returns the sslEnabler.

Specified by:
getSSLEnabler in interface CSClientService
Returns:
SSLEnabler

setSSLEnabler

public void setSSLEnabler(SSLEnabler sslEnabler)
Sets the sslEnabler.

Specified by:
setSSLEnabler in interface CSClientService
Parameters:
sslEnabler - The sslEnabler to set

getCharEncoding

public java.lang.String getCharEncoding()
Obtains the charEncoding attribute.

Returns:
String

setCharEncoding

public void setCharEncoding(java.lang.String c)
                     throws java.io.UnsupportedEncodingException
Sets the charEncoding attribute.

Parameters:
c - String
Throws:
java.io.UnsupportedEncodingException

closeSessionAndDeleteCookies

public void closeSessionAndDeleteCookies()
                                  throws DSECSInvalidRequestException
Method closeSessionAndDeleteCookies. Clear the Cookies when closing the session(e.g.Logoff) Added by China CDL L3,2004.03.26

Throws:
DSECSInvalidRequestException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005