Package io.micronaut.http.server.netty
Class FormRouteCompleter
java.lang.Object
io.micronaut.http.server.netty.FormRouteCompleter
- All Implemented Interfaces:
HttpBody
,Subscriber<Object>
@Internal
public final class FormRouteCompleter
extends Object
implements Subscriber<Object>, HttpBody
Special
HttpBody
that "demultiplexes" form data. Basically, this class receives a stream
of MicronautHttpData
and splits it into individual streams for each form field, and they
can all be subscribed to and bound independently.- Since:
- 4.0.0
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescription<R> reactor.core.publisher.Flux<R>
claimFields
(String name, BiFunction<? super MicronautHttpData<?>, ? super reactor.core.publisher.Flux<PartData>, R> fieldFactory) Claim all fields of the given name.reactor.core.publisher.Flux<? extends MicronautHttpData<?>>
claimFieldsComplete
(String name) Claim all fields of the given name.reactor.core.publisher.Flux<? extends MicronautHttpData<?>>
claimFieldsRaw
(String name) Claim all fields of the given name.boolean
next()
Get the next representation this body was transformed into, if any.void
void
void
void
void
release()
Release this body and any downstream representations.
-
Method Details
-
getExecute
-
onSubscribe
- Specified by:
onSubscribe
in interfaceSubscriber<Object>
-
onNext
- Specified by:
onNext
in interfaceSubscriber<Object>
-
onComplete
public void onComplete()- Specified by:
onComplete
in interfaceSubscriber<Object>
-
onError
- Specified by:
onError
in interfaceSubscriber<Object>
-
claimFieldsRaw
Claim all fields of the given name. In the returned publisher, eachMicronautHttpData
may appear multiple times if there is new data.- Parameters:
name
- The field name- Returns:
- The publisher of data with this field name
-
claimFields
public <R> reactor.core.publisher.Flux<R> claimFields(String name, BiFunction<? super MicronautHttpData<?>, ? super reactor.core.publisher.Flux<PartData>, R> fieldFactory) Claim all fields of the given name. When a new field of the name is seen,fieldFactory
is called with that field and a publisher that gets thePartData
every time there is new data for the field.- Type Parameters:
R
- The return type of the factory- Parameters:
name
- The field namefieldFactory
- The factory to call when a new field is seen- Returns:
- A publisher of the objects returned by the factory
-
claimFieldsComplete
Claim all fields of the given name. The returned publisher will only contain fields that arecompleted
.- Parameters:
name
- The field name- Returns:
- The publisher of the complete fields
-
isClaimed
-
release
public void release()Description copied from interface:HttpBody
Release this body and any downstream representations. -
next
Description copied from interface:HttpBody
Get the next representation this body was transformed into, if any. -
asMap
-