Search in sources :

Example 1 with MeetingStateMessage

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

the class MeetingClientMessageSender method handleMeetingMessage.

public void handleMeetingMessage(String message) {
    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();
            switch(messageName) {
                case DisconnectUserMessage.DISCONNECT_USER:
                    DisconnectUserMessage m = DisconnectUserMessage.fromJson(message);
                    if (m != null) {
                        processDisconnectUserMessage(m);
                    }
                    break;
                case DisconnectAllUsersMessage.DISCONNECT_All_USERS:
                    DisconnectAllUsersMessage daum = DisconnectAllUsersMessage.fromJson(message);
                    if (daum != null) {
                        processDisconnectAllUsersMessage(daum);
                    }
                    break;
                case MeetingEndedMessage.MEETING_ENDED:
                    MeetingEndedMessage mem = MeetingEndedMessage.fromJson(message);
                    if (mem != null) {
                        processMeetingEndedMessage(mem);
                    }
                    break;
                case MeetingEndingMessage.MEETING_ENDING:
                    MeetingEndingMessage me = MeetingEndingMessage.fromJson(message);
                    if (me != null) {
                        processMeetingEndingMessage(me);
                    }
                    break;
                case MeetingHasEndedMessage.MEETING_HAS_ENDED:
                    MeetingHasEndedMessage mhem = MeetingHasEndedMessage.fromJson(message);
                    if (mhem != null) {
                        processMeetingHasEndedMessage(mhem);
                    }
                    break;
                case MeetingStateMessage.MEETING_STATE:
                    MeetingStateMessage msm = MeetingStateMessage.fromJson(message);
                    if (msm != null) {
                        processMeetingStateMessage(msm);
                    }
                    break;
                case NewPermissionsSettingMessage.NEW_PERMISSIONS_SETTING:
                    NewPermissionsSettingMessage npsm = NewPermissionsSettingMessage.fromJson(message);
                    if (npsm != null) {
                        processNewPermissionsSettingMessage(npsm);
                    }
                    break;
                case MeetingMutedMessage.MEETING_MUTED:
                    MeetingMutedMessage mmm = MeetingMutedMessage.fromJson(message);
                    if (mmm != null) {
                        processMeetingMutedMessage(mmm);
                    }
                    break;
                case UserLockedMessage.USER_LOCKED:
                    UserLockedMessage ulm = UserLockedMessage.fromJson(message);
                    if (ulm != null) {
                        processUserLockedMessage(ulm);
                    }
                    break;
            }
        }
    }
}
Also used : DisconnectAllUsersMessage(org.bigbluebutton.common.messages.DisconnectAllUsersMessage) MeetingEndingMessage(org.bigbluebutton.common.messages.MeetingEndingMessage) MeetingHasEndedMessage(org.bigbluebutton.common.messages.MeetingHasEndedMessage) DisconnectUserMessage(org.bigbluebutton.common.messages.DisconnectUserMessage) MeetingEndedMessage(org.bigbluebutton.common.messages.MeetingEndedMessage) MeetingMutedMessage(org.bigbluebutton.common.messages.MeetingMutedMessage) MeetingStateMessage(org.bigbluebutton.common.messages.MeetingStateMessage) JsonObject(com.google.gson.JsonObject) UserLockedMessage(org.bigbluebutton.common.messages.UserLockedMessage) NewPermissionsSettingMessage(org.bigbluebutton.common.messages.NewPermissionsSettingMessage) JsonParser(com.google.gson.JsonParser)

Aggregations

JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 DisconnectAllUsersMessage (org.bigbluebutton.common.messages.DisconnectAllUsersMessage)1 DisconnectUserMessage (org.bigbluebutton.common.messages.DisconnectUserMessage)1 MeetingEndedMessage (org.bigbluebutton.common.messages.MeetingEndedMessage)1 MeetingEndingMessage (org.bigbluebutton.common.messages.MeetingEndingMessage)1 MeetingHasEndedMessage (org.bigbluebutton.common.messages.MeetingHasEndedMessage)1 MeetingMutedMessage (org.bigbluebutton.common.messages.MeetingMutedMessage)1 MeetingStateMessage (org.bigbluebutton.common.messages.MeetingStateMessage)1 NewPermissionsSettingMessage (org.bigbluebutton.common.messages.NewPermissionsSettingMessage)1 UserLockedMessage (org.bigbluebutton.common.messages.UserLockedMessage)1