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 onXtceTmExtractor
for 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 boolean
canProvide(org.yamcs.protobuf.Yamcs.NamedObjectId paraId)
Returns whether or not a given parameter can be provided by this providerboolean
canProvide(Parameter para)
boolean
canProvideContainer(org.yamcs.protobuf.Yamcs.NamedObjectId containerId)
Returns whether or not a given container can be provided by this providerprotected void
doStart()
protected void
doStop()
void
finished()
Notification that there is no more packet to processContainer
getContainer(org.yamcs.protobuf.Yamcs.NamedObjectId containerId)
Returns the containerDefinition corresponding to the itemIdParameter
getParameter(org.yamcs.protobuf.Yamcs.NamedObjectId paraId)
Returns the parameterDefinition corresponding to the parameter idProcessingStatistics
getStatistics()
Subscription
getSubscription()
XtceDb
getXtceDb()
void
init(Processor processor, YConfiguration config, Object spec)
void
processPacket(TmPacket pwrt, SequenceContainer sc)
Process telemetry packetsvoid
resetStatistics()
void
setContainerListener(ContainerListener c)
void
setParameterListener(ParameterListener p)
Send parameters to this listener.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.void
startProviding(SequenceContainer container)
void
startProvidingAll()
adds all parameters to the subscriptionvoid
startProvidingAllContainers()
Start providing all known containersvoid
stopProviding(Parameter param)
Removes a parameter from the list of parameters that have to be providedvoid
stopProviding(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:
init
in interfaceProcessorService
- Overrides:
init
in classAbstractProcessorService
config
- 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:ParameterProvider
Send parameters to this listener. Normally is the channel.parameterRequestManager but something different may be used for unit tests or special applications (PacketViewer)- Specified by:
setParameterListener
in interfaceParameterProvider
-
setContainerListener
public void setContainerListener(ContainerListener c)
- Specified by:
setContainerListener
in 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:
startProviding
in interfaceParameterProvider
- Parameters:
param
- parameter to be added to the current subscription list
-
startProvidingAll
public void startProvidingAll()
adds all parameters to the subscription- Specified by:
startProvidingAll
in interfaceParameterProvider
-
stopProviding
public void stopProviding(Parameter param)
Description copied from interface:ParameterProvider
Removes a parameter from the list of parameters that have to be provided- Specified by:
stopProviding
in interfaceParameterProvider
-
canProvide
public boolean canProvide(org.yamcs.protobuf.Yamcs.NamedObjectId paraId)
Description copied from interface:ParameterProvider
Returns whether or not a given parameter can be provided by this provider- Specified by:
canProvide
in interfaceParameterProvider
- Returns:
-
canProvide
public boolean canProvide(Parameter para)
- Specified by:
canProvide
in interfaceParameterProvider
-
getParameter
public Parameter getParameter(org.yamcs.protobuf.Yamcs.NamedObjectId paraId) throws InvalidIdentification
Description copied from interface:ParameterProvider
Returns the parameterDefinition corresponding to the parameter id- Specified by:
getParameter
in 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:
processPacket
in interfaceTmProcessor
-
finished
public void finished()
Description copied from interface:TmProcessor
Notification that there is no more packet to process- Specified by:
finished
in interfaceTmProcessor
-
resetStatistics
public void resetStatistics()
-
getStatistics
public ProcessingStatistics getStatistics()
-
canProvideContainer
public boolean canProvideContainer(org.yamcs.protobuf.Yamcs.NamedObjectId containerId)
Description copied from interface:ContainerProvider
Returns whether or not a given container can be provided by this provider- Specified by:
canProvideContainer
in interfaceContainerProvider
-
startProviding
public void startProviding(SequenceContainer container)
- Specified by:
startProviding
in interfaceContainerProvider
-
stopProviding
public void stopProviding(SequenceContainer container)
- Specified by:
stopProviding
in interfaceContainerProvider
-
startProvidingAllContainers
public void startProvidingAllContainers()
Description copied from interface:ContainerProvider
Start providing all known containers- Specified by:
startProvidingAllContainers
in interfaceContainerProvider
-
getContainer
public Container getContainer(org.yamcs.protobuf.Yamcs.NamedObjectId containerId) throws InvalidIdentification
Description copied from interface:ContainerProvider
Returns the containerDefinition corresponding to the itemId- Specified by:
getContainer
in interfaceContainerProvider
- Throws:
InvalidIdentification
-
getSubscription
public Subscription getSubscription()
-
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
-
getXtceDb
public XtceDb getXtceDb()
-
-