@Validated public class AgentRoutingServiceImpl extends java.lang.Object implements AgentRoutingService
AgentRoutingService
.Constructor and Description |
---|
AgentRoutingServiceImpl(AgentConnectionPersistenceService agentConnectionPersistenceService,
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 |
isAgentConnectionLocal(@NotBlank java.lang.String jobId)
Tells wether the agent running a given job is connected to the local node.
|
public AgentRoutingServiceImpl(AgentConnectionPersistenceService agentConnectionPersistenceService, GenieHostInfo genieHostInfo)
agentConnectionPersistenceService
- agent connection persistence servicegenieHostInfo
- 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 running