Interface AgentAssignmentService
- All Known Implementing Classes:
AgentAssignmentServiceImpl
public interface AgentAssignmentService
Service for managing the exclusive assignment (dedication) of agents to jobs/environments.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Definition of a single Executable that can be assigned to the Executor.static class
Definition of a single dedication of an "executor" (any type of agent) to the single executable. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.Retrieve an assignment map used to access executable and executor assignmentsboolean
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 Details
-
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
Helper methods to check if executor is capable of running executable -
isCapabilitiesMatch
-
isCapabilitiesMatch
-
isCapabilitiesMatch
-
isCapabilitiesMatch
-
isCapabilitiesMatch
-
isAgentAssignmentAllowed
boolean isAgentAssignmentAllowed()- Returns:
- true if agent assignment is allowed at Global settings or user is instance Administrator.
-