Package org.restheart.plugins
Interface Interceptor<R extends Request<?>,S extends Response<?>>
- Type Parameters:
R- Request the request typeS- Response the response type
- All Superinterfaces:
ConfigurablePlugin,ExchangeTypeResolver<R,,S> Plugin
- All Known Subinterfaces:
BsonInterceptor,ByteArrayInterceptor,GraphQLInterceptor,JsonInterceptor,MongoInterceptor,ProxyInterceptor,StringInterceptor,WildcardInterceptor
public interface Interceptor<R extends Request<?>,S extends Response<?>>
extends ConfigurablePlugin, ExchangeTypeResolver<R,S>
Interceptors allow to snoop and modify requests and responses at different
stages of the request lifecycle as defined by the interceptPoint parameter of
the annotation RegisterPlugin. Seeorg.restheart.plugins.InterceptPoint
An interceptor can intercept either proxied requests or requests handled by
Services.
An interceptor can intercept requests handled by a Service when its request
and response types are equal to the ones declared by the Service.
An interceptor can intercept a proxied request, when its request and response
types extends BufferedRequest and BufferedResponse.
See https://restheart.org/docs/plugins/core-plugins/#interceptors
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Method Summary
Methods inherited from interface org.restheart.plugins.ConfigurablePlugin
arg, argOrDefaultMethods inherited from interface org.restheart.plugins.ExchangeTypeResolver
requestType, responseType
-
Method Details
-
handle
handle the request- Parameters:
request-response-- Throws:
Exception
-
resolve
- Parameters:
request-response-- Returns:
- true if the plugin must handle the request
-