Remote System Explorer DataStore
Release 3.4

org.eclipse.dstore.core.util
Class CommandGenerator

java.lang.Object
  extended by org.eclipse.dstore.core.util.CommandGenerator

public class CommandGenerator
extends Object

This class is used to generate command object instances from command descriptors and arguments to commands. Command instances are instances of command descriptors. Each command instance contains a set of data arguments and a status object, that represents the current state of a command. After a command instance is created, it is referenced in the command log for the DataStore.

Since:
3.0 moved from non-API to API

Constructor Summary
CommandGenerator()
          Constructor
 
Method Summary
 DataElement createCommand(DataElement commandDescriptor)
          Creates a new command instance object from a command descriptor
 DataElement generateCommand(DataElement commandDescriptor, ArrayList arguments, DataElement dataObject, boolean refArg)
          Creates a new command from a command descriptor and it's arguments.
 DataElement generateCommand(DataElement commandDescriptor, DataElement dataObject, boolean refArg)
          Creates a new command from a command descriptor and it's arguments.
 DataElement generateCommand(DataElement commandDescriptor, DataElement arg, DataElement dataObject, boolean refArg)
          Creates a new command from a command descriptor and it's arguments.
 DataElement generateResponse(DataElement document, ArrayList objects)
          Creates a response tree for transmitting a set of data from a server to a client.
 DataElement generateResponse(String responseType)
          Creates a simple response object of the specified type
 DataElement generateResponse(String responseType, DataElement dataObject)
          Creates a response tree for transmitting a set of data from a server to a client.
 DataElement logCommand(DataElement commandObject)
          This method logs the current command object in the DataStore command log.
 void setDataStore(DataStore dataStore)
          Sets the associated DataStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandGenerator

public CommandGenerator()
Constructor

Method Detail

setDataStore

public void setDataStore(DataStore dataStore)
Sets the associated DataStore

Parameters:
dataStore - the associated DataStore

logCommand

public DataElement logCommand(DataElement commandObject)
This method logs the current command object in the DataStore command log. For each logged command, a status object is created and returned.

Parameters:
commandObject - the commandObject to log
Returns:
the status object of the command

createCommand

public DataElement createCommand(DataElement commandDescriptor)
Creates a new command instance object from a command descriptor

Parameters:
commandDescriptor - the descriptor of the command to create
Returns:
the new command instance

generateCommand

public DataElement generateCommand(DataElement commandDescriptor,
                                   ArrayList arguments,
                                   DataElement dataObject,
                                   boolean refArg)
Creates a new command from a command descriptor and it's arguments.

Parameters:
commandDescriptor - the command type of the new command
arguments - the arguments for the command, besides the subject
dataObject - the subject of the command
refArg - indicates whether the subject should be represented as a reference or directly
Returns:
the status object of the command

generateCommand

public DataElement generateCommand(DataElement commandDescriptor,
                                   DataElement arg,
                                   DataElement dataObject,
                                   boolean refArg)
Creates a new command from a command descriptor and it's arguments.

Parameters:
commandDescriptor - the command type of the new command
arg - the arguement for the command, besides the subject
dataObject - the subject of the command
refArg - indicates whether the subject should be represented as a reference or directly
Returns:
the status object of the command

generateCommand

public DataElement generateCommand(DataElement commandDescriptor,
                                   DataElement dataObject,
                                   boolean refArg)
Creates a new command from a command descriptor and it's arguments.

Parameters:
commandDescriptor - the command type of the new command
dataObject - the subject of the command
refArg - indicates whether the subject should be represented as a reference or directly
Returns:
the status object of the command

generateResponse

public DataElement generateResponse(DataElement document,
                                    ArrayList objects)
Creates a response tree for transmitting a set of data from a server to a client.

Parameters:
document - the root of the response
objects - the data contained in the response
Returns:
the response tree root

generateResponse

public DataElement generateResponse(String responseType,
                                    DataElement dataObject)
Creates a response tree for transmitting a set of data from a server to a client.

Parameters:
responseType - the type of data to respond with
dataObject - the child object in the response tree
Returns:
the response tree root

generateResponse

public DataElement generateResponse(String responseType)
Creates a simple response object of the specified type

Parameters:
responseType - the type of data to respond with
Returns:
the response object

Remote System Explorer DataStore
Release 3.4

Copyright (c) IBM Corporation and others 2000, 2012. All Rights Reserved.