Class ProxyResponse<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    BufferedExchange<T>
    Direct Known Subclasses:
    ByteArrayProxyResponse, JsonProxyResponse

    public abstract class ProxyResponse<T>
    extends Response<T>
    implements BufferedExchange<T>
    Base class for Response implementation that can be used in proxied requests. It stores the response content in the BUFFERED_RESPONSE_DATA_KEY attachment of the HttpServerExchange.
    Author:
    Andrea Di Cesare
    • Field Detail

      • BUFFERED_RESPONSE_DATA_KEY

        public static final io.undertow.util.AttachmentKey<io.undertow.connector.PooledByteBuffer[]> BUFFERED_RESPONSE_DATA_KEY
    • Constructor Detail

      • ProxyResponse

        protected ProxyResponse​(io.undertow.server.HttpServerExchange exchange)
    • Method Detail

      • getRawContentKey

        public io.undertow.util.AttachmentKey<io.undertow.connector.PooledByteBuffer[]> getRawContentKey()
      • getBuffer

        public io.undertow.connector.PooledByteBuffer[] getBuffer()
        Specified by:
        getBuffer in interface BufferedExchange<T>
      • setBuffer

        public void setBuffer​(io.undertow.connector.PooledByteBuffer[] raw)
        Specified by:
        setBuffer in interface BufferedExchange<T>
      • setContentLength

        protected void setContentLength​(int length)
      • getErrorContent

        protected abstract T getErrorContent​(int code,
                                             String httpStatusText,
                                             String message,
                                             Throwable t,
                                             boolean includeStackTrace)
                                      throws IOException
        Parameters:
        code -
        httpStatusText -
        message -
        t -
        includeStackTrace -
        Returns:
        the content descibing the error
        Throws:
        IOException