Package io.micronaut.http.server.netty
Interface HttpContentProcessor
- All Superinterfaces:
Toggleable
- All Known Implementing Classes:
DefaultHttpContentProcessor
Deprecated.
This class represents the first step of the HTTP body parsing pipeline. It transforms
Processors are stateful. They can receive repeated calls to
ByteBufHolder
instances that come from a
StreamedHttpRequest
into parsed objects, e.g. json nodes
or form data fragments.Processors are stateful. They can receive repeated calls to
add(io.netty.buffer.ByteBufHolder, java.util.Collection<java.lang.Object>)
with more data,
followed by a call to complete(java.util.Collection<java.lang.Object>)
to finish up. Both of these methods accept a
Collection
out
parameter that is populated with the processed items.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(io.netty.buffer.ByteBufHolder data, Collection<Object> out) Deprecated.Process more data.default void
cancel()
Deprecated.Cancel processing, clean up any data.default void
complete
(Collection<Object> out) Deprecated.Finish processing data.processSingle
(io.netty.buffer.ByteBuf data) Deprecated.Process a singleByteBuf
into a single item, if possible.default HttpContentProcessor
resultType
(Argument<?> type) Deprecated.Set the type of the values returned by this processor.Methods inherited from interface io.micronaut.core.util.Toggleable
isEnabled
-
Method Details
-
add
Deprecated.Process more data.- Parameters:
data
- The input dataout
- The collection to add output items to- Throws:
Throwable
-
complete
Deprecated.Finish processing data.- Parameters:
out
- The collection to add remaining output items to- Throws:
Throwable
-
cancel
Deprecated.Cancel processing, clean up any data. After this, there should be no more calls toadd(io.netty.buffer.ByteBufHolder, java.util.Collection<java.lang.Object>)
andcomplete(java.util.Collection<java.lang.Object>)
.- Throws:
Throwable
-
resultType
Deprecated.Set the type of the values returned by this processor. Most processors do not respect this setting, but e.g. theio.micronaut.http.server.netty.jackson.JsonContentProcessor
does.- Parameters:
type
- The type produced by this processor- Returns:
- This processor, for chaining
-
processSingle
Deprecated.Process a singleByteBuf
into a single item, if possible.- Parameters:
data
- The input data- Returns:
- The output value, or
null
if this is unsupported. - Throws:
Throwable
- Any failure
-
MessageBodyReader
API instead