com.ibm.wsspi.http

Interface HttpResponse



  • public interface HttpResponse
    Representation of an HTTP response message provided by the dispatcher to any HTTP container.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void addCookie(HttpCookie cookie)
      Add a cookie object to the message.
      void addHeader(java.lang.String name, java.lang.String value)
      Append a header on the message using the provided name and value pair.
      HttpOutputStream getBody()
      Access the output stream representation of the body for this message.
      long getContentLength()
      Query the current content-length header of the message.
      HttpCookie getCookie(java.lang.String name)
      Access the first instance of a cookie with the provided name.
      java.util.List<HttpCookie> getCookies()
      Access a list of all cookies found in this message.
      java.util.List<HttpCookie> getCookies(java.lang.String name)
      Access a list of all cookie instances matching the provided name.
      java.lang.String getHeader(java.lang.String name)
      Access the value associated with the first instance of the target header name.
      java.util.List<java.lang.String> getHeaderNames()
      Access a list of all header names found in this message.
      java.util.List<java.lang.String> getHeaders()
      Access a list of all header values in this message.
      java.util.List<java.lang.String> getHeaders(java.lang.String name)
      Access a list of all header values for a given header name.
      java.lang.String getReason()
      Query the current reason phrase of this message.
      int getStatus()
      Query the current status code of this message.
      java.lang.String getVersion()
      Query the current HTTP version of this message.
      boolean isCommitted()
      Check whether the response headers have been committed and sent out on the network or not.
      boolean isPersistent()
      Check whether the connection is persistent or not.
      void removeAllHeaders()
      Remove all headers and cookies from the message.
      void removeCookie(HttpCookie cookie)
      Remove a cookie object from the message.
      void removeHeader(java.lang.String name)
      Remove the target header from the message.
      void reset()
      Resets the status code, version, and headers.
      void setContentLength(long length)
      Set the content-length header of this message.
      void setHeader(java.lang.String name, java.lang.String value)
      Set a header on the message using the provided name and value pair.
      void setReason(java.lang.String phrase)
      Set the reason phrase to the input value.
      void setStatus(int code)
      Set the status code to the input value.
      void setTrailer(java.lang.String name, java.lang.String value)
      Sets a trailer header to follow the body of this message
      void setVersion(java.lang.String version)
      Set the HTTP version of this message to the input value.
      void writeTrailers()
      Write trailer when all have been set.
    • Method Detail

      • setStatus

        void setStatus(int code)
        Set the status code to the input value.
        Parameters:
        code -
      • setReason

        void setReason(java.lang.String phrase)
        Set the reason phrase to the input value.
        Parameters:
        phrase -
      • setVersion

        void setVersion(java.lang.String version)
        Set the HTTP version of this message to the input value. This is expected to be of the form "HTTP/.".
        Parameters:
        version -
      • setContentLength

        void setContentLength(long length)
        Set the content-length header of this message.
        Parameters:
        length -
      • setHeader

        void setHeader(java.lang.String name,
                       java.lang.String value)
        Set a header on the message using the provided name and value pair. This will replace any currently existing instances of the header name.
        Parameters:
        name -
        value -
        See Also:
        addHeader(String, String)
      • addHeader

        void addHeader(java.lang.String name,
                       java.lang.String value)
        Append a header on the message using the provided name and value pair. This will be added to any current instance of the header name.
        Parameters:
        name -
        value -
        See Also:
        setHeader(String, String)
      • addCookie

        void addCookie(HttpCookie cookie)
        Add a cookie object to the message.
        Parameters:
        cookie -
      • removeCookie

        void removeCookie(HttpCookie cookie)
        Remove a cookie object from the message.
        Parameters:
        cookie -
      • removeHeader

        void removeHeader(java.lang.String name)
        Remove the target header from the message.
        Parameters:
        name -
      • removeAllHeaders

        void removeAllHeaders()
        Remove all headers and cookies from the message.
      • isCommitted

        boolean isCommitted()
        Check whether the response headers have been committed and sent out on the network or not.
        Returns:
        boolean
      • isPersistent

        boolean isPersistent()
        Check whether the connection is persistent or not.
        Returns:
        boolean
      • reset

        void reset()
        Resets the status code, version, and headers.
      • getStatus

        int getStatus()
        Query the current status code of this message.
        Returns:
        int
      • getReason

        java.lang.String getReason()
        Query the current reason phrase of this message.
        Returns:
        String
      • getVersion

        java.lang.String getVersion()
        Query the current HTTP version of this message. It will be in the form of "HTTP/.".
        Returns:
        String
      • getContentLength

        long getContentLength()
        Query the current content-length header of the message. This will be -1L if the header is not set.
        Returns:
        long
      • getHeader

        java.lang.String getHeader(java.lang.String name)
        Access the value associated with the first instance of the target header name. This will return null if no instance was found.
        Parameters:
        name -
        Returns:
        String
      • getHeaders

        java.util.List<java.lang.String> getHeaders(java.lang.String name)
        Access a list of all header values for a given header name. This list is never null, but might be empty.
        Parameters:
        name -
        Returns:
        List
      • getHeaders

        java.util.List<java.lang.String> getHeaders()
        Access a list of all header values in this message. This list is never null, but might be empty.
        Returns:
        List
      • getHeaderNames

        java.util.List<java.lang.String> getHeaderNames()
        Access a list of all header names found in this message. This list is never null, but might be empty.
        Returns:
        List
      • getCookie

        HttpCookie getCookie(java.lang.String name)
        Access the first instance of a cookie with the provided name. This might be null if no match is found.
        Parameters:
        name -
        Returns:
        HttpCookie
      • getCookies

        java.util.List<HttpCookie> getCookies(java.lang.String name)
        Access a list of all cookie instances matching the provided name. This list is never null, but might be empty.
        Parameters:
        name -
        Returns:
        List
      • getCookies

        java.util.List<HttpCookie> getCookies()
        Access a list of all cookies found in this message. The list is never null, but might be empty.
        Returns:
        List
      • getBody

        HttpOutputStream getBody()
        Access the output stream representation of the body for this message.
        Returns:
        HttpOutputStream
      • setTrailer

        void setTrailer(java.lang.String name,
                        java.lang.String value)
        Sets a trailer header to follow the body of this message
        Parameters:
        name -
        value -
      • writeTrailers

        void writeTrailers()
        Write trailer when all have been set.
        Parameters:
        name -
        value -