Class JsonSubscriber

  • All Implemented Interfaces:
    org.reactivestreams.Subscriber<io.netty.handler.codec.http.HttpContent>, reactor.core.CoreSubscriber<io.netty.handler.codec.http.HttpContent>

    @Internal
    public final class JsonSubscriber
    extends java.lang.Object
    implements reactor.core.CoreSubscriber<io.netty.handler.codec.http.HttpContent>
    A Reactor subscriber used to handle JSON content. It delegates to an upstream subscriber, wrapping them with opening/closing brackets where necessary.
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonSubscriber​(reactor.core.CoreSubscriber<? super io.netty.handler.codec.http.HttpContent> upstream)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      reactor.util.context.Context currentContext()  
      static reactor.core.publisher.Flux<io.netty.handler.codec.http.HttpContent> lift​(org.reactivestreams.Publisher<io.netty.handler.codec.http.HttpContent> publisher)  
      void onComplete()
      On complete the opening bracket should be emitted if no items were ever produced, then the closing bracket.
      void onError​(java.lang.Throwable t)  
      void onNext​(io.netty.handler.codec.http.HttpContent o)
      The goal is to prevent the emission of the opening bracket if the underlying stream never emits an item and only produces an error.
      void onSubscribe​(org.reactivestreams.Subscription s)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonSubscriber

        public JsonSubscriber​(reactor.core.CoreSubscriber<? super io.netty.handler.codec.http.HttpContent> upstream)
    • Method Detail

      • currentContext

        public reactor.util.context.Context currentContext()
        Specified by:
        currentContext in interface reactor.core.CoreSubscriber<io.netty.handler.codec.http.HttpContent>
      • onSubscribe

        public void onSubscribe​(org.reactivestreams.Subscription s)
        Specified by:
        onSubscribe in interface reactor.core.CoreSubscriber<io.netty.handler.codec.http.HttpContent>
        Specified by:
        onSubscribe in interface org.reactivestreams.Subscriber<io.netty.handler.codec.http.HttpContent>
      • onNext

        public void onNext​(io.netty.handler.codec.http.HttpContent o)
        The goal is to prevent the emission of the opening bracket if the underlying stream never emits an item and only produces an error.
        Specified by:
        onNext in interface org.reactivestreams.Subscriber<io.netty.handler.codec.http.HttpContent>
        Parameters:
        o - The content
      • onError

        public void onError​(java.lang.Throwable t)
        Specified by:
        onError in interface org.reactivestreams.Subscriber<io.netty.handler.codec.http.HttpContent>
      • onComplete

        public void onComplete()
        On complete the opening bracket should be emitted if no items were ever produced, then the closing bracket.
        Specified by:
        onComplete in interface org.reactivestreams.Subscriber<io.netty.handler.codec.http.HttpContent>
      • lift

        public static reactor.core.publisher.Flux<io.netty.handler.codec.http.HttpContent> lift​(org.reactivestreams.Publisher<io.netty.handler.codec.http.HttpContent> publisher)