org.lsst.ccs.bus
Class Command

java.lang.Object
  extended by org.lsst.ccs.bus.BusMessage
      extended by org.lsst.ccs.bus.Command
All Implemented Interfaces:
Serializable, BusPayload, CommandBusMessage

public abstract class Command
extends BusMessage
implements CommandBusMessage

A command sent on the CCS bus Will be executed by the destination subsystem.

Author:
Eric Aubourg
See Also:
Serialized Form

Field Summary
protected  boolean canRunInActiveMode
           
protected  boolean canWaitForReady
           
protected  String destination
           
protected  String key
           
protected static org.apache.log4j.Logger log
           
 
Fields inherited from class org.lsst.ccs.bus.BusMessage
detailLevel, origin, priorityLevel, summary, timeStamp
 
Constructor Summary
Command()
           
 
Method Summary
 boolean canRunInActiveMode()
          Can this command be executed by a subsystem which is in "active" mode ?
 boolean canWaitForReady()
          can this command wait for a single-threaded ownerSubsystem to be ready ?
abstract  Object execute(CommandExecutor s)
           
 String getCorrelId()
           
 String getDestination()
          The command destination : subsystem name or "*"
 String getKey()
          Key used for lock and arbitration.
 String getMessageType()
           
 boolean isWrite()
          is this command a writing command that has to be protected ?
 void setCanRunInActiveMode(boolean canRunInActiveMode)
           
 void setCanWaitForReady(boolean canWaitForReady)
          can this command wait for a single-threaded ownerSubsystem to be ready
 void setCorrelId(String correlId)
          Correlation id, propagated from command to command
 void setDestination(String destination)
          The command destination : subsystem name or "*"
 void setKey(String key)
          Key used for lock and arbitration.
 String toString()
           
 
Methods inherited from class org.lsst.ccs.bus.BusMessage
getDetailLevel, getOrigin, getPriorityLevel, getSummary, getTimeStamp, setDetailLevel, setOrigin, setPriorityLevel, setSummary, setTimeStamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log

destination

protected String destination

key

protected String key

canWaitForReady

protected boolean canWaitForReady

canRunInActiveMode

protected boolean canRunInActiveMode
Constructor Detail

Command

public Command()
Method Detail

execute

public abstract Object execute(CommandExecutor s)

getMessageType

public String getMessageType()
Specified by:
getMessageType in class BusMessage

getDestination

public String getDestination()
The command destination : subsystem name or "*"

Returns:
command destination

setDestination

public void setDestination(String destination)
The command destination : subsystem name or "*"

Parameters:
destination -

getKey

public String getKey()
Key used for lock and arbitration. If set, incoming commands must have the same key.

Returns:
the key

setKey

public void setKey(String key)
Key used for lock and arbitration. If set, incoming commands must have the same key

Parameters:
key -

isWrite

public boolean isWrite()
is this command a writing command that has to be protected ?


canWaitForReady

public boolean canWaitForReady()
can this command wait for a single-threaded ownerSubsystem to be ready ?

Returns:
a boolean

setCanWaitForReady

public void setCanWaitForReady(boolean canWaitForReady)
can this command wait for a single-threaded ownerSubsystem to be ready

Parameters:
canWaitForReady -

canRunInActiveMode

public boolean canRunInActiveMode()
Can this command be executed by a subsystem which is in "active" mode ?

Returns:
a boolean

setCanRunInActiveMode

public void setCanRunInActiveMode(boolean canRunInActiveMode)

toString

public String toString()
Overrides:
toString in class Object

getCorrelId

public String getCorrelId()

setCorrelId

public void setCorrelId(String correlId)
Correlation id, propagated from command to command



Copyright © 2013 LSST. All Rights Reserved.