Package org.yamcs.tctm
Class StreamParameterProvider
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractService
-
- org.yamcs.AbstractProcessorService
-
- org.yamcs.tctm.StreamParameterProvider
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,ParameterProvider,ProcessorService,StreamSubscriber
public class StreamParameterProvider extends AbstractProcessorService implements StreamSubscriber, ParameterProvider
Provides parameters from yarch streams (pp_realtime) to ParameterRequestManager.
-
-
Field Summary
-
Fields inherited from class org.yamcs.AbstractProcessorService
config, log, processor
-
-
Constructor Summary
Constructors Constructor Description StreamParameterProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanProvide(org.yamcs.protobuf.Yamcs.NamedObjectId id)Returns whether or not a given parameter can be provided by this providerbooleancanProvide(Parameter p)protected voiddoStart()protected voiddoStop()ParametergetParameter(org.yamcs.protobuf.Yamcs.NamedObjectId id)Returns the parameterDefinition corresponding to the parameter idvoidinit(Processor processor, YConfiguration config, Object spec)voidonTuple(Stream s, Tuple tuple)Make sure all parameters are defined in the XtceDB, otherwise the PRM will chokevoidsetParameterListener(ParameterListener paraListener)Send parameters to this listener.voidstartProviding(Parameter paramDef)Adds a new parameter to the list of parameters that have to providedvoidstartProvidingAll()start providing all known parametersvoidstopProviding(Parameter paramDef)Removes a parameter from the list of parameters that have to be providedvoidstreamClosed(Stream s)-
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
-
-
-
-
Method Detail
-
init
public void init(Processor processor, YConfiguration config, Object spec)
- 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)
-
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
-
onTuple
public void onTuple(Stream s, Tuple tuple)
Make sure all parameters are defined in the XtceDB, otherwise the PRM will choke- Specified by:
onTuplein interfaceStreamSubscriber
-
streamClosed
public void streamClosed(Stream s)
- Specified by:
streamClosedin interfaceStreamSubscriber
-
setParameterListener
public void setParameterListener(ParameterListener paraListener)
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
-
stopProviding
public void stopProviding(Parameter paramDef)
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 id)
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 p)
- Specified by:
canProvidein interfaceParameterProvider
-
getParameter
public Parameter getParameter(org.yamcs.protobuf.Yamcs.NamedObjectId id) throws InvalidIdentification
Description copied from interface:ParameterProviderReturns the parameterDefinition corresponding to the parameter id- Specified by:
getParameterin interfaceParameterProvider- Parameters:
id- - id of the parameter that is returned- Returns:
- Throws:
InvalidIdentification
-
startProviding
public void startProviding(Parameter paramDef)
Description copied from interface:ParameterProviderAdds a new parameter to the list of parameters that have to provided- Specified by:
startProvidingin interfaceParameterProvider
-
startProvidingAll
public void startProvidingAll()
Description copied from interface:ParameterProviderstart providing all known parameters- Specified by:
startProvidingAllin interfaceParameterProvider
-
-