Package io.micronaut.http.server.netty
Class AbstractHttpContentProcessor
java.lang.Object
io.micronaut.http.server.netty.AbstractHttpContentProcessor
- All Implemented Interfaces:
io.micronaut.core.util.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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final longprotected final io.micronaut.http.server.HttpServerConfigurationprotected final NettyHttpRequest<?>protected final AtomicLongprotected final long -
Constructor Summary
ConstructorsConstructorDescriptionAbstractHttpContentProcessor(NettyHttpRequest<?> nettyHttpRequest, io.micronaut.http.server.HttpServerConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(io.netty.buffer.ByteBufHolder message, Collection<Object> out) Process more data.protected voidfireExceedsLength(long receivedLength, long expected, io.netty.buffer.ByteBufHolder message) protected abstract voidonData(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, waitMethods inherited from interface io.micronaut.http.server.netty.HttpContentProcessor
cancel, complete, processSingle, resultTypeMethods inherited from interface io.micronaut.core.util.Toggleable
isEnabled
-
Field Details
-
nettyHttpRequest
-
advertisedLength
protected final long advertisedLength -
requestMaxSize
protected final long requestMaxSize -
receivedLength
-
configuration
protected final io.micronaut.http.server.HttpServerConfiguration configuration
-
-
Constructor Details
-
AbstractHttpContentProcessor
public AbstractHttpContentProcessor(NettyHttpRequest<?> nettyHttpRequest, io.micronaut.http.server.HttpServerConfiguration configuration) - Parameters:
nettyHttpRequest- TheNettyHttpRequestconfiguration- 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:HttpContentProcessorProcess more data.- Specified by:
addin 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
-