Class AgentConnectionTrackingServiceImpl

  • All Implemented Interfaces:
    AgentConnectionTrackingService, org.springframework.boot.actuate.info.InfoContributor

    public class AgentConnectionTrackingServiceImpl
    extends java.lang.Object
    implements AgentConnectionTrackingService, org.springframework.boot.actuate.info.InfoContributor
    This service keeps track of agent connections and heartbeats. It notifies the downstream AgentRoutingService of connected/disconnected agents while hiding details of connections, disconnections, missed heartbeats.
    Since:
    4.0.0
    • Constructor Detail

      • AgentConnectionTrackingServiceImpl

        public AgentConnectionTrackingServiceImpl​(AgentRoutingService agentRoutingService,
                                                  org.springframework.scheduling.TaskScheduler taskScheduler,
                                                  AgentConnectionTrackingServiceProperties serviceProperties)
        Constructor.
        Parameters:
        agentRoutingService - the agent routing service
        taskScheduler - the task scheduler
        serviceProperties - the service properties
    • Method Detail

      • notifyHeartbeat

        public void notifyHeartbeat​(java.lang.String streamId,
                                    java.lang.String claimedJobId)
        Handle a heartbeat.
        Specified by:
        notifyHeartbeat in interface AgentConnectionTrackingService
        Parameters:
        streamId - the unique id of the connection
        claimedJobId - the job id claimed by the agent
      • notifyDisconnected

        public void notifyDisconnected​(java.lang.String streamId,
                                       java.lang.String claimedJobId)
        Handle a disconnection.
        Specified by:
        notifyDisconnected in interface AgentConnectionTrackingService
        Parameters:
        streamId - the unique id of the connection
        claimedJobId - the job id claimed by the agent
      • contribute

        public void contribute​(org.springframework.boot.actuate.info.Info.Builder builder)
        Specified by:
        contribute in interface org.springframework.boot.actuate.info.InfoContributor