Search in sources :

Example 1 with WsMessageRoomMsg

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);
}
Also used : WsMessageRoomMsg(org.apache.openmeetings.core.util.ws.WsMessageRoomMsg) TextRoomMessage(org.apache.openmeetings.db.util.ws.TextRoomMessage)

Example 2 with WsMessageRoomMsg

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);
    }
}
Also used : WsMessageAll(org.apache.openmeetings.core.util.ws.WsMessageAll) WsMessageUser(org.apache.openmeetings.core.util.ws.WsMessageUser) WsMessageRoom(org.apache.openmeetings.core.util.ws.WsMessageRoom) WsMessageRoomMsg(org.apache.openmeetings.core.util.ws.WsMessageRoomMsg) WsMessageChat(org.apache.openmeetings.core.util.ws.WsMessageChat)

Aggregations

WsMessageRoomMsg (org.apache.openmeetings.core.util.ws.WsMessageRoomMsg)2 WsMessageAll (org.apache.openmeetings.core.util.ws.WsMessageAll)1 WsMessageChat (org.apache.openmeetings.core.util.ws.WsMessageChat)1 WsMessageRoom (org.apache.openmeetings.core.util.ws.WsMessageRoom)1 WsMessageUser (org.apache.openmeetings.core.util.ws.WsMessageUser)1 TextRoomMessage (org.apache.openmeetings.db.util.ws.TextRoomMessage)1