public.javadoc.org.spincast.plugins.routing.WebsocketRouteBuilder.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
The newest version!
WebsocketRouteBuilder (org.spincast:spincast-framework 0.9.28 API)
org.spincast.plugins.routing
Class WebsocketRouteBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>>
- java.lang.Object
-
- org.spincast.plugins.routing.WebsocketRouteBuilder<R,W>
-
- All Implemented Interfaces:
- IWebsocketRouteBuilder<R,W>
public class WebsocketRouteBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>>
extends Object
implements IWebsocketRouteBuilder<R,W>
-
-
Constructor Summary
Constructors
Constructor and Description
WebsocketRouteBuilder(IRouter<R,W> router,
IWebsocketRouteFactory<R,W> websocketRouteFactory)
WebsocketRouteBuilder(IWebsocketRouteFactory<R,W> websocketRouteFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
IWebsocketRouteBuilder<R,W>
before(IHandler<R> beforeFilter)
Adds a before filter.
IWebsocketRoute<R,W>
create(IWebsocketController<R,W> websocketController)
Creates and returns the WebSocket route without adding it to
the router.
Set<String>
getBeforeFilterIdsToSkip()
List<IHandler<R>>
getBeforeFilters()
String
getId()
String
getPath()
protected IRouter<R,W>
getRouter()
IWebsocketController<R,W>
getWebsocketController()
protected IWebsocketRouteFactory<R,W>
getWebsocketRouteFactory()
IWebsocketRouteBuilder<R,W>
id(String id)
The WebSocket route id.
IWebsocketRouteBuilder<R,W>
path(String path)
The path that trigger the beginning of that
HTTP to WebSocket connection.
void
save(IWebsocketController<R,W> websocketController)
Saves the WebSocket route on the router.
IWebsocketRouteBuilder<R,W>
skip(String beforeFilterId)
Skip a "before" filter for this WebSocket route
("after" filters are never run).
-
-
Constructor Detail
-
WebsocketRouteBuilder
public WebsocketRouteBuilder(IWebsocketRouteFactory<R,W> websocketRouteFactory)
-
Method Detail
-
getWebsocketRouteFactory
protected IWebsocketRouteFactory<R,W> getWebsocketRouteFactory()
-
getPath
public String getPath()
-
getId
public String getId()
-
getWebsocketController
public IWebsocketController<R,W> getWebsocketController()
-
path
public IWebsocketRouteBuilder<R,W> path(String path)
Description copied from interface: IWebsocketRouteBuilder
The path that trigger the beginning of that
HTTP to WebSocket connection.
- Specified by:
path in interface IWebsocketRouteBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>>
-
id
public IWebsocketRouteBuilder<R,W> id(String id)
Description copied from interface: IWebsocketRouteBuilder
The WebSocket route id.
- Specified by:
id in interface IWebsocketRouteBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>>
-
before
public IWebsocketRouteBuilder<R,W> before(IHandler<R> beforeFilter)
Description copied from interface: IWebsocketRouteBuilder
Adds a before filter. Those will be run before the
WebSocket connection handshake is started.
Note that there are no "after" filters because once a
WebSocket connection is established, the HTTP one
is no more.
- Specified by:
before in interface IWebsocketRouteBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>>
-
save
public void save(IWebsocketController<R,W> websocketController)
Description copied from interface: IWebsocketRouteBuilder
Saves the WebSocket route on the router.
- Specified by:
save in interface IWebsocketRouteBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>>
-
create
public IWebsocketRoute<R,W> create(IWebsocketController<R,W> websocketController)
Description copied from interface: IWebsocketRouteBuilder
Creates and returns the WebSocket route without adding it to
the router.
NOTE : use save(...) instead to save the route
to the router at the end of the build process!
- Specified by:
create in interface IWebsocketRouteBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>>
-
skip
public IWebsocketRouteBuilder<R,W> skip(String beforeFilterId)
Description copied from interface: IWebsocketRouteBuilder
Skip a "before" filter for this WebSocket route
("after" filters are never run).
This is useful when you set a global filter but want to skip
it one a specific route only.
- Specified by:
skip in interface IWebsocketRouteBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>>
Copyright © 2016. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy