public class WebsocketEndpointConfig extends Object implements org.pentaho.platform.api.websocket.IWebsocketEndpointConfig
The CORS utility class usage is used as an example on how to pass a predicate as a parameter (use any other mean that you found useful). The predicate can implement just the following code:
sub_protocol_value
* return domain -> this.getDomainWhitelist().contains( domain );
For the websocket endpoint implementation you should go with an implementation of the
Endpoint
class, in order to have the endpoint registered in the platform.
The websocket is created in the PluginDispatchServlet
initialization.
The endpoint will be ws://Constructor and Description |
---|
WebsocketEndpointConfig(String urlSufix,
Class<?> endpointImpl,
List<String> subProtocolAccepted,
Predicate<String> isOriginAllowedPredicate,
int maxMessageBytesLength) |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getEndpointImpl()
The class that implements this websocket endpoint.
|
static WebsocketEndpointConfig |
getInstanceToReadProperties()
This should be used only to get the property names values, since it gives a raw empty instance.
|
Predicate<String> |
getIsOriginAllowedPredicate()
Gets the predicate which evaluates if a origin is allowed for the websocket.
|
int |
getMaxMessageBytesLength()
Gets the maximum message length in bytes.
|
String |
getMaxMessagePropertyName()
Get the maximum message property.
|
String |
getServletContextPathPropertyName()
Get the servlet context path property.
|
List<String> |
getSubProtocolAccepted()
Gets the list of sub protocols that this web socket will accept.
|
String |
getUrlSufix()
Get the URL sufix where the websocket will be available.
|
public String getUrlSufix()
getUrlSufix
in interface org.pentaho.platform.api.websocket.IWebsocketEndpointConfig
public Class<?> getEndpointImpl()
getEndpointImpl
in interface org.pentaho.platform.api.websocket.IWebsocketEndpointConfig
Class
instance with a websocket implementation.public List<String> getSubProtocolAccepted()
getSubProtocolAccepted
in interface org.pentaho.platform.api.websocket.IWebsocketEndpointConfig
String
with the subprotocols.public Predicate<String> getIsOriginAllowedPredicate()
getIsOriginAllowedPredicate
in interface org.pentaho.platform.api.websocket.IWebsocketEndpointConfig
public int getMaxMessageBytesLength()
getMaxMessageBytesLength
in interface org.pentaho.platform.api.websocket.IWebsocketEndpointConfig
public String getServletContextPathPropertyName()
getServletContextPathPropertyName
in interface org.pentaho.platform.api.websocket.IWebsocketEndpointConfig
public String getMaxMessagePropertyName()
getMaxMessagePropertyName
in interface org.pentaho.platform.api.websocket.IWebsocketEndpointConfig
public static WebsocketEndpointConfig getInstanceToReadProperties()
Copyright © 2021 Hitachi Vantara. All rights reserved.