Class AbstractCharAsyncEntityConsumer<T>

    • Field Detail

      • content

        private volatile T content
    • Constructor Detail

      • AbstractCharAsyncEntityConsumer

        protected AbstractCharAsyncEntityConsumer​(int bufSize,
                                                  CharCodingConfig charCodingConfig)
      • AbstractCharAsyncEntityConsumer

        public AbstractCharAsyncEntityConsumer()
    • 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 - in case of an HTTP protocol violation.
        java.io.IOException - in case of an I/O error.
      • generateContent

        protected abstract T generateContent()
                                      throws java.io.IOException
        Triggered to generate entity representation.
        Returns:
        the entity content
        Throws:
        java.io.IOException - in case of an I/O error.
      • streamStart

        public final void streamStart​(EntityDetails entityDetails,
                                      FutureCallback<T> resultCallback)
                               throws java.io.IOException,
                                      HttpException
        Description copied from interface: AsyncEntityConsumer
        Signals beginning of an incoming request entity stream.
        Specified by:
        streamStart in interface AsyncEntityConsumer<T>
        Parameters:
        entityDetails - the details of the incoming message entity.
        resultCallback - the result callback.
        Throws:
        java.io.IOException - in case of an I/O error.
        HttpException - in case of an HTTP protocol violation.
      • completed

        protected final void completed()
                                throws java.io.IOException
        Description copied from class: AbstractCharDataConsumer
        Triggered to signal completion of data processing.
        Specified by:
        completed in class AbstractCharDataConsumer
        Throws:
        java.io.IOException - in case of an I/O error.
      • 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.