Class RequestFilterAdapter.FilterSource

  • All Implemented Interfaces:
    org.littleshoot.proxy.HttpFiltersSource
    Enclosing class:
    RequestFilterAdapter

    public static class RequestFilterAdapter.FilterSource
    extends org.littleshoot.proxy.HttpFiltersSourceAdapter
    A HttpFiltersSourceAdapter for RequestFilterAdapters. By default, this FilterSource enables HTTP message aggregation and sets a maximum request buffer size of 2 MiB.
    • Constructor Summary

      Constructors 
      Constructor Description
      FilterSource​(RequestFilter filter)
      Creates a new filter source that will invoke the specified filter and uses the DEFAULT_MAXIMUM_REQUEST_BUFFER_SIZE as the maximum buffer size.
      FilterSource​(RequestFilter filter, int maximumRequestBufferSizeInBytes)
      Creates a new filter source that will invoke the specified filter and uses the maximumRequestBufferSizeInBytes as the maximum buffer size.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.littleshoot.proxy.HttpFilters filterRequest​(io.netty.handler.codec.http.HttpRequest originalRequest, io.netty.channel.ChannelHandlerContext ctx)  
      int getMaximumRequestBufferSizeInBytes()  
      • Methods inherited from class org.littleshoot.proxy.HttpFiltersSourceAdapter

        filterRequest, getMaximumResponseBufferSizeInBytes
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FilterSource

        public FilterSource​(RequestFilter filter)
        Creates a new filter source that will invoke the specified filter and uses the DEFAULT_MAXIMUM_REQUEST_BUFFER_SIZE as the maximum buffer size.
        Parameters:
        filter - RequestFilter to invoke
      • FilterSource

        public FilterSource​(RequestFilter filter,
                            int maximumRequestBufferSizeInBytes)
        Creates a new filter source that will invoke the specified filter and uses the maximumRequestBufferSizeInBytes as the maximum buffer size. Set maximumRequestBufferSizeInBytes to 0 to disable aggregation. If message aggregation is disabled, the HttpMessageContents will not be available for modification. (Note: HTTP message aggregation will be enabled if any filter has a maximum request or response buffer size greater than 0. See HttpFiltersSource.getMaximumRequestBufferSizeInBytes() for details.)
        Parameters:
        filter - RequestFilter to invoke
        maximumRequestBufferSizeInBytes - maximum buffer size when aggregating Requests for filtering
    • Method Detail

      • filterRequest

        public org.littleshoot.proxy.HttpFilters filterRequest​(io.netty.handler.codec.http.HttpRequest originalRequest,
                                                               io.netty.channel.ChannelHandlerContext ctx)
        Specified by:
        filterRequest in interface org.littleshoot.proxy.HttpFiltersSource
        Overrides:
        filterRequest in class org.littleshoot.proxy.HttpFiltersSourceAdapter
      • getMaximumRequestBufferSizeInBytes

        public int getMaximumRequestBufferSizeInBytes()
        Specified by:
        getMaximumRequestBufferSizeInBytes in interface org.littleshoot.proxy.HttpFiltersSource
        Overrides:
        getMaximumRequestBufferSizeInBytes in class org.littleshoot.proxy.HttpFiltersSourceAdapter