Package org.yamcs.cmdhistory
Class CommandHistoryRequestManager
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractService
-
- org.yamcs.cmdhistory.CommandHistoryRequestManager
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
public class CommandHistoryRequestManager extends com.google.common.util.concurrent.AbstractService
Part of processors: handles filtered requests for command history. We handle two kind of subscriptions:- subscription to specific commands
- subscription to all the commands but filtered on source and time.
-
-
Constructor Summary
Constructors Constructor Description CommandHistoryRequestManager(Processor processor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCommand(PreparedCommand pc)
Called when a new command has to be added to the command history (i.e. when a users sends a telecommand)void
addSubscription(CommandHistoryFilter filter, CommandHistoryConsumer consumer)
Called by the CommandHistoryImpl to move the subscription from another command history manager to this oneprotected void
doStart()
protected void
doStop()
String
getInstance()
org.yamcs.protobuf.Commanding.CommandHistoryEntry
subscribeCommand(org.yamcs.protobuf.Commanding.CommandId cmdId, CommandHistoryConsumer consumer)
Add a consumer to the subscriber list for a commandCommandHistoryFilter
subscribeCommandHistory(String commandsOrigin, long commandsSince, CommandHistoryConsumer consumer)
Called by the CommandHistory consumers when they want to receive all updates corresponding to a command.void
unsubscribeCommand(org.yamcs.protobuf.Commanding.CommandId cmdId, CommandHistoryConsumer consumer)
removes a consumer from the subscribers for a command (if existing).CommandHistoryFilter
unsubscribeCommandHistory(int id)
Called by the CommandHistory consumers to remove the subscriptionvoid
updateCommand(org.yamcs.protobuf.Commanding.CommandId cmdId, List<Attribute> attrs)
send updates.
-
-
-
Constructor Detail
-
CommandHistoryRequestManager
public CommandHistoryRequestManager(Processor processor) throws ConfigurationException
- Throws:
ConfigurationException
-
-
Method Detail
-
subscribeCommand
public org.yamcs.protobuf.Commanding.CommandHistoryEntry subscribeCommand(org.yamcs.protobuf.Commanding.CommandId cmdId, CommandHistoryConsumer consumer) throws InvalidCommandId
Add a consumer to the subscriber list for a command- Parameters:
cmdId
-consumer
-- Returns:
- all the entries existing so far for the command
- Throws:
InvalidCommandId
-
unsubscribeCommand
public void unsubscribeCommand(org.yamcs.protobuf.Commanding.CommandId cmdId, CommandHistoryConsumer consumer)
removes a consumer from the subscribers for a command (if existing).- Parameters:
cmdId
-consumer
-
-
subscribeCommandHistory
public CommandHistoryFilter subscribeCommandHistory(String commandsOrigin, long commandsSince, CommandHistoryConsumer consumer)
Called by the CommandHistory consumers when they want to receive all updates corresponding to a command.
-
unsubscribeCommandHistory
public CommandHistoryFilter unsubscribeCommandHistory(int id)
Called by the CommandHistory consumers to remove the subscription- Parameters:
id
-
-
addSubscription
public void addSubscription(CommandHistoryFilter filter, CommandHistoryConsumer consumer)
Called by the CommandHistoryImpl to move the subscription from another command history manager to this one- Parameters:
filter
-
-
addCommand
public void addCommand(PreparedCommand pc)
Called when a new command has to be added to the command history (i.e. when a users sends a telecommand)
-
updateCommand
public void updateCommand(org.yamcs.protobuf.Commanding.CommandId cmdId, List<Attribute> attrs)
send updates.- Parameters:
cmdId
-attrs
-
-
doStart
protected void doStart()
- Specified by:
doStart
in classcom.google.common.util.concurrent.AbstractService
-
doStop
protected void doStop()
- Specified by:
doStop
in classcom.google.common.util.concurrent.AbstractService
-
getInstance
public String getInstance()
-
-