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 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
-
-
-
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: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
public AgentAssignmentMap getAgentAssignments()
Description copied from interface:AgentAssignmentService
Retrieve an assignment map used to access executable and executor assignments- Specified by:
getAgentAssignments
in interfaceAgentAssignmentService
- Returns:
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(BuildAgent agent, ImmutableJob job)
Description copied from interface:AgentAssignmentService
Helper methods to check if executor is capable of running executable- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(ElasticImageConfiguration image, ImmutableJob job)
- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(EphemeralAgentTemplate template, ImmutableJob job)
- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(BuildAgent agent, long environmentId)
- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(ElasticImageConfiguration image, long environmentId)
- Specified by:
isCapabilitiesMatch
in interfaceAgentAssignmentService
-
isCapabilitiesMatch
public boolean isCapabilitiesMatch(EphemeralAgentTemplate template, long environmentId)
- 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.
-
-