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
ConstructorDescriptionEnvironmentRequirementServiceImpl
(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 ImmutableRequirement
addRequirement
(long environmentId, @NotNull String key, ImmutableRequirement.MatchType matchType, @Nullable String matchValue) Add new requirement to an environment.@NotNull ExecutableAgentsMatrix
getExecutableAgentMatrixForEnvironment
(long environmentId) Retrieve all executable agents for a particular environment.@NotNull ExecutableAgentsMatrix
getExecutableAgentMatrixForEnvironment
(@NotNull InternalEnvironment environment) Retrieve all executable agents for a particular environment.@NotNull ImmutableRequirement
getRequirementForEnvironment
(long environmentId, long requirementId) Get a single requirement for a environment.@NotNull List<? extends ImmutableRequirement>
getRequirementsForEnvironment
(long environmentId) Get all requirements for environment.void
removeRequirement
(long environmentId, long requirementId) Remove a specific requirementvoid
renameRequirement
(CapabilityType capabilityType, String oldCapabilityKey, String newCapabilityLabel, boolean override) Updates capability key across all environments.@NotNull ImmutableRequirement
updateRequirement
(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:EnvironmentRequirementService
Get all requirements for environment.- Specified by:
getRequirementsForEnvironment
in 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:EnvironmentRequirementService
Retrieve all executable agents for a particular environment. Includes all disabled and offline agents/images.- Specified by:
getExecutableAgentMatrixForEnvironment
in 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:EnvironmentRequirementService
Retrieve all executable agents for a particular environment. Includes all disabled and offline agents/images.- Specified by:
getExecutableAgentMatrixForEnvironment
in 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:EnvironmentRequirementService
Get a single requirement for a environment.- Specified by:
getRequirementForEnvironment
in 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:EnvironmentRequirementService
Add new requirement to an environment.- Specified by:
addRequirement
in 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:EnvironmentRequirementService
Update an existing requirement.- Specified by:
updateRequirement
in 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:EnvironmentRequirementService
Remove a specific requirement- Specified by:
removeRequirement
in 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:EnvironmentRequirementService
Updates capability key across all environments.- Specified by:
renameRequirement
in 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.
-