public class WebHookManager extends HookManager
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.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addListener(WebHookListener listener) |
Adds a WebHook event listener.
|
protected void |
fireBuildEvent(BuildEvent buildEvent) |
|
void |
fireEvent(Event event) |
Fire the event to the registered listeners.
|
protected void |
fireIssueEvent(IssueEvent issueEvent) |
|
protected void |
fireMergeRequestEvent(MergeRequestEvent mergeRequestEvent) |
|
protected void |
fireNoteEvent(NoteEvent noteEvent) |
|
protected void |
firePipelineEvent(PipelineEvent pipelineEvent) |
|
protected void |
firePushEvent(PushEvent pushEvent) |
|
protected void |
fireTagPushEvent(TagPushEvent tagPushEvent) |
|
protected void |
fireWikiPageEvent(WikiPageEvent wikiPageEvent) |
|
void |
handleEvent(javax.servlet.http.HttpServletRequest request) |
Parses and verifies an Event instance from the HTTP request and
fires it off to the registered listeners.
|
void |
handleEvent(Event event) |
Verifies the provided Event and fires it off to the registered listeners.
|
void |
removeListener(WebHookListener listener) |
Removes a WebHook event listener.
|
isValidSecretToken, isValidSecretToken, setSecretToken
public WebHookManager()
public WebHookManager(String secretToken)
secretToken
- the secret token to verify againstpublic void handleEvent(javax.servlet.http.HttpServletRequest request) throws GitLabApiException
handleEvent
in class HookManager
request
- the HttpServletRequest to read the Event instance fromGitLabApiException
- if the parsed event is not supportedpublic void handleEvent(Event event) throws GitLabApiException
event
- the Event instance to handleGitLabApiException
- if the event is not supportedpublic void addListener(WebHookListener listener)
listener
- the SystemHookListener to addpublic void removeListener(WebHookListener listener)
listener
- the SystemHookListener to removepublic void fireEvent(Event event) throws GitLabApiException
event
- the Event instance to fire to the registered event listenersGitLabApiException
- if the event is not supportedprotected void fireBuildEvent(BuildEvent buildEvent)
protected void fireIssueEvent(IssueEvent issueEvent)
protected void fireMergeRequestEvent(MergeRequestEvent mergeRequestEvent)
protected void fireNoteEvent(NoteEvent noteEvent)
protected void firePipelineEvent(PipelineEvent pipelineEvent)
protected void firePushEvent(PushEvent pushEvent)
protected void fireTagPushEvent(TagPushEvent tagPushEvent)
protected void fireWikiPageEvent(WikiPageEvent wikiPageEvent)
Copyright © 2018. All rights reserved.