Class DataProviderDictionaryService

java.lang.Object
org.lsst.ccs.services.DataProviderDictionaryService
All Implemented Interfaces:
HasLifecycle, BusMessagePreProcessor, ServiceLifecycle, AgentService

public final class DataProviderDictionaryService extends Object implements ServiceLifecycle, HasLifecycle, AgentService, BusMessagePreProcessor
A service to manage a worker subsystem's dictionary of DataProviders.
Author:
The LSST CCS Team
  • Constructor Details

    • DataProviderDictionaryService

      public DataProviderDictionaryService()
  • Method Details

    • getAgentServiceName

      public String getAgentServiceName()
      Description copied from interface: AgentService
      Get the name of this service. This name will be used to add the given service to the lookup tree.
      Specified by:
      getAgentServiceName in interface AgentService
      Returns:
      the AgentService name.
    • startForAgent

      public boolean startForAgent(AgentInfo agentInfo)
      Description copied from interface: AgentService
      This method is invoked after an agent service is created to see if this service is to be started for the tiven Agent.
      Specified by:
      startForAgent in interface AgentService
      Returns:
      true if the service is to be added to the given agent.
    • preBuild

      public void preBuild()
      Specified by:
      preBuild in interface ServiceLifecycle
    • init

      public void init()
      Description copied from interface: HasLifecycle
      Called from the enclosing Subsystem at initialization phase.

      This method is called before the children components of this object have their init method called.

      At the time it is called, connection to the messaging layer is not yet done, so there should be no attempt to send messages in the body of this method. Configuration for message listening can nevertheless be done here, such as adding MessageListener objects.

      It is unnecessary to call super.init()

      Specified by:
      init in interface HasLifecycle
    • afterInit

      public void afterInit()
      Specified by:
      afterInit in interface ServiceLifecycle
    • getDictionaryChecksum

      public long getDictionaryChecksum()
    • shutdown

      public void shutdown()
      Description copied from interface: HasLifecycle
      Called from the enclosing Subsystem when org.lsst.ccs.Subsystem#shutdown() has been called. At the time it is called PhaseState is CLOSING. It should be overridden to free non hardware related resources.
      Specified by:
      shutdown in interface HasLifecycle
    • addDataProviderInfoToDictionary

      public void addDataProviderInfoToDictionary(DataProviderInfo info)
    • getDataProviderDictionary

      public DataProviderDictionary getDataProviderDictionary()
    • getDataProviderDictionaryForAgent

      public DataProviderDictionary getDataProviderDictionaryForAgent(String agentName)
    • addMetadataForObject

      public void addMetadataForObject(KeyValueDataList data, String metadataName, String metadataValue, Object origin)
    • purge

      @Deprecated public void purge(AgentInfo agent)
      Deprecated.
    • purge

      @Deprecated public void purge()
      Deprecated.
    • registerData

      public void registerData(KeyValueData kvd, boolean isPeriodic)
    • registerData

      public void registerData(KeyValueData kvd)
    • registerClass

      public void registerClass(Class clazz)
    • registerClass

      public void registerClass(Class clazz, String path)
    • publishingTrendingData

      public void publishingTrendingData(StatusSubsystemData ssd)
    • calculateHashCodeForData

      public int calculateHashCodeForData(StatusSubsystemData ssd)
    • calculateHashCodeForData

      public int calculateHashCodeForData(KeyValueDataList kvdl)
    • addDataProviderDictionaryListener

      public void addDataProviderDictionaryListener(DataProviderDictionaryService.DataProviderDictionaryListener listener)
    • removeDataProviderDictionaryListener

      public void removeDataProviderDictionaryListener(DataProviderDictionaryService.DataProviderDictionaryListener listener)
    • getBus

      public Bus getBus()
      Description copied from interface: BusMessagePreProcessor
      The Bus this BusMessagePreProcessor applies to.
      Specified by:
      getBus in interface BusMessagePreProcessor
      Returns:
      The Bus.
    • preProcessMessage

      public BusMessage preProcessMessage(BusMessage msg)
      Description copied from interface: BusMessagePreProcessor
      Pre-process the incoming BusMessage and return the message to be forwarded to the bus message listeners. The returned message can either be a modified version of the original message or a brand new message. The Class of the returned message can be different than the incoming message. If null is returned the message will not be sent to the BusMessage listeners, but it will still be passed to other BusMessagePreProcessors This method can be invoked by separate threads, but it's invoked by one thread at a time; there is no concurrent invocation of the method.
      Specified by:
      preProcessMessage in interface BusMessagePreProcessor
      Parameters:
      msg - The incoming BusMessage
      Returns:
      The modified BusMessage to be forwarded to the BusMessageListeners
    • waitForAgentDictionary

      public final DataProviderDictionary waitForAgentDictionary(AgentInfo agentInfo, long timeout, TimeUnit unit) throws InterruptedException
      Throws:
      InterruptedException