Class HookProcessor
- java.lang.Object
-
- com.cloudbees.jenkins.plugins.bitbucket.hooks.HookProcessor
-
- Direct Known Subclasses:
NativeServerPullRequestHookProcessor
,NativeServerPushHookProcessor
,PingHookProcessor
,PullRequestHookProcessor
,PushHookProcessor
public abstract class HookProcessor extends Object
Abstract hook processor. Add new hook processors by extending this class and implementprocess(HookEventType, String, BitbucketType, String)
, extract owner and repository name from the hook payload and then callscmSourceReIndex(String, String)
to launch a branch/PR reindexing on the matching SCMSource.
-
-
Constructor Summary
Constructors Constructor Description HookProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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)
To be called by implementations once the owner and the repository have been extracted from the payload.
-
-
-
Method Detail
-
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
protected void scmSourceReIndex(String owner, String repository)
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 SCMSource
-
-