Search in sources :

Example 1 with UserJoinedVoiceMessage

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

the class UserClientMessageSender method handleUsersMessage.

public void handleUsersMessage(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")) {
            // Used for JSON unmarshalling
            Gson gson = new Gson();
            String messageName = header.get("name").getAsString();
            switch(messageName) {
                case ValidateAuthTokenReplyMessage.VALIDATE_AUTH_TOKEN_REPLY:
                    ValidateAuthTokenReplyMessage m = ValidateAuthTokenReplyMessage.fromJson(message);
                    if (m != null) {
                        processValidateAuthTokenReply(m);
                    }
                    break;
                case ValidateAuthTokenTimeoutMessage.VALIDATE_AUTH_TOKEN_TIMEOUT:
                    ValidateAuthTokenTimeoutMessage vattm = ValidateAuthTokenTimeoutMessage.fromJson(message);
                    if (vattm != null) {
                        processValidateAuthTokenTimeoutMessage(vattm);
                    }
                    break;
                case UserLeftMessage.USER_LEFT:
                    UserLeftMessage ulm = UserLeftMessage.fromJson(message);
                    if (ulm != null) {
                        processUserLeftMessage(ulm);
                    }
                    break;
                case UserJoinedMessage.USER_JOINED:
                    UserJoinedMessage ujm = UserJoinedMessage.fromJson(message);
                    if (ujm != null) {
                        processUserJoinedMessage(ujm);
                    }
                    break;
                case PresenterAssignedMessage.PRESENTER_ASSIGNED:
                    PresenterAssignedMessage pam = PresenterAssignedMessage.fromJson(message);
                    if (pam != null) {
                        processPresenterAssignedMessage(pam);
                    }
                    break;
                case UserStatusChangedMessage.USER_STATUS_CHANGED:
                    UserStatusChangedMessage usm = UserStatusChangedMessage.fromJson(message);
                    if (usm != null) {
                        processUserStatusChangedMessage(usm);
                    }
                    break;
                case UserEmojiStatusMessage.USER_EMOJI_STATUS:
                    UserEmojiStatusMessage urhm = UserEmojiStatusMessage.fromJson(message);
                    if (urhm != null) {
                        processUserEmojiStatusMessage(urhm);
                    }
                    break;
                case UserListeningOnlyMessage.USER_LISTENING_ONLY:
                    UserListeningOnlyMessage ulom = UserListeningOnlyMessage.fromJson(message);
                    if (ulom != null) {
                        processUserListeningOnlyMessage(ulom);
                    }
                    break;
                case UserSharedWebcamMessage.USER_SHARED_WEBCAM:
                    UserSharedWebcamMessage uswm = UserSharedWebcamMessage.fromJson(message);
                    if (uswm != null) {
                        processUserSharedWebcamMessage(uswm);
                    }
                    break;
                case UserUnsharedWebcamMessage.USER_UNSHARED_WEBCAM:
                    UserUnsharedWebcamMessage uuwm = UserUnsharedWebcamMessage.fromJson(message);
                    if (uuwm != null) {
                        processUserUnsharedWebcamMessage(uuwm);
                    }
                    break;
                case UserJoinedVoiceMessage.USER_JOINED_VOICE:
                    UserJoinedVoiceMessage ujvm = UserJoinedVoiceMessage.fromJson(message);
                    if (ujvm != null) {
                        processUserJoinedVoiceMessage(ujvm);
                    }
                    break;
                case UserLeftVoiceMessage.USER_LEFT_VOICE:
                    UserLeftVoiceMessage ulvm = UserLeftVoiceMessage.fromJson(message);
                    if (ulvm != null) {
                        processUserLeftVoiceMessage(ulvm);
                    }
                    break;
                case UserVoiceMutedMessage.USER_VOICE_MUTED:
                    UserVoiceMutedMessage uvmm = UserVoiceMutedMessage.fromJson(message);
                    if (uvmm != null) {
                        processUserVoiceMutedMessage(uvmm);
                    }
                    break;
                case UserVoiceTalkingMessage.USER_VOICE_TALKING:
                    UserVoiceTalkingMessage uvtm = UserVoiceTalkingMessage.fromJson(message);
                    if (uvtm != null) {
                        processUserVoiceTalkingMessage(uvtm);
                    }
                    break;
                case RecordingStatusChangedMessage.RECORDING_STATUS_CHANGED:
                    RecordingStatusChangedMessage rscm = RecordingStatusChangedMessage.fromJson(message);
                    if (rscm != null) {
                        processRecordingStatusChangedMessage(rscm);
                    }
                    break;
                case GetRecordingStatusReplyMessage.Get_RECORDING_STATUS_REPLY:
                    GetRecordingStatusReplyMessage grsrm = GetRecordingStatusReplyMessage.fromJson(message);
                    if (grsrm != null) {
                        processGetRecordingStatusReplyMessage(grsrm);
                    }
                    break;
                case GetUsersReplyMessage.GET_USERS_REPLY:
                    GetUsersReplyMessage gurm = GetUsersReplyMessage.fromJson(message);
                    if (gurm != null) {
                        processGetUsersReplyMessage(gurm);
                    }
                    break;
                case GetCurrentLayoutReplyMessage.GET_CURRENT_LAYOUT_REPLY:
                    processGetCurrentLayoutReplyMessage(message);
                    break;
                case BroadcastLayoutMessage.BROADCAST_LAYOUT:
                    processBroadcastLayoutMessage(message);
                    break;
                case LockLayoutMessage.LOCK_LAYOUT:
                    processLockLayoutMessage(message);
                    break;
                case UserEjectedFromMeetingMessage.USER_EJECTED_FROM_MEETING:
                    processUserEjectedFromMeetingMessage(message);
                    break;
                case BreakoutRoomsList.NAME:
                    BreakoutRoomsList brl = gson.fromJson(message, BreakoutRoomsList.class);
                    if (brl != null) {
                        processBreakoutRoomsList(brl);
                    }
                    break;
                case BreakoutRoomJoinURL.NAME:
                    BreakoutRoomJoinURL brjum = gson.fromJson(message, BreakoutRoomJoinURL.class);
                    if (brjum != null) {
                        processBreakoutRoomJoinURL(brjum);
                    }
                    break;
                case TimeRemainingUpdate.NAME:
                    TimeRemainingUpdate trum = gson.fromJson(message, TimeRemainingUpdate.class);
                    if (trum != null) {
                        processTimeRemainingUpdate(trum);
                    }
                    break;
                case BreakoutRoomsTimeRemainingUpdate.NAME:
                    BreakoutRoomsTimeRemainingUpdate brtru = gson.fromJson(message, BreakoutRoomsTimeRemainingUpdate.class);
                    if (brtru != null) {
                        processBreakoutRoomsTimeRemainingUpdate(brtru);
                    }
                    break;
                case UpdateBreakoutUsers.NAME:
                    UpdateBreakoutUsers ubum = gson.fromJson(message, UpdateBreakoutUsers.class);
                    if (ubum != null) {
                        processUpdateBreakoutUsers(ubum);
                    }
                    break;
                case BreakoutRoomStarted.NAME:
                    BreakoutRoomStarted brsm = gson.fromJson(message, BreakoutRoomStarted.class);
                    if (brsm != null) {
                        processBreakoutRoomStarted(brsm);
                    }
                    break;
                case BreakoutRoomClosed.NAME:
                    BreakoutRoomClosed brcm = gson.fromJson(message, BreakoutRoomClosed.class);
                    if (brcm != null) {
                        processBreakoutRoomClosed(brcm);
                    }
                    break;
            }
        }
    }
}
Also used : UserLeftMessage(org.bigbluebutton.common.messages.UserLeftMessage) UserSharedWebcamMessage(org.bigbluebutton.common.messages.UserSharedWebcamMessage) UserStatusChangedMessage(org.bigbluebutton.common.messages.UserStatusChangedMessage) UserVoiceMutedMessage(org.bigbluebutton.common.messages.UserVoiceMutedMessage) UserUnsharedWebcamMessage(org.bigbluebutton.common.messages.UserUnsharedWebcamMessage) TimeRemainingUpdate(org.bigbluebutton.messages.TimeRemainingUpdate) BreakoutRoomsTimeRemainingUpdate(org.bigbluebutton.messages.BreakoutRoomsTimeRemainingUpdate) UserVoiceTalkingMessage(org.bigbluebutton.common.messages.UserVoiceTalkingMessage) GetUsersReplyMessage(org.bigbluebutton.common.messages.GetUsersReplyMessage) JsonObject(com.google.gson.JsonObject) Gson(com.google.gson.Gson) BreakoutRoomClosed(org.bigbluebutton.messages.BreakoutRoomClosed) UserJoinedMessage(org.bigbluebutton.common.messages.UserJoinedMessage) BreakoutRoomsTimeRemainingUpdate(org.bigbluebutton.messages.BreakoutRoomsTimeRemainingUpdate) PresenterAssignedMessage(org.bigbluebutton.common.messages.PresenterAssignedMessage) UserLeftVoiceMessage(org.bigbluebutton.common.messages.UserLeftVoiceMessage) UserEmojiStatusMessage(org.bigbluebutton.common.messages.UserEmojiStatusMessage) JsonParser(com.google.gson.JsonParser) UpdateBreakoutUsers(org.bigbluebutton.messages.UpdateBreakoutUsers) BreakoutRoomStarted(org.bigbluebutton.messages.BreakoutRoomStarted) ValidateAuthTokenTimeoutMessage(org.bigbluebutton.common.messages.ValidateAuthTokenTimeoutMessage) BreakoutRoomsList(org.bigbluebutton.messages.BreakoutRoomsList) GetRecordingStatusReplyMessage(org.bigbluebutton.common.messages.GetRecordingStatusReplyMessage) ValidateAuthTokenReplyMessage(org.bigbluebutton.common.messages.ValidateAuthTokenReplyMessage) UserJoinedVoiceMessage(org.bigbluebutton.common.messages.UserJoinedVoiceMessage) UserListeningOnlyMessage(org.bigbluebutton.common.messages.UserListeningOnlyMessage) RecordingStatusChangedMessage(org.bigbluebutton.common.messages.RecordingStatusChangedMessage) BreakoutRoomJoinURL(org.bigbluebutton.messages.BreakoutRoomJoinURL)

