Package org.yamcs.xtceproc
Class XtceTmProcessor
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractService
-
- org.yamcs.AbstractProcessorService
-
- org.yamcs.xtceproc.XtceTmProcessor
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,ContainerProvider,ParameterProvider,ProcessorService,TmProcessor
public class XtceTmProcessor extends AbstractProcessorService implements TmProcessor, ParameterProvider, ContainerProvider
Does the job of getting containers and transforming them into parameters which are then sent to the parameter request manager for the distribution to the requesters. Relies onXtceTmExtractorfor extracting the parameters out of containers
-
-
Constructor Summary
Constructors Constructor Description XtceTmProcessor(Processor processor)XtceTmProcessor(XtceDb xtcedb, ProcessorConfig pconfig)Creates a TmProcessor to be used in "standalone" mode, outside of any processor It still uses the processor config for configuration parameters relevant to container processing
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanProvide(org.yamcs.protobuf.Yamcs.NamedObjectId paraId)Returns whether or not a given parameter can be provided by this providerbooleancanProvide(Parameter para)booleancanProvideContainer(org.yamcs.protobuf.Yamcs.NamedObjectId containerId)Returns whether or not a given container can be provided by this providerprotected voiddoStart()protected voiddoStop()voidfinished()Notification that there is no more packet to processContainergetContainer(org.yamcs.protobuf.Yamcs.NamedObjectId containerId)Returns the containerDefinition corresponding to the itemIdParametergetParameter(org.yamcs.protobuf.Yamcs.NamedObjectId paraId)Returns the parameterDefinition corresponding to the parameter idProcessingStatisticsgetStatistics()SubscriptiongetSubscription()XtceDbgetXtceDb()voidinit(Processor processor, YConfiguration config, Object spec)voidprocessPacket(TmPacket pwrt, SequenceContainer sc)Process telemetry packetsvoidresetStatistics()voidsetContainerListener(ContainerListener c)voidsetParameterListener(ParameterListener p)Send parameters to this listener.voidstartProviding(Parameter param)Adds a parameter to the current subscription list: finds all the SequenceContainers in which this parameter may appear and adds them to the list. also for each sequence container adds the parameter needed to instantiate the sequence container.voidstartProviding(SequenceContainer container)voidstartProvidingAll()adds all parameters to the subscriptionvoidstartProvidingAllContainers()Start providing all known containersvoidstopProviding(Parameter param)Removes a parameter from the list of parameters that have to be providedvoidstopProviding(SequenceContainer container)-
Methods inherited from class org.yamcs.AbstractProcessorService
getConfig, getYamcsInstance
-
Methods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.yamcs.ProcessorService
getSpec
-
-
-
-
Field Detail
-
xtcedb
public final XtceDb xtcedb
-
-
Constructor Detail
-
XtceTmProcessor
public XtceTmProcessor(Processor processor)
-
XtceTmProcessor
public XtceTmProcessor(XtceDb xtcedb, ProcessorConfig pconfig)
Creates a TmProcessor to be used in "standalone" mode, outside of any processor It still uses the processor config for configuration parameters relevant to container processing
-
-
Method Detail
-
init
public void init(Processor processor, YConfiguration config, Object spec) throws ConfigurationException
- Specified by:
initin interfaceProcessorService- Overrides:
initin classAbstractProcessorServiceconfig- service configuration as specified in processor.yamlspec- passed by the user when creating the processor (for instance via the REST API)- Throws:
ConfigurationException
-
setParameterListener
public void setParameterListener(ParameterListener p)
Description copied from interface:ParameterProviderSend parameters to this listener. Normally is the channel.parameterRequestManager but something different may be used for unit tests or special applications (PacketViewer)- Specified by:
setParameterListenerin interfaceParameterProvider
-
setContainerListener
public void setContainerListener(ContainerListener c)
- Specified by:
setContainerListenerin interfaceContainerProvider
-
startProviding
public void startProviding(Parameter param)
Adds a parameter to the current subscription list: finds all the SequenceContainers in which this parameter may appear and adds them to the list. also for each sequence container adds the parameter needed to instantiate the sequence container.- Specified by:
startProvidingin interfaceParameterProvider- Parameters:
param- parameter to be added to the current subscription list
-
startProvidingAll
public void startProvidingAll()
adds all parameters to the subscription- Specified by:
startProvidingAllin interfaceParameterProvider
-
stopProviding
public void stopProviding(Parameter param)
Description copied from interface:ParameterProviderRemoves a parameter from the list of parameters that have to be provided- Specified by:
stopProvidingin interfaceParameterProvider
-
canProvide
public boolean canProvide(org.yamcs.protobuf.Yamcs.NamedObjectId paraId)
Description copied from interface:ParameterProviderReturns whether or not a given parameter can be provided by this provider- Specified by:
canProvidein interfaceParameterProvider- Returns:
-
canProvide
public boolean canProvide(Parameter para)
- Specified by:
canProvidein interfaceParameterProvider
-
getParameter
public Parameter getParameter(org.yamcs.protobuf.Yamcs.NamedObjectId paraId) throws InvalidIdentification
Description copied from interface:ParameterProviderReturns the parameterDefinition corresponding to the parameter id- Specified by:
getParameterin interfaceParameterProvider- Parameters:
paraId- - id of the parameter that is returned- Returns:
- Throws:
InvalidIdentification
-
processPacket
public void processPacket(TmPacket pwrt, SequenceContainer sc)
Process telemetry packets- Specified by:
processPacketin interfaceTmProcessor
-
finished
public void finished()
Description copied from interface:TmProcessorNotification that there is no more packet to process- Specified by:
finishedin interfaceTmProcessor
-
resetStatistics
public void resetStatistics()
-
getStatistics
public ProcessingStatistics getStatistics()
-
canProvideContainer
public boolean canProvideContainer(org.yamcs.protobuf.Yamcs.NamedObjectId containerId)
Description copied from interface:ContainerProviderReturns whether or not a given container can be provided by this provider- Specified by:
canProvideContainerin interfaceContainerProvider
-
startProviding
public void startProviding(SequenceContainer container)
- Specified by:
startProvidingin interfaceContainerProvider
-
stopProviding
public void stopProviding(SequenceContainer container)
- Specified by:
stopProvidingin interfaceContainerProvider
-
startProvidingAllContainers
public void startProvidingAllContainers()
Description copied from interface:ContainerProviderStart providing all known containers- Specified by:
startProvidingAllContainersin interfaceContainerProvider
-
getContainer
public Container getContainer(org.yamcs.protobuf.Yamcs.NamedObjectId containerId) throws InvalidIdentification
Description copied from interface:ContainerProviderReturns the containerDefinition corresponding to the itemId- Specified by:
getContainerin interfaceContainerProvider- Throws:
InvalidIdentification
-
getSubscription
public Subscription getSubscription()
-
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
-
getXtceDb
public XtceDb getXtceDb()
-
-