com.github.lontime.exthttp.container.HttpInterceptorInterface Maven / Gradle / Ivy
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) {
}
}