Class AbstractWebhookProcessor
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.impl.webhook.AbstractWebhookProcessor
- All Implemented Interfaces:
- BitbucketWebhookProcessor,- ExtensionPoint
- Direct Known Subclasses:
- CloudPullRequestWebhookProcessor,- CloudPushWebhookProcessor,- PluginPullRequestWebhookProcessor,- PluginPushWebhookProcessor,- ServerPingWebhookProcessor,- ServerPullRequestWebhookProcessor,- ServerPushWebhookProcessor
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public abstract class AbstractWebhookProcessor
extends Object
implements BitbucketWebhookProcessor
Abstract hook processor.
 Add new hook processors by extending this class and implement 
BitbucketWebhookProcessor.process(String, String, Map, BitbucketEndpoint),
 extract details from the hook payload and then fire an SCMEvent to dispatch it to the SCM API.- 
Nested Class SummaryNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final Stringprotected final Loggerprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from interface com.cloudbees.jenkins.plugins.bitbucket.api.webhook.BitbucketWebhookProcessorSCAN_ON_EMPTY_CHANGES_PROPERTY_NAME
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetEventType(Map<String, String> headers, org.apache.commons.collections4.MultiValuedMap<String, String> parameters) Extracts the event type that represent the payload in the request.protected StringgetServerURL(Map<String, String> headers, org.apache.commons.collections4.MultiValuedMap<String, String> parameters) Extracts the server URL from where this request coming from, the URL must match one of the configuredBitbucketEndpoints.protected voidscmSourceReIndex(String owner, String repository, String mirrorId) To be called by implementations once the owner and the repository have been extracted from the payload.voidverifyPayload(Map<String, String> headers, String body, BitbucketEndpoint endpoint) The implementation must verify if the incoming request is secured or not eventually gather some settings from the givenBitbucketEndpointconfiguration.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cloudbees.jenkins.plugins.bitbucket.api.webhook.BitbucketWebhookProcessorbuildHookContext, canHandle, notifyEvent, process, reindexOnEmptyChanges
- 
Field Details- 
logger
- 
REQUEST_ID_CLOUD_HEADER- See Also:
 
- 
REQUEST_ID_SERVER_HEADER- See Also:
 
- 
SIGNATURE_HEADER- See Also:
 
- 
EVENT_TYPE_HEADER- See Also:
 
- 
SERVER_URL_PARAMETER- See Also:
 
 
- 
- 
Constructor Details- 
AbstractWebhookProcessorpublic AbstractWebhookProcessor()
 
- 
- 
Method Details- 
scmSourceReIndexTo be called by implementations once the owner and the repository have been extracted from the payload.- Parameters:
- owner- the repository owner as configured in the SCMSource
- repository- the repository name as configured in the SCMSource
- mirrorId- the mirror id if applicable, may be null
 
- 
getServerURL@NonNull public String getServerURL(@NonNull Map<String, String> headers, @NonNull org.apache.commons.collections4.MultiValuedMap<String, String> parameters) Description copied from interface:BitbucketWebhookProcessorExtracts the server URL from where this request coming from, the URL must match one of the configuredBitbucketEndpoints.- Specified by:
- getServerURLin interface- BitbucketWebhookProcessor
- Parameters:
- headers- request
- parameters- request
- Returns:
- the URL of the server from where this request has been sent.
 
- 
getEventType@NonNull public String getEventType(@NonNull Map<String, String> headers, @NonNull org.apache.commons.collections4.MultiValuedMap<String, String> parameters) Description copied from interface:BitbucketWebhookProcessorExtracts the event type that represent the payload in the request.- Specified by:
- getEventTypein interface- BitbucketWebhookProcessor
- Parameters:
- headers- request
- parameters- request
- Returns:
- the event type key.
 
- 
verifyPayloadpublic void verifyPayload(@NonNull Map<String, String> headers, @NonNull String body, @NonNull BitbucketEndpoint endpoint) throws BitbucketWebhookProcessorExceptionDescription copied from interface:BitbucketWebhookProcessorThe implementation must verify if the incoming request is secured or not eventually gather some settings from the givenBitbucketEndpointconfiguration.- Specified by:
- verifyPayloadin interface- BitbucketWebhookProcessor
- Parameters:
- headers- request
- body- request
- endpoint- configured for the given- BitbucketWebhookProcessor.getServerURL(Map, MultiValuedMap)
- Throws:
- BitbucketWebhookProcessorException- when signature verification fails
 
- 
getOrigin
 
-