Class ProtocolSwitchAccepted

All Implemented Interfaces:
Future<Void>, Associator, Eligible

Indicates that a component has accepted a Request.In.Get with a header that requested an upgrade to another protocol.

The HttpServer component listens for such events and automatically creates the required Response event.

  • Constructor Details

    • ProtocolSwitchAccepted

      public ProtocolSwitchAccepted(Request.In request, String protocol)
      Creates a new event.

      The request event passed in as parameter is used by the HttpServer to build the response message and link an existing session to the web socket.

      To be precise, the HttpServer retrieves the HttpRequest from the request event and uses the prepared response provided by HttpRequest.response() to build the response. The default information contained in this prepared response is sufficient to build the actual response. If required, the accepting component can add special header fields to the prepared response.

      Parameters:
      request - the base response data
      protocol - the accepted protocol
  • Method Details

    • resourceName

      public URI resourceName()
      Returns the resource for which the socket was opened.
      Returns:
      the value
    • requestEvent

      Returns the original request.
      Returns:
      the value
    • protocol

      public String protocol()
      The accepted protocol.
      Returns:
      the protocol