public class CommandQueueManager extends com.google.common.util.concurrent.AbstractService implements ParameterConsumer, SystemParametersProducer
| Constructor and Description |
|---|
CommandQueueManager(CommandingManager commandingManager)
Constructs a Command Queue Manager.
|
| Modifier and Type | Method and Description |
|---|---|
CommandQueue |
addCommand(AuthenticationToken authToken,
PreparedCommand pc)
Called from the CommandingImpl to add a command to the queue
First the command is added to the command history
Depending on the status of the queue, the command is rejected by setting the CommandFailed in the command history
added to the queue or directly sent using the uplinker
|
void |
addToCommandHistory(Commanding.CommandId commandId,
String key,
String value) |
void |
doStart()
called at processor startup, subscribe all parameters required for checking command constraints
|
void |
doStop() |
String |
getChannelName() |
String |
getInstance() |
CommandQueue |
getQueue(AuthenticationToken authToken,
PreparedCommand pc) |
CommandQueue |
getQueue(String name) |
Collection<CommandQueue> |
getQueues() |
Collection<Pvalue.ParameterValue> |
getSystemParameters() |
void |
registerListener(CommandQueueListener cqm)
Called from a queue monitor to register itself in order to be notified when
new commands are added/removed from the queue.
|
PreparedCommand |
rejectCommand(Commanding.CommandId commandId,
String username)
Called by external clients to remove a command from the queue
|
PreparedCommand |
rejectCommand(UUID uuid,
String username) |
boolean |
removeListener(CommandQueueListener cqm) |
PreparedCommand |
sendCommand(Commanding.CommandId commandId,
boolean rebuild)
Called from external client to release a command from the queue
|
PreparedCommand |
sendCommand(UUID uuid,
boolean rebuild) |
CommandQueue |
setQueueState(String queueName,
Commanding.QueueState newState)
Called from external clients to change the state of the queue
|
void |
updateItems(int subscriptionId,
List<ParameterValue> items) |
public CommandQueueManager(CommandingManager commandingManager) throws ConfigurationException
commandingManager - ConfigurationException - in case there is an error in the configuration file.
Note: if the configuration file doesn't exist, this exception is not thrown.public void doStart()
doStart in class com.google.common.util.concurrent.AbstractServicepublic void doStop()
doStop in class com.google.common.util.concurrent.AbstractServicepublic Collection<CommandQueue> getQueues()
public CommandQueue getQueue(String name)
public CommandQueue addCommand(AuthenticationToken authToken, PreparedCommand pc) throws InvalidAuthenticationToken
authToken - pc - InvalidAuthenticationTokenpublic void addToCommandHistory(Commanding.CommandId commandId, String key, String value)
public CommandQueue getQueue(AuthenticationToken authToken, PreparedCommand pc) throws InvalidAuthenticationToken
authToken - pc - InvalidAuthenticationTokenpublic PreparedCommand rejectCommand(Commanding.CommandId commandId, String username)
commandId - username - - the username rejecting the commandpublic PreparedCommand rejectCommand(UUID uuid, String username)
public PreparedCommand sendCommand(Commanding.CommandId commandId, boolean rebuild)
commandId - rebuild - - if to rebuild the command binary from the sourcepublic PreparedCommand sendCommand(UUID uuid, boolean rebuild)
public CommandQueue setQueueState(String queueName, Commanding.QueueState newState)
queueName - the queue whose state has to be setnewState - the new state of the queuepublic void registerListener(CommandQueueListener cqm)
cqm - the callback which will be called with updatespublic boolean removeListener(CommandQueueListener cqm)
public String getInstance()
public String getChannelName()
public void updateItems(int subscriptionId,
List<ParameterValue> items)
updateItems in interface ParameterConsumerpublic Collection<Pvalue.ParameterValue> getSystemParameters()
getSystemParameters in interface SystemParametersProducerCopyright © 2017 Space Applications Services. All rights reserved.