Class AbstractBinAsyncEntityConsumer<T>

    • Field Detail

      • content

        private volatile T content
    • Constructor Detail

      • AbstractBinAsyncEntityConsumer

        public AbstractBinAsyncEntityConsumer()
    • Method Detail

      • streamStart

        protected abstract void streamStart​(ContentType contentType)
                                     throws HttpException,
                                            java.io.IOException
        Triggered to signal beginning of entity content stream.
        Parameters:
        contentType - the entity content type
        Throws:
        HttpException
        java.io.IOException
      • generateContent

        protected abstract T generateContent()
                                      throws java.io.IOException
        Triggered to generate entity representation.
        Returns:
        the entity content
        Throws:
        java.io.IOException
      • failed

        public final void failed​(java.lang.Exception cause)
        Description copied from interface: AsyncEntityConsumer
        Triggered to signal a failure in data processing.
        Specified by:
        failed in interface AsyncEntityConsumer<T>
        Parameters:
        cause - the cause of the failure.
      • getContent

        public final T getContent()
        Description copied from interface: AsyncEntityConsumer
        Returns the result of entity processing when it becomes available or null if the entity is still being received.
        Specified by:
        getContent in interface AsyncEntityConsumer<T>
        Returns:
        the response processing result.