Interface WebSocketRoute<A extends ExchangeContext>

Type Parameters:
A - the exchange context type
All Superinterfaces:
BaseWebRoute<A,WebExchange<A>>

public interface WebSocketRoute<A extends ExchangeContext> extends BaseWebRoute<A,WebExchange<A>>

A WebSocket route specifies criteria used to determine the WebSocket exchange handler to execute to handle an exchange.

It basically supports the following criteria:

  • the request path which can be parameterized as defined by URIBuilder.
  • the language tag accepted by the request
  • the WebSocket subProtocol used by the handler

The request path criteria can be either static or dynamic if a parameterized path is specified as defined by URIBuilder. When a parameterized path is defined, the router extracts path parameters from the URIMatcher used to match the request. For instance, path /books/{id} defines path parameter id and matches paths: /books/1, /books/2...

Since:
1.5
Author:
Jeremy Kuhn
  • Method Details

    • getPath

      String getPath()

      Returns the absolute normalized path matched by a Web exchange in order to be processed by the route.

      Path and path pattern are exclusive.

      Returns:
      an absolute normalized path or null to match any exchange
    • getPathPattern

      URIPattern getPathPattern()

      Returns the path pattern matched by a Web exchange in order to be processed by the route.

      Path and path pattern are exclusive.

      Returns:
      a path pattern or null to match any exchange
    • getLanguage

      String getLanguage()

      Returns the language tag or language range as defined RFC 7231 Section 5.3.5 matched by a Web exchange in order to be processed by the route.

      Returns:
      a language tag, a language range or null to match any exchange
    • getSubProtocol

      String getSubProtocol()

      Returns the WebSocket subProtocol matched by a Web exchange in order to be processed by the route.

      Returns:
      a subProtocol or null to match any exchange
    • getHandler

      Returns the WebSocket exchange handler used to handle Web exchanges matching the route criteria.

      Returns:
      a WebSocket exchange handler