Class ResponseFilterAdapter.FilterSource

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

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

      Constructors 
      Constructor Description
      FilterSource​(ResponseFilter filter)
      Creates a new filter source that will invoke the specified filter and uses the DEFAULT_MAXIMUM_RESPONSE_BUFFER_SIZE as the maximum buffer size.
      FilterSource​(ResponseFilter filter, int maximumResponseBufferSizeInBytes)
      Creates a new filter source that will invoke the specified filter and uses the maximumResponseBufferSizeInBytes 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 getMaximumResponseBufferSizeInBytes()  
      • Methods inherited from class org.littleshoot.proxy.HttpFiltersSourceAdapter

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

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

      • FilterSource

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

        public FilterSource​(ResponseFilter filter,
                            int maximumResponseBufferSizeInBytes)
        Creates a new filter source that will invoke the specified filter and uses the maximumResponseBufferSizeInBytes as the maximum buffer size. Set maximumResponseBufferSizeInBytes 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.getMaximumResponseBufferSizeInBytes() for details.)
        Parameters:
        filter - ResponseFilter to invoke
        maximumResponseBufferSizeInBytes - maximum buffer size when aggregating responses 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
      • getMaximumResponseBufferSizeInBytes

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