Class AgentAssignmentServiceImpl
java.lang.Object
com.atlassian.bamboo.buildqueue.manager.AgentAssignmentServiceImpl
- All Implemented Interfaces:
AgentAssignmentService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.buildqueue.manager.AgentAssignmentService
AgentAssignmentService.AgentAssignmentExecutable, AgentAssignmentService.AgentAssignmentExecutor
-
Constructor Summary
ConstructorDescriptionAgentAssignmentServiceImpl
(@NotNull AgentAssignmentDao agentAssignmentDao, @NotNull AuditLogService auditLogService, @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate, @NotNull ProjectManager projectManager, @NotNull CachedPlanManager cachedPlanManager, @NotNull com.atlassian.struts.TextProvider textProvider, @NotNull EnvironmentService environmentService, @NotNull com.atlassian.event.api.EventPublisher eventPublisher, @NotNull CapabilitySetManager capabilitySetManager, @NotNull CapabilityRequirementsMatcher capabilityRequirementsMatcher, @NotNull AdministrationConfigurationAccessor administrationConfigurationAccessor, @NotNull FeatureManager featureManager) -
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
-
Constructor Details
-
AgentAssignmentServiceImpl
public AgentAssignmentServiceImpl(@NotNull @NotNull AgentAssignmentDao agentAssignmentDao, @NotNull @NotNull AuditLogService auditLogService, @NotNull @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate, @NotNull @NotNull ProjectManager projectManager, @NotNull @NotNull CachedPlanManager cachedPlanManager, @NotNull @NotNull com.atlassian.struts.TextProvider textProvider, @NotNull @NotNull EnvironmentService environmentService, @NotNull @NotNull com.atlassian.event.api.EventPublisher eventPublisher, @NotNull @NotNull CapabilitySetManager capabilitySetManager, @NotNull @NotNull CapabilityRequirementsMatcher capabilityRequirementsMatcher, @NotNull @NotNull AdministrationConfigurationAccessor administrationConfigurationAccessor, @NotNull @NotNull FeatureManager featureManager)
-
-
Method Details
-
saveAgentAssignment
@NotNull public @NotNull AgentAssignment saveAgentAssignment(@NotNull AgentAssignment.ExecutorType executorType, long executorId, @NotNull AgentAssignment.ExecutableType executableType, long entityId) throws WebValidationException, AccessDeniedException Description copied from interface:AgentAssignmentService
Save an agent assignment- Specified by:
saveAgentAssignment
in interfaceAgentAssignmentService
- Returns:
- The saved agent assignment
- Throws:
WebValidationException
AccessDeniedException
-
deleteExecutableAssignments
public void deleteExecutableAssignments(@NotNull @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutable> agentAssignments) throws AccessDeniedException Description copied from interface:AgentAssignmentService
Remove a collection of agent assignments.- Specified by:
deleteExecutableAssignments
in interfaceAgentAssignmentService
- Parameters:
agentAssignments
- to delete- Throws:
AccessDeniedException
-
deleteAssignment
public void deleteAssignment(AgentAssignment.ExecutorType executorType, long executorId, AgentAssignment.ExecutableType executableType, long entityId) throws AccessDeniedException Description copied from interface:AgentAssignmentService
Remove agent assignment.- Specified by:
deleteAssignment
in interfaceAgentAssignmentService
- Parameters:
executorType
- executor typeexecutorId
- executor idexecutableType
- executable typeentityId
- executable id- Throws:
AccessDeniedException
- if don't have permissions to edit entity
-
deleteExecutorAssignments
public void deleteExecutorAssignments(@NotNull @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutor> agentAssignments) Description copied from interface:AgentAssignmentService
Remove a collection of agent assignments.- Specified by:
deleteExecutorAssignments
in interfaceAgentAssignmentService
- Parameters:
agentAssignments
- to delete
-
getAgentAssignments
Description copied from interface:AgentAssignmentService
Retrieve an assignment map used to access executable and executor assignments- Specified by:
getAgentAssignments
in interfaceAgentAssignmentService
- Returns:
-
isCapabilitiesMatch
Description copied from interface:AgentAssignmentService
Helper methods to check if executor is capable of running executable- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isCapabilitiesMatch
- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isCapabilitiesMatch
- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isCapabilitiesMatch
- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isCapabilitiesMatch
- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isCapabilitiesMatch
- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isAgentAssignmentAllowed
public boolean isAgentAssignmentAllowed()- Specified by:
isAgentAssignmentAllowed
in interfaceAgentAssignmentService
- Returns:
- true if agent assignment is allowed at Global settings or user is instance Administrator.
-