Interface AgentAssignmentService
-
- All Known Implementing Classes:
AgentAssignmentServiceImpl
public interface AgentAssignmentService
Service for managing the exclusive assignment for agents to jobs/environments
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AgentAssignmentService.AgentAssignmentExecutable
static class
AgentAssignmentService.AgentAssignmentExecutor
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteAssignment(AgentAssignment.ExecutorType executorType, long executorId, AgentAssignment.ExecutableType executableType, long entityId)
Remove agent assignment.void
deleteExecutableAssignments(@NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutable> agentAssignments)
Remove a collection of agent assignments.void
deleteExecutorAssignments(@NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutor> agentAssignments)
Remove a collection of agent assignments.AgentAssignmentMap
getAgentAssignments()
Retrieve an assignment map used to access executable and executor assignmentsboolean
isAgentAssignmentAllowed()
boolean
isCapabilitiesMatch(ElasticImageConfiguration image, long environmentId)
boolean
isCapabilitiesMatch(ElasticImageConfiguration image, ImmutableJob job)
boolean
isCapabilitiesMatch(EphemeralAgentTemplate template, long environmentId)
boolean
isCapabilitiesMatch(EphemeralAgentTemplate template, ImmutableJob job)
boolean
isCapabilitiesMatch(BuildAgent agent, long environmentid)
boolean
isCapabilitiesMatch(BuildAgent agent, ImmutableJob job)
Helper methods to check if executor is capable of running executable@NotNull AgentAssignment
saveAgentAssignment(AgentAssignment.ExecutorType executorType, long executorId, AgentAssignment.ExecutableType executableType, long entityId)
Save an agent assignment
-
-
-
Method Detail
-
saveAgentAssignment
@NotNull @NotNull AgentAssignment saveAgentAssignment(@NotNull AgentAssignment.ExecutorType executorType, long executorId, @NotNull AgentAssignment.ExecutableType executableType, long entityId) throws WebValidationException, AccessDeniedException
Save an agent assignment- Returns:
- The saved agent assignment
- Throws:
WebValidationException
AccessDeniedException
-
deleteExecutableAssignments
void deleteExecutableAssignments(@NotNull @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutable> agentAssignments) throws AccessDeniedException
Remove a collection of agent assignments.- Parameters:
agentAssignments
- to delete- Throws:
AccessDeniedException
-
deleteExecutorAssignments
void deleteExecutorAssignments(@NotNull @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutor> agentAssignments) throws AccessDeniedException
Remove a collection of agent assignments.- Parameters:
agentAssignments
- to delete- Throws:
AccessDeniedException
-
deleteAssignment
void deleteAssignment(AgentAssignment.ExecutorType executorType, long executorId, AgentAssignment.ExecutableType executableType, long entityId) throws AccessDeniedException
Remove agent assignment.- Parameters:
executorType
- executor typeexecutorId
- executor idexecutableType
- executable typeentityId
- executable id- Throws:
AccessDeniedException
- if don't have permissions to edit entity
-
getAgentAssignments
AgentAssignmentMap getAgentAssignments()
Retrieve an assignment map used to access executable and executor assignments- Returns:
-
isCapabilitiesMatch
boolean isCapabilitiesMatch(BuildAgent agent, ImmutableJob job)
Helper methods to check if executor is capable of running executable
-
isCapabilitiesMatch
boolean isCapabilitiesMatch(ElasticImageConfiguration image, ImmutableJob job)
-
isCapabilitiesMatch
boolean isCapabilitiesMatch(EphemeralAgentTemplate template, ImmutableJob job)
-
isCapabilitiesMatch
boolean isCapabilitiesMatch(BuildAgent agent, long environmentid)
-
isCapabilitiesMatch
boolean isCapabilitiesMatch(ElasticImageConfiguration image, long environmentId)
-
isCapabilitiesMatch
boolean isCapabilitiesMatch(EphemeralAgentTemplate template, long environmentId)
-
isAgentAssignmentAllowed
boolean isAgentAssignmentAllowed()
- Returns:
- true if agent assignment is allowed at Global settings or user is instance Administrator.
-
-