public class TriggerConfigurationServiceImpl extends Object implements TriggerConfigurationService
NEW_REPOSITORY_INDICATOR
Constructor and Description |
---|
TriggerConfigurationServiceImpl(BuildDefinitionManager buildDefinitionManager,
com.opensymphony.xwork2.TextProvider textProvider,
PlanManager planManager,
AuditLogService auditLogService,
ScopedExclusionService scopedExclusionService) |
Modifier and Type | Method and Description |
---|---|
void |
addTriggeringRepository(Chain chain,
long repositoryId)
Updates all repository aware triggers of Chain by adding a new repository.
|
TriggerDefinition |
createTrigger(PlanKey planKey,
TriggerModuleDescriptor triggerDescriptor,
String userDescription,
boolean isEnabled,
Set<Long> triggeringRepositories,
Map<String,String> configuration,
Map<String,String> triggerConditionsConfiguration)
Create a trigger Definition and save it against the plan
|
void |
createTriggerList(PlanKey planKey,
List<TriggerDefinition> triggerDefinitions)
Initializes trigger list of a plan with the provided list.
|
void |
deleteTrigger(PlanKey planKey,
long triggerId)
Delete a given trigger Definition
|
TriggerDefinition |
editTrigger(PlanKey planKey,
long triggerId,
String userDescription,
boolean isEnabled,
Set<Long> triggeringRepositories,
Map<String,String> triggerConfigurationMap,
Map<String,String> triggerConditionsConfiguration)
Update the details of specific triggerDefinition
|
void |
removeRepositoryIdsFromTriggers(Chain chain,
Set<Long> removedRepositoriesIds)
Removes listed repository ids from chain's triggers
|
void |
updateRepositoryIdsInTriggers(Chain chain,
Map<Long,Long> repositoryIdsChanges)
Updates Chain configurations affected by repository edition.
|
void |
updateRepositoryIdsInTriggers(Chain chain,
Map<Long,Long> repositoryIdsChanges,
boolean reactivateTriggers)
Updates Chain configurations affected by repository edition.
|
public TriggerConfigurationServiceImpl(@NotNull BuildDefinitionManager buildDefinitionManager, @NotNull com.opensymphony.xwork2.TextProvider textProvider, @NotNull PlanManager planManager, @NotNull AuditLogService auditLogService, @NotNull ScopedExclusionService scopedExclusionService)
public TriggerDefinition createTrigger(@NotNull PlanKey planKey, @NotNull TriggerModuleDescriptor triggerDescriptor, @NotNull String userDescription, boolean isEnabled, @Nullable Set<Long> triggeringRepositories, @NotNull Map<String,String> configuration, @NotNull Map<String,String> triggerConditionsConfiguration) throws IllegalArgumentException
TriggerConfigurationService
createTrigger
in interface TriggerConfigurationService
planKey
- of the plan to add the trigger definition to, plan should be Triggerable
triggerDescriptor
- for the TriggerDefinition to be addeduserDescription
- description the user has specified for this TriggerDefinitionisEnabled
- - set enabled/disabled state of the newly created triggertriggeringRepositories
- - ids of repositories relevant to this triggerconfiguration
- configuration from the plugin for this TriggerDefinitiontriggerConditionsConfiguration
- - configuration for BuildTriggerCondition
pluginsTriggerDefinition
createdIllegalArgumentException
- if planKey is invalid (e.g. doesn't exist or is not a buildable)public void deleteTrigger(@NotNull PlanKey planKey, long triggerId) throws IllegalArgumentException, IllegalStateException
TriggerConfigurationService
deleteTrigger
in interface TriggerConfigurationService
planKey
- for the plan to delete the TriggerDefinition fromtriggerId
- of the TriggerDefinition to delete.IllegalArgumentException
- if planKey is invalid (e.g. doesn't exist or is not a buildable),IllegalStateException
- if the task list has changed since submitting request, i.e the task isn't there to delete anymore.public TriggerDefinition editTrigger(@NotNull PlanKey planKey, long triggerId, @Nullable String userDescription, boolean isEnabled, @Nullable Set<Long> triggeringRepositories, @NotNull Map<String,String> triggerConfigurationMap, @NotNull Map<String,String> triggerConditionsConfiguration) throws IllegalArgumentException
TriggerConfigurationService
editTrigger
in interface TriggerConfigurationService
planKey
- - the plan the triggerDefinition belongs to, must be Triggerable
triggerId
- - the TriggerDefinition to edituserDescription
- - new user descriptionisEnabled
- - set new enabled/disabled statetriggeringRepositories
- - ids of repositories relevant to this triggertriggerConfigurationMap
- - new task ConfigurationtriggerConditionsConfiguration
- - configuration for BuildTriggerCondition
pluginsTriggerDefinition
with updates.IllegalArgumentException
- if planKey or triggerId is invalid.public void createTriggerList(PlanKey planKey, @NotNull List<TriggerDefinition> triggerDefinitions)
TriggerConfigurationService
createTriggerList
in interface TriggerConfigurationService
planKey
- - the plan the task list belongs totriggerDefinitions
- - list of the tasks to be addedpublic void addTriggeringRepository(@NotNull Chain chain, long repositoryId)
TriggerConfigurationService
addTriggeringRepository
in interface TriggerConfigurationService
public void updateRepositoryIdsInTriggers(@NotNull Chain chain, Map<Long,Long> repositoryIdsChanges)
TriggerConfigurationService
updateRepositoryIdsInTriggers
in interface TriggerConfigurationService
repositoryIdsChanges
- mapping between old and new repositories idspublic void updateRepositoryIdsInTriggers(@NotNull Chain chain, Map<Long,Long> repositoryIdsChanges, boolean reactivateTriggers)
TriggerConfigurationService
updateRepositoryIdsInTriggers
in interface TriggerConfigurationService
repositoryIdsChanges
- mapping between old and new repositories idsreactivateTriggers
- indicates if triggers need to be (re)activatedpublic void removeRepositoryIdsFromTriggers(@NotNull Chain chain, Set<Long> removedRepositoriesIds)
TriggerConfigurationService
removeRepositoryIdsFromTriggers
in interface TriggerConfigurationService
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.