Class AgentVersionsService

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

public class AgentVersionsService extends Object implements AgentService, ServiceLifecycle, HasLifecycle, AgentPresenceListener
An Agent Service to handle information related to the distribution. This information includes versions for: - the current running agent - the toolkit it's using - the distribution it's running in This service also provides a way to verify that the current versions are supported by the cluster it's running in. This service is activated for all Agents.
Author:
The LSST CCS Team
  • Field Details

  • Constructor Details

    • AgentVersionsService

      public AgentVersionsService()
  • 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
    • preInit

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

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

      public void afterStart()
      Description copied from interface: ServiceLifecycle
      Invoked when the state is OPERATIONAL.
      Specified by:
      afterStart in interface ServiceLifecycle
    • preShutdown

      public void preShutdown()
      Specified by:
      preShutdown in interface ServiceLifecycle
    • connecting

      public void connecting(AgentInfo... agents)
      Description copied from interface: AgentPresenceListener
      Indicates that the list of agents represented by agents is present on the buses. This method is invoked when the listener is added with all the agents that are already connected. At this point not all services on the connecting agents are guaranteed to have completely started. This method should be used only to receive a notification that an agent is connecting. For a guarantee that an agent information is fully present, please use the #connected methods. The implementation should return immediately : any blocking operations should be scheduled on a separate thread.
      Specified by:
      connecting in interface AgentPresenceListener
    • disconnected

      public void disconnected(AgentInfo... agents)
      Description copied from interface: AgentPresenceListener
      Invoked when one or more agents are disconnected from this cluster, either because the shutdown or because they were lost. The implementation should return immediately : any blocking operations should be scheduled on a separate thread.
      Specified by:
      disconnected in interface AgentPresenceListener
    • extractVersionConstraintPropertiesFor

      protected Properties extractVersionConstraintPropertiesFor(String key, Properties props)
    • getAllDistributionInfo

      public Map<String,DistributionInfo> getAllDistributionInfo()