@Validated public class AgentRoutingServiceSingleNodeImpl extends java.lang.Object implements AgentRoutingService
AgentRoutingService
that assumes a single Genie node and tracks connections in-memory.Constructor and Description |
---|
AgentRoutingServiceSingleNodeImpl(GenieHostInfo genieHostInfo)
Constructor.
|
Modifier and Type | Method and 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.
|
public AgentRoutingServiceSingleNodeImpl(GenieHostInfo genieHostInfo)
genieHostInfo
- local genie node host informationpublic java.util.Optional<java.lang.String> getHostnameForAgentConnection(@NotBlank @NotBlank java.lang.String jobId)
getHostnameForAgentConnection
in interface AgentRoutingService
jobId
- the job idpublic boolean isAgentConnectionLocal(@NotBlank @NotBlank java.lang.String jobId)
isAgentConnectionLocal
in interface AgentRoutingService
jobId
- the job idpublic void handleClientConnected(@NotBlank @NotBlank java.lang.String jobId)
handleClientConnected
in interface AgentRoutingService
jobId
- the job id the connected agent is runningpublic void handleClientDisconnected(@NotBlank @NotBlank java.lang.String jobId)
handleClientDisconnected
in interface AgentRoutingService
jobId
- the job id the disconnected agent is runningpublic boolean isAgentConnected(java.lang.String jobId)
isAgentConnected
in interface AgentRoutingService
jobId
- the job id