reiern70 commented on a change in pull request #479:
URL: https://github.com/apache/wicket/pull/479#discussion_r744647012



##########
File path: 
wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketPushBroadcaster.java
##########
@@ -109,6 +109,72 @@ public void broadcastAll(Application application, 
IWebSocketPushMessage message)
                process(application, wsConnections, message);
        }
 
+       /**
+        * Processes the given message in all pages in a given session that 
have active Web Socket connections.
+        * The message is sent as an event to the Page and components of the 
session allowing the components
+        * to be updated.
+        *
+        * This method can be invoked from any thread, even a non-wicket 
thread. By default all processing
+        * is done in the caller thread. Use
+        * {@link 
WebSocketSettings#setWebSocketPushMessageExecutor(org.apache.wicket.protocol.ws.concurrent.Executor)}
+        * to move processing to background threads.
+        *
+        * If some connections are not in valid state they are silently ignored.
+        *
+        * @param application
+        *                      The wicket application
+        *
+        * @param sessionId
+        *         The session ID
+        * @param message
+        *                      The push message event
+        */
+       public void broadcastAllInSession(Application application, String 
sessionId, IWebSocketPushMessage message)
+       {
+               Args.notNull(application, "application");
+               Args.notNull(message, "message");
+
+               Collection<IWebSocketConnection> wsConnections = 
registry.getConnections(application, sessionId);
+               if (wsConnections == null)
+               {
+                       return;
+               }
+               process(application, wsConnections, message);
+       }
+
+       /**
+        * Processes the given message in all pages in a given session that 
have active Web Socket connections and match
+        * the given filter. The message is sent as an event to the Page and 
components of the session allowing the components
+        * to be updated.
+        *
+        * This method can be invoked from any thread, even a non-wicket 
thread. By default all processing
+        * is done in the caller thread. Use
+        * {@link 
WebSocketSettings#setWebSocketPushMessageExecutor(org.apache.wicket.protocol.ws.concurrent.Executor)}
+        * to move processing to background threads.
+        *
+        * If some connections are not in valid state they are silently ignored.
+        *
+        * @param application
+        *                      The wicket application
+        *
+        * @param connectionsFilter
+        *         the {@link 
org.apache.wicket.protocol.ws.api.registry.IWebSocketConnectionRegistry.IConnectionsFilter}
+        * @param message
+        *                      The push message event
+        */
+       public void broadcastAllMatchingFilter(Application application, 
IWebSocketConnectionRegistry.IConnectionsFilter connectionsFilter, 
IWebSocketPushMessage message)
+       {
+               Args.notNull(application, "application");
+               Args.notNull(message, "message");
+
+               Collection<IWebSocketConnection> wsConnections = 
registry.getConnections(application, connectionsFilter);
+               if (wsConnections == null)

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to