public class SystemHookManager extends HookManager
Modifier and Type | Field | Description |
---|---|---|
static String |
SYSTEM_HOOK_EVENT |
Constructor | Description |
---|---|
SystemHookManager() |
Create a HookManager to handle GitLab system hook events.
|
SystemHookManager(String secretToken) |
Create a HookManager to handle GitLab system hook events which will be verified
against the specified secretToken.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addListener(SystemHookListener listener) |
Adds a System Hook event listener.
|
void |
fireEvent(SystemHookEvent event) |
Fire the event to the registered listeners.
|
protected void |
fireGroupEvent(GroupSystemHookEvent event) |
|
protected void |
fireGroupMemberEvent(GroupMemberSystemHookEvent event) |
|
protected void |
fireKeyEvent(KeySystemHookEvent event) |
|
protected void |
fireProjectEvent(ProjectSystemHookEvent event) |
|
protected void |
firePushEvent(PushSystemHookEvent event) |
|
protected void |
fireRepositoryEvent(RepositorySystemHookEvent event) |
|
protected void |
fireTagPushEvent(TagPushSystemHookEvent event) |
|
protected void |
fireTeamMemberEvent(TeamMemberSystemHookEvent event) |
|
protected void |
fireUserEvent(UserSystemHookEvent event) |
|
void |
handleEvent(javax.servlet.http.HttpServletRequest request) |
Parses and verifies an SystemHookEvent instance from the HTTP request and
fires it off to the registered listeners.
|
void |
handleEvent(SystemHookEvent event) |
Verifies the provided Event and fires it off to the registered listeners.
|
void |
removeListener(SystemHookListener listener) |
Removes a System Hook event listener.
|
isValidSecretToken, isValidSecretToken, setSecretToken
public static final String SYSTEM_HOOK_EVENT
public SystemHookManager()
public SystemHookManager(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(SystemHookEvent event) throws GitLabApiException
event
- the Event instance to handleGitLabApiException
- if the event is not supportedpublic void addListener(SystemHookListener listener)
listener
- the SystemHookListener to addpublic void removeListener(SystemHookListener listener)
listener
- the SystemHookListener to removepublic void fireEvent(SystemHookEvent event) throws GitLabApiException
event
- the SystemHookEvent instance to fire to the registered event listenersGitLabApiException
- if the event is not supportedprotected void fireProjectEvent(ProjectSystemHookEvent event)
protected void fireTeamMemberEvent(TeamMemberSystemHookEvent event)
protected void fireUserEvent(UserSystemHookEvent event)
protected void fireKeyEvent(KeySystemHookEvent event)
protected void fireGroupEvent(GroupSystemHookEvent event)
protected void fireGroupMemberEvent(GroupMemberSystemHookEvent event)
protected void firePushEvent(PushSystemHookEvent event)
protected void fireTagPushEvent(TagPushSystemHookEvent event)
protected void fireRepositoryEvent(RepositorySystemHookEvent event)
Copyright © 2018. All rights reserved.