Class UpgradeResponseAdapter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SEC_WEBSOCKET_PROTOCOL
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addHeader​(java.lang.String name, java.lang.String value)
      Deprecated.
      Add a header value to the response.
      java.lang.String getAcceptedSubProtocol()
      Deprecated.
      Get the accepted WebSocket protocol.
      java.util.List<ExtensionConfig> getExtensions()
      Deprecated.
      Get the list of extensions that should be used for the websocket.
      java.lang.String getHeader​(java.lang.String name)
      Deprecated.
      Get a header value
      java.util.Set<java.lang.String> getHeaderNames()
      Deprecated.
      Get the header names
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
      Deprecated.
      Get the headers map
      java.util.List<java.lang.String> getHeaders​(java.lang.String name)
      Deprecated.
      Get the multi-value header value
      int getStatusCode()
      Deprecated.
      Get the HTTP Response Status Code
      java.lang.String getStatusReason()
      Deprecated.
      Get the HTTP Response Status Reason
      boolean isSuccess()
      Deprecated.
      Test if upgrade response is successful.
      void sendForbidden​(java.lang.String message)
      Deprecated.
      Issue a forbidden upgrade response.
      void setAcceptedSubProtocol​(java.lang.String protocol)
      Deprecated.
      Set the accepted WebSocket Protocol.
      void setExtensions​(java.util.List<ExtensionConfig> extensions)
      Deprecated.
      Set the list of extensions that are approved for use with this websocket.
      void setHeader​(java.lang.String name, java.lang.String value)
      Deprecated.
      Set a header
      void setStatusCode​(int statusCode)
      Deprecated.
      Set the HTTP Response status code
      void setStatusReason​(java.lang.String statusReason)
      Deprecated.
      Set the HTTP Response status reason phrase
      void setSuccess​(boolean success)
      Deprecated.
      Set the success of the upgrade response.
      • Methods inherited from class java.lang.Object

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

      • SEC_WEBSOCKET_PROTOCOL

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

      • UpgradeResponseAdapter

        public UpgradeResponseAdapter()
        Deprecated.
    • Method Detail

      • addHeader

        public void addHeader​(java.lang.String name,
                              java.lang.String value)
        Deprecated.
        Description copied from interface: UpgradeResponse
        Add a header value to the response.
        Specified by:
        addHeader in interface UpgradeResponse
        Parameters:
        name - the header name
        value - the header value
      • getAcceptedSubProtocol

        public java.lang.String getAcceptedSubProtocol()
        Deprecated.
        Get the accepted WebSocket protocol.
        Specified by:
        getAcceptedSubProtocol in interface UpgradeResponse
        Returns:
        the accepted WebSocket protocol.
      • getExtensions

        public java.util.List<ExtensionConfig> getExtensions()
        Deprecated.
        Get the list of extensions that should be used for the websocket.
        Specified by:
        getExtensions in interface UpgradeResponse
        Returns:
        the list of negotiated extensions to use.
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
        Deprecated.
        Description copied from interface: UpgradeResponse
        Get a header value
        Specified by:
        getHeader in interface UpgradeResponse
        Parameters:
        name - the header name
        Returns:
        the value (null if header doesn't exist)
      • getHeaderNames

        public java.util.Set<java.lang.String> getHeaderNames()
        Deprecated.
        Description copied from interface: UpgradeResponse
        Get the header names
        Specified by:
        getHeaderNames in interface UpgradeResponse
        Returns:
        the set of header names
      • getHeaders

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
        Deprecated.
        Description copied from interface: UpgradeResponse
        Get the headers map
        Specified by:
        getHeaders in interface UpgradeResponse
        Returns:
        the map of headers
      • getHeaders

        public java.util.List<java.lang.String> getHeaders​(java.lang.String name)
        Deprecated.
        Description copied from interface: UpgradeResponse
        Get the multi-value header value
        Specified by:
        getHeaders in interface UpgradeResponse
        Parameters:
        name - the header name
        Returns:
        the list of values (null if header doesn't exist)
      • getStatusCode

        public int getStatusCode()
        Deprecated.
        Description copied from interface: UpgradeResponse
        Get the HTTP Response Status Code
        Specified by:
        getStatusCode in interface UpgradeResponse
        Returns:
        the status code
      • getStatusReason

        public java.lang.String getStatusReason()
        Deprecated.
        Description copied from interface: UpgradeResponse
        Get the HTTP Response Status Reason
        Specified by:
        getStatusReason in interface UpgradeResponse
        Returns:
        the HTTP Response status reason
      • isSuccess

        public boolean isSuccess()
        Deprecated.
        Description copied from interface: UpgradeResponse
        Test if upgrade response is successful.

        Merely notes if the response was sent as a WebSocket Upgrade, or was failed (resulting in no upgrade handshake)

        Specified by:
        isSuccess in interface UpgradeResponse
        Returns:
        true if upgrade response was generated, false if no upgrade response was generated
      • sendForbidden

        public void sendForbidden​(java.lang.String message)
                           throws java.io.IOException
        Deprecated.
        Issue a forbidden upgrade response.

        This means that the websocket endpoint was valid, but the conditions to use a WebSocket resulted in a forbidden access.

        Use this when the origin or authentication is invalid.

        Specified by:
        sendForbidden in interface UpgradeResponse
        Parameters:
        message - the short 1 line detail message about the forbidden response
        Throws:
        java.io.IOException - if unable to send the forbidden
      • setAcceptedSubProtocol

        public void setAcceptedSubProtocol​(java.lang.String protocol)
        Deprecated.
        Set the accepted WebSocket Protocol.
        Specified by:
        setAcceptedSubProtocol in interface UpgradeResponse
        Parameters:
        protocol - the protocol to list as accepted
      • setExtensions

        public void setExtensions​(java.util.List<ExtensionConfig> extensions)
        Deprecated.
        Set the list of extensions that are approved for use with this websocket.

        Notes:

        • Per the spec you cannot add extensions that have not been seen in the UpgradeRequest, just remove entries you don't want to use
        • If this is unused, or a null is passed, then the list negotiation will follow default behavior and use the complete list of extensions that are available in this WebSocket server implementation.
        Specified by:
        setExtensions in interface UpgradeResponse
        Parameters:
        extensions - the list of extensions to use.
      • setHeader

        public void setHeader​(java.lang.String name,
                              java.lang.String value)
        Deprecated.
        Description copied from interface: UpgradeResponse
        Set a header

        Overrides previous value of header (if set)

        Specified by:
        setHeader in interface UpgradeResponse
        Parameters:
        name - the header name
        value - the header value
      • setStatusCode

        public void setStatusCode​(int statusCode)
        Deprecated.
        Description copied from interface: UpgradeResponse
        Set the HTTP Response status code
        Specified by:
        setStatusCode in interface UpgradeResponse
        Parameters:
        statusCode - the status code
      • setStatusReason

        public void setStatusReason​(java.lang.String statusReason)
        Deprecated.
        Description copied from interface: UpgradeResponse
        Set the HTTP Response status reason phrase

        Note, not all implementation of UpgradeResponse can support this feature

        Specified by:
        setStatusReason in interface UpgradeResponse
        Parameters:
        statusReason - the status reason phrase
      • setSuccess

        public void setSuccess​(boolean success)
        Deprecated.
        Description copied from interface: UpgradeResponse
        Set the success of the upgrade response.

        Specified by:
        setSuccess in interface UpgradeResponse
        Parameters:
        success - true to indicate a response to the upgrade handshake was sent, false to indicate no upgrade response was sent