Interface WebSocketRouteManager<A extends ExchangeContext,B extends WebRoutable<A,B>>
- Type Parameters:
A
- the type of the exchange contextB
- the type of web routable
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 TypeMethodDescriptiondisable()
Disables all WebSocket routes that matches the criteria specified in the WebSocket route manager and defined in the router it comes from.enable()
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.handler
(WebSocketExchangeHandler<? super A, Web2SocketExchange<A>> handler) Specifies the route WebSocket exchange handler.Specifies the language of the WebSocket resource served by the web route.default WebSocketRouteManager
<A, B> Specifies the path to the WebSocket resource served by the route without matching trailing slash.Specifies the path to the WebSocket resource served by the route matching or not trailing slash.remove()
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 resourcematchTrailingSlash
- 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
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
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
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
-