Class AgentAssignmentServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.buildqueue.manager.AgentAssignmentServiceImpl
-
- All Implemented Interfaces:
AgentAssignmentService
public class AgentAssignmentServiceImpl extends Object implements AgentAssignmentService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.bamboo.buildqueue.manager.AgentAssignmentService
AgentAssignmentService.AgentAssignmentExecutable, AgentAssignmentService.AgentAssignmentExecutor
-
-
Constructor Summary
Constructors Constructor Description AgentAssignmentServiceImpl(@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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteAssignment(AgentAssignment.ExecutorType executorType, long executorId, AgentAssignment.ExecutableType executableType, long entityId)Remove agent assignment.voiddeleteExecutableAssignments(@NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutable> agentAssignments)Remove a collection of agent assignments.voiddeleteExecutorAssignments(@NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutor> agentAssignments)Remove a collection of agent assignments.AgentAssignmentMapgetAgentAssignments()Retrieve an assignment map used to access executable and executor assignmentsbooleanisAgentAssignmentAllowed()booleanisCapabilitiesMatch(ElasticImageConfiguration image, long environmentId)booleanisCapabilitiesMatch(ElasticImageConfiguration image, ImmutableJob job)booleanisCapabilitiesMatch(EphemeralAgentTemplate template, long environmentId)booleanisCapabilitiesMatch(EphemeralAgentTemplate template, ImmutableJob job)booleanisCapabilitiesMatch(BuildAgent agent, long environmentId)booleanisCapabilitiesMatch(BuildAgent agent, ImmutableJob job)Helper methods to check if executor is capable of running executable@NotNull AgentAssignmentsaveAgentAssignment(AgentAssignment.ExecutorType executorType, long executorId, AgentAssignment.ExecutableType executableType, long entityId)Save an agent assignment
-
-
-
Constructor Detail
-
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 Detail
-
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:AgentAssignmentServiceSave an agent assignment- Specified by:
saveAgentAssignmentin interfaceAgentAssignmentService- Returns:
- The saved agent assignment
- Throws:
WebValidationExceptionAccessDeniedException
-
deleteExecutableAssignments
public void deleteExecutableAssignments(@NotNull @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutable> agentAssignments) throws AccessDeniedExceptionDescription copied from interface:AgentAssignmentServiceRemove a collection of agent assignments.- Specified by:
deleteExecutableAssignmentsin 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:AgentAssignmentServiceRemove agent assignment.- Specified by:
deleteAssignmentin 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:AgentAssignmentServiceRemove a collection of agent assignments.- Specified by:
deleteExecutorAssignmentsin interfaceAgentAssignmentService- Parameters:
agentAssignments- to delete
-
getAgentAssignments
public AgentAssignmentMap getAgentAssignments()
Description copied from interface:AgentAssignmentServiceRetrieve an assignment map used to access executable and executor assignments- Specified by:
getAgentAssignmentsin interfaceAgentAssignmentService- Returns:
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(BuildAgent agent, ImmutableJob job)
Description copied from interface:AgentAssignmentServiceHelper methods to check if executor is capable of running executable- Specified by:
isCapabilitiesMatchin interfaceAgentAssignmentService
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(ElasticImageConfiguration image, ImmutableJob job)
- Specified by:
isCapabilitiesMatchin interfaceAgentAssignmentService
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(EphemeralAgentTemplate template, ImmutableJob job)
- Specified by:
isCapabilitiesMatchin interfaceAgentAssignmentService
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(BuildAgent agent, long environmentId)
- Specified by:
isCapabilitiesMatchin interfaceAgentAssignmentService
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(ElasticImageConfiguration image, long environmentId)
- Specified by:
isCapabilitiesMatchin interfaceAgentAssignmentService
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(EphemeralAgentTemplate template, long environmentId)
- Specified by:
isCapabilitiesMatchin interfaceAgentAssignmentService
-
isAgentAssignmentAllowed
public boolean isAgentAssignmentAllowed()
- Specified by:
isAgentAssignmentAllowedin interfaceAgentAssignmentService- Returns:
- true if agent assignment is allowed at Global settings or user is instance Administrator.
-
-