Class SystemParametersCollector

  • All Implemented Interfaces:
    com.google.common.util.concurrent.Service, Runnable, YamcsService

    public class SystemParametersCollector
    extends AbstractYamcsService
    implements Runnable
    Collects each second system processed parameters from whomever registers and sends them on the sys_var stream
    • Constructor Detail

      • SystemParametersCollector

        public SystemParametersCollector()
    • Method Detail

      • getSpec

        public Spec getSpec()
        Description copied from interface: YamcsService
        Returns the valid configuration options for this service.
        Specified by:
        getSpec in interface YamcsService
        Returns:
        the argument specification, or null if the args should not be validated.
      • init

        public void init​(String yamcsInstance,
                         YConfiguration config)
                  throws InitException
        Description copied from interface: YamcsService
        Initialize this service. This is called before the service is started. All operations should finish fast.
        Specified by:
        init in interface YamcsService
        Overrides:
        init in class AbstractYamcsService
        Parameters:
        yamcsInstance - The yamcs instance, or null if this is a global service.
        config - The configured arguments for this service. If YamcsService.getSpec() is implemented then this contains the arguments after being validated (including any defaults).
        Throws:
        InitException - When something goes wrong during the execution of this method.
      • doStart

        public void doStart()
        Specified by:
        doStart in class com.google.common.util.concurrent.AbstractService
      • doStop

        public void doStop()
        Specified by:
        doStop in class com.google.common.util.concurrent.AbstractService
      • run

        public void run()
        Run from the timer, collect all parameters and send them on the stream
        Specified by:
        run in interface Runnable
      • registerProducer

        public void registerProducer​(SystemParametersProducer p)
        Register a parameter producer to be called each time the parameters are collected
      • unregisterProducer

        public void unregisterProducer​(SystemParametersProducer p)
        Unregister producer - from now on it will not be invoked. Note that the collector collects parameters into a different thread taking all producer in turns, and there might be one collection already started when this method is called.
      • getNamespace

        public String getNamespace()
        this is the namespace all system parameters should be in
        Returns:
        the namespace to be used by the system parameters
      • getUnsignedIntPV

        public static ParameterValue getUnsignedIntPV​(String fqn,
                                                      long time,
                                                      int v)