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
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(BitbucketWebhookConfiguration configuration) The configuration that returned this implementation class.default void
apply
(jenkins.scm.api.trait.SCMSourceTrait trait) Trait instance associate to aSCMSource
where gather extra configuration options.read
(BitbucketAuthenticatedClient client) Returns the list of all registered webhook at this repository related to this Jenkins.void
register
(BitbucketAuthenticatedClient client) Save a webhook (updating or creating a new one) using the actual configuration.void
remove
(String webhookId, BitbucketAuthenticatedClient client) Remove the webhook from the Bitbucket repository with the given identifier.void
setCallbackURL
(String callbackURL, BitbucketEndpoint endpoint) The callback URL where send event payload.default Collection<Class<? extends jenkins.scm.api.trait.SCMSourceTrait>>
A list of traits class that this manager supports to obtain additional configuration options.default void
withTraits
(List<jenkins.scm.api.trait.SCMSourceTrait> traits) Convenient method to apply only supported traits to this customiser.
-
Method Details
-
setCallbackURL
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
The configuration that returned this implementation class.- Parameters:
configuration
- to apply
-
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 aSCMSource
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
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
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
-