Class EnvironmentTriggerServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.deployments.environments.service.EnvironmentTriggerServiceImpl
-
- All Implemented Interfaces:
EnvironmentTriggerService
public class EnvironmentTriggerServiceImpl extends Object implements EnvironmentTriggerService
-
-
Constructor Summary
Constructors Constructor Description EnvironmentTriggerServiceImpl(AuditLogService auditLogService, DeploymentProjectService deploymentProjectService, EnvironmentDao environmentDao, PlanScheduler planScheduler, ScopedExclusionService scopedExclusionService, com.opensymphony.xwork2.TextProvider textProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TriggerDefinition
createEnvironmentTrigger(long environmentId, @NotNull TriggerModuleDescriptor triggerModuleDescriptor, @Nullable String userDescription, boolean isEnabled, @NotNull Map<String,String> configuration)
Create a trigger Definition and save it against the planvoid
deleteEnvironmentTrigger(long environmentId, long triggerId)
Delete a given trigger Definitionvoid
deleteEnvironmentTriggers(long environmentId, Predicate<TriggerDefinition> shouldBeRemoved)
Delete all triggers that match a predicate.TriggerDefinition
editEnvironmentTrigger(long environmentId, long triggerId, @Nullable String userDescription, boolean isEnabled, @NotNull Map<String,String> triggerConfigurationMap)
Update the details of specific triggerDefinition@Nullable PlanKey
getCalculatedTriggeringPlanKey(@NotNull InternalEnvironment environment, @NotNull DeploymentTriggerBranchSelectionMode branchSelectionMode, @Nullable PlanKey customBranchKey)
-
-
-
Constructor Detail
-
EnvironmentTriggerServiceImpl
public EnvironmentTriggerServiceImpl(AuditLogService auditLogService, DeploymentProjectService deploymentProjectService, EnvironmentDao environmentDao, PlanScheduler planScheduler, ScopedExclusionService scopedExclusionService, com.opensymphony.xwork2.TextProvider textProvider)
-
-
Method Detail
-
createEnvironmentTrigger
public TriggerDefinition createEnvironmentTrigger(long environmentId, @NotNull @NotNull TriggerModuleDescriptor triggerModuleDescriptor, @Nullable @Nullable String userDescription, boolean isEnabled, @NotNull @NotNull Map<String,String> configuration) throws IllegalArgumentException
Description copied from interface:EnvironmentTriggerService
Create a trigger Definition and save it against the plan- Specified by:
createEnvironmentTrigger
in interfaceEnvironmentTriggerService
- Parameters:
environmentId
- id of an environment the triggerDefinition belongs totriggerModuleDescriptor
- for the TriggerDefinition to be addeduserDescription
- description the user has specified for this TriggerDefinitionisEnabled
- set enabled/disabled state of the newly created triggerconfiguration
- configuration from the plugin for this TriggerDefinition- Returns:
- the
TriggerDefinition
created - Throws:
IllegalArgumentException
- if environmentId is invalid
-
editEnvironmentTrigger
public TriggerDefinition editEnvironmentTrigger(long environmentId, long triggerId, @Nullable @Nullable String userDescription, boolean isEnabled, @NotNull @NotNull Map<String,String> triggerConfigurationMap) throws IllegalArgumentException
Description copied from interface:EnvironmentTriggerService
Update the details of specific triggerDefinition- Specified by:
editEnvironmentTrigger
in interfaceEnvironmentTriggerService
- Parameters:
environmentId
- id of an environment the triggerDefinition belongs totriggerId
- the TriggerDefinition to edituserDescription
- new user descriptionisEnabled
- set new enabled/disabled statetriggerConfigurationMap
- new task Configuration- Returns:
TriggerDefinition
with updates.- Throws:
IllegalArgumentException
- if environmentId or triggerId is invalid.
-
deleteEnvironmentTrigger
public void deleteEnvironmentTrigger(long environmentId, long triggerId) throws IllegalArgumentException, IllegalStateException
Description copied from interface:EnvironmentTriggerService
Delete a given trigger Definition- Specified by:
deleteEnvironmentTrigger
in interfaceEnvironmentTriggerService
- Parameters:
environmentId
- id of an environment the triggerDefinition belongs totriggerId
- of the TriggerDefinition to delete.- Throws:
IllegalArgumentException
- if environmentId is invalidIllegalStateException
- if the task list has changed since submitting request, i.e the task isn't there to delete anymore.
-
deleteEnvironmentTriggers
public void deleteEnvironmentTriggers(long environmentId, Predicate<TriggerDefinition> shouldBeRemoved)
Description copied from interface:EnvironmentTriggerService
Delete all triggers that match a predicate.- Specified by:
deleteEnvironmentTriggers
in interfaceEnvironmentTriggerService
-
getCalculatedTriggeringPlanKey
@Nullable public @Nullable PlanKey getCalculatedTriggeringPlanKey(@NotNull @NotNull InternalEnvironment environment, @NotNull @NotNull DeploymentTriggerBranchSelectionMode branchSelectionMode, @Nullable @Nullable PlanKey customBranchKey) throws DeploymentException
- Specified by:
getCalculatedTriggeringPlanKey
in interfaceEnvironmentTriggerService
- Throws:
DeploymentException
-
-