Aggregations

Gson (com.google.gson.Gson)1 JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 GetRecordingStatusReplyMessage (org.bigbluebutton.common.messages.GetRecordingStatusReplyMessage)1 GetUsersReplyMessage (org.bigbluebutton.common.messages.GetUsersReplyMessage)1 PresenterAssignedMessage (org.bigbluebutton.common.messages.PresenterAssignedMessage)1 RecordingStatusChangedMessage (org.bigbluebutton.common.messages.RecordingStatusChangedMessage)1 UserEmojiStatusMessage (org.bigbluebutton.common.messages.UserEmojiStatusMessage)1 UserJoinedMessage (org.bigbluebutton.common.messages.UserJoinedMessage)1 UserJoinedVoiceMessage (org.bigbluebutton.common.messages.UserJoinedVoiceMessage)1 UserLeftMessage (org.bigbluebutton.common.messages.UserLeftMessage)1 UserLeftVoiceMessage (org.bigbluebutton.common.messages.UserLeftVoiceMessage)1 UserListeningOnlyMessage (org.bigbluebutton.common.messages.UserListeningOnlyMessage)1 UserSharedWebcamMessage (org.bigbluebutton.common.messages.UserSharedWebcamMessage)1 UserStatusChangedMessage (org.bigbluebutton.common.messages.UserStatusChangedMessage)1 UserUnsharedWebcamMessage (org.bigbluebutton.common.messages.UserUnsharedWebcamMessage)1 UserVoiceMutedMessage (org.bigbluebutton.common.messages.UserVoiceMutedMessage)1 UserVoiceTalkingMessage (org.bigbluebutton.common.messages.UserVoiceTalkingMessage)1 ValidateAuthTokenReplyMessage (org.bigbluebutton.common.messages.ValidateAuthTokenReplyMessage)1 ValidateAuthTokenTimeoutMessage (org.bigbluebutton.common.messages.ValidateAuthTokenTimeoutMessage)1