Class TriggerConfigurationServiceImpl

java.lang.Object
com.atlassian.bamboo.trigger.TriggerConfigurationServiceImpl
All Implemented Interfaces:
TriggerConfigurationService

public class TriggerConfigurationServiceImpl extends Object implements TriggerConfigurationService
  • Constructor Details

    • TriggerConfigurationServiceImpl

      public TriggerConfigurationServiceImpl(@NotNull @NotNull BuildDefinitionManager buildDefinitionManager, @NotNull @NotNull org.apache.struts2.text.TextProvider textProvider, @NotNull @NotNull PlanManager planManager, @NotNull @NotNull AuditLogService auditLogService, @NotNull @NotNull ScopedExclusionService scopedExclusionService)
  • Method Details

    • createTrigger

      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
      Description copied from interface: TriggerConfigurationService
      Create a trigger Definition and save it against the plan
      Specified by:
      createTrigger in interface TriggerConfigurationService
      Parameters:
      planKey - of the plan to add the trigger definition to, plan should be Triggerable
      triggerDescriptor - for the TriggerDefinition to be added
      userDescription - description the user has specified for this TriggerDefinition
      isEnabled - - set enabled/disabled state of the newly created trigger
      triggeringRepositories - - ids of repositories relevant to this trigger
      configuration - configuration from the plugin for this TriggerDefinition
      triggerConditionsConfiguration - - configuration for BuildTriggerCondition plugins
      Returns:
      the TriggerDefinition created
      Throws:
      IllegalArgumentException - if planKey is invalid (e.g. doesn't exist or is not a buildable)
    • deleteTrigger

      public void deleteTrigger(@NotNull @NotNull PlanKey planKey, long triggerId) throws IllegalArgumentException, IllegalStateException
      Description copied from interface: TriggerConfigurationService
      Delete a given trigger Definition
      Specified by:
      deleteTrigger in interface TriggerConfigurationService
      Parameters:
      planKey - for the plan to delete the TriggerDefinition from
      triggerId - 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

      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
      Description copied from interface: TriggerConfigurationService
      Update the details of specific triggerDefinition
      Specified by:
      editTrigger in interface TriggerConfigurationService
      Parameters:
      planKey - - the plan the triggerDefinition belongs to, must be Triggerable
      triggerId - - the TriggerDefinition to edit
      userDescription - - new user description
      isEnabled - - set new enabled/disabled state
      triggeringRepositories - - ids of repositories relevant to this trigger
      triggerConfigurationMap - - new task Configuration
      triggerConditionsConfiguration - - configuration for BuildTriggerCondition plugins
      Returns:
      TriggerDefinition with updates.
      Throws:
      IllegalArgumentException - if planKey or triggerId is invalid.
    • createTriggerList

      public void createTriggerList(PlanKey planKey, @NotNull @NotNull List<TriggerDefinition> triggerDefinitions)
      Description copied from interface: TriggerConfigurationService
      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.
      Specified by:
      createTriggerList in interface TriggerConfigurationService
      Parameters:
      planKey - - the plan the task list belongs to
      triggerDefinitions - - list of the tasks to be added
    • addTriggeringRepository

      public void addTriggeringRepository(@NotNull @NotNull Chain chain, long repositoryId, boolean reactivateTriggers)
      Description copied from interface: TriggerConfigurationService
      Updates all repository aware triggers of Chain by adding a new repository.
      Specified by:
      addTriggeringRepository in interface TriggerConfigurationService
      Parameters:
      chain -
      repositoryId -
      reactivateTriggers - true if triggers should be restarted
    • updateRepositoryIdsInTriggers

      public void updateRepositoryIdsInTriggers(@NotNull @NotNull Chain chain, Map<Long,Long> repositoryIdsChanges)
      Description copied from interface: TriggerConfigurationService
      Updates Chain configurations affected by repository edition. If map contains entry for NEW_REPOSITORY_INDICATOR this repository is added to all the triggers.
      Specified by:
      updateRepositoryIdsInTriggers in interface TriggerConfigurationService
      Parameters:
      chain -
      repositoryIdsChanges - mapping between old and new repositories ids
    • updateRepositoryIdsInTriggers

      public void updateRepositoryIdsInTriggers(@NotNull @NotNull Chain chain, Map<Long,Long> repositoryIdsChanges, boolean reactivateTriggers)
      Description copied from interface: TriggerConfigurationService
      Updates Chain configurations affected by repository edition. If map contains entry for NEW_REPOSITORY_INDICATOR this repository is added to all the triggers.
      Specified by:
      updateRepositoryIdsInTriggers in interface TriggerConfigurationService
      Parameters:
      chain -
      repositoryIdsChanges - mapping between old and new repositories ids
      reactivateTriggers - indicates if triggers need to be (re)activated
    • removeRepositoryIdsFromTriggers

      public void removeRepositoryIdsFromTriggers(@NotNull @NotNull Chain chain, Set<Long> removedRepositoriesIds)
      Description copied from interface: TriggerConfigurationService
      Removes listed repository ids from chain's triggers
      Specified by:
      removeRepositoryIdsFromTriggers in interface TriggerConfigurationService
      Parameters:
      chain -
      removedRepositoriesIds -