Interface BitbucketWebhookManager

All Superinterfaces:
ExtensionPoint
All Known Implementing Classes:
CloudWebhookManager, PluginWebhookManager, ServerWebhookManager

@Restricted(org.kohsuke.accmod.restrictions.Beta.class) public interface BitbucketWebhookManager extends ExtensionPoint
The implementation is in charge to apply a specific BitbucketWebhookConfiguration to the Bitbucket registering the webhook commit
Since:
937.0.0
Author:
Nikolas Falco
  • Method Details

    • setCallbackURL

      void setCallbackURL(@NonNull String callbackURL, @NonNull BitbucketEndpoint endpoint)
      The callback URL where send event payload.

      The method is called with the URL of the default receiver and processed using an appropriate BitbucketWebhookProcessor. The implementation could decide to ignore given URL and use an own servlet endpoint to process own events.

      Parameters:
      callbackURL - used to send webhook payload.
      endpoint - this webhook is registered for, it could be used to retrieve additional information to compose the callbackURL
    • apply

      void apply(BitbucketWebhookConfiguration configuration)
      The configuration that returned this implementation class.
      Parameters:
      configuration - to apply
    • supportedTraits

      default Collection<Class<? extends jenkins.scm.api.trait.SCMSourceTrait>> supportedTraits()
      A list of traits class that this manager supports to obtain additional configuration options.
      Returns:
      a list of SCMSourceTrait classes.
    • apply

      default void apply(jenkins.scm.api.trait.SCMSourceTrait trait)
      Trait instance associate to a SCMSource where gather extra configuration options.

      Each BitbucketWebhookConfiguration that would obtain additional configuration options per project must provide an own specific trait implementation.

      Parameters:
      trait - to apply
    • withTraits

      default void withTraits(List<jenkins.scm.api.trait.SCMSourceTrait> traits)
      Convenient method to apply only supported traits to this customiser.
      Parameters:
      traits - to apply if supported too
    • read

      Returns the list of all registered webhook at this repository related to this Jenkins.
      Parameters:
      client - authenticated to communicate with Bitbucket
      Returns:
      a list of registered BitbucketWebHook.
      Throws:
      IOException - in case of communication issue with Bitbucket
    • register

      void register(@NonNull BitbucketAuthenticatedClient client) throws IOException
      Save a webhook (updating or creating a new one) using the actual configuration.
      Parameters:
      client - authenticated to communicate with Bitbucket
      Throws:
      IOException - in case of communication issue with Bitbucket
    • remove

      void remove(@NonNull String webhookId, @NonNull BitbucketAuthenticatedClient client) throws IOException
      Remove the webhook from the Bitbucket repository with the given identifier.
      Parameters:
      webhookId - webhook identifier to delete.
      client - authenticated to communicate with Bitbucket
      Throws:
      IOException - in case of communication issue with Bitbucket