public class EnvironmentTriggerServiceImpl extends Object implements EnvironmentTriggerService
Constructor and Description |
---|
EnvironmentTriggerServiceImpl(AuditLogService auditLogService,
DeploymentProjectService deploymentProjectService,
EnvironmentDao environmentDao,
PlanScheduler planScheduler,
ScopedExclusionService scopedExclusionService,
com.opensymphony.xwork2.TextProvider textProvider) |
Modifier and Type | Method and Description |
---|---|
TriggerDefinition |
createEnvironmentTrigger(long environmentId,
TriggerModuleDescriptor triggerModuleDescriptor,
String userDescription,
boolean isEnabled,
Map<String,String> configuration)
Create a trigger Definition and save it against the plan
|
void |
deleteEnvironmentTrigger(long environmentId,
long triggerId)
Delete a given trigger Definition
|
void |
deleteEnvironmentTriggers(long environmentId,
Predicate<TriggerDefinition> shouldBeRemoved)
Delete all triggers that match a predicate.
|
TriggerDefinition |
editEnvironmentTrigger(long environmentId,
long triggerId,
String userDescription,
boolean isEnabled,
Map<String,String> triggerConfigurationMap)
Update the details of specific triggerDefinition
|
PlanKey |
getCalculatedTriggeringPlanKey(InternalEnvironment environment,
DeploymentTriggerBranchSelectionMode branchSelectionMode,
PlanKey customBranchKey) |
public EnvironmentTriggerServiceImpl(AuditLogService auditLogService, DeploymentProjectService deploymentProjectService, EnvironmentDao environmentDao, PlanScheduler planScheduler, ScopedExclusionService scopedExclusionService, com.opensymphony.xwork2.TextProvider textProvider)
public TriggerDefinition createEnvironmentTrigger(long environmentId, @NotNull TriggerModuleDescriptor triggerModuleDescriptor, @Nullable String userDescription, boolean isEnabled, @NotNull Map<String,String> configuration) throws IllegalArgumentException
EnvironmentTriggerService
createEnvironmentTrigger
in interface EnvironmentTriggerService
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 TriggerDefinitionTriggerDefinition
createdIllegalArgumentException
- if environmentId is invalidpublic TriggerDefinition editEnvironmentTrigger(long environmentId, long triggerId, @Nullable String userDescription, boolean isEnabled, @NotNull Map<String,String> triggerConfigurationMap) throws IllegalArgumentException
EnvironmentTriggerService
editEnvironmentTrigger
in interface EnvironmentTriggerService
environmentId
- id of an environment the triggerDefinition belongs totriggerId
- the TriggerDefinition to edituserDescription
- new user descriptionisEnabled
- set new enabled/disabled statetriggerConfigurationMap
- new task ConfigurationTriggerDefinition
with updates.IllegalArgumentException
- if environmentId or triggerId is invalid.public void deleteEnvironmentTrigger(long environmentId, long triggerId) throws IllegalArgumentException, IllegalStateException
EnvironmentTriggerService
deleteEnvironmentTrigger
in interface EnvironmentTriggerService
environmentId
- id of an environment the triggerDefinition belongs totriggerId
- of the TriggerDefinition to delete.IllegalArgumentException
- if environmentId is invalidIllegalStateException
- if the task list has changed since submitting request, i.e the task isn't there to delete anymore.public void deleteEnvironmentTriggers(long environmentId, Predicate<TriggerDefinition> shouldBeRemoved)
EnvironmentTriggerService
deleteEnvironmentTriggers
in interface EnvironmentTriggerService
@Nullable public PlanKey getCalculatedTriggeringPlanKey(@NotNull InternalEnvironment environment, @NotNull DeploymentTriggerBranchSelectionMode branchSelectionMode, @Nullable PlanKey customBranchKey) throws DeploymentException
getCalculatedTriggeringPlanKey
in interface EnvironmentTriggerService
DeploymentException
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.