WebSocketCreator, FrameHandlerFactory and
Configuration.Customizer .
When the upgrade(WebSocketNegotiator, Request, Response, Callback, Configuration.
method is called, a match for the pathSpec is looked for. If one is found then the
creator is used to create a POJO for the WebSocket endpoint, the factory is used to
wrap that POJO with a FrameHandler and the customizer is used to configure the resulting
CoreSession.
| Modifier and Type | Field and Description |
|---|---|
| private final WebSocketComponents | |
| private final Handshaker | |
| private static final Logger | |
| private final PathMappings | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addMapping(PathSpec
the pathspec to respond on pathSpec, WebSocketCreator the websocket creator to activate on the provided mapping. creator, FrameHandlerFactory the factory to use to create a FrameHandler for the websocket. factory, Configuration.the customizer to use to customize the WebSocket session. customizerManually add a WebSocket mapping. |
| public void | addMapping(PathSpec
the pathspec to respond on pathSpec, WebSocketNegotiator the WebSocketNegotiator to use to create a FrameHandler for the websocket. negotiator)Manually add a WebSocket mapping. |
| public void | |
| public void | dump(Appendable
The appendable to dump to out, String The indent to apply after any new lines. indent)Implements org. Dump this object (and children) into an Appendable using the provided indent after any new lines. |
| public static WebSocketMappings | |
| public Handshaker | |
| public static WebSocketMappings | |
| public WebSocketNegotiator | getMatchedNegotiator(Request
the request to match request, BiConsumer<Request, PathSpec> the consumer to invoke in case of match consumer)Returns the mapped |
| public WebSocketComponents | |
| public WebSocketCreator | |
| public WebSocketNegotiator | |
| public void | lifeCycleStopping(LifeCycle event)
Overrides default org.
|
| public static PathSpec | Returns: thePathSpec implementation for the rawSpecthe raw path spec as String to parse. rawSpec)Parse a PathSpec string into a PathSpec instance. |
| public boolean | |
| private static void | |
| public boolean | Returns: true if the WebSocket upgrade was acceptedthe request request, Response the response response, Callback the callback callback, Configuration.the customizer defaultCustomizerAttempts to find a WebSocket mapping and upgrade a request to WebSocket. |
| public boolean | Returns: true if the WebSocket upgrade was acceptedthe negotiator negotiator, Request the request request, Response the response response, Callback the callback callback, Configuration.the customizer defaultCustomizerAttempts to find a WebSocket mapping and upgrade a request to WebSocket. |
| components | back to summary |
|---|---|
| private final WebSocketComponents components | |
| handshaker | back to summary |
|---|---|
| private final Handshaker handshaker | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| mappings | back to summary |
|---|---|
| private final PathMappings<WebSocketNegotiator> mappings | |
| WEBSOCKET_MAPPING_ATTRIBUTE | back to summary |
|---|---|
| public static final String WEBSOCKET_MAPPING_ATTRIBUTE | |
| WebSocketMappings | back to summary |
|---|---|
| public WebSocketMappings() | |
| WebSocketMappings | back to summary |
|---|---|
| public WebSocketMappings(WebSocketComponents components) | |
| addMapping | back to summary |
|---|---|
| public void addMapping(PathSpec pathSpec, WebSocketCreator creator, FrameHandlerFactory factory, Configuration. Manually add a WebSocket mapping. If mapping is added before this configuration is started, then it is persisted through stop/start of this configuration's lifecycle. Otherwise it will be removed when this configuration is stopped.
| |
| addMapping | back to summary |
|---|---|
| public void addMapping(PathSpec pathSpec, WebSocketNegotiator negotiator) throws WebSocketException Manually add a WebSocket mapping. If mapping is added before this configuration is started, then it is persisted through stop/start of this configuration's lifecycle. Otherwise it will be removed when this configuration is stopped.
| |
| clear | back to summary |
|---|---|
| public void clear() | |
| dump | back to summary |
|---|---|
| public void dump(Appendable out, String indent) throws IOException Implements org. Doc from org. Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
| |
| ensureMappings | back to summary |
|---|---|
| public static WebSocketMappings ensureMappings(ContextHandler contextHandler) | |
| getHandshaker | back to summary |
|---|---|
| public Handshaker getHandshaker() | |
| getMappings | back to summary |
|---|---|
| public static WebSocketMappings getMappings(ContextHandler contextHandler) | |
| getMatchedNegotiator | back to summary |
|---|---|
| public WebSocketNegotiator getMatchedNegotiator(Request request, BiConsumer<Request, PathSpec> consumer) Returns the mapped If there is a match, the given consumer is invoked with the
| |
| getWebSocketComponents | back to summary |
|---|---|
| public WebSocketComponents getWebSocketComponents() | |
| getWebSocketCreator | back to summary |
|---|---|
| public WebSocketCreator getWebSocketCreator(PathSpec pathSpec) | |
| getWebSocketNegotiator | back to summary |
|---|---|
| public WebSocketNegotiator getWebSocketNegotiator(PathSpec pathSpec) | |
| lifeCycleStopping | back to summary |
|---|---|
| public void lifeCycleStopping(LifeCycle event) Overrides default org.
| |
| parsePathSpec | back to summary |
|---|---|
| public static PathSpec parsePathSpec(String rawSpec) Parse a PathSpec string into a PathSpec instance. Recognized Path Spec syntaxes:
| |
| removeMapping | back to summary |
|---|---|
| public boolean removeMapping(PathSpec pathSpec) | |
| storePathSpec | back to summary |
|---|---|
| private static void storePathSpec(Request request, PathSpec pathSpec) | |
| upgrade | back to summary |
|---|---|
| public boolean upgrade(Request request, Response response, Callback callback, Configuration. Attempts to find a WebSocket mapping and upgrade a request to WebSocket. Returns
| |
| upgrade | back to summary |
|---|---|
| public boolean upgrade(WebSocketNegotiator negotiator, Request request, Response response, Callback callback, Configuration. Attempts to find a WebSocket mapping and upgrade a request to WebSocket. Returns
| |