Interface WebSocketRouteManager<A extends ExchangeContext,B extends WebRoutable<A,B>>

Type Parameters:
A - the type of the exchange context
B - the type of web routable

public interface WebSocketRouteManager<A extends ExchangeContext,B extends WebRoutable<A,B>>

A WebSocket route manager is used to manage WebSocket routes in a web router.

It is created by a web router and allows to define, enable, disable, remove and find WebSocket routes in a web router.

Since:
1.5
Author:
Jeremy Kuhn
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Disables all WebSocket routes that matches the criteria specified in the WebSocket route manager and defined in the router it comes from.
    Enables all WebSocket routes that matches the criteria specified in the WebSocket route manager and defined in the router it comes from.
    Finds all WebSocket routes that matches the criteria specified in the WebSocket route manager and defined in the router it comes from.
    Specifies the route WebSocket exchange handler.
    language(String language)
    Specifies the language of the WebSocket resource served by the web route.
    path(String path)
    Specifies the path to the WebSocket resource served by the route without matching trailing slash.
    path(String path, boolean matchTrailingSlash)
    Specifies the path to the WebSocket resource served by the route matching or not trailing slash.
    Removes all WebSocket routes that matches the criteria specified in the WebSocket route manager and defined in the router it comes from.
    subprotocol(String subprotocol)
    Specifies the subprotocol supported by the WebSocket resource served by the route.
  • Method Details

    • path

      Specifies the path to the WebSocket resource served by the route without matching trailing slash.

      The specified path can be a parameterized path including path parameters as defined by URIBuilder.

      Parameters:
      path - the path to the resource
      Returns:
      the WebSocket route manager
      Throws:
      IllegalArgumentException - if the specified path is not absolute
      See Also:
    • path

      WebSocketRouteManager<A,B> path(String path, boolean matchTrailingSlash) throws IllegalArgumentException

      Specifies the path to the WebSocket resource served by the route matching or not trailing slash.

      The specified path can be a parameterized path including path parameters as defined by URIBuilder.

      Parameters:
      path - the path to the resource
      matchTrailingSlash - true to match path with or without trailing slash, false otherwise
      Returns:
      the WebSocket route manager
      Throws:
      IllegalArgumentException - if the specified path is not absolute
      See Also:
    • language

      WebSocketRouteManager<A,B> language(String language)

      Specifies the language of the WebSocket resource served by the web route.

      Parameters:
      language - a language tag
      Returns:
      the WebSocket route manager
      See Also:
    • subprotocol

      WebSocketRouteManager<A,B> subprotocol(String subprotocol)

      Specifies the subprotocol supported by the WebSocket resource served by the route.

      Parameters:
      subprotocol - a WebSocket subprotocol
      Returns:
      the WebSocket route manager
      See Also:
    • handler

      B handler(WebSocketExchangeHandler<? super A,Web2SocketExchange<A>> handler)

      Specifies the route WebSocket exchange handler.

      This method basically appends the route specified in the WebSocket route manager to the router it comes from.

      Parameters:
      handler - the route WebSocket exchange handler
      Returns:
      the Web routable
    • enable

      B enable()

      Enables all WebSocket routes that matches the criteria specified in the WebSocket route manager and defined in the router it comes from.

      Returns:
      the Web routable
    • disable

      B disable()

      Disables all WebSocket routes that matches the criteria specified in the WebSocket route manager and defined in the router it comes from.

      Returns:
      the Web routable
    • remove

      B remove()

      Removes all WebSocket routes that matches the criteria specified in the WebSocket route manager and defined in the router it comes from.

      Returns:
      the Web routable
    • findRoutes

      Set<WebSocketRoute<A>> findRoutes()

      Finds all WebSocket routes that matches the criteria specified in the WebSocket route manager and defined in the router it comes from.

      Returns:
      a set of WebSocketRoute routes or an empty set if no route matches the criteria