ist.palcom.resource.descriptor
Class Command

java.lang.Object
  extended by ist.palcom.resource.descriptor.ASTNode
      extended by ist.palcom.resource.descriptor.ControlItem
          extended by ist.palcom.resource.descriptor.Command
All Implemented Interfaces:
java.lang.Cloneable

public class Command
extends ControlItem
implements java.lang.Cloneable


Field Summary
static java.lang.String DIRECTION_IN
           
static java.lang.String DIRECTION_OUT
           
protected  boolean getBrowserLabel_visited
           
 
Fields inherited from class ist.palcom.resource.descriptor.ASTNode
CHANGE, children, encloseInBraces_visited, generatedWithCacheCycle, generatedWithCircularEnabled, generatedWithComponentCheck, getAssemblyLabel_visited, getErrorList_visited, getIndent_visited, getParentPRDAssemblyVer_visited, getPrettyClosingString_visited, getPrettyString_visited, IN_CIRCLE, LAST_CYCLE, numChildren, parent, prettyPrintChildren_visited, RESET_CYCLE
 
Constructor Summary
Command()
           
Command(CommandInfo p0, List p1)
           
Command(java.lang.String id, java.lang.String direction)
           
 
Method Summary
 void addParam(Param node)
           
 void addParamAndInfo(Param param)
           
 java.lang.Object clone()
           
 ASTNode copy()
           
 Command findCommand(java.lang.String id, java.lang.String direction)
           
 ControlItem findItem(java.lang.String id)
          Returns the ControlItem within the sub-tree rooted at this ControlItem that has the sought ID, or null if none exists.
 Command findMatchingCommand(Command command)
          Implements this method for Commands (overrides the one in ControlItem).
 void flushCache()
           
 ASTNode fullCopy()
           
 java.lang.String getBrowserLabel()
           
 java.lang.Object[] getChildArray()
          Helper method for the TreeView
 Command getCopy()
          Returns a copy of this command, with the same ID and the same parameters and parameter values.
 java.lang.String getDirection()
           
 java.lang.String getHelp()
           
 CommandInfo getInfo()
           
 PRDData getInfoAsInfo()
          Workaround for static typing.
 CommandInfo getInfoNoTransform()
           
 int getNumParam()
           
 Param getParam(int i)
           
 Param getParam(java.lang.String id)
          Returns a param with ID id, or null if none is found.
 List getParamList()
           
 List getParamListNoTransform()
           
 void invoke()
          Invoke this command.
 void invoke(java.util.ArrayList addresses)
          Invoke this command.
 boolean isAboutTheSameEntityAs(PRDData data)
           
protected  boolean matches(Command command)
          Returns true if this Command matches command.
protected  int numChildren()
           
 void setDataRefsAndAddDataToList(java.util.ArrayList dataList)
           
 void setDataAccordingToDataRefs(byte[][] data)
           
 void setHelp(java.lang.String help)
           
 void setInfo(CommandInfo node)
           
 void setParam(Param node, int i)
           
 void setParamList(List list)
           
 void update(Command command)
          Update this Command with the parameter values in command.
 
Methods inherited from class ist.palcom.resource.descriptor.ControlItem
getID, getMessage, getServiceProxy, getTagName, initializeFromElement, writeStartTagAndAttributes, writeXMLElement
 
Methods inherited from class ist.palcom.resource.descriptor.ASTNode
addASTtoList, addChild, Define_AbstractResourceAddress_custServiceAddress, Define_AbstractResourceAddress_provServiceAddress, Define_CommandInfo_ci, Define_Device_parentDevice, Define_Identifier_getLocalName, Define_NetworkNode_lookup, Define_PRDAssemblyVer_av, Define_Service_inhCust, Define_Service_inhProv, Define_Service_parentService, Define_String_expectedType, Define_Universe_universe, encloseInBraces, getAssemblyLabel, getChild, getChildNoTransform, getErrorList, getIDforEditing, getIndent, getIndexOfChild, getNumChild, getParent, getParentPRDAssemblyVer, getPrettyClosingString, getPrettyString, insertChild, prettyprint, prettyPrintChildren, remove, removeChild, reset, resetTree, setChild, setParent, updateIDfromEditor
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTION_IN

public static final java.lang.String DIRECTION_IN
See Also:
Constant Field Values

