All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.commercetools.sunrise.framework.hooks.application.HttpRequestStartedHook Maven / Gradle / Ivy

There is a newer version: 1.0.0-M10
Show newest version
package com.commercetools.sunrise.framework.hooks.application;

import com.commercetools.sunrise.framework.hooks.HookRunner;
import play.mvc.Http;

import java.util.concurrent.CompletionStage;

/**
 * The first hook to be run, right after the request has been received from the customer.
 *
 * Enabled using {@code @EnableHooks} annotation.
 */
public interface HttpRequestStartedHook extends ApplicationHook {

    CompletionStage onHttpRequestStarted(final Http.Context httpContext);

    static CompletionStage runHook(final HookRunner hookRunner, final Http.Context httpContext) {
        return hookRunner.runEventHook(HttpRequestStartedHook.class, hook -> hook.onHttpRequestStarted(httpContext));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy