Package org.gitlab4j.api.webhook
Class WebHookManager
- java.lang.Object
-
- org.gitlab4j.api.HookManager
-
- org.gitlab4j.api.webhook.WebHookManager
-
public class WebHookManager extends HookManager
This class provides a handler for processing GitLab WebHook callouts.
-
-
Constructor Summary
Constructors Constructor Description WebHookManager()Create a HookManager to handle GitLab webhook events.WebHookManager(String secretToken)Create a HookManager to handle GitLab webhook events which will be verified against the specified secretToken.
-
Method Summary
Modifier and Type Method Description voidaddListener(WebHookListener listener)Adds a WebHook event listener.protected voidfireBuildEvent(BuildEvent buildEvent)voidfireEvent(Event event)Fire the event to the registered listeners.protected voidfireIssueEvent(IssueEvent issueEvent)protected voidfireMergeRequestEvent(MergeRequestEvent mergeRequestEvent)protected voidfireNoteEvent(NoteEvent noteEvent)protected voidfirePipelineEvent(PipelineEvent pipelineEvent)protected voidfirePushEvent(PushEvent pushEvent)protected voidfireTagPushEvent(TagPushEvent tagPushEvent)protected voidfireWikiPageEvent(WikiPageEvent wikiPageEvent)voidhandleEvent(javax.servlet.http.HttpServletRequest request)Parses and verifies an Event instance from the HTTP request and fires it off to the registered listeners.voidhandleEvent(Event event)Verifies the provided Event and fires it off to the registered listeners.voidremoveListener(WebHookListener listener)Removes a WebHook event listener.-
Methods inherited from class org.gitlab4j.api.HookManager
isValidSecretToken, isValidSecretToken, setSecretToken
-
-
-
-
Constructor Detail
-
WebHookManager
public WebHookManager()
Create a HookManager to handle GitLab webhook events.
-
WebHookManager
public WebHookManager(String secretToken)
Create a HookManager to handle GitLab webhook events which will be verified against the specified secretToken.- Parameters:
secretToken- the secret token to verify against
-
-
Method Detail
-
handleEvent
public void handleEvent(javax.servlet.http.HttpServletRequest request) throws GitLabApiExceptionParses and verifies an Event instance from the HTTP request and fires it off to the registered listeners.- Specified by:
handleEventin classHookManager- Parameters:
request- the HttpServletRequest to read the Event instance from- Throws:
GitLabApiException- if the parsed event is not supported
-
handleEvent
public void handleEvent(Event event) throws GitLabApiException
Verifies the provided Event and fires it off to the registered listeners.- Parameters:
event- the Event instance to handle- Throws:
GitLabApiException- if the event is not supported
-
addListener
public void addListener(WebHookListener listener)
Adds a WebHook event listener.- Parameters:
listener- the SystemHookListener to add
-
removeListener
public void removeListener(WebHookListener listener)
Removes a WebHook event listener.- Parameters:
listener- the SystemHookListener to remove
-
fireEvent
public void fireEvent(Event event) throws GitLabApiException
Fire the event to the registered listeners.- Parameters:
event- the Event instance to fire to the registered event listeners- Throws:
GitLabApiException- if the event is not supported
-
fireBuildEvent
protected void fireBuildEvent(BuildEvent buildEvent)
-
fireIssueEvent
protected void fireIssueEvent(IssueEvent issueEvent)
-
fireMergeRequestEvent
protected void fireMergeRequestEvent(MergeRequestEvent mergeRequestEvent)
-
fireNoteEvent
protected void fireNoteEvent(NoteEvent noteEvent)
-
firePipelineEvent
protected void firePipelineEvent(PipelineEvent pipelineEvent)
-
firePushEvent
protected void firePushEvent(PushEvent pushEvent)
-
fireTagPushEvent
protected void fireTagPushEvent(TagPushEvent tagPushEvent)
-
fireWikiPageEvent
protected void fireWikiPageEvent(WikiPageEvent wikiPageEvent)
-
-