Remote Systems
v6.4.1

com.ibm.etools.systems.dstore.core.server
Class ServerUpdateHandler

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.ibm.etools.systems.dstore.core.model.Handler
          extended bycom.ibm.etools.systems.dstore.core.model.UpdateHandler
              extended bycom.ibm.etools.systems.dstore.core.server.ServerUpdateHandler
All Implemented Interfaces:
Runnable

public class ServerUpdateHandler
extends UpdateHandler

The ServerUpdateHandler is contains a queue of data update requests and periodically transmits it's queue to the client


Field Summary
protected  DataElement _confirmKeepAliveDocumentElement
           
protected  DataElement _keepAliveDocumentElement
           
protected  DataElement _pendingKeepAliveConfirmation
           
protected  DataElement _pendingKeepAliveRequest
           
static String Copyright
           
 
Fields inherited from class com.ibm.etools.systems.dstore.core.model.UpdateHandler
_dataObjects
 
Fields inherited from class com.ibm.etools.systems.dstore.core.model.Handler
_dataStore, _waitIncrement
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerUpdateHandler()
          Constructor
 
Method Summary
 void addSender(Sender sender)
          Add a sender to the list of senders.
 void handle()
          Periodically called on the handler thread to sends data updates.
 void removeSender(Sender sender)
          Remove a sender from the list of senders.
 void removeSenderWith(Socket socket)
          Removes the sender that is associated with the specified socket.
 void sendKeepAliveConfirmation()
          Implemented to provide the means by which keepalive confirmations are sent across the comm channel.
 void sendKeepAliveRequest()
          Implemented to provide the means by which keepalive requests are sent across the comm channel.
 void sendUpdates()
          Periodically called to send data in the queue from the server to the client
 void setDataStore(DataStore dataStore)
          Sets the associated DataStore
 void updateAppendFile(String path, byte[] bytes, int size, boolean binary)
          Appends bytes to the specified file on the client.
 void updateAppendFile(String path, byte[] bytes, int size, boolean binary, String byteStreamHandlerId)
          Appends bytes to the specified file on the client.
 void updateFile(String path, byte[] bytes, int size, boolean binary)
          Sends bytes to the specified file on the client.
 void updateFile(String path, byte[] bytes, int size, boolean binary, String byteStreamHandlerId)
          Sends bytes to the specified file on the client.
 
Methods inherited from class com.ibm.etools.systems.dstore.core.model.UpdateHandler
clean, clean, update, update, update
 
Methods inherited from class com.ibm.etools.systems.dstore.core.model.Handler
finish, getWaitTime, isFinished, run, setWaitTime
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

_keepAliveDocumentElement

protected DataElement _keepAliveDocumentElement

_confirmKeepAliveDocumentElement

protected DataElement _confirmKeepAliveDocumentElement

_pendingKeepAliveRequest

protected DataElement _pendingKeepAliveRequest

_pendingKeepAliveConfirmation

protected DataElement _pendingKeepAliveConfirmation
Constructor Detail

ServerUpdateHandler

public ServerUpdateHandler()
Constructor

Method Detail

setDataStore

public void setDataStore(DataStore dataStore)
Sets the associated DataStore

Overrides:
setDataStore in class Handler
Parameters:
dataStore -

addSender

public void addSender(Sender sender)
Add a sender to the list of senders. Normally there is only one client for the server, which requires one Sender. If there are more than one clients, then this is how senders are added.

Parameters:
sender - a sender connected to a socket

removeSender

public void removeSender(Sender sender)
Remove a sender from the list of senders.

Parameters:
sender - the sender to remove

updateFile

public void updateFile(String path,
                       byte[] bytes,
                       int size,
                       boolean binary)
Sends bytes to the specified file on the client.

Specified by:
updateFile in class UpdateHandler
Parameters:
path - the name of the file on the client
bytes - the bytes to send
size - the number of bytes to send
binary - indicates whether to send the bytes and binary or text

updateFile

public void updateFile(String path,
                       byte[] bytes,
                       int size,
                       boolean binary,
                       String byteStreamHandlerId)
Sends bytes to the specified file on the client.

Specified by:
updateFile in class UpdateHandler
Parameters:
path - the name of the file on the client
bytes - the bytes to send
size - the number of bytes to send
binary - indicates whether to send the bytes and binary or text
byteStreamHandlerId - indicates the byte stream handler to receive the bytes

updateAppendFile

public void updateAppendFile(String path,
                             byte[] bytes,
                             int size,
                             boolean binary)
Appends bytes to the specified file on the client.

Specified by:
updateAppendFile in class UpdateHandler
Parameters:
path - the name of the file on the client
bytes - the bytes to send
size - the number of bytes to send
binary - indicates whether to send the bytes and binary or text

updateAppendFile

public void updateAppendFile(String path,
                             byte[] bytes,
                             int size,
                             boolean binary,
                             String byteStreamHandlerId)
Appends bytes to the specified file on the client.

Specified by:
updateAppendFile in class UpdateHandler
Parameters:
path - the name of the file on the client
bytes - the bytes to send
size - the number of bytes to send
binary - indicates whether to send the bytes and binary or text
byteStreamHandlerId - indicates the byte stream handler to receive the bytes

handle

public void handle()
Periodically called on the handler thread to sends data updates.

Overrides:
handle in class UpdateHandler

sendUpdates

public void sendUpdates()
Periodically called to send data in the queue from the server to the client

Specified by:
sendUpdates in class UpdateHandler

removeSenderWith

public void removeSenderWith(Socket socket)
Removes the sender that is associated with the specified socket. This causes A disconnect for the client that is associated with this socket.

Parameters:
socket - the socket on which a sender communicates

sendKeepAliveRequest

public void sendKeepAliveRequest()
Description copied from class: UpdateHandler
Implemented to provide the means by which keepalive requests are sent across the comm channel.

Specified by:
sendKeepAliveRequest in class UpdateHandler

sendKeepAliveConfirmation

public void sendKeepAliveConfirmation()
Description copied from class: UpdateHandler
Implemented to provide the means by which keepalive confirmations are sent across the comm channel.

Specified by:
sendKeepAliveConfirmation in class UpdateHandler

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.