use of org.apache.openmeetings.core.util.ws.WsMessageRoomMsg in project openmeetings by apache.
the class WebSocketHelper method sendRoom.
private static void sendRoom(final RoomMessage m, boolean publish) {
if (publish) {
publish(new WsMessageRoomMsg(m));
}
log.debug("Sending WebSocket message: {} {}", m.getType(), m instanceof TextRoomMessage ? ((TextRoomMessage) m).getText() : "");
sendRoom(m.getRoomId(), (t, c) -> t.sendMessage(m), null);
}
use of org.apache.openmeetings.core.util.ws.WsMessageRoomMsg in project openmeetings by apache.
the class WebSocketHelper method send.
public static void send(IClusterWsMessage _m) {
if (_m instanceof WsMessageRoomMsg) {
sendRoom(((WsMessageRoomMsg) _m).getMsg(), false);
} else if (_m instanceof WsMessageRoom) {
WsMessageRoom m = (WsMessageRoom) _m;
sendRoom(m.getRoomId(), m.getMsg(), false);
} else if (_m instanceof WsMessageChat) {
WsMessageChat m = (WsMessageChat) _m;
sendRoom(m.getChatMessage(), m.getMsg(), false);
} else if (_m instanceof WsMessageUser) {
WsMessageUser m = (WsMessageUser) _m;
sendUser(m.getUserId(), m.getMsg(), false);
} else if (_m instanceof WsMessageAll) {
sendAll(((WsMessageAll) _m).getMsg(), false);
}
}
Aggregations