public class TriggerConfigurationServiceImpl extends Object implements TriggerConfigurationService
NEW_REPOSITORY_INDICATOR
Constructor and Description |
---|
TriggerConfigurationServiceImpl(@NotNull BuildDefinitionManager buildDefinitionManager,
@NotNull com.opensymphony.xwork2.TextProvider textProvider,
@NotNull PlanManager planManager,
@NotNull AuditLogService auditLogService,
@NotNull ScopedExclusionService scopedExclusionService) |
Modifier and Type | Method and Description |
---|---|
void |
addTriggeringRepository(@NotNull Chain chain,
long repositoryId)
Updates all repository aware triggers of Chain by adding a new repository.
|
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)
Create a trigger Definition and save it against the plan
|
void |
createTriggerList(PlanKey planKey,
@NotNull List<TriggerDefinition> triggerDefinitions)
Initializes trigger list of a plan with the provided list.
|
void |
deleteTrigger(@NotNull PlanKey planKey,
long triggerId)
Delete a given trigger Definition
|
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)
Update the details of specific triggerDefinition
|
void |
removeRepositoryIdsFromTriggers(@NotNull Chain chain,
Set<Long> removedRepositoriesIds)
Removes listed repository ids from chain's triggers
|
void |
updateRepositoryIdsInTriggers(@NotNull Chain chain,
Map<Long,Long> repositoryIdsChanges)
Updates Chain configurations affected by repository edition.
|
void |
updateRepositoryIdsInTriggers(@NotNull Chain chain,
Map<Long,Long> repositoryIdsChanges,
boolean reactivateTriggers)
Updates Chain configurations affected by repository edition.
|
public TriggerConfigurationServiceImpl(@NotNull @NotNull BuildDefinitionManager buildDefinitionManager, @NotNull @NotNull com.opensymphony.xwork2.TextProvider textProvider, @NotNull @NotNull PlanManager planManager, @NotNull @NotNull AuditLogService auditLogService, @NotNull @NotNull ScopedExclusionService scopedExclusionService)
public TriggerDefinition createTrigger(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull TriggerModuleDescriptor triggerDescriptor, @NotNull @NotNull String userDescription, boolean isEnabled, @Nullable @Nullable Set<Long> triggeringRepositories, @NotNull @NotNull Map<String,String> configuration, @NotNull @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 @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 @NotNull PlanKey planKey, long triggerId, @Nullable @Nullable String userDescription, boolean isEnabled, @Nullable @Nullable Set<Long> triggeringRepositories, @NotNull @NotNull Map<String,String> triggerConfigurationMap, @NotNull @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 @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 @NotNull Chain chain, long repositoryId)
TriggerConfigurationService
addTriggeringRepository
in interface TriggerConfigurationService
public void updateRepositoryIdsInTriggers(@NotNull @NotNull Chain chain, Map<Long,Long> repositoryIdsChanges)
TriggerConfigurationService
updateRepositoryIdsInTriggers
in interface TriggerConfigurationService
repositoryIdsChanges
- mapping between old and new repositories idspublic void updateRepositoryIdsInTriggers(@NotNull @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 @NotNull Chain chain, Set<Long> removedRepositoriesIds)
TriggerConfigurationService
removeRepositoryIdsFromTriggers
in interface TriggerConfigurationService
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.