Class EnvironmentRequirementServiceImpl
java.lang.Object
com.atlassian.bamboo.deployments.environments.requirement.EnvironmentRequirementServiceImpl
- All Implemented Interfaces:
EnvironmentRequirementService
public class EnvironmentRequirementServiceImpl
extends Object
implements EnvironmentRequirementService
-
Constructor Summary
ConstructorsConstructorDescriptionEnvironmentRequirementServiceImpl(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, EnvironmentCustomConfigService environmentCustomConfigService) -
Method Summary
Modifier and TypeMethodDescription@NotNull ImmutableRequirementaddRequirement(long environmentId, @NotNull String key, ImmutableRequirement.MatchType matchType, @Nullable String matchValue) Add new requirement to an environment.@NotNull ExecutableAgentsMatrixgetExecutableAgentMatrixForEnvironment(long environmentId) Retrieve all executable agents for a particular environment.@NotNull ExecutableAgentsMatrixgetExecutableAgentMatrixForEnvironment(@NotNull InternalEnvironment environment) Retrieve all executable agents for a particular environment.@NotNull ImmutableRequirementgetRequirementForEnvironment(long environmentId, long requirementId) Get a single requirement for a environment.@NotNull List<? extends ImmutableRequirement>getRequirementsForEnvironment(long environmentId) Get all requirements for environment.voidremoveRequirement(long environmentId, long requirementId) Remove a specific requirementvoidrenameRequirement(CapabilityType capabilityType, String oldCapabilityKey, String newCapabilityLabel, boolean override) Updates capability key across all environments.@NotNull ImmutableRequirementupdateRequirement(long environmentId, long requirementId, @NotNull String key, ImmutableRequirement.MatchType matchType, @Nullable String matchValue) Update an existing requirement.
-
Constructor Details
-
EnvironmentRequirementServiceImpl
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, EnvironmentCustomConfigService environmentCustomConfigService)
-
-
Method Details
-
getRequirementsForEnvironment
@NotNull public @NotNull List<? extends ImmutableRequirement> getRequirementsForEnvironment(long environmentId) throws WebValidationException Description copied from interface:EnvironmentRequirementServiceGet all requirements for environment.- Specified by:
getRequirementsForEnvironmentin interfaceEnvironmentRequirementService- Parameters:
environmentId- of environment- Returns:
- RequirementSet for environment
- Throws:
WebValidationException- if environmentId invalid
-
getExecutableAgentMatrixForEnvironment
@NotNull public @NotNull ExecutableAgentsMatrix getExecutableAgentMatrixForEnvironment(long environmentId) Description copied from interface:EnvironmentRequirementServiceRetrieve all executable agents for a particular environment. Includes all disabled and offline agents/images.- Specified by:
getExecutableAgentMatrixForEnvironmentin interfaceEnvironmentRequirementService- Parameters:
environmentId- of environment- Returns:
- executableAgentMatrix (requirements to matching agents and images)
-
getExecutableAgentMatrixForEnvironment
@NotNull public @NotNull ExecutableAgentsMatrix getExecutableAgentMatrixForEnvironment(@NotNull @NotNull InternalEnvironment environment) Description copied from interface:EnvironmentRequirementServiceRetrieve all executable agents for a particular environment. Includes all disabled and offline agents/images.- Specified by:
getExecutableAgentMatrixForEnvironmentin interfaceEnvironmentRequirementService- Parameters:
environment- environment- Returns:
- executableAgentMatrix (requirements to matching agents and images)
-
getRequirementForEnvironment
@NotNull public @NotNull ImmutableRequirement getRequirementForEnvironment(long environmentId, long requirementId) Description copied from interface:EnvironmentRequirementServiceGet a single requirement for a environment.- Specified by:
getRequirementForEnvironmentin interfaceEnvironmentRequirementService- Parameters:
environmentId- of environmentrequirementId- of requirement- Returns:
- requirement
-
addRequirement
@NotNull public @NotNull ImmutableRequirement addRequirement(long environmentId, @NotNull @NotNull String key, @NotNull ImmutableRequirement.MatchType matchType, @Nullable @Nullable String matchValue) throws WebValidationException Description copied from interface:EnvironmentRequirementServiceAdd new requirement to an environment.- Specified by:
addRequirementin interfaceEnvironmentRequirementService- Parameters:
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 match- Returns:
- created requirement
- Throws:
WebValidationException- for any data related error.
-
updateRequirement
@NotNull public @NotNull ImmutableRequirement updateRequirement(long environmentId, long requirementId, @NotNull @NotNull String key, @NotNull ImmutableRequirement.MatchType matchType, @Nullable @Nullable String matchValue) throws WebValidationException Description copied from interface:EnvironmentRequirementServiceUpdate an existing requirement.- Specified by:
updateRequirementin interfaceEnvironmentRequirementService- Parameters:
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 match- Returns:
- updated requirement
- Throws:
WebValidationException- for any data related error.
-
removeRequirement
Description copied from interface:EnvironmentRequirementServiceRemove a specific requirement- Specified by:
removeRequirementin interfaceEnvironmentRequirementService- Parameters:
environmentId- of environmentrequirementId- of requirement to remove- Throws:
WebValidationException- if requirement is not allowed to be removed
-
renameRequirement
public void renameRequirement(CapabilityType capabilityType, String oldCapabilityKey, String newCapabilityLabel, boolean override) Description copied from interface:EnvironmentRequirementServiceUpdates capability key across all environments.- Specified by:
renameRequirementin interfaceEnvironmentRequirementService- Parameters:
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.
-