Sync: code local unifié

Synchronisation du code source local (fait foi).

Signed-off-by: lions dev Team
This commit is contained in:
dahoud
2026-03-15 16:25:40 +00:00
parent e82dc356f3
commit 75a19988b0
730 changed files with 53599 additions and 13145 deletions

View File

@@ -0,0 +1,54 @@
package dev.lions.unionflow.server.service;
import io.quarkus.websockets.next.OpenConnections;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.jboss.logging.Logger;
/**
* Service de broadcast WebSocket pour les notifications temps réel du dashboard.
*/
@ApplicationScoped
public class WebSocketBroadcastService {
private static final Logger LOG = Logger.getLogger(WebSocketBroadcastService.class);
@Inject
OpenConnections openConnections;
/**
* Broadcast un message à toutes les connexions WebSocket ouvertes.
*/
public void broadcast(String message) {
LOG.debugf("Broadcasting message to %d connections", openConnections.stream().count());
openConnections.forEach(connection -> connection.sendTextAndAwait(message));
}
/**
* Broadcast une mise à jour de statistiques.
*/
public void broadcastStatsUpdate(String jsonData) {
broadcast("{\"type\":\"stats_update\",\"data\":" + jsonData + "}");
}
/**
* Broadcast une nouvelle activité.
*/
public void broadcastNewActivity(String jsonData) {
broadcast("{\"type\":\"new_activity\",\"data\":" + jsonData + "}");
}
/**
* Broadcast une mise à jour d'événement.
*/
public void broadcastEventUpdate(String jsonData) {
broadcast("{\"type\":\"event_update\",\"data\":" + jsonData + "}");
}
/**
* Broadcast une notification.
*/
public void broadcastNotification(String jsonData) {
broadcast("{\"type\":\"notification\",\"data\":" + jsonData + "}");
}
}