DIRECTION_OUT

public static final java.lang.String DIRECTION_OUT
See Also:
Constant Field Values

getBrowserLabel_visited

protected boolean getBrowserLabel_visited
Constructor Detail

Command

public Command(java.lang.String id,
               java.lang.String direction)

Command

public Command()

Command

public Command(CommandInfo p0,
               List p1)
Method Detail

flushCache

public void flushCache()
Overrides:
flushCache in class ControlItem

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class ControlItem
Throws:
java.lang.CloneNotSupportedException

copy

public ASTNode copy()
Overrides:
copy in class ASTNode

fullCopy

public ASTNode fullCopy()
Overrides:
fullCopy in class ASTNode

getChildArray

public java.lang.Object[] getChildArray()
Description copied from class: ASTNode
Helper method for the TreeView

Overrides:
getChildArray in class ASTNode
Returns:
The (interesting) children of a node, as an Object array possibly bypassing levels in the tree or ignoring certain children.

getInfoAsInfo

public PRDData getInfoAsInfo()
Description copied from class: ControlItem
Workaround for static typing.

Specified by:
getInfoAsInfo in class ControlItem

getDirection

public java.lang.String getDirection()

getHelp

public java.lang.String getHelp()

setHelp

public void setHelp(java.lang.String help)

findCommand

public Command findCommand(java.lang.String id,
                           java.lang.String direction)

findItem

public ControlItem findItem(java.lang.String id)
Description copied from class: ControlItem
Returns the ControlItem within the sub-tree rooted at this ControlItem that has the sought ID, or null if none exists. This method is overridden in appropriate subclasses.

Overrides:
findItem in class ControlItem

findMatchingCommand

public Command findMatchingCommand(Command command)
Implements this method for Commands (overrides the one in ControlItem). Returns this Command if it matches command, and null if not.

Overrides:
findMatchingCommand in class ControlItem

setDataRefsAndAddDataToList

public void setDataRefsAndAddDataToList(java.util.ArrayList dataList)
Specified by:
setDataRefsAndAddDataToList in class ControlItem

setDataAccordingToDataRefs

public void setDataAccordingToDataRefs(byte[][] data)
Specified by:
setDataAccordingToDataRefs in class ControlItem

getCopy

public Command getCopy()
Returns a copy of this command, with the same ID and the same parameters and parameter values.


getParam

public Param getParam(java.lang.String id)
Returns a param with ID id, or null if none is found.


invoke

public void invoke()
Invoke this command. This means that it will be sent to registered receivers in the surrounding ServiceProxy, with the current parameter values. Which receivers that are notified depends on the actual type of this object. The command will be sent to all available connections if it has direction OUT otherwise it will be sent to the service corresponding to the surrounding ServiceProxy. If there is no surrounding ServiceProxy, nothing will happen.


invoke

public void invoke(java.util.ArrayList addresses)
Invoke this command. This means that it will be sent to registered receivers in the surrounding ServiceProxy, with the current parameter values. Which receivers that are notified depends on the actual type of this object. The command will be sent to the connections matching the localSIDs/serviceInstanceIDs or actual connection objects in the arrayList. If there is no surrounding ServiceProxy, nothing will happen.


matches

protected boolean matches(Command command)
Returns true if this Command matches command. A Command is considered to match if it has the same ID, direction and if all params have the same ID and the same types, and are in the same order.


update

public void update(Command command)
Update this Command with the parameter values in command. If command does not match this Command, nothing happens.


addParamAndInfo

public void addParamAndInfo(Param param)

isAboutTheSameEntityAs

public boolean isAboutTheSameEntityAs(PRDData data)

numChildren

protected int numChildren()
Overrides:
numChildren in class ControlItem

setInfo

public void setInfo(CommandInfo node)

getInfo

public CommandInfo getInfo()

getInfoNoTransform

public CommandInfo getInfoNoTransform()

setParamList

public void setParamList(List list)

getNumParam

public int getNumParam()

getParam

public Param getParam(int i)

addParam

public void addParam(Param node)

setParam

public void setParam(Param node,
                     int i)

getParamList

public List getParamList()

getParamListNoTransform

public List getParamListNoTransform()

getBrowserLabel

public java.lang.String getBrowserLabel()
Overrides:
getBrowserLabel in class ControlItem