public class EnvironmentRequirementServiceImpl extends Object implements EnvironmentRequirementService
Constructor and Description |
---|
EnvironmentRequirementServiceImpl(com.atlassian.struts.TextProvider textProvider,
AuditLogService auditLogService,
com.atlassian.event.api.EventPublisher eventPublisher,
CapabilityHelper capabilityHelper,
TaskManager taskManager,
ElasticFunctionalityFacade elasticFunctionalityFacade,
ExecutableAgentsHelper executableAgentsHelper,
EnvironmentService environmentService,
EnvironmentDao environmentDao,
PlanScheduler planScheduler) |
Modifier and Type | Method and Description |
---|---|
ImmutableRequirement |
addRequirement(long environmentId,
String key,
ImmutableRequirement.MatchType matchType,
String matchValue)
Add new requirement to an environment.
|
ExecutableAgentsMatrix |
getExecutableAgentMatrixForEnvironment(long environmentId)
retrieve all executable agents for a particular environment.
|
ImmutableRequirement |
getRequirementForEnvironment(long environmentId,
long requirementId)
Get a single requirement for a environment.
|
List<? extends ImmutableRequirement> |
getRequirementsForEnvironment(long environmentId)
Get all requirements for environment.
|
void |
removeRequirement(long environmentId,
long requirementId)
Remove a specific requirement
|
void |
renameRequirement(CapabilityType capabilityType,
String oldCapabilityKey,
String newCapabilityLabel,
boolean override)
Updates capability key across all environments.
|
ImmutableRequirement |
updateRequirement(long environmentId,
long requirementId,
String key,
ImmutableRequirement.MatchType matchType,
String matchValue)
Update an existing requirement.
|
public EnvironmentRequirementServiceImpl(com.atlassian.struts.TextProvider textProvider, AuditLogService auditLogService, com.atlassian.event.api.EventPublisher eventPublisher, CapabilityHelper capabilityHelper, TaskManager taskManager, ElasticFunctionalityFacade elasticFunctionalityFacade, ExecutableAgentsHelper executableAgentsHelper, EnvironmentService environmentService, EnvironmentDao environmentDao, PlanScheduler planScheduler)
@NotNull public List<? extends ImmutableRequirement> getRequirementsForEnvironment(long environmentId) throws WebValidationException
EnvironmentRequirementService
getRequirementsForEnvironment
in interface EnvironmentRequirementService
environmentId
- of environmentWebValidationException
- if environmentId invalid@NotNull public ExecutableAgentsMatrix getExecutableAgentMatrixForEnvironment(long environmentId) throws WebValidationException
EnvironmentRequirementService
getExecutableAgentMatrixForEnvironment
in interface EnvironmentRequirementService
environmentId
- of environmentWebValidationException
@NotNull public ImmutableRequirement getRequirementForEnvironment(long environmentId, long requirementId)
EnvironmentRequirementService
getRequirementForEnvironment
in interface EnvironmentRequirementService
environmentId
- of environmentrequirementId
- of requirement@NotNull public ImmutableRequirement addRequirement(long environmentId, @NotNull String key, @NotNull ImmutableRequirement.MatchType matchType, @Nullable String matchValue) throws WebValidationException
EnvironmentRequirementService
addRequirement
in interface EnvironmentRequirementService
environmentId
- of environmentkey
- 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 ImmutableRequirement updateRequirement(long environmentId, long requirementId, @NotNull String key, @NotNull ImmutableRequirement.MatchType matchType, @Nullable String matchValue) throws WebValidationException
EnvironmentRequirementService
updateRequirement
in interface EnvironmentRequirementService
environmentId
- of environmentrequirementId
- 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(long environmentId, long requirementId) throws WebValidationException
EnvironmentRequirementService
removeRequirement
in interface EnvironmentRequirementService
environmentId
- of environmentrequirementId
- of requirement to removeWebValidationException
- if requirement is not allowed to be removedpublic void renameRequirement(CapabilityType capabilityType, String oldCapabilityKey, String newCapabilityLabel, boolean override)
EnvironmentRequirementService
renameRequirement
in interface EnvironmentRequirementService
capabilityType
- capability typeoldCapabilityKey
- previous capability key, for example system.builder.mvn.Maven 3newCapabilityLabel
- new capability label, for example Maven 3 updatedoverride
- existing values in case of conflict. If there is a conflict when entity already has capability
with new label this flag indicates if it should be overridden or not.Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.