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
RequirementServicegetRequirementsForJob in interface RequirementServicejobKey - of jobWebValidationException - if job key invalid@NotNull public ExecutableAgentsMatrix getExecutableAgentMatrixForJob(@NotNull PlanKey jobKey) throws WebValidationException
RequirementServicegetExecutableAgentMatrixForJob in interface RequirementServiceWebValidationException@NotNull public ImmutableRequirement getRequirementForJob(@NotNull PlanKey jobKey, long requirementId)
RequirementServicegetRequirementForJob in interface RequirementServicejobKey - of jobrequirementId - of requirement@NotNull public ErrorCollection validateRequirementForAdd(@NotNull PlanKey jobKey, @Nullable String key, @Nullable ImmutableRequirement.MatchType matchType, @Nullable String matchValue)
RequirementServicevalidateRequirementForAdd in interface RequirementServicejobKey - 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
RequirementServiceaddRequirement in interface RequirementServicejobKey - 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)
RequirementServicevalidateRequirementForUpdate in interface RequirementServicejobKey - 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
RequirementServiceupdateRequirement in interface RequirementServicejobKey - 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
RequirementServiceremoveRequirement in interface RequirementServicejobKey - requirement belongs torequirementId - of requirement to removeWebValidationException - if requirement is not allowed to be removedCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.