Package io.micronaut.http.server.netty
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 Summary
Modifier and TypeFieldDescriptionprotected final long
protected final HttpServerConfiguration
protected final NettyHttpRequest<?>
protected final AtomicLong
protected final long
-
Constructor Summary
ConstructorDescriptionAbstractHttpContentProcessor
(NettyHttpRequest<?> nettyHttpRequest, HttpServerConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(io.netty.buffer.ByteBufHolder message, Collection<Object> out) Process more data.protected void
fireExceedsLength
(long receivedLength, long expected, io.netty.buffer.ByteBufHolder message) protected abstract void
onData
(io.netty.buffer.ByteBufHolder message, Collection<Object> out) Called after verifying the data of the message.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.http.server.netty.HttpContentProcessor
cancel, complete, processSingle, resultType
Methods inherited from interface io.micronaut.core.util.Toggleable
isEnabled
-
Field Details
-
nettyHttpRequest
-
advertisedLength
protected final long advertisedLength -
requestMaxSize
protected final long requestMaxSize -
receivedLength
-
configuration
-
-
Constructor Details
-
AbstractHttpContentProcessor
public AbstractHttpContentProcessor(NettyHttpRequest<?> nettyHttpRequest, HttpServerConfiguration configuration) - Parameters:
nettyHttpRequest
- TheNettyHttpRequest
configuration
- TheHttpServerConfiguration
-
-
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 messageout
- The collection to add any produced messages to- Throws:
Throwable
-
add
Description copied from interface:HttpContentProcessor
Process more data.- Specified by:
add
in interfaceHttpContentProcessor
- Parameters:
message
- The input dataout
- 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 receivedexpected
- The expected length of the contentmessage
- The message to release
-