Package org.gitlab4j.api.systemhooks
Class SystemHookManager
- java.lang.Object
-
- org.gitlab4j.api.HookManager
-
- org.gitlab4j.api.systemhooks.SystemHookManager
-
public class SystemHookManager extends HookManager
This class provides a handler for processing GitLab System Hook callouts.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SYSTEM_HOOK_EVENT
-
Constructor Summary
Constructors 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.
-
Method Summary
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
fireMergeRequestEvent(MergeRequestSystemHookEvent 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.-
Methods inherited from class org.gitlab4j.api.HookManager
isValidSecretToken, isValidSecretToken, setSecretToken
-
-
-
-
Field Detail
-
SYSTEM_HOOK_EVENT
public static final String SYSTEM_HOOK_EVENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SystemHookManager
public SystemHookManager()
Create a HookManager to handle GitLab system hook events.
-
SystemHookManager
public SystemHookManager(String secretToken)
Create a HookManager to handle GitLab system hook 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 GitLabApiException
Parses and verifies an SystemHookEvent instance from the HTTP request and fires it off to the registered listeners.- Specified by:
handleEvent
in classHookManager
- Parameters:
request
- the HttpServletRequest to read the Event instance from- Throws:
GitLabApiException
- if the parsed event is not supported
-
handleEvent
public void handleEvent(SystemHookEvent 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(SystemHookListener listener)
Adds a System Hook event listener.- Parameters:
listener
- the SystemHookListener to add
-
removeListener
public void removeListener(SystemHookListener listener)
Removes a System Hook event listener.- Parameters:
listener
- the SystemHookListener to remove
-
fireEvent
public void fireEvent(SystemHookEvent event) throws GitLabApiException
Fire the event to the registered listeners.- Parameters:
event
- the SystemHookEvent instance to fire to the registered event listeners- Throws:
GitLabApiException
- if the event is not supported
-
fireProjectEvent
protected void fireProjectEvent(ProjectSystemHookEvent event)
-
fireTeamMemberEvent
protected void fireTeamMemberEvent(TeamMemberSystemHookEvent event)
-
fireUserEvent
protected void fireUserEvent(UserSystemHookEvent event)
-
fireKeyEvent
protected void fireKeyEvent(KeySystemHookEvent event)
-
fireGroupEvent
protected void fireGroupEvent(GroupSystemHookEvent event)
-
fireGroupMemberEvent
protected void fireGroupMemberEvent(GroupMemberSystemHookEvent event)
-
firePushEvent
protected void firePushEvent(PushSystemHookEvent event)
-
fireTagPushEvent
protected void fireTagPushEvent(TagPushSystemHookEvent event)
-
fireRepositoryEvent
protected void fireRepositoryEvent(RepositorySystemHookEvent event)
-
fireMergeRequestEvent
protected void fireMergeRequestEvent(MergeRequestSystemHookEvent event)
-
-