Package com.atlassian.bamboo.trigger
Interface TriggerConfigurationService
- All Known Implementing Classes:
TriggerConfigurationServiceImpl
@Internal
public interface TriggerConfigurationService
- Since:
- 5.8
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addTriggeringRepository
(@NotNull Chain chain, long repositoryId) Deprecated.since 9.4 usevoid
addTriggeringRepository
(@NotNull Chain chain, long repositoryId, boolean reactivateTriggers) Updates all repository aware triggers of Chain by adding a new repository.createTrigger
(@NotNull PlanKey planKey, @NotNull TriggerModuleDescriptor triggerModuleDescriptor, @Nullable 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 planvoid
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 DefinitioneditTrigger
(@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 triggerDefinitionvoid
removeRepositoryIdsFromTriggers
(@NotNull Chain chain, @NotNull Set<Long> removedRepositoriesIds) Removes listed repository ids from chain's triggersvoid
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.
-
Field Details
-
NEW_REPOSITORY_INDICATOR
static final long NEW_REPOSITORY_INDICATOR- See Also:
-
-
Method Details
-
createTrigger
TriggerDefinition createTrigger(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull TriggerModuleDescriptor triggerModuleDescriptor, @Nullable @Nullable String userDescription, boolean isEnabled, @Nullable @Nullable Set<Long> triggeringRepositories, @NotNull @NotNull Map<String, String> configuration, @NotNull @NotNull Map<String, throws IllegalArgumentExceptionString> triggerConditionsConfiguration) Create a trigger Definition and save it against the plan- Parameters:
planKey
- of the plan to add the trigger definition to, plan should beTriggerable
triggerModuleDescriptor
- 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 forBuildTriggerCondition
plugins- Returns:
- the
TriggerDefinition
created - Throws:
IllegalArgumentException
- if planKey is invalid (e.g. doesn't exist or is not a buildable)
-
deleteTrigger
void deleteTrigger(@NotNull @NotNull PlanKey planKey, long triggerId) throws IllegalArgumentException, IllegalStateException Delete a given trigger Definition- Parameters:
planKey
- for the plan to delete the TriggerDefinition fromtriggerId
- of the TriggerDefinition to delete.- Throws:
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.
-
editTrigger
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, throws IllegalArgumentExceptionString> triggerConditionsConfiguration) Update the details of specific triggerDefinition- Parameters:
planKey
- - the plan the triggerDefinition belongs to, must beTriggerable
triggerId
- - the TriggerDefinition to edituserDescription
- - new user descriptionisEnabled
- - set new enabled/disabled statetriggeringRepositories
- - ids of repositories relevant to this triggertriggerConfigurationMap
- - new task ConfigurationtriggerConditionsConfiguration
- - configuration forBuildTriggerCondition
plugins- Returns:
TriggerDefinition
with updates.- Throws:
IllegalArgumentException
- if planKey or triggerId is invalid.
-
createTriggerList
void createTriggerList(PlanKey planKey, @NotNull @NotNull List<TriggerDefinition> triggerDefinitions) Initializes trigger list of a plan with the provided list. WARNING: If plan has existing triggers they are erased. It is assumed that the list is well-formed (i.e. ids are properly initialized) It can be used when automatically creating Plans.- Parameters:
planKey
- - the plan the task list belongs totriggerDefinitions
- - list of the tasks to be added- Throws:
IllegalArgumentException
- if plan does not exist
-
updateRepositoryIdsInTriggers
void updateRepositoryIdsInTriggers(@NotNull @NotNull Chain chain, Map<Long, Long> repositoryIdsChanges) Updates Chain configurations affected by repository edition. If map contains entry for NEW_REPOSITORY_INDICATOR this repository is added to all the triggers.- Parameters:
chain
-repositoryIdsChanges
- mapping between old and new repositories ids
-
updateRepositoryIdsInTriggers
void updateRepositoryIdsInTriggers(@NotNull @NotNull Chain chain, Map<Long, Long> repositoryIdsChanges, boolean reactivateTriggers) Updates Chain configurations affected by repository edition. If map contains entry for NEW_REPOSITORY_INDICATOR this repository is added to all the triggers.- Parameters:
chain
-repositoryIdsChanges
- mapping between old and new repositories idsreactivateTriggers
- indicates if triggers need to be (re)activated
-
addTriggeringRepository
Deprecated.since 9.4 useUpdates all repository aware triggers of Chain by adding a new repository.- Parameters:
chain
-repositoryId
-
-
addTriggeringRepository
void addTriggeringRepository(@NotNull @NotNull Chain chain, long repositoryId, boolean reactivateTriggers) Updates all repository aware triggers of Chain by adding a new repository.- Parameters:
chain
-repositoryId
-reactivateTriggers
- true if triggers should be restarted- Since:
- 9.4
-
removeRepositoryIdsFromTriggers
void removeRepositoryIdsFromTriggers(@NotNull @NotNull Chain chain, @NotNull @NotNull Set<Long> removedRepositoriesIds) Removes listed repository ids from chain's triggers- Parameters:
chain
-removedRepositoriesIds
-
-