public class RequirementServiceImpl extends Object implements RequirementService
Constructor and Description |
---|
RequirementServiceImpl(CachedPlanManager cachedPlanManager,
com.atlassian.struts.TextProvider textProvider,
PlanManager planManager,
AuditLogService auditLogService,
com.atlassian.event.api.EventPublisher eventPublisher,
BambooPermissionManager bambooPermissionManager,
CapabilityHelper capabilityHelper,
TaskManager taskManager,
ElasticFunctionalityFacade elasticFunctionalityFacade,
ExecutableAgentsHelper executableAgentsHelper) |
Modifier and Type | Method and Description |
---|---|
ImmutableRequirement |
addRequirement(PlanKey jobKey,
String key,
ImmutableRequirement.MatchType matchType,
String matchValue)
Add new requirement to a job.
|
ExecutableAgentsMatrix |
getExecutableAgentMatrixForJob(PlanKey jobKey)
retrieve all executable agents for a particular job.
|
ImmutableRequirement |
getRequirementForJob(PlanKey jobKey,
long requirementId)
Get a single requirement for a job.
|
List<? extends ImmutableRequirement> |
getRequirementsForJob(PlanKey jobKey)
Get all requirements for jobs.
|
void |
removeRequirement(PlanKey jobKey,
long requirementId)
Remove a specific requirement
|
ImmutableRequirement |
updateRequirement(PlanKey jobKey,
long requirementId,
String key,
ImmutableRequirement.MatchType matchType,
String matchValue)
Update an existing requirement.
|
ErrorCollection |
validateRequirementForAdd(PlanKey jobKey,
String key,
ImmutableRequirement.MatchType matchType,
String matchValue)
Validate requirement details.
|
ErrorCollection |
validateRequirementForUpdate(PlanKey jobKey,
long requirementId,
String key,
ImmutableRequirement.MatchType matchType,
String matchValue)
Validate requirement details
|
public RequirementServiceImpl(CachedPlanManager cachedPlanManager, com.atlassian.struts.TextProvider textProvider, PlanManager planManager, AuditLogService auditLogService, com.atlassian.event.api.EventPublisher eventPublisher, BambooPermissionManager bambooPermissionManager, CapabilityHelper capabilityHelper, TaskManager taskManager, ElasticFunctionalityFacade elasticFunctionalityFacade, ExecutableAgentsHelper executableAgentsHelper)
@NotNull public List<? extends ImmutableRequirement> getRequirementsForJob(@NotNull PlanKey jobKey) throws WebValidationException
RequirementService
getRequirementsForJob
in interface RequirementService
jobKey
- of jobWebValidationException
- if job key invalid@NotNull public ExecutableAgentsMatrix getExecutableAgentMatrixForJob(@NotNull PlanKey jobKey) throws WebValidationException
RequirementService
getExecutableAgentMatrixForJob
in interface RequirementService
WebValidationException
@NotNull public ImmutableRequirement getRequirementForJob(@NotNull PlanKey jobKey, long requirementId)
RequirementService
getRequirementForJob
in interface RequirementService
jobKey
- of jobrequirementId
- of requirement@NotNull public ErrorCollection validateRequirementForAdd(@NotNull PlanKey jobKey, @Nullable String key, @Nullable ImmutableRequirement.MatchType matchType, @Nullable String matchValue)
RequirementService
validateRequirementForAdd
in interface RequirementService
jobKey
- of job requirement will be added tokey
- of requirement to match with the capabilitymatchType
- e.g. exists, regex match, equalsmatchValue
- for regex and equals the value the requirement should match@NotNull public ImmutableRequirement addRequirement(@NotNull PlanKey jobKey, @NotNull String key, @NotNull ImmutableRequirement.MatchType matchType, @Nullable String matchValue) throws WebValidationException
RequirementService
addRequirement
in interface RequirementService
jobKey
- of job to add to, must not be a branchkey
- of requirement to match with the capabilitymatchType
- e.g. exists, regex match, equalsmatchValue
- for regex and equals the value the requirement should matchWebValidationException
- for any data related error.@NotNull public ErrorCollection validateRequirementForUpdate(@NotNull PlanKey jobKey, long requirementId, @Nullable String key, @Nullable ImmutableRequirement.MatchType matchType, @Nullable String matchValue)
RequirementService
validateRequirementForUpdate
in interface RequirementService
jobKey
- of job requirement belongs torequirementId
- if of the requirement being updatedkey
- of requirement to match with the capabilitymatchType
- e.g. exists, regex match, equalsmatchValue
- for regex and equals the value the requirement should match@NotNull public ImmutableRequirement updateRequirement(@NotNull PlanKey jobKey, long requirementId, @NotNull String key, @NotNull ImmutableRequirement.MatchType matchType, @Nullable String matchValue) throws WebValidationException
RequirementService
updateRequirement
in interface RequirementService
jobKey
- of job requirement belongs torequirementId
- if of the requirement being updatedkey
- of requirement to match with the capabilitymatchType
- e.g. exists, regex match, equalsmatchValue
- for regex and equals the value the requirement should matchWebValidationException
- for any data related error.public void removeRequirement(@NotNull PlanKey jobKey, long requirementId) throws WebValidationException
RequirementService
removeRequirement
in interface RequirementService
jobKey
- requirement belongs torequirementId
- of requirement to removeWebValidationException
- if requirement is not allowed to be removedCopyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.