Class AgentConnectionTrackingServiceImpl
- java.lang.Object
- 
- com.netflix.genie.web.agent.services.impl.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 downstreamAgentRoutingServiceof connected/disconnected agents while hiding details of connections, disconnections, missed heartbeats.- Since:
- 4.0.0
 
- 
- 
Constructor SummaryConstructors Constructor Description AgentConnectionTrackingServiceImpl(AgentRoutingService agentRoutingService, org.springframework.scheduling.TaskScheduler taskScheduler, AgentConnectionTrackingServiceProperties serviceProperties)Constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontribute(org.springframework.boot.actuate.info.Info.Builder builder)longgetConnectedAgentsCount()Get the count of locally connected agents.voidnotifyDisconnected(java.lang.String streamId, java.lang.String claimedJobId)Handle a disconnection.voidnotifyHeartbeat(java.lang.String streamId, java.lang.String claimedJobId)Handle a heartbeat.
 
- 
- 
- 
Constructor Detail- 
AgentConnectionTrackingServiceImplpublic 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- 
notifyHeartbeatpublic void notifyHeartbeat(java.lang.String streamId, java.lang.String claimedJobId)Handle a heartbeat.- Specified by:
- notifyHeartbeatin interface- AgentConnectionTrackingService
- Parameters:
- streamId- the unique id of the connection
- claimedJobId- the job id claimed by the agent
 
 - 
notifyDisconnectedpublic void notifyDisconnected(java.lang.String streamId, java.lang.String claimedJobId)Handle a disconnection.- Specified by:
- notifyDisconnectedin interface- AgentConnectionTrackingService
- Parameters:
- streamId- the unique id of the connection
- claimedJobId- the job id claimed by the agent
 
 - 
getConnectedAgentsCountpublic long getConnectedAgentsCount() Get the count of locally connected agents.- Specified by:
- getConnectedAgentsCountin interface- AgentConnectionTrackingService
- Returns:
- the number of agents connected.
 
 - 
contributepublic void contribute(org.springframework.boot.actuate.info.Info.Builder builder) - Specified by:
- contributein interface- org.springframework.boot.actuate.info.InfoContributor
 
 
- 
 
-