Search in sources :

Example 1 with GetLockSettingsMessage

use of org.bigbluebutton.common.messages.GetLockSettingsMessage in project bigbluebutton by bigbluebutton.

the class LockMessageReceiver method handleMessage.

@Override
public void handleMessage(String pattern, String channel, String message) {
    if (channel.equalsIgnoreCase(MessagingConstants.TO_MEETING_CHANNEL)) {
        JsonParser parser = new JsonParser();
        JsonObject obj = (JsonObject) parser.parse(message);
        if (obj.has("header") && obj.has("payload")) {
            JsonObject header = (JsonObject) obj.get("header");
            if (header.has("name")) {
                String messageName = header.get("name").getAsString();
                if (GetLockSettingsMessage.GET_LOCK_SETTINGS.equals(messageName)) {
                    GetLockSettingsMessage msg = GetLockSettingsMessage.fromJson(message);
                    bbbGW.getLockSettings(msg.meetingId, msg.userId);
                } else if (LockUserMessage.LOCK_USER.equals(messageName)) {
                    LockUserMessage msg = LockUserMessage.fromJson(message);
                    bbbGW.lockUser(msg.meetingId, msg.requesterId, msg.lock, msg.internalUserId);
                } else if (SendLockSettingsMessage.SEND_LOCK_SETTINGS.equals(messageName)) {
                    SendLockSettingsMessage msg = SendLockSettingsMessage.fromJson(message);
                    bbbGW.sendLockSettings(msg.meetingId, msg.userId, msg.newSettings);
                }
            }
        }
    }
}
Also used : LockUserMessage(org.bigbluebutton.common.messages.LockUserMessage) GetLockSettingsMessage(org.bigbluebutton.common.messages.GetLockSettingsMessage) JsonObject(com.google.gson.JsonObject) SendLockSettingsMessage(org.bigbluebutton.common.messages.SendLockSettingsMessage) JsonParser(com.google.gson.JsonParser)

Aggregations

JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 GetLockSettingsMessage (org.bigbluebutton.common.messages.GetLockSettingsMessage)1 LockUserMessage (org.bigbluebutton.common.messages.LockUserMessage)1 SendLockSettingsMessage (org.bigbluebutton.common.messages.SendLockSettingsMessage)1