Class HookProcessor
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.hooks.HookProcessor
- Direct Known Subclasses:
NativeServerPingHookProcessor
,NativeServerPullRequestHookProcessor
,NativeServerPushHookProcessor
,PullRequestHookProcessor
,PushHookProcessor
Abstract hook processor.
Add new hook processors by extending this class and implement
process(HookEventType, String, BitbucketType, String)
,
extract details from the hook payload and then fire an SCMEvent
to dispatch it to the SCM API.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
notifyEvent
(jenkins.scm.api.SCMHeadEvent<?> event, int delaySeconds) Implementations have to call this method when want propagate anSCMHeadEvent
to the scm-api.abstract void
process
(HookEventType type, String payload, BitbucketType instanceType, String origin) See Event Payloads for more information about the payload parameter format.void
process
(HookEventType type, String payload, BitbucketType instanceType, String origin, String serverUrl) See Event Payloads for more information about the payload parameter format.void
process
(String payload, BitbucketType instanceType) Deprecated.protected void
scmSourceReIndex
(String owner, String repository, String mirrorId) To be called by implementations once the owner and the repository have been extracted from the payload.
-
Field Details
-
SCAN_ON_EMPTY_CHANGES_PROPERTY_NAME
- See Also:
-
SCAN_ON_EMPTY_CHANGES
protected static final boolean SCAN_ON_EMPTY_CHANGES
-
-
Constructor Details
-
HookProcessor
public HookProcessor()
-
-
Method Details
-
process
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void process(String payload, BitbucketType instanceType) Deprecated.See Event Payloads for more information about the payload parameter format.- Parameters:
payload
- the hook payloadinstanceType
- the Bitbucket type that called the hook
-
process
public abstract void process(HookEventType type, String payload, BitbucketType instanceType, String origin) See Event Payloads for more information about the payload parameter format.- Parameters:
type
- the type of hook.payload
- the hook payloadinstanceType
- the Bitbucket type that called the hookorigin
- the origin of the event.
-
process
public void process(HookEventType type, String payload, BitbucketType instanceType, String origin, String serverUrl) See Event Payloads for more information about the payload parameter format.- Parameters:
type
- the type of hook.payload
- the hook payloadinstanceType
- the Bitbucket type that called the hookorigin
- the origin of the event.serverUrl
- special value for native Bitbucket Server hooks which don't expose the server URL in the payload.
-
scmSourceReIndex
To 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 SCMSourcerepository
- the repository name as configured in the SCMSourcemirrorId
- the mirror id if applicable, may be null
-
notifyEvent
protected void notifyEvent(jenkins.scm.api.SCMHeadEvent<?> event, int delaySeconds) Implementations have to call this method when want propagate anSCMHeadEvent
to the scm-api.- Parameters:
event
- the to firedelaySeconds
- a delay in seconds to wait before propagate the event. If the given value is less than 0 than default will be used.
-
process(HookEventType, String, BitbucketType, String)