Class AgentHeartBeatService

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

public class AgentHeartBeatService extends Object implements ServiceLifecycle, AgentService, HasLifecycle
A Service to manage the HeartBeat for CCS Agents. It starts for all agents and its main functions is to publish a HeartBeat status message every second for transport layers that do not already have a heartbeat
Author:
The LSST CCS Team
  • Field Details

  • Constructor Details

    • AgentHeartBeatService

      public AgentHeartBeatService()
  • 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.
    • build

      public void build()
      Description copied from interface: HasLifecycle
      First lifecycle hook. Modification of the component tree is allowed at this stage. After this stage the tree of component cannot be modified anymore. This is where agent periodic tasks should be scheduled.
      Specified by:
      build in interface HasLifecycle
    • getStatusBroadcastPeriod

      public int getStatusBroadcastPeriod()
      * Returns heartbeat broadcasting period for this Agent.
      Returns:
      period (in seconds) for status broadcasting.
    • broadcastStatus

      public final void broadcastStatus()
      Broadcasts the current heartbeat status.
    • isPublishingHeartbeat

      public boolean isPublishingHeartbeat()