Class HttpResponse


  • public class HttpResponse
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String HTTP_TARGET_HOST  
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpResponse()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      M addHeader​(java.lang.String name, java.lang.String value)  
      java.lang.Object getAttribute​(java.lang.String key)
      Retrieves a user-defined attribute of this message.
      java.lang.Iterable<java.lang.String> getAttributeNames()  
      java.util.function.Supplier<java.io.InputStream> getContent()  
      java.nio.charset.Charset getContentEncoding()  
      java.lang.String getHeader​(java.lang.String name)  
      java.lang.Iterable<java.lang.String> getHeaderNames()  
      java.lang.Iterable<java.lang.String> getHeaders​(java.lang.String name)  
      int getStatus()  
      java.lang.String getTargetHost()
      Returns the host this response was received from, or null if it was not set.
      boolean isSuccessful()  
      M removeAttribute​(java.lang.String key)  
      M removeHeader​(java.lang.String name)  
      M setAttribute​(java.lang.String key, java.lang.Object value)  
      M setContent​(java.util.function.Supplier<java.io.InputStream> supplier)  
      M setHeader​(java.lang.String name, java.lang.String value)  
      HttpResponse setStatus​(int status)  
      HttpResponse setTargetHost​(java.lang.String host)
      Sets the host this response was received from.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • HTTP_TARGET_HOST

        public static final java.lang.String HTTP_TARGET_HOST
        See Also:
        Constant Field Values
    • Constructor Detail

      • HttpResponse

        public HttpResponse()
    • Method Detail

      • isSuccessful

        public boolean isSuccessful()
      • getStatus

        public int getStatus()
      • setTargetHost

        public HttpResponse setTargetHost​(java.lang.String host)
        Sets the host this response was received from.
        Parameters:
        host - originating host
      • getTargetHost

        public java.lang.String getTargetHost()
        Returns the host this response was received from, or null if it was not set.
        Returns:
        originating host
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String key)
        Retrieves a user-defined attribute of this message. Attributes are stored as simple key-value pairs and are not included in a message's serialized form.
        Parameters:
        key - attribute name
        Returns:
        attribute object
      • setAttribute

        public M setAttribute​(java.lang.String key,
                              java.lang.Object value)
      • removeAttribute

        public M removeAttribute​(java.lang.String key)
      • getAttributeNames

        public java.lang.Iterable<java.lang.String> getAttributeNames()
      • getHeaderNames

        public java.lang.Iterable<java.lang.String> getHeaderNames()
      • getHeaders

        public java.lang.Iterable<java.lang.String> getHeaders​(java.lang.String name)
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
      • setHeader

        public M setHeader​(java.lang.String name,
                           java.lang.String value)
      • addHeader

        public M addHeader​(java.lang.String name,
                           java.lang.String value)
      • removeHeader

        public M removeHeader​(java.lang.String name)
      • getContentEncoding

        public java.nio.charset.Charset getContentEncoding()
      • setContent

        public M setContent​(java.util.function.Supplier<java.io.InputStream> supplier)
      • getContent

        public java.util.function.Supplier<java.io.InputStream> getContent()