Interface TriggerActivator

All Known Implementing Classes:
AbstractQuartzTriggerActivator, AfterSuccessfulDeploymentTriggerActivator, AfterSuccessfulPlanTriggerActivator, AfterSuccessfulStageTriggerActivator, BitbucketCloudTriggerActivator, CronTriggerActivator, DailyTriggerActivator, PollingTriggerActivator, RemoteTriggerActivator, StashTriggerActivator, TagTriggerActivator

public interface TriggerActivator
Class responsible for setting up and tearing down triggers. For example: - registering Triggerable in event handling service - starting/stopping quartz polling job Additional actions may be performed on server startup, for instance, triggers based on external events might need to catch up with the events lost during Bamboo's inactivity. Implementation should be stateless.
Since:
5.8
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(@NotNull Triggerable triggerable, @NotNull TriggerDefinition triggerDefinition)
    This method should activate any services or threads that are required for this trigger to function.
    void
    deactivate(@NotNull Triggerable triggerable, @NotNull TriggerDefinition triggerDefinition)
    This method should deactivate any services or threads related to this trigger This method is called: - when triggered object is removed - when trigger is removed - before update of triggered object's configuration - when trigger plugin module is disabled
    void
    initAndActivate(@NotNull Triggerable triggerable, @NotNull TriggerDefinition triggerDefinition, @Nullable Date lastShutdownTime)
    This method is called on Bamboo server startup and when trigger plugin is enabled.
  • Method Details

    • initAndActivate

      void initAndActivate(@NotNull @NotNull Triggerable triggerable, @NotNull @NotNull TriggerDefinition triggerDefinition, @Nullable @Nullable Date lastShutdownTime)
      This method is called on Bamboo server startup and when trigger plugin is enabled. It should activate any services or threads that are required for this trigger to function. In most cases it should be the same as activate(Triggerable, TriggerDefinition)
      Parameters:
      triggerable - object to be triggered
      triggerDefinition - how trigger is configured
      lastShutdownTime - last recorded shutdown time or null if no record of server having been shut down is available
    • activate

      void activate(@NotNull @NotNull Triggerable triggerable, @NotNull @NotNull TriggerDefinition triggerDefinition)
      This method should activate any services or threads that are required for this trigger to function. This method is called: - after trigger creation - after trigger update - after update of triggered object's configuration
      Parameters:
      triggerable - object to be triggered
      triggerDefinition - how trigger is configured
    • deactivate

      void deactivate(@NotNull @NotNull Triggerable triggerable, @NotNull @NotNull TriggerDefinition triggerDefinition)
      This method should deactivate any services or threads related to this trigger This method is called: - when triggered object is removed - when trigger is removed - before update of triggered object's configuration - when trigger plugin module is disabled
      Parameters:
      triggerable - object not to be triggered
      triggerDefinition - how trigger is configured