Remote Systems
v6.4.1

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

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

public class ServerCommandHandler
extends CommandHandler

The ServerCommandHandler is reponsible for maintaining a queue of commands and periodically routing commands from the queue to the appropriate miners.


Field Summary
static String Copyright
           
 
Fields inherited from class com.ibm.etools.systems.dstore.core.model.CommandHandler
_commands
 
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
ServerCommandHandler(ArrayList loaders)
          Constructor
 
Method Summary
 void finish()
          Called when the DataStore session is finished or when there is an unexpected error.
 void finishMiner(String name)
          Terminates a specified miner
 Miner getMiner(String name)
          Returns the specified miner
 ArrayList getMiners()
          Returns the list of loaded miners
 void loadMiners()
          Loads the miners
 void sendAppendFile(String fileName, byte[] bytes, int size, boolean binary)
          Appends bytes sent from the client to a file
 void sendAppendFile(String fileName, byte[] bytes, int size, boolean binary, String byteStreamHandlerId)
          Appends bytes sent from the client to a file
 void sendCommands()
          Called periodically to route the current queue of commands to the appropriate miners
 void sendFile(String fileName, byte[] bytes, int size, boolean binary)
          Sets the contents of a file with bytes sent from the client
 void sendFile(String fileName, byte[] bytes, int size, boolean binary, String byteStreamHandlerId)
          Sets the contents of a file with bytes sent from the client
 void sendFile(String fileName, File file)
          Set the contents of a file with the specified file
 void sendKeepAliveConfirmation()
          Does not apply to server.
 void sendKeepAliveRequest()
          Does not apply to server.
 void setDataStore(DataStore dataStore)
          Sets the associated DataStore
 
Methods inherited from class com.ibm.etools.systems.dstore.core.model.CommandHandler
addCommand, cancelAllCommands, command, command, command, command, command, getDataStore, handle
 
Methods inherited from class com.ibm.etools.systems.dstore.core.model.Handler
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
Constructor Detail

ServerCommandHandler

public ServerCommandHandler(ArrayList loaders)
Constructor

Parameters:
loaders - a list of ExternalLoaders used for loading miners
Method Detail

setDataStore

public void setDataStore(DataStore dataStore)
Sets the associated DataStore

Overrides:
setDataStore in class CommandHandler
Parameters:
dataStore - the associated DataStore

loadMiners

public void loadMiners()
Loads the miners


getMiners

public ArrayList getMiners()
Returns the list of loaded miners

Returns:
the list of miners

getMiner

public Miner getMiner(String name)
Returns the specified miner

Parameters:
name - the qualified classname of the miner to return
Returns:
the miner

finishMiner

public void finishMiner(String name)
Terminates a specified miner

Parameters:
name - the qualified classname of the miner to terminate

finish

public void finish()
Called when the DataStore session is finished or when there is an unexpected error.

Overrides:
finish in class Handler

sendCommands

public void sendCommands()
Called periodically to route the current queue of commands to the appropriate miners

Specified by:
sendCommands in class CommandHandler

sendFile

public void sendFile(String fileName,
                     File file)
Set the contents of a file with the specified file

Parameters:
fileName - the name of the target file
file - the source file

sendFile

public void sendFile(String fileName,
                     byte[] bytes,
                     int size,
                     boolean binary)
Sets the contents of a file with bytes sent from the client

Specified by:
sendFile in class CommandHandler
Parameters:
fileName - the name of the file to append to
bytes - the bytes of a file to insert
size - the number of bytes to insert
binary - indicates whether to insert the bytes as binary or unicode

sendFile

public void sendFile(String fileName,
                     byte[] bytes,
                     int size,
                     boolean binary,
                     String byteStreamHandlerId)
Sets the contents of a file with bytes sent from the client

Specified by:
sendFile in class CommandHandler
Parameters:
fileName - the name of the file to append to
bytes - the bytes of a file to insert
size - the number of bytes to insert
binary - indicates whether to insert the bytes as binary or unicode
byteStreamHandlerId - indicates which byte stream handler should receive the bytes

sendAppendFile

public void sendAppendFile(String fileName,
                           byte[] bytes,
                           int size,
                           boolean binary)
Appends bytes sent from the client to a file

Specified by:
sendAppendFile in class CommandHandler
Parameters:
fileName - the name of the file to append to
bytes - the bytes of a file to append
size - the number of bytes to append
binary - indicates whether to append the bytes as binary or unicode

sendAppendFile

public void sendAppendFile(String fileName,
                           byte[] bytes,
                           int size,
                           boolean binary,
                           String byteStreamHandlerId)
Appends bytes sent from the client to a file

Specified by:
sendAppendFile in class CommandHandler
Parameters:
fileName - the name of the file to append to
bytes - the bytes of a file to append
size - the number of bytes to append
binary - indicates whether to append the bytes as binary or unicode
byteStreamHandlerId - indicates which byte stream handler should receive the bytes

sendKeepAliveConfirmation

public void sendKeepAliveConfirmation()
Does not apply to server. Use ServerUpdateHandler.sendKeepAliveConfirmation().

Specified by:
sendKeepAliveConfirmation in class CommandHandler

sendKeepAliveRequest

public void sendKeepAliveRequest()
Does not apply to server. Use ServerUpdateHandler.sendKeepAliveRequest().

Specified by:
sendKeepAliveRequest in class CommandHandler

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.