src/main/java/org/gitlab4j/api/webhook/WebHookManager.java
public void handleEvent(HttpServletRequest request) throws GitLabApiException {

        if (!isValidSecretToken(request)) {
            String message = "X-Gitlab-Token mismatch!";
            LOGGER.warning(message);
            throw new GitLabApiException(message);
        }

        String eventName = request.getHeader("X-Gitlab-Event");
        LOGGER.info("handleEvent: X-Gitlab-Event=" + eventName);
        switch (eventName) {

        case BuildEvent.BUILD_HOOK_X_GITLAB_EVENT:
        case BuildEvent.JOB_HOOK_X_GITLAB_EVENT:
        case IssueEvent.X_GITLAB_EVENT:
        case MergeRequestEvent.X_GITLAB_EVENT:
        case NoteEvent.X_GITLAB_EVENT:
        case PipelineEvent.X_GITLAB_EVENT:
        case PushEvent.X_GITLAB_EVENT:
        case TagPushEvent.X_GITLAB_EVENT:
        case WikiPageEvent.X_GITLAB_EVENT:
            break;

        default:
            String message = "Unsupported X-Gitlab-Event, event Name=" + eventName;
            LOGGER.warning(message);
            throw new GitLabApiException(message);
        }

        try {

            Event event;
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine(HttpRequestUtils.getShortRequestDump(eventName + " webhook", true, request));
                String postData = HttpRequestUtils.getPostDataAsString(request);
                LOGGER.fine("Raw POST data:\n" + postData);
                event = jacksonJson.unmarshal(Event.class, postData);
                LOGGER.fine(event.getObjectKind() + " event:\n" + jacksonJson.marshal(event) + "\n");
            } else {
                InputStreamReader reader = new InputStreamReader(request.getInputStream());
                event = jacksonJson.unmarshal(Event.class, reader);
            }

            fireEvent(event);

        } catch (Exception e) {
            LOGGER.warning("Error parsing JSON data, exception=" + e.getClass().getSimpleName() + ", error=" + e.getMessage());
            throw new GitLabApiException(e);
        }
    }
/**
     * Parses and verifies an Event instance from the HTTP request and
     * fires it off to the registered listeners.
     * 
     * @param request the HttpServletRequest to read the Event instance from
     * @throws GitLabApiException if the parsed event is not supported
     */
Parses and verifies an Event instance from the HTTP request and
fires it off to the registered listeners.

@param request the HttpServletRequest to read the Event instance from
@throws GitLabApiException if the parsed event is not supported
Parses and verifies an Event instance from the HTTP request and fires it off to the registered listeners . @param request the HttpServletRequest to read the Event instance from @throws GitLabApiException if the parsed event is not supported
public void handleEvent(HttpServletRequest request) throws GitLabApiException {
        if (!isValidSecretToken(request)) {
            String message = "X-Gitlab-Token mismatch!";
            LOGGER.warning(message);
            throw new GitLabApiException(message);
        }
        String eventName = request.getHeader("X-Gitlab-Event");
        LOGGER.info("handleEvent: X-Gitlab-Event=" + eventName);
        switch (eventName) {
        case BuildEvent.BUILD_HOOK_X_GITLAB_EVENT:
        case BuildEvent.JOB_HOOK_X_GITLAB_EVENT:
        case IssueEvent.X_GITLAB_EVENT:
        case MergeRequestEvent.X_GITLAB_EVENT:
        case NoteEvent.X_GITLAB_EVENT:
        case PipelineEvent.X_GITLAB_EVENT:
        case PushEvent.X_GITLAB_EVENT:
        case TagPushEvent.X_GITLAB_EVENT:
        case WikiPageEvent.X_GITLAB_EVENT:
            break;
        default:
            String message = "Unsupported X-Gitlab-Event, event Name=" + eventName;
            LOGGER.warning(message);
            throw new GitLabApiException(message);
        }
        try {
            Event event;
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine(HttpRequestUtils.getShortRequestDump(eventName + " webhook", true, request));
                String postData = HttpRequestUtils.getPostDataAsString(request);
                LOGGER.fine("Raw POST data:\n" + postData);
                event = jacksonJson.unmarshal(Event.class, postData);
                LOGGER.fine(event.getObjectKind() + " event:\n" + jacksonJson.marshal(event) + "\n");
            } else {
                InputStreamReader reader = new InputStreamReader(request.getInputStream());
                event = jacksonJson.unmarshal(Event.class, reader);
            }
            fireEvent(event);
        } catch (Exception e) {
            LOGGER.warning("Error parsing JSON data, exception=" + e.getClass().getSimpleName() + ", error=" + e.getMessage());
            throw new GitLabApiException(e);
        }
    }
public void handleEvent ( HttpServletRequest request ) throws GitLabApiException { if ( ! isValidSecretToken ( request ) ) { String message = "X-Gitlab-Token mismatch!" ; LOGGER . warning ( message ) ; throw new GitLabApiException ( message ) ; } String eventName = request . getHeader ( "X-Gitlab-Event" ) ; LOGGER . info ( "handleEvent: X-Gitlab-Event=" + eventName ) ; switch ( eventName ) { case BuildEvent . BUILD_HOOK_X_GITLAB_EVENT : case BuildEvent . JOB_HOOK_X_GITLAB_EVENT : case IssueEvent . X_GITLAB_EVENT : case MergeRequestEvent . X_GITLAB_EVENT : case NoteEvent . X_GITLAB_EVENT : case PipelineEvent . X_GITLAB_EVENT : case PushEvent . X_GITLAB_EVENT : case TagPushEvent . X_GITLAB_EVENT : case WikiPageEvent . X_GITLAB_EVENT : break ; default : String message = "Unsupported X-Gitlab-Event, event Name=" + eventName ; LOGGER . warning ( message ) ; throw new GitLabApiException ( message ) ; } try { Event event ; if ( LOGGER . isLoggable ( Level . FINE ) ) { LOGGER . fine ( HttpRequestUtils . getShortRequestDump ( eventName + " webhook" , true , request ) ) ; String postData = HttpRequestUtils . getPostDataAsString ( request ) ; LOGGER . fine ( "Raw POST data:\n" + postData ) ; event = jacksonJson . unmarshal ( Event . class , postData ) ; LOGGER . fine ( event . getObjectKind ( ) + " event:\n" + jacksonJson . marshal ( event ) + "\n" ) ; } else { InputStreamReader reader = new InputStreamReader ( request . getInputStream ( ) ) ; event = jacksonJson . unmarshal ( Event . class , reader ) ; } fireEvent ( event ) ; } catch ( Exception e ) { LOGGER . warning ( "Error parsing JSON data, exception=" + e . getClass ( ) . getSimpleName ( ) + ", error=" + e . getMessage ( ) ) ; throw new GitLabApiException ( e ) ; } }
Parses and verifies an Event instance from the HTTP request and
 fires it off to the registered listeners.
Parses and verifies an Event instance from the HTTP request and fires it off to the registered listeners .