Package org.yamcs
Class Processor
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractService
-
- org.yamcs.Processor
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
public class Processor extends com.google.common.util.concurrent.AbstractServiceThis class helps keeping track of the different objects used in a Yamcs Processor - i.e. all the objects required to have a TM/TC processing chain (either realtime or playback).
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROC_PARAMETERS_STREAM
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddProcessorListener(ProcessorListener processorListener)voidchangeSpeed(org.yamcs.protobuf.Yamcs.ReplaySpeed speed)voidconnect(ConnectedClient s)Increase with one the number of connected clientsvoiddisconnect(ConnectedClient s)Disconnects a client from this processor.voiddoStart()starts processing by invoking the start method for all the associated componentsvoiddoStop()Closes the processor by stoping the tm/pp and tc It can be that there are still clients connected, but they will not get any data and new clients can not connect to these processors anymore.CommandHistoryRequestManagergetCommandHistoryManager()CommandHistoryPublishergetCommandHistoryPublisher()CommandingManagergetCommandingManager()CommandReleasergetCommandReleaser()ProcessorConfiggetConfig()intgetConnectedClients()ContainerRequestManagergetContainerRequestManager()StringgetCreator()longgetCurrentTime()Returns the processor time for realtime processors it is the mission time or simulation time for replay processors it is the replay timeEventAlarmServergetEventAlarmServer()ExecutorServicegetExecutor()StringgetInstance()LastValueCachegetLastValueCache()StringgetName()ParameterCacheConfiggetPameterCacheConfig()ParameterCachegetParameterCache()ParameterRequestManagergetParameterRequestManager()ProcessorDatagetProcessorData()Returns the processor data used to store processor specific calibration, alarmsorg.yamcs.protobuf.Yamcs.ReplayRequestgetReplayRequest()valid only if isArchiveReplay returns trueorg.yamcs.protobuf.Yamcs.ReplayStatus.ReplayStategetReplayState()valid only if isArchiveReplay returns trueList<ProcessorServiceWithConfig>getServices()<T extends ProcessorService>
List<T>getServices(Class<T> serviceClass)org.yamcs.protobuf.ServiceStategetState()StreamParameterSendergetStreamParameterSender()If recording to the archive initial values and local parameters is enabled, this class can be used to do it.ScheduledThreadPoolExecutorgetTimer()TmPacketProvidergetTmPacketProvider()XtceTmProcessorgetTmProcessor()StringgetType()XtceDbgetXtceDb()booleanhasAlarmChecker()booleanhasAlarmServer()booleanhasCommanding()booleanisPersistent()booleanisReplay()booleanisSubscribeAll()booleanisSynchronous()voidnotifyStateChange()voidpause()voidquit()booleanrecordLocalValues()static voidremoveProcessorListener(ProcessorListener processorListener)voidresume()voidseek(long instant)voidsetCommandHistoryProvider(CommandHistoryProvider chp)voidsetCommandReleaser(CommandReleaser cr)voidsetCreator(String creator)voidsetPacketProvider(TmPacketProvider tpp)voidsetPersistent(boolean systemSession)voidsetSynchronous(boolean synchronous)voidstart()StringtoString()
-
-
-
Field Detail
-
PROC_PARAMETERS_STREAM
public static final String PROC_PARAMETERS_STREAM
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Processor
public Processor(String yamcsInstance, String name, String type, String creator) throws ProcessorException
- Throws:
ProcessorException
-
-
Method Detail
-
getStreamParameterSender
public StreamParameterSender getStreamParameterSender()
If recording to the archive initial values and local parameters is enabled, this class can be used to do it. Otherwise it will return null.- Returns:
- the stream parameter sender that can be used to send data on the
PROC_PARAMETERS_STREAMstream to be recorded in the archive
-
setPacketProvider
public void setPacketProvider(TmPacketProvider tpp)
-
setCommandReleaser
public void setCommandReleaser(CommandReleaser cr) throws ValidationException
- Throws:
ValidationException
-
setCommandHistoryProvider
public void setCommandHistoryProvider(CommandHistoryProvider chp)
-
getExecutor
public ExecutorService getExecutor()
-
getCommandHistoryPublisher
public CommandHistoryPublisher getCommandHistoryPublisher()
-
getParameterRequestManager
public ParameterRequestManager getParameterRequestManager()
-
getContainerRequestManager
public ContainerRequestManager getContainerRequestManager()
-
getTmProcessor
public XtceTmProcessor getTmProcessor()
-
doStart
public void doStart()
starts processing by invoking the start method for all the associated components- Specified by:
doStartin classcom.google.common.util.concurrent.AbstractService
-
getServices
public List<ProcessorServiceWithConfig> getServices()
-
pause
public void pause()
-
resume
public void resume()
-
seek
public void seek(long instant)
-
changeSpeed
public void changeSpeed(org.yamcs.protobuf.Yamcs.ReplaySpeed speed)
-
getCommandReleaser
public CommandReleaser getCommandReleaser()
- Returns:
- the tcUplinker
-
getTmPacketProvider
public TmPacketProvider getTmPacketProvider()
- Returns:
- the tmPacketProvider
-
getName
public String getName()
-
getType
public String getType()
- Returns:
- the type
-
getCreator
public String getCreator()
-
setCreator
public void setCreator(String creator)
-
getConnectedClients
public int getConnectedClients()
-
connect
public void connect(ConnectedClient s) throws ProcessorException
Increase with one the number of connected clients- Throws:
ProcessorException
-
disconnect
public void disconnect(ConnectedClient s)
Disconnects a client from this processor. If the processor has no more clients, quit.
-
doStop
public void doStop()
Closes the processor by stoping the tm/pp and tc It can be that there are still clients connected, but they will not get any data and new clients can not connect to these processors anymore. Once it is closed, you can create a processor with the same name which will make it maybe a bit confusing :(- Specified by:
doStopin classcom.google.common.util.concurrent.AbstractService
-
addProcessorListener
public static void addProcessorListener(ProcessorListener processorListener)
-
removeProcessorListener
public static void removeProcessorListener(ProcessorListener processorListener)
-
isPersistent
public boolean isPersistent()
-
setPersistent
public void setPersistent(boolean systemSession)
-
isSynchronous
public boolean isSynchronous()
-
hasCommanding
public boolean hasCommanding()
-
setSynchronous
public void setSynchronous(boolean synchronous)
-
isReplay
public boolean isReplay()
-
getReplayRequest
public org.yamcs.protobuf.Yamcs.ReplayRequest getReplayRequest()
valid only if isArchiveReplay returns true- Returns:
-
getReplayState
public org.yamcs.protobuf.Yamcs.ReplayStatus.ReplayState getReplayState()
valid only if isArchiveReplay returns true- Returns:
-
getState
public org.yamcs.protobuf.ServiceState getState()
-
getCommandingManager
public CommandingManager getCommandingManager()
-
getInstance
public String getInstance()
- Returns:
- the yamcs instance this processor is part of
-
getXtceDb
public XtceDb getXtceDb()
-
getCommandHistoryManager
public CommandHistoryRequestManager getCommandHistoryManager()
-
hasAlarmChecker
public boolean hasAlarmChecker()
-
hasAlarmServer
public boolean hasAlarmServer()
-
getTimer
public ScheduledThreadPoolExecutor getTimer()
-
getCurrentTime
public long getCurrentTime()
Returns the processor time for realtime processors it is the mission time or simulation time for replay processors it is the replay time- Returns:
-
quit
public void quit()
-
start
public void start()
-
notifyStateChange
public void notifyStateChange()
-
getPameterCacheConfig
public ParameterCacheConfig getPameterCacheConfig()
-
getParameterCache
public ParameterCache getParameterCache()
-
getProcessorData
public ProcessorData getProcessorData()
Returns the processor data used to store processor specific calibration, alarms- Returns:
- processor specific data
-
getLastValueCache
public LastValueCache getLastValueCache()
-
isSubscribeAll
public boolean isSubscribeAll()
-
getServices
public <T extends ProcessorService> List<T> getServices(Class<T> serviceClass)
-
recordLocalValues
public boolean recordLocalValues()
-
getEventAlarmServer
public EventAlarmServer getEventAlarmServer()
-
getConfig
public ProcessorConfig getConfig()
-
toString
public String toString()
- Overrides:
toStringin classcom.google.common.util.concurrent.AbstractService
-
-