Interface Interceptor<R extends Request<?>,S extends Response<?>>

Type Parameters:
R - Request the request type
S - 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 Details

    • handle

      void handle(R request, S response) throws Exception
      handle the request
      Parameters:
      request -
      response -
      Throws:
      Exception
    • resolve

      boolean resolve(R request, S response)
      Parameters:
      request -
      response -
      Returns:
      true if the plugin must handle the request