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.booleannext()Get the next representation this body was transformed into, if any.voidvoidvoidvoidvoidrelease()Release this body and any downstream representations.
-
Method Details
-
getExecute
-
onSubscribe
- Specified by:
onSubscribein interfaceSubscriber<Object>
-
onNext
- Specified by:
onNextin interfaceSubscriber<Object>
-
onComplete
public void onComplete()- Specified by:
onCompletein interfaceSubscriber<Object>
-
onError
- Specified by:
onErrorin interfaceSubscriber<Object>
-
claimFieldsRaw
Claim all fields of the given name. In the returned publisher, eachMicronautHttpDatamay 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,fieldFactoryis called with that field and a publisher that gets thePartDataevery 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:HttpBodyRelease this body and any downstream representations. -
next
Description copied from interface:HttpBodyGet the next representation this body was transformed into, if any. -
asMap
-