Interface AgentRoutingService
-
- All Known Implementing Classes:
AgentRoutingServiceCuratorDiscoveryImpl
,AgentRoutingServiceSingleNodeImpl
@Validated public interface AgentRoutingService
Service that tracks agent connections on the local Genie node and provides routing information for agent connected to other nodes.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
getHostnameForAgentConnection(@NotBlank java.lang.String jobId)
Look up the hostname of the Genie node currently handling the agent connection for a given job.void
handleClientConnected(@NotBlank java.lang.String jobId)
Handle a new agent connection.void
handleClientDisconnected(@NotBlank java.lang.String jobId)
Handle connected agent disconnection.boolean
isAgentConnected(java.lang.String jobId)
Whether the agent executing a given job is currently connected.boolean
isAgentConnectionLocal(@NotBlank java.lang.String jobId)
Tells whether the agent running a given job is connected to the local node.
-
-
-
Method Detail
-
getHostnameForAgentConnection
java.util.Optional<java.lang.String> getHostnameForAgentConnection(@NotBlank @NotBlank java.lang.String jobId)
Look up the hostname of the Genie node currently handling the agent connection for a given job.- Parameters:
jobId
- the job id- Returns:
- a boxed hostname string, empty if the connection for the given job id is not found
-
isAgentConnectionLocal
boolean isAgentConnectionLocal(@NotBlank @NotBlank java.lang.String jobId)
Tells whether the agent running a given job is connected to the local node.- Parameters:
jobId
- the job id- Returns:
- true if the agent has an active connection to this node
-
handleClientConnected
void handleClientConnected(@NotBlank @NotBlank java.lang.String jobId)
Handle a new agent connection.- Parameters:
jobId
- the job id the connected agent is running
-
handleClientDisconnected
void handleClientDisconnected(@NotBlank @NotBlank java.lang.String jobId)
Handle connected agent disconnection.- Parameters:
jobId
- the job id the disconnected agent is running
-
isAgentConnected
boolean isAgentConnected(java.lang.String jobId)
Whether the agent executing a given job is currently connected.- Parameters:
jobId
- the job id- Returns:
- true if an agent running the job is connected
-
-