Class WebSocketSettings


  • public class WebSocketSettings
    extends java.lang.Object
    Web Socket related settings. More documentation is available about each setting in the setter method for the property.
    • Constructor Detail

      • WebSocketSettings

        public WebSocketSettings()
    • Method Detail

      • setWebSocketPushMessageExecutor

        public WebSocketSettings setWebSocketPushMessageExecutor​(Executor executor)
        Set the executor for processing websocket push messages broadcasted to all sessions. Default executor does all the processing in the caller thread. Using a proper thread pool is adviced for applications that send push events from ajax calls to avoid page level deadlocks.
        Parameters:
        executor - The executor used for processing push messages.
      • getWebSocketPushMessageExecutor

        public Executor getWebSocketPushMessageExecutor()
        Returns:
        the executor for processing websocket push messages broadcasted to all sessions.
      • getConnectionRegistry

        public IWebSocketConnectionRegistry getConnectionRegistry()
        Returns:
        The registry that tracks all currently connected WebSocket clients
      • setConnectionRegistry

        public WebSocketSettings setConnectionRegistry​(IWebSocketConnectionRegistry connectionRegistry)
        Sets the connection registry
        Parameters:
        connectionRegistry - The registry that tracks all currently connected WebSocket clients
        Returns:
        this, for method chaining
      • setSendPayloadExecutor

        public WebSocketSettings setSendPayloadExecutor​(Executor sendPayloadExecutor)
        The executor that broadcasts the WebSocketPayload via Wicket's event bus. Default executor does all the processing in the caller thread.
        Parameters:
        sendPayloadExecutor - The executor used for broadcasting the events with web socket payloads to WebSocketBehaviors and WebSocketResources.
      • newWebSocketResponse

        public org.apache.wicket.request.http.WebResponse newWebSocketResponse​(IWebSocketConnection connection)
        A factory method for the WebResponse that should be used to write the response back to the client/browser
        Parameters:
        connection - The active web socket connection
        Returns:
        the response object that should be used to write the response back to the client
      • newWebSocketRequestHandler

        public WebSocketRequestHandler newWebSocketRequestHandler​(org.apache.wicket.Page page,
                                                                  IWebSocketConnection connection)
        A factory method for creating instances of WebSocketRequestHandler for processing a web socket request
        Parameters:
        page - The page with the web socket client. A dummy page in case of usage of WebSocketResource
        connection - The active web socket connection
        Returns:
        a new instance of WebSocketRequestHandler for processing a web socket request
      • newWebSocketRequest

        public org.apache.wicket.request.http.WebRequest newWebSocketRequest​(javax.servlet.http.HttpServletRequest request,
                                                                             java.lang.String filterPath)
        A factory method for the WebRequest that should be used in the WebSocket processing request cycle
        Parameters:
        request - The upgraded http request
        filterPath - The configured filter path of WicketFilter in web.xml
        Returns:
        the request object that should be used in the WebSocket processing request cycle
      • setFilterPrefix

        public void setFilterPrefix​(java.lang.CharSequence filterPrefix)
      • getFilterPrefix

        public java.lang.CharSequence getFilterPrefix()
      • setContextPath

        public void setContextPath​(java.lang.CharSequence contextPath)
      • getContextPath

        public java.lang.CharSequence getContextPath()
      • setBaseUrl

        public void setBaseUrl​(java.lang.CharSequence baseUrl)
      • getBaseUrl

        public java.lang.CharSequence getBaseUrl()
      • setPort

        public void setPort​(int wsPort)
        Sets the port that should be used for ws: connections. If unset then the current HTTP port will be used.
        Parameters:
        wsPort - The custom port for WS connections
      • getPort

        public java.lang.Integer getPort()
        Returns:
        The custom port for WS connections
      • setSecurePort

        public void setSecurePort​(int wssPort)
        Sets the port that should be used for wss: connections. If unset then the current HTTPS port will be used.
        Parameters:
        wssPort - The custom port for WSS connections
      • getSecurePort

        public java.lang.Integer getSecurePort()
        Returns:
        The custom port for WSS connections