@Transactional public class JpaAgentConnectionPersistenceServiceImpl extends java.lang.Object implements AgentConnectionPersistenceService
Constructor and Description |
---|
JpaAgentConnectionPersistenceServiceImpl(JpaAgentConnectionRepository agentConnectionRepository)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
long |
getNumAgentConnectionsOnServer(@NotBlank java.lang.String hostname)
Get the number of active agent connections on Genie server with the given
hostname . |
java.util.Optional<java.lang.String> |
lookupAgentConnectionServer(@NotBlank java.lang.String jobId)
Lookup the hostname/address of the server with an active connection to a given agent.
|
void |
removeAgentConnection(@NotBlank java.lang.String jobId,
@NotBlank java.lang.String hostname)
Remove an existing connection currently active from the given agent to the local node.
|
int |
removeAllAgentConnectionToServer(@NotBlank java.lang.String hostname)
Drop all records of agent connections to the specified hostname.
|
void |
saveAgentConnection(@NotBlank java.lang.String jobId,
@NotBlank java.lang.String hostname)
Store a new connection currently active from the given agent to the given node.
|
public JpaAgentConnectionPersistenceServiceImpl(JpaAgentConnectionRepository agentConnectionRepository)
agentConnectionRepository
- agent connection repositorypublic void saveAgentConnection(@NotBlank @NotBlank java.lang.String jobId, @NotBlank @NotBlank java.lang.String hostname)
saveAgentConnection
in interface AgentConnectionPersistenceService
jobId
- the id of a job the agent is runninghostname
- the server owning the connectionpublic void removeAgentConnection(@NotBlank @NotBlank java.lang.String jobId, @NotBlank @NotBlank java.lang.String hostname)
removeAgentConnection
in interface AgentConnectionPersistenceService
jobId
- the id of a job the agent is runninghostname
- the hostname expected to be associated to the connection@Transactional(readOnly=true) public java.util.Optional<java.lang.String> lookupAgentConnectionServer(@NotBlank @NotBlank java.lang.String jobId)
lookupAgentConnectionServer
in interface AgentConnectionPersistenceService
jobId
- the id of a job the agent is running@Transactional(readOnly=true) public long getNumAgentConnectionsOnServer(@NotBlank @NotBlank java.lang.String hostname)
hostname
.getNumAgentConnectionsOnServer
in interface AgentConnectionPersistenceService
hostname
- The server hostname to get the count forpublic int removeAllAgentConnectionToServer(@NotBlank @NotBlank java.lang.String hostname)
AgentConnectionPersistenceService
removeAllAgentConnectionToServer
in interface AgentConnectionPersistenceService
hostname
- the server hostname