Class UpgradeResponse

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String LOCATION
      Header containing a new URI when getStatus() .
      static java.lang.String RETRY_AFTER
      Header containing delay or date in which client can try to reconnect to the server.
      static java.lang.String TRACING_HEADER_PREFIX
      Prefix of headers used for including tracing information into handshake response.
      static java.lang.String WWW_AUTHENTICATE
      Header containing challenge with authentication scheme and parameters.
    • Constructor Summary

      Constructors 
      Constructor Description
      UpgradeResponse()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getFirstHeaderValue​(java.lang.String name)
      Gets the value of the response header with the given name.
      abstract int getStatus()
      Get the current HTTP status code of this response.
      abstract void setReasonPhrase​(java.lang.String reason)
      Get HTTP reason phrase.
      abstract void setStatus​(int status)
      Set HTTP status code for this response.
      • Methods inherited from class java.lang.Object

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

      • WWW_AUTHENTICATE

        public static final java.lang.String WWW_AUTHENTICATE
        Header containing challenge with authentication scheme and parameters.
        See Also:
        Constant Field Values
      • RETRY_AFTER

        public static final java.lang.String RETRY_AFTER
        Header containing delay or date in which client can try to reconnect to the server.
        See Also:
        Constant Field Values
      • TRACING_HEADER_PREFIX

        public static final java.lang.String TRACING_HEADER_PREFIX
        Prefix of headers used for including tracing information into handshake response.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UpgradeResponse

        public UpgradeResponse()
    • Method Detail

      • getStatus

        public abstract int getStatus()
        Get the current HTTP status code of this response.
        Returns:
        the current HTTP status code.
      • setStatus

        public abstract void setStatus​(int status)
        Set HTTP status code for this response.
        Parameters:
        status - HTTP status code for this response.
      • setReasonPhrase

        public abstract void setReasonPhrase​(java.lang.String reason)
        Get HTTP reason phrase.

        TODO remove ?? we are using only for "Switching Protocols" and that is TODO standard status code 101

        Parameters:
        reason - reason phrase to be set.
      • getFirstHeaderValue

        public final java.lang.String getFirstHeaderValue​(java.lang.String name)
        Gets the value of the response header with the given name.

        If a response header with the given name exists and contains multiple values, the value that was added first will be returned.

        Parameters:
        name - header name.
        Returns:
        the value of the response header with the given name, null if no header with the given name has been set on this response. TODO rename to getHeader(String name) ?? similar to TODO HttpServletResponse#getHeader(String)