Class AbstractHttpContentProcessor

java.lang.Object
io.micronaut.http.server.netty.AbstractHttpContentProcessor
All Implemented Interfaces:
Toggleable, HttpContentProcessor
Direct Known Subclasses:
FormDataHttpContentProcessor, JsonContentProcessor

@Internal public abstract class AbstractHttpContentProcessor extends Object implements HttpContentProcessor
Abstract implementation of the HttpContentProcessor interface that deals with limiting file upload sizes.
Since:
1.0
Author:
Graeme Rocher
  • Field Details

    • nettyHttpRequest

      protected final NettyHttpRequest<?> nettyHttpRequest
    • advertisedLength

      protected final long advertisedLength
    • requestMaxSize

      protected final long requestMaxSize
    • receivedLength

      protected final AtomicLong receivedLength
    • configuration

      protected final HttpServerConfiguration configuration
  • Constructor Details

  • Method Details

    • onData

      protected abstract void onData(io.netty.buffer.ByteBufHolder message, Collection<Object> out) throws Throwable
      Called after verifying the data of the message.
      Parameters:
      message - The message
      out - The collection to add any produced messages to
      Throws:
      Throwable
    • add

      public void add(io.netty.buffer.ByteBufHolder message, Collection<Object> out) throws Throwable
      Description copied from interface: HttpContentProcessor
      Process more data.
      Specified by:
      add in interface HttpContentProcessor
      Parameters:
      message - The input data
      out - The collection to add output items to
      Throws:
      Throwable
    • fireExceedsLength

      protected void fireExceedsLength(long receivedLength, long expected, io.netty.buffer.ByteBufHolder message)
      Parameters:
      receivedLength - The length of the content received
      expected - The expected length of the content
      message - The message to release