Class FormRouteCompleter

java.lang.Object
io.micronaut.http.server.netty.FormRouteCompleter
All Implemented Interfaces:
Subscriber<Object>

@Internal public final class FormRouteCompleter extends Object implements Subscriber<Object>
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 Details

    • getExecute

      public DelayedExecutionFlow<RouteMatch<?>> getExecute()
    • onSubscribe

      public void onSubscribe(Subscription s)
      Specified by:
      onSubscribe in interface Subscriber<Object>
    • onNext

      public void onNext(Object o)
      Specified by:
      onNext in interface Subscriber<Object>
    • onComplete

      public void onComplete()
      Specified by:
      onComplete in interface Subscriber<Object>
    • onError

      public void onError(Throwable t)
      Specified by:
      onError in interface Subscriber<Object>
    • claimFieldsRaw

      public reactor.core.publisher.Flux<? extends MicronautHttpData<?>> claimFieldsRaw(String name)
      Claim all fields of the given name. In the returned publisher, each MicronautHttpData 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 the PartData every time there is new data for the field.
      Type Parameters:
      R - The return type of the factory
      Parameters:
      name - The field name
      fieldFactory - The factory to call when a new field is seen
      Returns:
      A publisher of the objects returned by the factory
    • claimFieldsComplete

      public reactor.core.publisher.Flux<? extends MicronautHttpData<?>> claimFieldsComplete(String name)
      Claim all fields of the given name. The returned publisher will only contain fields that are completed.
      Parameters:
      name - The field name
      Returns:
      The publisher of the complete fields
    • isClaimed

      public boolean isClaimed(String name)
    • release

      public void release()
    • asMap

      public Map<String,Object> asMap(Charset defaultCharset)
    • toMap

      public static Map<String,Object> toMap(Charset charset, Collection<? extends MicronautHttpData<?>> dataList)