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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when a new command has to be added to the command history (i.e. when a users sends a telecommand)voidaddSubscription(CommandHistoryFilter filter, CommandHistoryConsumer consumer) Called by the CommandHistoryImpl to move the subscription from another command history manager to this onevoidcommandFinished(org.yamcs.protobuf.Commanding.CommandId cmdId) Called when there can be no more events for this command.protected voiddoStart()protected voiddoStop()org.yamcs.protobuf.Commanding.CommandHistoryEntrysubscribeCommand(org.yamcs.protobuf.Commanding.CommandId cmdId, CommandHistoryConsumer consumer) Add a consumer to the subscriber list for a commandsubscribeCommandHistory(String commandsOrigin, long commandsSince, CommandHistoryConsumer consumer) Called by the CommandHistory consumers when they want to receive all updates corresponding to a command.voidunsubscribeCommand(org.yamcs.protobuf.Commanding.CommandId cmdId, CommandHistoryConsumer consumer) removes a consumer from the subscribers for a command (if existing).unsubscribeCommandHistory(int id) Called by the CommandHistory consumers to remove the subscriptionvoidupdateCommand(org.yamcs.protobuf.Commanding.CommandId cmdId, List<Attribute> attrs) send updates.Methods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, doCancelStart, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toString
-
Constructor Details
-
CommandHistoryRequestManager
- Throws:
ConfigurationException
-
-
Method Details
-
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
Called by the CommandHistory consumers to remove the subscription- Parameters:
id-
-
addSubscription
Called by the CommandHistoryImpl to move the subscription from another command history manager to this one- Parameters:
filter-
-
addCommand
Called when a new command has to be added to the command history (i.e. when a users sends a telecommand) -
updateCommand
send updates.- Parameters:
cmdId-attrs-
-
commandFinished
public void commandFinished(org.yamcs.protobuf.Commanding.CommandId cmdId) Called when there can be no more events for this command.We remove it from the active commands only after a few seconds because some tools may subscribe to it after being sent and if there was no verifier, the command would immediately disappear so the subscription would fail.
-
doStart
protected void doStart()- Specified by:
doStartin classcom.google.common.util.concurrent.AbstractService
-
doStop
protected void doStop()- Specified by:
doStopin classcom.google.common.util.concurrent.AbstractService
-
getInstance
-