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

com.github.lontime.exthttp.container.HttpInterceptorInterface Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.github.lontime.exthttp.container;

import java.net.SocketAddress;

import com.github.lontime.base.commonj.components.ComponentInterface;
import com.github.lontime.base.commonj.constants.Consts;
import com.github.lontime.base.commonj.langs.Prioritized;
import reactor.netty.Connection;
import reactor.netty.http.client.HttpClientRequest;
import reactor.netty.http.client.HttpClientResponse;

/**
 * HttpInterceptorInterface.
 * @author lontime
 * @since 1.0
 */
public interface HttpInterceptorInterface extends ComponentInterface, Prioritized {

    /**
     * getClazz.
     * @return Class
     */
    @Override
    default Class getClazz() {
        return HttpInterceptorInterface.class;
    }

    @Override
    default String getName() {
        return Consts.DEFAULT_OBJECT_NAME;
    }

    /**
     * onRequest.
     * @param request request
     * @param connection connection
     */
    default void onRequest(HttpClientRequest request, Connection connection) {

    }

    /**
     * onRequest.
     * @param request request
     * @param throwable throwable
     */
    default void onRequestError(HttpClientRequest request, Throwable throwable) {

    }

    /**
     * onRequest.
     * @param request request
     * @param connection connection
     */
    default void afterRequest(HttpClientRequest request, Connection connection) {

    }

    /**
     * onResponse.
     * @param response request
     * @param connection connection
     */
    default void onResponse(HttpClientResponse response, Connection connection) {

    }

    /**
     * onRequest.
     * @param response response
     * @param throwable throwable
     */
    default void onResponseError(HttpClientResponse response, Throwable throwable) {

    }

    /**
     * onResponse.
     * @param response request
     * @param connection connection
     */
    default void afterResponseSuccess(HttpClientResponse response, Connection connection) {

    }

    /**
     * onResolve.
     * @param connection connection
     */
    default void onResolve(Connection connection) {

    }

    /**
     * OnResolveError.
     * @param connection connection
     * @param throwable throwable
     */
    default void OnResolveError(Connection connection, Throwable throwable) {

    }

    /**
     * onResolve.
     * @param connection connection
     * @param address address
     */
    default void afterResolve(Connection connection, SocketAddress address) {

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy