From 00988e2da64dbc61319023ecc3c61fb09d4223bb Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Thu, 28 May 2015 17:58:35 +0000 Subject: [PATCH] - remove apps from red5 --- .../messages/SendPrivateChatMessage.java | 2 +- .../messages/SendPublicChatMessage.java | 2 +- .../bigbluebutton/common/messages/Util.java | 2 +- .../redis/MeetingMessageHandler.java | 126 - .../service/chat/ChatMessageListener.java | 47 - .../service/lock/LockMessageListener.java | 47 - .../messaging/redis/MessageDistributor.java | 25 - .../messaging/redis/MessageHandler.java | 23 - .../messaging/redis/MessageReceiver.java | 92 - .../messaging/redis/MessageSender.java | 74 - .../messaging/redis/MessageToSend.java | 19 - .../messaging/redis/ReceivedMessage.java | 28 - .../redis/ReceivedMessageHandler.java | 72 - .../participants/ParticipantsListener.java | 284 --- .../conference/service/poll/PollService.java | 85 - .../redis/PollRedisMessageHandler.java | 45 - .../ConversionUpdatesProcessor.java | 59 - .../PresentationMessageListener.java | 240 -- .../presentation/PreuploadedPresentation.java | 12 - .../PreuploadedPresentationsUtil.java | 55 - .../service/recorder/RecordEvent.java | 85 - .../conference/service/recorder/Recorder.java | 35 - .../service/recorder/RecorderApplication.java | 108 - .../service/recorder/RedisDispatcher.java | 57 - .../chat/AbstractChatRecordEvent.java | 28 - .../recorder/chat/PublicChatRecordEvent.java | 43 - .../AbstractParticipantRecordEvent.java | 28 - .../AssignPresenterRecordEvent.java | 39 - .../ParticipantEndAndKickAllRecordEvent.java | 27 - .../ParticipantJoinRecordEvent.java | 47 - .../ParticipantLeftRecordEvent.java | 32 - .../ParticipantStatusChangeRecordEvent.java | 39 - .../participants/RecordStatusRecordEvent.java | 35 - .../polling/AbstractPollRecordEvent.java | 29 - .../polling/PollClearedRecordEvent.java | 35 - .../polling/PollCreatedRecordEvent.java | 66 - .../polling/PollRemovedRecordEvent.java | 37 - .../polling/PollStartedRecordEvent.java | 35 - .../polling/PollStoppedRecordEvent.java | 35 - .../polling/PollUpdatedRecordEvent.java | 60 - .../AbstractPresentationRecordEvent.java | 28 - ...rsionCompletedPresentationRecordEvent.java | 40 - .../presentation/CursorUpdateRecordEvent.java | 36 - .../GenerateSlidePresentationRecordEvent.java | 40 - .../GotoSlidePresentationRecordEvent.java | 81 - ...vePresentationPresentationRecordEvent.java | 33 - ...zeAndMoveSlidePresentationRecordEvent.java | 72 - ...rePresentationPresentationRecordEvent.java | 40 - .../service/voice/VoiceMessageListener.java | 50 - .../whiteboard/WhiteboardListener.java | 68 - .../redis/AbstractWhiteboardRecordEvent.java | 46 - .../redis/AddShapeWhiteboardRecordEvent.java | 69 - .../redis/AddTextWhiteboardRecordEvent.java | 54 - .../redis/ClearPageWhiteboardRecordEvent.java | 28 - .../ModifyTextWhiteboardRecordEvent.java | 53 - .../ToggleGridWhiteboardRecordEvent.java | 33 - .../redis/UndoShapeWhiteboardRecordEvent.java | 32 - .../bigbluebutton/core/api/IDispatcher.java | 6 - .../bigbluebutton/core/api/IOutMessage.java | 5 - .../core/api/MessageOutGateway.java | 23 - .../core/api/OutMessageListener2.java | 6 - .../bigbluebutton/core/api/Red5BBBInGw.java | 23 +- .../core/api/RedisLpushDispatcher.java | 66 - .../pubsub/redis/MessageDistributor.java | 25 - .../pubsub/redis/MessageHandler.java | 23 - .../pubsub/redis/MessageReceiver.java | 92 - .../pubsub/redis/MessageSender.java | 74 - .../pubsub/redis/MessageToSend.java | 19 - .../pubsub/redis/ReceivedMessage.java | 28 - .../pubsub/redis/ReceivedMessageHandler.java | 72 - .../redis/RedisPubSubMessageHandler.java | 46 - .../BigBlueButtonApplication.java | 19 +- .../BigBlueButtonSession.java | 2 +- .../{conference => red5}/Constants.java | 2 +- .../red5/client/ChatClientMessageSender.java | 6 +- .../client/MeetingClientMessageSender.java | 10 +- .../PresentationClientMessageSender.java | 6 +- .../red5/client/UserClientMessageSender.java | 6 +- .../client/WhiteboardClientMessageSender.java | 6 +- .../messaging}/BroadcastClientMessage.java | 2 +- .../client/messaging}/ClientMessage.java | 2 +- .../messaging}/ConnectionInvokerService.java | 2 +- .../messaging}/DirectClientMessage.java | 2 +- .../DisconnectAllClientsMessage.java | 2 +- .../messaging}/DisconnectClientMessage.java | 2 +- .../messaging}/SharedObjectClientMessage.java | 2 +- .../GenericObjectPoolConfigWrapper.java | 2 +- .../redis/RedisPubSubMessageHandler.java | 2 +- .../chat => red5/service}/ChatKeyUtil.java | 2 +- .../chat => red5/service}/ChatService.java | 6 +- .../service}/LayoutService.java | 6 +- .../lock => red5/service}/LockService.java | 6 +- .../service}/ParticipantsService.java | 6 +- .../service}/PresentationApplication.java | 2 +- .../service}/PresentationService.java | 6 +- .../voice => red5/service}/VoiceKeyUtil.java | 2 +- .../voice => red5/service}/VoiceService.java | 6 +- .../service}/WhiteboardApplication.java | 2 +- .../service}/WhiteboardKeyUtil.java | 2 +- .../service}/WhiteboardService.java | 6 +- .../service/recording/RecordMessage.java | 5 - .../service/recording/RedisListRecorder.java | 78 - .../voice/AbstractVoiceRecordEvent.java | 32 - .../voice/ConferenceServerListener.java | 26 - .../voice/ConferenceServiceProvider.java | 28 - .../FreeswitchConferenceEventListener.java | 115 - .../voice/IVoiceConferenceService.java | 13 - .../ParticipantJoinedVoiceRecordEvent.java | 51 - .../ParticipantLeftVoiceRecordEvent.java | 31 - .../ParticipantLockedVoiceRecordEvent.java | 35 - .../ParticipantMutedVoiceRecordEvent.java | 35 - .../ParticipantTalkingVoiceRecordEvent.java | 36 - .../voice/StartRecordingVoiceRecordEvent.java | 38 - .../voice/VoiceEventRecorder.java | 144 -- .../voice/commands/ConferenceCommand.java | 40 - .../commands/ConferenceCommandResult.java | 56 - .../commands/EjectParticipantCommand.java | 34 - .../commands/GetParticipantsCommand.java | 27 - .../commands/MuteParticipantCommand.java | 40 - .../voice/events/ConferenceEventListener.java | 25 - .../voice/events/UnknownConferenceEvent.java | 27 - .../voice/events/VoiceConferenceEvent.java | 32 - .../events/VoiceStartRecordingEvent.java | 51 - .../voice/events/VoiceUserJoinedEvent.java | 70 - .../voice/events/VoiceUserLeftEvent.java | 33 - .../voice/events/VoiceUserLockedEvent.java | 40 - .../voice/events/VoiceUserMutedEvent.java | 40 - .../voice/events/VoiceUserTalkingEvent.java | 40 - .../voice/freeswitch/ConnectionManager.java | 157 -- .../voice/freeswitch/ESLEventListener.java | 208 -- .../freeswitch/FreeswitchApplication.java | 205 -- .../actions/BroadcastConferenceCommand.java | 54 - .../actions/EjectAllUsersCommand.java | 31 - .../actions/EjectParticipantCommand.java | 34 - .../freeswitch/actions/FreeswitchCommand.java | 45 - .../actions/MuteParticipantCommand.java | 40 - .../actions/PopulateRoomCommand.java | 119 - .../actions/RecordConferenceCommand.java | 53 - .../freeswitch/response/ConferenceMember.java | 88 - .../response/ConferenceMemberFlags.java | 54 - .../XMLResponseConferenceListParser.java | 164 -- .../voice/freeswitch/HeartbeatMonitor.scala | 5 - .../core/BigBlueButtonActor.scala | 182 -- .../core/BigBlueButtonGateway.scala | 23 - .../core/BigBlueButtonInGW.scala | 469 ---- .../bigbluebutton/core/CollectorActor.scala | 2163 ----------------- .../bigbluebutton/core/CollectorGateway.scala | 22 - .../org/bigbluebutton/core/MeetingActor.scala | 260 -- .../bigbluebutton/core/RunningMeeting.scala | 37 - .../core/SystemConfiguration.scala | 20 - .../scala/org/bigbluebutton/core/User.scala | 29 - .../core/api/ConsoleDispatcher.scala | 8 - .../bigbluebutton/core/api/Constants.scala | 97 - .../bigbluebutton/core/api/InMessages.scala | 514 ---- .../bigbluebutton/core/api/MessageNames.scala | 167 -- .../bigbluebutton/core/api/OutMessages.scala | 665 ----- .../core/api/TimestampGenerator.scala | 14 - .../bigbluebutton/core/api/ValueObjects.scala | 110 - .../org/bigbluebutton/core/api/Versions.scala | 5 - .../core/apps/chat/ChatApp.scala | 31 - .../core/apps/chat/ChatInGateway.scala | 19 - .../chat/redis/ChatEventRedisPublisher.scala | 38 - .../chat/redis/ChatEventRedisRecorder.scala | 29 - .../redis/ChatMessageToJsonConverter.scala | 67 - .../core/apps/layout/LayoutApp.scala | 66 - .../core/apps/layout/LayoutInGateway.scala | 26 - .../bigbluebutton/core/apps/poll/Poll.scala | 141 -- .../core/apps/poll/PollApp.scala | 123 - .../core/apps/poll/PollInGateway.scala | 56 - .../core/apps/poll/PollMessageConverter.scala | 190 -- .../core/apps/poll/PollModel.scala | 235 -- .../core/apps/poll/QuestionType.scala | 7 - .../poll/red5/PollClientMessageSender.scala | 125 - .../poll/redis/PollEventRedisPublisher.scala | 114 - .../poll/redis/PollEventRedisRecorder.scala | 115 - .../apps/presentation/PresentationApp.scala | 157 -- .../apps/presentation/PresentationModel.scala | 128 - .../PresentationClientMessageSender.scala | 295 --- .../PesentationMessageToJsonConverter.scala | 281 --- .../PresentationEventRedisPublisher.scala | 161 -- .../PresentationEventRedisRecorder.scala | 128 - .../bigbluebutton/core/apps/users/Users.scala | 133 - .../core/apps/users/UsersApp.scala | 448 ---- .../core/apps/users/UsersModel.scala | 101 - .../redis/UsersEventRedisPublisher.scala | 252 -- .../users/redis/UsersEventRedisRecorder.scala | 214 -- .../redis/UsersMessageToJsonConverter.scala | 431 ---- .../core/apps/voice/VoiceApp.scala | 34 - .../core/apps/voice/VoiceInGateway.scala | 65 - .../core/apps/whiteboard/WhiteboardApp.scala | 100 - .../apps/whiteboard/WhiteboardInGateway.scala | 54 - .../apps/whiteboard/WhiteboardModel.scala | 87 - .../redis/WhiteboardEventRedisPublisher.scala | 56 - .../redis/WhiteboardEventRedisRecorder.scala | 93 - .../WhiteboardMessageToJsonConverter.scala | 94 - .../apps/whiteboard/vo/ValueObjects.scala | 3 - .../meeting/MeetingEventRedisPublisher.scala | 94 - .../MeetingMessageToJsonConverter.scala | 132 - .../bigbluebutton/core/messaging/Util.scala | 33 - .../bigbluebutton/core/models/Values.scala | 23 - .../bigbluebutton/core/util/LogHelper.scala | 13 - .../core/util/RandomStringGenerator.scala | 17 - .../core/voice/VoiceConferenceActor.scala | 16 - .../core/voice/VoiceConferenceService.scala | 19 - .../freeswitch/FreeswitchConference.scala | 54 - .../FreeswitchConferenceActor.scala | 250 -- .../FreeswitchConferenceService.scala | 126 - .../freeswitch/FreeswitchManagerProxy.scala | 32 - .../freeswitch/FsInGwWrapper.scala | 12 - .../src/main/webapp/WEB-INF/bbb-app-chat.xml | 37 - .../main/webapp/WEB-INF/bbb-app-layout.xml | 35 - .../src/main/webapp/WEB-INF/bbb-app-lock.xml | 37 - .../src/main/webapp/WEB-INF/bbb-app-poll.xml | 34 - .../webapp/WEB-INF/bbb-app-presentation.xml | 46 - .../src/main/webapp/WEB-INF/bbb-app-users.xml | 38 - .../webapp/WEB-INF/bbb-app-whiteboard.xml | 42 - .../webapp/WEB-INF/bbb-redis-messaging.xml | 62 - .../main/webapp/WEB-INF/bbb-redis-pool.xml | 2 +- .../webapp/WEB-INF/bbb-redis-recorder.xml | 44 - .../src/main/webapp/WEB-INF/bbb-voice-app.xml | 39 - .../webapp/WEB-INF/bbb-voice-freeswitch.xml | 72 - .../main/webapp/WEB-INF/configgy-logger.conf | 21 - .../src/main/webapp/WEB-INF/red5-web.xml | 175 +- 223 files changed, 105 insertions(+), 17038 deletions(-) delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/redis/MeetingMessageHandler.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatMessageListener.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/lock/LockMessageListener.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageDistributor.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageHandler.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageReceiver.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageSender.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageToSend.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/ReceivedMessage.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/ReceivedMessageHandler.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsListener.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/poll/PollService.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/poll/messaging/redis/PollRedisMessageHandler.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/ConversionUpdatesProcessor.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationMessageListener.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PreuploadedPresentation.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PreuploadedPresentationsUtil.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/Recorder.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RecorderApplication.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RedisDispatcher.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/chat/AbstractChatRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/chat/PublicChatRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AbstractParticipantRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AssignPresenterRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantEndAndKickAllRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantJoinRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantLeftRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantStatusChangeRecordEvent.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/RecordStatusRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/AbstractPollRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollClearedRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollCreatedRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollRemovedRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollStartedRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollStoppedRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollUpdatedRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/AbstractPresentationRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/ConversionCompletedPresentationRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/CursorUpdateRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/GenerateSlidePresentationRecordEvent.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/GotoSlidePresentationRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/RemovePresentationPresentationRecordEvent.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/ResizeAndMoveSlidePresentationRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/SharePresentationPresentationRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceMessageListener.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardListener.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AbstractWhiteboardRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AddShapeWhiteboardRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AddTextWhiteboardRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ClearPageWhiteboardRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ModifyTextWhiteboardRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ToggleGridWhiteboardRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/UndoShapeWhiteboardRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/IDispatcher.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/IOutMessage.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/MessageOutGateway.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/OutMessageListener2.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/RedisLpushDispatcher.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageDistributor.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageHandler.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageReceiver.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageSender.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageToSend.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/ReceivedMessage.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/ReceivedMessageHandler.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/RedisPubSubMessageHandler.java rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference => red5}/BigBlueButtonApplication.java (94%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference => red5}/BigBlueButtonSession.java (98%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference => red5}/Constants.java (96%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/meeting/messaging/red5 => red5/client/messaging}/BroadcastClientMessage.java (92%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/meeting/messaging/red5 => red5/client/messaging}/ClientMessage.java (91%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/meeting/messaging/red5 => red5/client/messaging}/ConnectionInvokerService.java (96%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/meeting/messaging/red5 => red5/client/messaging}/DirectClientMessage.java (93%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/meeting/messaging/red5 => red5/client/messaging}/DisconnectAllClientsMessage.java (77%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/meeting/messaging/red5 => red5/client/messaging}/DisconnectClientMessage.java (81%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/meeting/messaging/red5 => red5/client/messaging}/SharedObjectClientMessage.java (93%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/recorder => red5/pubsub/redis}/GenericObjectPoolConfigWrapper.java (95%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/chat => red5/service}/ChatKeyUtil.java (89%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/chat => red5/service}/ChatService.java (96%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/layout => red5/service}/LayoutService.java (94%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/lock => red5/service}/LockService.java (95%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/participants => red5/service}/ParticipantsService.java (96%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/presentation => red5/service}/PresentationApplication.java (98%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/presentation => red5/service}/PresentationService.java (96%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/voice => red5/service}/VoiceKeyUtil.java (69%) mode change 100644 => 100755 rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/voice => red5/service}/VoiceService.java (95%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/whiteboard => red5/service}/WhiteboardApplication.java (95%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/whiteboard => red5/service}/WhiteboardKeyUtil.java (88%) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/{conference/service/whiteboard => red5/service}/WhiteboardService.java (93%) delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/service/recording/RecordMessage.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/service/recording/RedisListRecorder.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/AbstractVoiceRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ConferenceServerListener.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ConferenceServiceProvider.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/FreeswitchConferenceEventListener.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/IVoiceConferenceService.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantJoinedVoiceRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantLeftVoiceRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantLockedVoiceRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantMutedVoiceRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantTalkingVoiceRecordEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/StartRecordingVoiceRecordEvent.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/VoiceEventRecorder.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/ConferenceCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/ConferenceCommandResult.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/EjectParticipantCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/GetParticipantsCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/MuteParticipantCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ConferenceEventListener.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/UnknownConferenceEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceConferenceEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceStartRecordingEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserJoinedEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserLeftEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserLockedEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserMutedEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserTalkingEvent.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/ConnectionManager.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/ESLEventListener.java delete mode 100644 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/BroadcastConferenceCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/EjectAllUsersCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/EjectParticipantCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/FreeswitchCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/MuteParticipantCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/PopulateRoomCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/RecordConferenceCommand.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/ConferenceMember.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/ConferenceMemberFlags.java delete mode 100755 bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/XMLResponseConferenceListParser.java delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/conference/voice/freeswitch/HeartbeatMonitor.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonGateway.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonInGW.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/CollectorActor.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/CollectorGateway.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/MeetingActor.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/RunningMeeting.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/SystemConfiguration.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/User.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/ConsoleDispatcher.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/Constants.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/InMessages.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/MessageNames.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/OutMessages.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/TimestampGenerator.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/ValueObjects.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/Versions.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/ChatApp.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/ChatInGateway.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatEventRedisPublisher.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatEventRedisRecorder.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatMessageToJsonConverter.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/layout/LayoutApp.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/layout/LayoutInGateway.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/Poll.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollApp.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollInGateway.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollMessageConverter.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollModel.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/QuestionType.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/red5/PollClientMessageSender.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/redis/PollEventRedisPublisher.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/redis/PollEventRedisRecorder.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationModel.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/red5/PresentationClientMessageSender.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PesentationMessageToJsonConverter.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PresentationEventRedisPublisher.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PresentationEventRedisRecorder.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/Users.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersModel.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersEventRedisPublisher.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersEventRedisRecorder.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersMessageToJsonConverter.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceInGateway.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardApp.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardInGateway.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardModel.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardEventRedisPublisher.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardEventRedisRecorder.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardMessageToJsonConverter.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/vo/ValueObjects.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/meeting/MeetingEventRedisPublisher.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/meeting/MeetingMessageToJsonConverter.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/messaging/Util.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/models/Values.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/util/LogHelper.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/util/RandomStringGenerator.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/voice/VoiceConferenceActor.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/voice/VoiceConferenceService.scala delete mode 100644 bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConference.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConferenceActor.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConferenceService.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchManagerProxy.scala delete mode 100755 bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FsInGwWrapper.scala delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-chat.xml delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-layout.xml delete mode 100644 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-lock.xml delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-poll.xml delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-presentation.xml delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-users.xml delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-whiteboard.xml delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-messaging.xml delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-recorder.xml delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-freeswitch.xml delete mode 100755 bigbluebutton-apps/src/main/webapp/WEB-INF/configgy-logger.conf diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/SendPrivateChatMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/SendPrivateChatMessage.java index aa048b3dc8..dab9339794 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/SendPrivateChatMessage.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/SendPrivateChatMessage.java @@ -3,7 +3,7 @@ package org.bigbluebutton.common.messages; import java.util.HashMap; import java.util.Map; -import org.bigbluebutton.conference.service.chat.ChatKeyUtil; +import org.bigbluebutton.red5.service.ChatKeyUtil; import com.google.gson.JsonObject; import com.google.gson.JsonParser; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/SendPublicChatMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/SendPublicChatMessage.java index e3af4428e8..ac36757ef8 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/SendPublicChatMessage.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/SendPublicChatMessage.java @@ -3,7 +3,7 @@ package org.bigbluebutton.common.messages; import java.util.HashMap; import java.util.Map; -import org.bigbluebutton.conference.service.chat.ChatKeyUtil; +import org.bigbluebutton.red5.service.ChatKeyUtil; import com.google.gson.JsonObject; import com.google.gson.JsonParser; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/Util.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/Util.java index c89714d17c..5a73d9af98 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/Util.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/common/messages/Util.java @@ -5,7 +5,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import org.bigbluebutton.conference.service.chat.ChatKeyUtil; +import org.bigbluebutton.red5.service.ChatKeyUtil; import com.google.gson.JsonArray; import com.google.gson.JsonElement; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/redis/MeetingMessageHandler.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/redis/MeetingMessageHandler.java deleted file mode 100755 index 4533fea179..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/redis/MeetingMessageHandler.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.bigbluebutton.conference.meeting.messaging.redis; - -import java.util.HashMap; -import java.util.Map; - -import org.bigbluebutton.common.messages.CreateMeetingMessage; -import org.bigbluebutton.common.messages.DestroyMeetingMessage; -import org.bigbluebutton.common.messages.EndMeetingMessage; -import org.bigbluebutton.common.messages.GetAllMeetingsRequest; -import org.bigbluebutton.common.messages.IPublishedMessage; -import org.bigbluebutton.common.messages.KeepAliveMessage; -import org.bigbluebutton.common.messages.MessageFromJsonConverter; -import org.bigbluebutton.common.messages.MessagingConstants; -import org.bigbluebutton.common.messages.RegisterUserMessage; -import org.bigbluebutton.common.messages.UserConnectedToGlobalAudio; -import org.bigbluebutton.common.messages.UserDisconnectedFromGlobalAudio; -import org.bigbluebutton.common.messages.ValidateAuthTokenMessage; -import org.bigbluebutton.conference.service.messaging.redis.MessageHandler; -import org.bigbluebutton.core.api.IBigBlueButtonInGW; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -import com.google.gson.Gson; - - -public class MeetingMessageHandler implements MessageHandler { - private static Logger log = Red5LoggerFactory.getLogger(MeetingMessageHandler.class, "bigbluebutton"); - - private IBigBlueButtonInGW bbbGW; - - @Override - public void handleMessage(String pattern, String channel, String message) { -// System.out.println("Checking message: " + pattern + " " + channel + " " + message); - if (channel.equalsIgnoreCase(MessagingConstants.TO_MEETING_CHANNEL)) { - System.out.println("Meeting message: " + channel + " " + message); - IPublishedMessage msg = MessageFromJsonConverter.convert(message); - - if (msg != null) { - if (msg instanceof EndMeetingMessage) { - EndMeetingMessage emm = (EndMeetingMessage) msg; - log.info("Received end meeting request. Meeting id [{}]", emm.meetingId); - bbbGW.endMeeting(emm.meetingId); - } else if (msg instanceof CreateMeetingMessage) { - CreateMeetingMessage emm = (CreateMeetingMessage) msg; - log.info("Received create meeting request. Meeting id [{}]", emm.id); - bbbGW.createMeeting2(emm.id, emm.externalId, emm.name, emm.record, emm.voiceBridge, - emm.duration, emm.autoStartRecording, emm.allowStartStopRecording, - emm.moderatorPass, emm.viewerPass, emm.createTime, emm.createDate); - } else if (msg instanceof RegisterUserMessage) { - RegisterUserMessage emm = (RegisterUserMessage) msg; - log.info("Received register user request. Meeting id [{}], userid=[{}], token=[{}]", emm.meetingID, emm.internalUserId, emm.authToken); - bbbGW.registerUser(emm.meetingID, emm.internalUserId, emm.fullname, emm.role, emm.externUserID, emm.authToken); - } else if (msg instanceof DestroyMeetingMessage) { - DestroyMeetingMessage emm = (DestroyMeetingMessage) msg; - log.info("Received destroy meeting request. Meeting id [{}]", emm.meetingId); - bbbGW.destroyMeeting(emm.meetingId); - } else if (msg instanceof ValidateAuthTokenMessage) { - ValidateAuthTokenMessage emm = (ValidateAuthTokenMessage) msg; - System.out.println("Received ValidateAuthTokenMessage token request. Meeting id [" + emm.meetingId + "]"); - - log.info("Received ValidateAuthTokenMessage token request. Meeting id [{}]", emm.meetingId); - log.warn("TODO: Need to pass sessionId on ValidateAuthTokenMessage message."); - String sessionId = "tobeimplemented"; - bbbGW.validateAuthToken(emm.meetingId, emm.userId, emm.token, emm.replyTo, sessionId); - } else if (msg instanceof UserConnectedToGlobalAudio) { - UserConnectedToGlobalAudio emm = (UserConnectedToGlobalAudio) msg; - - Map logData = new HashMap(); - logData.put("voiceConf", emm.voiceConf); - logData.put("userId", emm.userid); - logData.put("username", emm.name); - logData.put("event", "user_connected_to_global_audio"); - logData.put("description", "User connected to global audio."); - - Gson gson = new Gson(); - String logStr = gson.toJson(logData); - - log.info("User connected to global audio: data={}", logStr); - - bbbGW.userConnectedToGlobalAudio(emm.voiceConf, emm.userid, emm.name); - } else if (msg instanceof UserDisconnectedFromGlobalAudio) { - UserDisconnectedFromGlobalAudio emm = (UserDisconnectedFromGlobalAudio) msg; - - Map logData = new HashMap(); - logData.put("voiceConf", emm.voiceConf); - logData.put("userId", emm.userid); - logData.put("username", emm.name); - logData.put("event", "user_disconnected_from_global_audio"); - logData.put("description", "User disconnected from global audio."); - - Gson gson = new Gson(); - String logStr = gson.toJson(logData); - - log.info("User disconnected from global audio: data={}", logStr); - bbbGW.userDisconnectedFromGlobalAudio(emm.voiceConf, emm.userid, emm.name); - } - else if (msg instanceof GetAllMeetingsRequest) { - GetAllMeetingsRequest emm = (GetAllMeetingsRequest) msg; - log.info("Received GetAllMeetingsRequest"); - bbbGW.getAllMeetings("no_need_of_a_meeting_id"); - } else { - log.warn("Unknown message: [" + message + "]"); - } - } else { - log.warn("Failed to decode message: [" + message + "]"); - } - } else if (channel.equalsIgnoreCase(MessagingConstants.TO_SYSTEM_CHANNEL)) { - IPublishedMessage msg = MessageFromJsonConverter.convert(message); - - if (msg != null) { - if (msg instanceof KeepAliveMessage) { - KeepAliveMessage emm = (KeepAliveMessage) msg; -// log.debug("Received KeepAliveMessage request. Meeting id [{}]", emm.keepAliveId); - bbbGW.isAliveAudit(emm.keepAliveId); - } - } else { - log.warn("Unknown message: [" + message + "]"); - } - } - } - - public void setBigBlueButtonInGW(IBigBlueButtonInGW bbbGW) { - this.bbbGW = bbbGW; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatMessageListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatMessageListener.java deleted file mode 100755 index 5612cdb3cb..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatMessageListener.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.bigbluebutton.conference.service.chat; - -import org.bigbluebutton.common.messages.GetChatHistoryRequestMessage; -import org.bigbluebutton.common.messages.MessagingConstants; -import org.bigbluebutton.common.messages.SendPrivateChatMessage; -import org.bigbluebutton.common.messages.SendPublicChatMessage; -import org.bigbluebutton.conference.service.messaging.redis.MessageHandler; - -import com.google.gson.JsonParser; -import com.google.gson.JsonObject; - -import org.bigbluebutton.core.api.IBigBlueButtonInGW; - -public class ChatMessageListener implements MessageHandler{ - - private IBigBlueButtonInGW bbbGW; - - public void setBigBlueButtonInGW(IBigBlueButtonInGW bbbGW) { - this.bbbGW = bbbGW; - } - - @Override - public void handleMessage(String pattern, String channel, String message) { - if (channel.equalsIgnoreCase(MessagingConstants.TO_CHAT_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 (GetChatHistoryRequestMessage.GET_CHAT_HISTORY_REQUEST.equals(messageName)) { - GetChatHistoryRequestMessage msg = GetChatHistoryRequestMessage.fromJson(message); - bbbGW.getChatHistory(msg.meetingId, msg.requesterId, msg.replyTo); - } else if (SendPublicChatMessage.SEND_PUBLIC_CHAT_MESSAGE.equals(messageName)){ - SendPublicChatMessage msg = SendPublicChatMessage.fromJson(message); - bbbGW.sendPublicMessage(msg.meetingId, msg.requesterId, msg.messageInfo); - } else if (SendPrivateChatMessage.SEND_PRIVATE_CHAT_MESSAGE.equals(messageName)){ - SendPrivateChatMessage msg = SendPrivateChatMessage.fromJson(message); - bbbGW.sendPrivateMessage(msg.meetingId, msg.requesterId, msg.messageInfo); - } - } - } - } - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/lock/LockMessageListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/lock/LockMessageListener.java deleted file mode 100755 index 67761f69a7..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/lock/LockMessageListener.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.bigbluebutton.conference.service.lock; - -import org.bigbluebutton.common.messages.GetLockSettingsMessage; -import org.bigbluebutton.common.messages.LockUserMessage; -import org.bigbluebutton.common.messages.MessagingConstants; -import org.bigbluebutton.common.messages.SendLockSettingsMessage; -import org.bigbluebutton.conference.service.messaging.redis.MessageHandler; -import org.bigbluebutton.core.api.IBigBlueButtonInGW; - -import com.google.gson.JsonParser; -import com.google.gson.JsonObject; - - -public class LockMessageListener implements MessageHandler{ - - private IBigBlueButtonInGW bbbGW; - - public void setBigBlueButtonInGW(IBigBlueButtonInGW bbbGW) { - this.bbbGW = bbbGW; - } - - @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); - } - } - } - } - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageDistributor.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageDistributor.java deleted file mode 100755 index d8518438ea..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageDistributor.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.bigbluebutton.conference.service.messaging.redis; - -import java.util.Set; - -public class MessageDistributor { - private ReceivedMessageHandler handler; - private Set listeners; - - public void setMessageListeners(Set listeners) { - this.listeners = listeners; - } - - public void setMessageHandler(ReceivedMessageHandler handler) { - this.handler = handler; - if (handler != null) { - handler.setMessageDistributor(this); - } - } - - public void notifyListeners(String pattern, String channel, String message) { - for (MessageHandler listener : listeners) { - listener.handleMessage(pattern, channel, message); - } - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageHandler.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageHandler.java deleted file mode 100755 index 64e25cb510..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.messaging.redis; - -public interface MessageHandler { - void handleMessage(String pattern, String channel, String message); -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageReceiver.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageReceiver.java deleted file mode 100755 index 7e92d2b05b..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageReceiver.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.bigbluebutton.conference.service.messaging.redis; - -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; - -import org.bigbluebutton.common.messages.MessagingConstants; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; -import redis.clients.jedis.JedisPubSub; - -public class MessageReceiver { - private static Logger log = Red5LoggerFactory.getLogger(MessageReceiver.class, "bigbluebutton"); - - private ReceivedMessageHandler handler; - - private JedisPool redisPool; - private volatile boolean receiveMessage = false; - - private final Executor msgReceiverExec = Executors.newSingleThreadExecutor(); - - public void stop() { - receiveMessage = false; - } - - public void start() { - log.info("Ready to receive messages from Redis pubsub."); - try { - receiveMessage = true; - final Jedis jedis = redisPool.getResource(); - - Runnable messageReceiver = new Runnable() { - public void run() { - if (receiveMessage) { - jedis.psubscribe(new PubSubListener(), - MessagingConstants.TO_BBB_APPS_PATTERN); - } - } - }; - msgReceiverExec.execute(messageReceiver); - } catch (Exception e) { - log.error("Error subscribing to channels: " + e.getMessage()); - } - } - - public void setRedisPool(JedisPool redisPool){ - this.redisPool = redisPool; - } - - public void setMessageHandler(ReceivedMessageHandler handler) { - this.handler = handler; - } - - private class PubSubListener extends JedisPubSub { - - public PubSubListener() { - super(); - } - - @Override - public void onMessage(String channel, String message) { - // Not used. - } - - @Override - public void onPMessage(String pattern, String channel, String message) { - handler.handleMessage(pattern, channel, message); - } - - @Override - public void onPSubscribe(String pattern, int subscribedChannels) { - log.debug("Subscribed to the pattern: " + pattern); - } - - @Override - public void onPUnsubscribe(String pattern, int subscribedChannels) { - // Not used. - } - - @Override - public void onSubscribe(String channel, int subscribedChannels) { - // Not used. - } - - @Override - public void onUnsubscribe(String channel, int subscribedChannels) { - // Not used. - } - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageSender.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageSender.java deleted file mode 100644 index f464e76daf..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageSender.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.bigbluebutton.conference.service.messaging.redis; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; - -public class MessageSender { - private static Logger log = Red5LoggerFactory.getLogger(MessageSender.class, "bigbluebutton"); - - private JedisPool redisPool; - private volatile boolean sendMessage = false; - - private final Executor msgSenderExec = Executors.newSingleThreadExecutor(); - private final Executor runExec = Executors.newSingleThreadExecutor(); - private BlockingQueue messages = new LinkedBlockingQueue(); - - public void stop() { - sendMessage = false; - } - - public void start() { - log.info("Redis message publisher starting!"); - try { - sendMessage = true; - - Runnable messageSender = new Runnable() { - public void run() { - while (sendMessage) { - try { - MessageToSend msg = messages.take(); - publish(msg.getChannel(), msg.getMessage()); - } catch (InterruptedException e) { - log.warn("Failed to get message from queue."); - } - } - } - }; - msgSenderExec.execute(messageSender); - } catch (Exception e) { - log.error("Error subscribing to channels: " + e.getMessage()); - } - } - - public void send(String channel, String message) { - MessageToSend msg = new MessageToSend(channel, message); - messages.add(msg); - } - - private void publish(final String channel, final String message) { - Runnable task = new Runnable() { - public void run() { - Jedis jedis = redisPool.getResource(); - try { - jedis.publish(channel, message); - } catch(Exception e){ - log.warn("Cannot publish the message to redis", e); - } finally { - redisPool.returnResource(jedis); - } - } - }; - - runExec.execute(task); - } - - public void setRedisPool(JedisPool redisPool){ - this.redisPool = redisPool; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageToSend.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageToSend.java deleted file mode 100755 index e01dfc84e1..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/MessageToSend.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.bigbluebutton.conference.service.messaging.redis; - -public class MessageToSend { - private final String channel; - private final String message; - - public MessageToSend(String channel, String message) { - this.channel = channel; - this.message = message; - } - - public String getChannel() { - return channel; - } - - public String getMessage() { - return message; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/ReceivedMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/ReceivedMessage.java deleted file mode 100755 index 9319407276..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/ReceivedMessage.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.bigbluebutton.conference.service.messaging.redis; - -public class ReceivedMessage { - - private final String pattern; - private final String channel; - private final String message; - - public ReceivedMessage(String pattern, String channel, String message) { - this.pattern = pattern; - this.channel = channel; - this.message = message; - } - - public String getPattern() { - return pattern; - } - - public String getChannel() { - return channel; - } - - public String getMessage() { - return message; - } - - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/ReceivedMessageHandler.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/ReceivedMessageHandler.java deleted file mode 100644 index 7df2fb37ec..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/redis/ReceivedMessageHandler.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.bigbluebutton.conference.service.messaging.redis; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; - -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class ReceivedMessageHandler { - private static Logger log = Red5LoggerFactory.getLogger(ReceivedMessageHandler.class, "bigbluebutton"); - - private BlockingQueue receivedMessages = new LinkedBlockingQueue(); - - private volatile boolean processMessage = false; - - private final Executor msgProcessorExec = Executors.newSingleThreadExecutor(); - private final Executor runExec = Executors.newSingleThreadExecutor(); - - private MessageDistributor handler; - - public void stop() { - processMessage = false; - } - - public void start() { - log.info("Ready to handle messages from Redis pubsub!"); - - try { - processMessage = true; - - Runnable messageProcessor = new Runnable() { - public void run() { - while (processMessage) { - try { - ReceivedMessage msg = receivedMessages.take(); - processMessage(msg); - } catch (InterruptedException e) { - log.warn("Error while taking received message from queue."); - } - } - } - }; - msgProcessorExec.execute(messageProcessor); - } catch (Exception e) { - log.error("Error subscribing to channels: " + e.getMessage()); - } - } - - private void processMessage(final ReceivedMessage msg) { - Runnable task = new Runnable() { - public void run() { - if (handler != null) { - handler.notifyListeners(msg.getPattern(), msg.getChannel(), msg.getMessage()); - } else { - log.info("No listeners interested in messages from Redis!"); - } - } - }; - runExec.execute(task); - } - - public void handleMessage(String pattern, String channel, String message) { - ReceivedMessage rm = new ReceivedMessage(pattern, channel, message); - receivedMessages.add(rm); - } - - public void setMessageDistributor(MessageDistributor h) { - this.handler = h; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsListener.java deleted file mode 100755 index 27d528c61e..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsListener.java +++ /dev/null @@ -1,284 +0,0 @@ - -package org.bigbluebutton.conference.service.participants; - -import org.bigbluebutton.common.messages.AssignPresenterRequestMessage; -import org.bigbluebutton.common.messages.BroadcastLayoutRequestMessage; -import org.bigbluebutton.common.messages.EjectUserFromMeetingRequestMessage; -import org.bigbluebutton.common.messages.EjectUserFromVoiceRequestMessage; -import org.bigbluebutton.common.messages.GetCurrentLayoutRequestMessage; -import org.bigbluebutton.common.messages.GetRecordingStatusRequestMessage; -import org.bigbluebutton.common.messages.GetUsersRequestMessage; -import org.bigbluebutton.common.messages.InitAudioSettingsMessage; -import org.bigbluebutton.common.messages.InitPermissionsSettingMessage; -import org.bigbluebutton.common.messages.IsMeetingMutedRequestMessage; -import org.bigbluebutton.common.messages.LockLayoutRequestMessage; -import org.bigbluebutton.common.messages.LockMuteUserRequestMessage; -import org.bigbluebutton.common.messages.MessagingConstants; -import org.bigbluebutton.common.messages.MuteAllExceptPresenterRequestMessage; -import org.bigbluebutton.common.messages.MuteAllRequestMessage; -import org.bigbluebutton.common.messages.MuteUserRequestMessage; -import org.bigbluebutton.common.messages.SetRecordingStatusRequestMessage; -import org.bigbluebutton.common.messages.SetUserStatusRequestMessage; -import org.bigbluebutton.common.messages.UserLeavingMessage; -import org.bigbluebutton.common.messages.UserLoweredHandMessage; -import org.bigbluebutton.common.messages.UserRaisedHandMessage; -import org.bigbluebutton.common.messages.UserShareWebcamRequestMessage; -import org.bigbluebutton.common.messages.UserUnshareWebcamRequestMessage; -import org.bigbluebutton.conference.BigBlueButtonApplication; -import org.bigbluebutton.conference.service.messaging.redis.MessageHandler; -import org.bigbluebutton.core.api.IBigBlueButtonInGW; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -import com.google.gson.JsonParser; -import com.google.gson.JsonObject; - -public class ParticipantsListener implements MessageHandler{ - private static Logger log = Red5LoggerFactory.getLogger(BigBlueButtonApplication.class, "bigbluebutton"); - - private IBigBlueButtonInGW bbbInGW; - - public void setBigBlueButtonInGW(IBigBlueButtonInGW bbbInGW) { - this.bbbInGW = bbbInGW; - } - - @Override - public void handleMessage(String pattern, String channel, String message) { - if (channel.equalsIgnoreCase(MessagingConstants.TO_USERS_CHANNEL)) { - System.out.println("Users message: " + channel + " " + message); - JsonParser parser = new JsonParser(); - JsonObject obj = (JsonObject) parser.parse(message); - if (obj.has("header") && obj.has("payload")) { - JsonObject header = (JsonObject) obj.get("header"); - JsonObject payload = (JsonObject) obj.get("payload"); - - if (header.has("name")) { - String messageName = header.get("name").getAsString(); - switch (messageName) { - case UserLeavingMessage.USER_LEAVING: - processUserLeavingMessage(message); - break; - case AssignPresenterRequestMessage.ASSIGN_PRESENTER_REQUEST: - processAssignPresenterRequestMessage(message); - break; - case UserRaisedHandMessage.USER_RAISED_HAND: - processUserRaisedHandMessage(message); - break; - case UserLoweredHandMessage.USER_LOWERED_HAND: - processUserLoweredHandMessage(message); - break; - case EjectUserFromMeetingRequestMessage.EJECT_USER_FROM_MEETING_REQUEST: - processEjectUserFromMeetingRequestMessage(message); - break; - case UserShareWebcamRequestMessage.USER_SHARE_WEBCAM_REQUEST: - processUserShareWebcamRequestMessage(message); - break; - case UserUnshareWebcamRequestMessage.USER_UNSHARE_WEBCAM_REQUEST: - processUserUnshareWebcamRequestMessage(message); - break; - case SetUserStatusRequestMessage.SET_USER_STATUS_REQUEST: - processSetUserStatusRequestMessage(message); - break; - case SetRecordingStatusRequestMessage.SET_RECORDING_STATUS_REQUEST: - processSetRecordingStatusRequestMessage(message); - break; - case GetRecordingStatusRequestMessage.GET_RECORDING_STATUS_REQUEST: - processGetRecordingStatusRequestMessage(message); - break; - case GetUsersRequestMessage.GET_USERS_REQUEST: - processGetUsersRequestMessage(message); - break; - case InitPermissionsSettingMessage.INIT_PERMISSIONS_SETTING: - processInitPermissionsSettingMessage(message); - break; - case InitAudioSettingsMessage.INIT_AUDIO_SETTING: - processInitAudioSettingsMessage(message); - break; - case BroadcastLayoutRequestMessage.BROADCAST_LAYOUT_REQUEST: - processBroadcastLayoutRequestMessage(message); - break; - case LockLayoutRequestMessage.LOCK_LAYOUT_REQUEST: - processLockLayoutRequestMessage(message); - break; - case GetCurrentLayoutRequestMessage.GET_CURRENT_LAYOUT_REQUEST: - processGetCurrentLayoutRequestMessage(message); - break; - case MuteAllExceptPresenterRequestMessage.MUTE_ALL_EXCEPT_PRESENTER_REQUEST: - processMuteAllExceptPresenterRequestMessage(message); - break; - case MuteAllRequestMessage.MUTE_ALL_REQUEST: - processMuteAllRequestMessage(message); - break; - case IsMeetingMutedRequestMessage.IS_MEETING_MUTED_REQUEST: - processIsMeetingMutedRequestMessage(message); - break; - case MuteUserRequestMessage.MUTE_USER_REQUEST: - processMuteUserRequestMessage(message); - break; - case LockMuteUserRequestMessage.LOCK_MUTE_USER_REQUEST: - processLockMuteUserRequestMessage(message); - break; - case EjectUserFromVoiceRequestMessage.EJECT_USER_FROM_VOICE_REQUEST: - processEjectUserFromVoiceRequestMessage(message); - break; - - } - } - } - } - } - - private void processUserLeavingMessage(String message) { - UserLeavingMessage ulm = UserLeavingMessage.fromJson(message); - if (ulm != null) { - bbbInGW.userLeft(ulm.meetingId, ulm.userId, ulm.meetingId); - } - } - - private void processAssignPresenterRequestMessage(String message) { - AssignPresenterRequestMessage apm = AssignPresenterRequestMessage.fromJson(message); - if (apm != null) { - bbbInGW.assignPresenter(apm.meetingId, apm.newPresenterId, apm.newPresenterName, apm.assignedBy); - } - } - - private void processUserRaisedHandMessage(String message) { - UserRaisedHandMessage urhm = UserRaisedHandMessage.fromJson(message); - if (urhm != null) { - bbbInGW.userRaiseHand(urhm.meetingId, urhm.userId);; - } - } - - private void processUserLoweredHandMessage(String message) { - UserLoweredHandMessage ulhm = UserLoweredHandMessage.fromJson(message); - if (ulhm != null) { - bbbInGW.lowerHand(ulhm.meetingId, ulhm.userId, ulhm.loweredBy); - } - } - - private void processEjectUserFromMeetingRequestMessage(String message) { - EjectUserFromMeetingRequestMessage eufm = EjectUserFromMeetingRequestMessage.fromJson(message); - if (eufm != null) { - bbbInGW.ejectUserFromMeeting(eufm.meetingId, eufm.userId, eufm.ejectedBy); - } - } - - private void processUserShareWebcamRequestMessage(String message) { - UserShareWebcamRequestMessage msg = UserShareWebcamRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.shareWebcam(msg.meetingId, msg.userId, msg.stream); - } - } - - private void processUserUnshareWebcamRequestMessage(String message) { - UserUnshareWebcamRequestMessage msg = UserUnshareWebcamRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.unshareWebcam(msg.meetingId, msg.userId, msg.stream); - } - } - - private void processSetUserStatusRequestMessage(String message) { - SetUserStatusRequestMessage msg = SetUserStatusRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.setUserStatus(msg.meetingId, msg.userId, msg.status, msg.value); - } - } - - private void processSetRecordingStatusRequestMessage(String message) { - SetRecordingStatusRequestMessage msg = SetRecordingStatusRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.setRecordingStatus(msg.meetingId, msg.userId, msg.recording); - } - } - - private void processGetRecordingStatusRequestMessage(String message) { - GetRecordingStatusRequestMessage msg = GetRecordingStatusRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.getRecordingStatus(msg.meetingId, msg.userId); - } - } - - private void processGetUsersRequestMessage(String message) { - GetUsersRequestMessage msg = GetUsersRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.getUsers(msg.meetingId, msg.requesterId); - } - } - - private void processInitPermissionsSettingMessage(String message) { - InitPermissionsSettingMessage msg = InitPermissionsSettingMessage.fromJson(message); - if (msg != null) { - bbbInGW.initLockSettings(msg.meetingId, msg.permissions); - } - } - - private void processInitAudioSettingsMessage(String message) { - InitAudioSettingsMessage msg = InitAudioSettingsMessage.fromJson(message); - if (msg != null) { - bbbInGW.initAudioSettings(msg.meetingId, msg.userId, msg.muted); - } - } - - private void processBroadcastLayoutRequestMessage(String message) { - BroadcastLayoutRequestMessage msg = BroadcastLayoutRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.broadcastLayout(msg.meetingId, msg.userId, msg.layout); - } - } - - private void processLockLayoutRequestMessage(String message) { - LockLayoutRequestMessage msg = LockLayoutRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.lockLayout(msg.meetingId, msg.userId, msg.lock, msg.viewersOnly, msg.layout); - } - } - - private void processGetCurrentLayoutRequestMessage(String message) { - GetCurrentLayoutRequestMessage msg = GetCurrentLayoutRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.getCurrentLayout(msg.meetingId, msg.userId); - } - } - - private void processMuteAllExceptPresenterRequestMessage(String message) { - MuteAllExceptPresenterRequestMessage msg = MuteAllExceptPresenterRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.muteAllExceptPresenter(msg.meetingId, msg.requesterId, msg.mute); - } - } - - private void processMuteAllRequestMessage(String message) { - MuteAllRequestMessage msg = MuteAllRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.muteAllUsers(msg.meetingId, msg.requesterId, msg.mute); - } - } - - private void processIsMeetingMutedRequestMessage(String message) { - IsMeetingMutedRequestMessage msg = IsMeetingMutedRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.isMeetingMuted(msg.meetingId, msg.requesterId); - } - } - - private void processMuteUserRequestMessage(String message) { - MuteUserRequestMessage msg = MuteUserRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.muteUser(msg.meetingId, msg.requesterId, msg.userId, msg.mute); - } - } - - private void processLockMuteUserRequestMessage(String message) { - LockMuteUserRequestMessage msg = LockMuteUserRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.lockMuteUser(msg.meetingId, msg.requesterId, msg.userId, msg.lock); - } - } - - private void processEjectUserFromVoiceRequestMessage(String message) { - EjectUserFromVoiceRequestMessage msg = EjectUserFromVoiceRequestMessage.fromJson(message); - if (msg != null) { - bbbInGW.ejectUserFromVoice(msg.meetingId, msg.userId, msg.requesterId); - } - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/poll/PollService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/poll/PollService.java deleted file mode 100755 index 7e4004f625..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/poll/PollService.java +++ /dev/null @@ -1,85 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2010 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 2.1 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.poll; - -import org.slf4j.Logger; -import org.bigbluebutton.conference.BigBlueButtonSession; -import org.bigbluebutton.conference.Constants; -import org.bigbluebutton.core.api.IBigBlueButtonInGW; -import org.red5.logging.Red5LoggerFactory; -import org.red5.server.api.Red5; -import org.red5.server.api.scope.IScope; - -public class PollService { - private static Logger log = Red5LoggerFactory.getLogger( PollService.class, "bigbluebutton" ); - - private IBigBlueButtonInGW bbbInGW; - - public void setBigBlueButtonInGW(IBigBlueButtonInGW inGW) { - bbbInGW = inGW; - } - - public void getPolls() { - bbbInGW.getPolls(getMeetingID(), getRequesterID()); - } - - public void createPoll(String msg){ - System.out.println("*** PollService:: create poll \n" + msg + "\n"); - - bbbInGW.createPoll(getMeetingID(), getRequesterID(), msg); - } - - public void updatePoll(String msg){ - System.out.println("*** PollService:: update poll \n" + msg + "\n"); - bbbInGW.updatePoll(getMeetingID(), getRequesterID(), msg); - } - - public void startPoll(String msg){ - System.out.println("*** PollService:: start poll \n" + msg + "\n"); - bbbInGW.startPoll(getMeetingID(), getRequesterID(), msg); - } - - public void stopPoll(String msg){ - System.out.println("*** PollService:: stop poll \n" + msg + "\n"); - bbbInGW.stopPoll(getMeetingID(), getRequesterID(), msg); - } - - public void removePoll(String msg){ - System.out.println("*** PollService:: remove poll \n" + msg + "\n"); - bbbInGW.removePoll(getMeetingID(), getRequesterID(), msg); - } - - public void respondPoll(String msg){ - System.out.println("*** PollService:: respond poll \n" + msg + "\n"); - bbbInGW.respondPoll(getMeetingID(), getRequesterID(), msg); - } - - private String getMeetingID() { - IScope scope = Red5.getConnectionLocal().getScope(); - return scope.getName(); - } - - private String getRequesterID() { - return getBbbSession().getInternalUserID(); - } - - private BigBlueButtonSession getBbbSession() { - return (BigBlueButtonSession) Red5.getConnectionLocal().getAttribute(Constants.SESSION); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/poll/messaging/redis/PollRedisMessageHandler.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/poll/messaging/redis/PollRedisMessageHandler.java deleted file mode 100755 index 96e2be9bd3..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/poll/messaging/redis/PollRedisMessageHandler.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.bigbluebutton.conference.service.poll.messaging.redis; - - -import org.bigbluebutton.common.messages.MessagingConstants; -import org.bigbluebutton.conference.service.messaging.redis.MessageHandler; -import org.bigbluebutton.core.api.IBigBlueButtonInGW; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; - -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class PollRedisMessageHandler implements MessageHandler { - private static Logger log = Red5LoggerFactory.getLogger(PollRedisMessageHandler.class, "bigbluebutton"); - - private IBigBlueButtonInGW bbbGW; - - @Override - public void handleMessage(String pattern, String channel, String message) { -// log.debug("Checking message: " + pattern + " " + channel + " " + message); - if (channel.equalsIgnoreCase(MessagingConstants.TO_POLLING_CHANNEL)){ - Gson gson = new Gson(); - JsonParser parser = new JsonParser(); - JsonObject obj = parser.parse(message).getAsJsonObject(); - String messageId = gson.fromJson(obj.get("messageId"), String.class); - - //HashMap map = gson.fromJson(message, new TypeToken>() {}.getType()); - - //String messageId = map.get("messageId"); - if (messageId != null){ - if (MessagingConstants.SEND_POLLS_EVENT.equalsIgnoreCase(messageId)){ - String meetingId = gson.fromJson(obj.get("meetingId"), String.class); - bbbGW.preCreatedPoll(meetingId, message); - } - } - } - } - - public void setBigBlueButtonInGW(IBigBlueButtonInGW bbbGW) { - this.bbbGW = bbbGW; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/ConversionUpdatesProcessor.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/ConversionUpdatesProcessor.java deleted file mode 100755 index 1cf384454c..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/ConversionUpdatesProcessor.java +++ /dev/null @@ -1,59 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.presentation; - -import org.slf4j.Logger; -import org.red5.logging.Red5LoggerFactory; -public class ConversionUpdatesProcessor { - private static Logger log = Red5LoggerFactory.getLogger(ConversionUpdatesProcessor.class, "bigbluebutton"); - - private PresentationApplication presentationApplication; - - public void sendConversionUpdate(String messageKey, String conference, - String code, String presId, String presName) { - presentationApplication.sendConversionUpdate(messageKey, conference, - code, presId, presName); - } - - public void sendPageCountError(String messageKey, String conference, - String code, String presId, int numberOfPages, - int maxNumberPages, String presName) { - presentationApplication.sendPageCountError(messageKey, conference, - code, presId, numberOfPages, - maxNumberPages, presName); - } - - public void sendSlideGenerated(String messageKey, String conference, - String code, String presId, int numberOfPages, - int pagesCompleted, String presName) { - presentationApplication.sendSlideGenerated(messageKey, conference, - code, presId, numberOfPages, pagesCompleted, presName); - } - - public void sendConversionCompleted(String messageKey, String conference, - String code, String presId, Integer numberOfPages, String presName, - String presBaseUrl) { - presentationApplication.sendConversionCompleted(messageKey, conference, - code, presId, numberOfPages, presName, presBaseUrl); - } - - public void setPresentationApplication(PresentationApplication a) { - presentationApplication = a; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationMessageListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationMessageListener.java deleted file mode 100755 index 55ecb5424b..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationMessageListener.java +++ /dev/null @@ -1,240 +0,0 @@ -package org.bigbluebutton.conference.service.presentation; - -import java.util.HashMap; -import java.util.Map; - -import org.bigbluebutton.common.messages.GetPresentationInfoMessage; -import org.bigbluebutton.common.messages.GetSlideInfoMessage; -import org.bigbluebutton.common.messages.GoToSlideMessage; -import org.bigbluebutton.common.messages.MessagingConstants; -import org.bigbluebutton.common.messages.RemovePresentationMessage; -import org.bigbluebutton.common.messages.ResizeAndMoveSlideMessage; -import org.bigbluebutton.common.messages.SendConversionCompletedMessage; -import org.bigbluebutton.common.messages.SendConversionUpdateMessage; -import org.bigbluebutton.common.messages.SendCursorUpdateMessage; -import org.bigbluebutton.common.messages.SendPageCountErrorMessage; -import org.bigbluebutton.common.messages.SendSlideGeneratedMessage; -import org.bigbluebutton.common.messages.SharePresentationMessage; -import org.bigbluebutton.conference.service.messaging.redis.MessageHandler; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import org.bigbluebutton.core.api.IBigBlueButtonInGW; -import com.google.gson.JsonParser; -import com.google.gson.JsonObject; - -public class PresentationMessageListener implements MessageHandler { - - public static final String OFFICE_DOC_CONVERSION_SUCCESS_KEY = "OFFICE_DOC_CONVERSION_SUCCESS"; - public static final String OFFICE_DOC_CONVERSION_FAILED_KEY = "OFFICE_DOC_CONVERSION_FAILED"; - public static final String SUPPORTED_DOCUMENT_KEY = "SUPPORTED_DOCUMENT"; - public static final String UNSUPPORTED_DOCUMENT_KEY = "UNSUPPORTED_DOCUMENT"; - public static final String PAGE_COUNT_FAILED_KEY = "PAGE_COUNT_FAILED"; - public static final String PAGE_COUNT_EXCEEDED_KEY = "PAGE_COUNT_EXCEEDED"; - public static final String GENERATED_SLIDE_KEY = "GENERATED_SLIDE"; - public static final String GENERATING_THUMBNAIL_KEY = "GENERATING_THUMBNAIL"; - public static final String GENERATED_THUMBNAIL_KEY = "GENERATED_THUMBNAIL"; - public static final String CONVERSION_COMPLETED_KEY = "CONVERSION_COMPLETED"; - - private ConversionUpdatesProcessor conversionUpdatesProcessor; - private IBigBlueButtonInGW bbbInGW; - - public void setConversionUpdatesProcessor(ConversionUpdatesProcessor p) { - conversionUpdatesProcessor = p; - } - - public void setBigBlueButtonInGW(IBigBlueButtonInGW inGW) { - bbbInGW = inGW; - } - - private void sendConversionUpdate(String messageKey, String conference, - String code, String presId, String filename) { - - conversionUpdatesProcessor.sendConversionUpdate(messageKey, conference, - code, presId, filename); - } - - public void sendPageCountError(String messageKey, String conference, - String code, String presId, Integer numberOfPages, - Integer maxNumberPages, String filename) { - - conversionUpdatesProcessor.sendPageCountError(messageKey, conference, - code, presId, numberOfPages, - maxNumberPages, filename); - } - - private void sendSlideGenerated(String messageKey, String conference, - String code, String presId, Integer numberOfPages, - Integer pagesCompleted, String filename) { - - conversionUpdatesProcessor.sendSlideGenerated(messageKey, conference, - code, presId, numberOfPages, - pagesCompleted, filename); - } - - private void sendConversionCompleted(String messageKey, String conference, - String code, String presId, Integer numberOfPages, - String filename, String presBaseUrl) { - - conversionUpdatesProcessor.sendConversionCompleted(messageKey, conference, - code, presId, numberOfPages, filename, presBaseUrl); - } - - @Override - public void handleMessage(String pattern, String channel, String message) { - if (channel.equalsIgnoreCase(MessagingConstants.TO_PRESENTATION_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 (SendConversionUpdateMessage.SEND_CONVERSION_UPDATE.equals(messageName)) { - SendConversionUpdateMessage msg = SendConversionUpdateMessage.fromJson(message); - System.out.println("in messageHandler - sendConversionCompleted"); - -// sendConversionUpdate(msg.messageKey, msg.meetingId, msg.code, -// msg.presId, msg.presName); - bbbInGW.sendConversionUpdate(msg.messageKey, msg.meetingId, - msg.code, msg.presId, msg.presName); - } else if (ResizeAndMoveSlideMessage.RESIZE_AND_MOVE_SLIDE.equals(messageName)) { - System.out.println("in messageHandler - resizeAndMoveSlide"); - ResizeAndMoveSlideMessage msg = ResizeAndMoveSlideMessage.fromJson(message); - - bbbInGW.resizeAndMoveSlide(msg.meetingId, msg.xOffset, msg.yOffset, - msg.widthRatio, msg.heightRatio); - } else if (GetPresentationInfoMessage.GET_PRESENTATION_INFO.equals(messageName)) { - System.out.println("in messageHandler - getPresentationInfo"); - GetPresentationInfoMessage msg = GetPresentationInfoMessage.fromJson(message); - - bbbInGW.getPresentationInfo(msg.meetingId, msg.requesterId, msg.replyTo); - } else if (SendConversionCompletedMessage.SEND_CONVERSION_COMPLETED.equals(messageName)) { - System.out.println("in messageHandler - sendConversionCompleted"); - SendConversionCompletedMessage msg = SendConversionCompletedMessage.fromJson(message); - -// sendConversionCompleted(msg.messageKey, msg.meetingId, msg.code, -// msg.presId, msg.numPages, msg.presName, msg.presBaseUrl); - bbbInGW.sendConversionCompleted(msg.messageKey, msg.meetingId, msg.code, - msg.presId, msg.numPages, msg.presName, msg.presBaseUrl); - } else if (SendPageCountErrorMessage.SEND_PAGE_COUNT_ERROR.equals(messageName)) { - System.out.println("in messageHandler - sendPageCountError"); - SendPageCountErrorMessage msg = SendPageCountErrorMessage.fromJson(message); - -// sendPageCountError(msg.messageKey, msg.meetingId, msg.code, -// msg.presId, msg.numberOfPages, msg.maxNumberPages, msg.presName); - bbbInGW.sendPageCountError(msg.messageKey, msg.meetingId, msg.code, - msg.presId, msg.numberOfPages, msg.maxNumberPages, msg.presName); - } else if (GoToSlideMessage.GO_TO_SLIDE.equals(messageName)) { - System.out.println("in messageHandler - goToSlide"); - GoToSlideMessage msg = GoToSlideMessage.fromJson(message); - - bbbInGW.gotoSlide(msg.meetingId, msg.page); - } else if (RemovePresentationMessage.REMOVE_PRESENTATION.equals(messageName)) { - System.out.println("in messageHandler - removePresentation"); - RemovePresentationMessage msg = RemovePresentationMessage.fromJson(message); - - bbbInGW.removePresentation(msg.meetingId, msg.presentationId); - } else if (SendCursorUpdateMessage.SEND_CURSOR_UPDATE.equals(messageName)) { - SendCursorUpdateMessage msg = SendCursorUpdateMessage.fromJson(message); - - bbbInGW.sendCursorUpdate(msg.meetingId, msg.xPercent, msg.yPercent); - } else if (SharePresentationMessage.SHARE_PRESENTATION.equals(messageName)) { - System.out.println("in messageHandler - sharePresentation"); - SharePresentationMessage msg = SharePresentationMessage.fromJson(message); - - bbbInGW.sharePresentation(msg.meetingId, msg.presentationId, msg.share); - } else if (GetSlideInfoMessage.GET_SLIDE_INFO.equals(messageName)) { - System.out.println("in messageHandler - GetSlideInfo"); - GetSlideInfoMessage msg = GetSlideInfoMessage.fromJson(message); - - bbbInGW.getSlideInfo(msg.meetingId, msg.requesterId, msg.replyTo); - } else if (SendSlideGeneratedMessage.SEND_SLIDE_GENERATED.equals(messageName)) { - System.out.println("in messageHandler - SendSlideGenerated"); - SendSlideGeneratedMessage msg = SendSlideGeneratedMessage.fromJson(message); - - bbbInGW.sendSlideGenerated(msg.messageKey, msg.meetingId, msg.code, - msg.presId, msg.numberOfPages, msg.pagesCompleted, msg.presName); - } - } - } - else { - Gson gson = new Gson(); - HashMap map = gson.fromJson(message, new TypeToken>() {}.getType()); - String code = (String) map.get("returnCode"); - String presId = (String) map.get("presentationId"); - String filename = (String) map.get("filename"); - String conference = (String) map.get("conference"); - String messageKey = (String) map.get("messageKey"); - - if (messageKey.equalsIgnoreCase(OFFICE_DOC_CONVERSION_SUCCESS_KEY) || - messageKey.equalsIgnoreCase(OFFICE_DOC_CONVERSION_FAILED_KEY) || - messageKey.equalsIgnoreCase(SUPPORTED_DOCUMENT_KEY) || - messageKey.equalsIgnoreCase(UNSUPPORTED_DOCUMENT_KEY) || - messageKey.equalsIgnoreCase(GENERATING_THUMBNAIL_KEY) || - messageKey.equalsIgnoreCase(GENERATED_THUMBNAIL_KEY) || - messageKey.equalsIgnoreCase(PAGE_COUNT_FAILED_KEY)){ - - sendConversionUpdate(messageKey, conference, code, presId, filename); - } else if(messageKey.equalsIgnoreCase(PAGE_COUNT_EXCEEDED_KEY)){ - - Integer numberOfPages = new Integer((String) map.get("numberOfPages")); - Integer maxNumberPages = new Integer((String) map.get("maxNumberPages")); - sendPageCountError(messageKey, conference, code, - presId, numberOfPages, maxNumberPages, filename); - - } else if(messageKey.equalsIgnoreCase(GENERATED_SLIDE_KEY)){ - Integer numberOfPages = new Integer((String) map.get("numberOfPages")); - Integer pagesCompleted = new Integer((String) map.get("pagesCompleted")); - - sendSlideGenerated(messageKey, conference, code, - presId, numberOfPages, pagesCompleted, filename); - - } else if(messageKey.equalsIgnoreCase(CONVERSION_COMPLETED_KEY)){ - Integer numberOfPages = new Integer((String) map.get("numberOfPages")); - String presBaseUrl = (String) map.get("presentationBaseUrl"); - - sendConversionCompleted(messageKey, conference, code, - presId, numberOfPages, filename, presBaseUrl); - } - } - } - } -// @Override -// public void handleMessage(String pattern, String channel, String message) { -// -// if (channel.equalsIgnoreCase(MessagingConstants.TO_PRESENTATION_CHANNEL)) { -// -// JsonParser parser = new JsonParser(); -// JsonObject obj = (JsonObject) parser.parse(message); -// -// if(obj.has("payload") && obj.has("header")) { -// -// JsonObject headerObject = (JsonObject) obj.get("header"); -// JsonObject payloadObject = (JsonObject) obj.get("payload"); -// -// String eventName = headerObject.get("name").toString().replace("\"", ""); -// -// if(eventName.equalsIgnoreCase("presentation_page_changed_message") || -// eventName.equalsIgnoreCase("presentation_page_resized_message")) { -// -// JsonObject pageObject = (JsonObject) payloadObject.get("page"); -// String roomName = payloadObject.get("meeting_id").toString().replace("\"", ""); -// -// if(eventName.equalsIgnoreCase("presentation_page_changed_message")) { -// String pageId = pageObject.get("id").toString().replace("\"", ""); -// bbbInGW.gotoSlide(roomName, pageId); -// } else if(eventName.equalsIgnoreCase("presentation_page_resized_message")) { -// String xOffset = pageObject.get("x_offset").toString().replace("\"", ""); -// String yOffset = pageObject.get("y_offset").toString().replace("\"", ""); -// String widthRatio = pageObject.get("width_ratio").toString().replace("\"", ""); -// String heightRatio = pageObject.get("height_ratio").toString().replace("\"", ""); -// bbbInGW.resizeAndMoveSlide(roomName, Double.parseDouble(xOffset), Double.parseDouble(yOffset), Double.parseDouble(widthRatio), Double.parseDouble(heightRatio)); -// } -// } -// } -// -// } -// } -} - diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PreuploadedPresentation.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PreuploadedPresentation.java deleted file mode 100755 index 0c05f23f20..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PreuploadedPresentation.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.bigbluebutton.conference.service.presentation; - -public class PreuploadedPresentation { - - public final String id; - public final int numPages; - - public PreuploadedPresentation(String id, int numPages) { - this.id = id; - this.numPages = numPages; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PreuploadedPresentationsUtil.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PreuploadedPresentationsUtil.java deleted file mode 100644 index 94266c37f1..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PreuploadedPresentationsUtil.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.bigbluebutton.conference.service.presentation; - -import java.io.File; -import java.io.FileFilter; -import java.io.FilenameFilter; -import java.util.ArrayList; - -public class PreuploadedPresentationsUtil { - - private String bbbDir = "/var/bigbluebutton/"; - - public ArrayList getPreuploadedPresentations(String meetingID) { - ArrayList preuploadedPresentations = new ArrayList(); - - try { - // TODO: this is hard-coded, and not really a great abstraction. need to fix this up later - String folderPath = bbbDir + meetingID + "/" + meetingID; - File folder = new File(folderPath); - //log.debug("folder: {} - exists: {} - isDir: {}", folder.getAbsolutePath(), folder.exists(), folder.isDirectory()); - if (folder.exists() && folder.isDirectory()) { - File[] presentations = folder.listFiles(new FileFilter() { - public boolean accept(File path) { - return path.isDirectory(); - } - }); - for (File presFile : presentations) { - int numPages = getNumPages(presFile); - PreuploadedPresentation p = new PreuploadedPresentation(presFile.getName(), numPages); - preuploadedPresentations.add(p); - } - } - } catch (Exception ex) { - - } - - return preuploadedPresentations; - } - - private int getNumPages(File presDir) { - File[] files = presDir.listFiles(new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.toLowerCase().endsWith(".swf"); - } - }); - - return files.length; - } - - public void setBigBlueButtonDirectory(String dir) { - if (dir.endsWith("/")) bbbDir = dir; - else bbbDir = dir + "/"; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RecordEvent.java deleted file mode 100755 index a8cf016b6e..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RecordEvent.java +++ /dev/null @@ -1,85 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder; - -import java.util.HashMap; - -/** - * Abstract class for all events that need to be recorded. - * @author Richard Alam - * - */ -public abstract class RecordEvent { - protected final HashMap eventMap = new HashMap(); - - protected final static String MODULE = "module"; - protected final static String TIMESTAMP = "timestamp"; - protected final static String MEETING = "meetingId"; - protected final static String EVENT = "eventName"; - - public final String getMeetingID() { - return eventMap.get(MEETING); - } - - /** - * Set the module that generated the event. - * @param module - */ - public final void setModule(String module) { - eventMap.put(MODULE, module); - } - - /** - * Set the timestamp of the event. - * @param timestamp - */ - public final void setTimestamp(long timestamp) { - eventMap.put(TIMESTAMP, Long.toString(timestamp)); - } - - /** - * Set the meetingId for this particular event. - * @param meetingId - */ - public final void setMeetingId(String meetingId) { - eventMap.put(MEETING, meetingId); - } - - /** - * Set the name of the event. - * @param event - */ - public final void setEvent(String event) { - eventMap.put(EVENT, event); - } - - - /** - * Convert the event into a Map to be recorded. - * @return - */ - public final HashMap toMap() { - return eventMap; - } - - @Override - public String toString() { - return eventMap.get(MODULE) + " " + eventMap.get(EVENT); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/Recorder.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/Recorder.java deleted file mode 100755 index f5a24578ba..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/Recorder.java +++ /dev/null @@ -1,35 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder; - -/** - * - * The IRecorder interface define all the neccesary methods to implement for - * dispatch events to a JMS queue - * - * */ -public interface Recorder { - /** - * Receive the messages from the bigbluebutton modules and send - * them to a queue. These messages are the events generated in a conference. - * @param message a JSON String message with the attributes of an event - */ - public void record(String session, RecordEvent event); - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RecorderApplication.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RecorderApplication.java deleted file mode 100644 index d8fb2bd689..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RecorderApplication.java +++ /dev/null @@ -1,108 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; - -import org.bigbluebutton.service.recording.RedisListRecorder; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -/** - * - * The RecorderApplication class is used for setting the record module - * in BigBlueButton for send events messages to a JMS queue. - * The class follows the same standard as the others modules of BigBlueButton Apps. - */ -public class RecorderApplication { - private static Logger log = Red5LoggerFactory.getLogger(RecorderApplication.class, "bigbluebutton"); - - private static final int NTHREADS = 1; - private static final Executor exec = Executors.newFixedThreadPool(NTHREADS); - private static final Executor runExec = Executors.newFixedThreadPool(NTHREADS); - - private BlockingQueue messages; - private volatile boolean recordEvents = false; - - private RedisListRecorder redisListRecorder; - - private Recorder recorder; - - public RecorderApplication() { - messages = new LinkedBlockingQueue(); - } - - public void start() { - recordEvents = true; - Runnable sender = new Runnable() { - public void run() { - while (recordEvents) { - RecordEvent message; - try { - message = messages.take(); - recordEvent(message); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - } - }; - exec.execute(sender); - } - - public void stop() { - recordEvents = false; - } - - public void destroyRecordSession(String meetingID) { -// recordingSessions.remove(meetingID); - } - - public void createRecordSession(String meetingID) { -// recordingSessions.put(meetingID, meetingID); - } - - public void record(String meetingID, RecordEvent message) { - messages.offer(message); - } - - private void recordEvent(final RecordEvent message) { - Runnable task = new Runnable() { - public void run() { - recorder.record(message.getMeetingID(), message); - } - }; - runExec.execute(task); - } - - public void setRecorder(Recorder recorder) { - this.recorder = recorder; - log.debug("setting recorder"); - } - - public void setRedisListRecorder(RedisListRecorder rec) { - redisListRecorder = rec; - } -} - diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RedisDispatcher.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RedisDispatcher.java deleted file mode 100755 index 877f50dc7e..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/RedisDispatcher.java +++ /dev/null @@ -1,57 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder; - -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; - -public class RedisDispatcher implements Recorder { - private static Logger log = Red5LoggerFactory.getLogger(Recorder.class, "bigbluebutton"); - private static final String COLON=":"; - JedisPool redisPool; - - public RedisDispatcher() { - super(); - log.debug("setting redis dispatcher"); - } - - @Override - public void record(String session, RecordEvent message) { - Jedis jedis = redisPool.getResource(); - try { - Long msgid = jedis.incr("global:nextRecordedMsgId"); - jedis.hmset("recording" + COLON + session + COLON + msgid, message.toMap()); - jedis.rpush("meeting" + COLON + session + COLON + "recordings", msgid.toString()); - } finally { - redisPool.returnResource(jedis); - } - } - - public JedisPool getRedisPool() { - return redisPool; - } - - public void setRedisPool(JedisPool redisPool) { - this.redisPool = redisPool; - } - - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/chat/AbstractChatRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/chat/AbstractChatRecordEvent.java deleted file mode 100755 index f07a52713c..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/chat/AbstractChatRecordEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.chat; - -import org.bigbluebutton.conference.service.recorder.RecordEvent; - -public abstract class AbstractChatRecordEvent extends RecordEvent { - - public AbstractChatRecordEvent() { - setModule("CHAT"); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/chat/PublicChatRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/chat/PublicChatRecordEvent.java deleted file mode 100755 index d3db884a58..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/chat/PublicChatRecordEvent.java +++ /dev/null @@ -1,43 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.chat; - - -public class PublicChatRecordEvent extends AbstractChatRecordEvent { - private static final String SENDER = "sender"; - private static final String MESSAGE = "message"; - private static final String COLOR = "color"; - - public PublicChatRecordEvent() { - super(); - setEvent("PublicChatEvent"); - } - - public void setSender(String sender) { - eventMap.put(SENDER, sender); - } - - public void setMessage(String message) { - eventMap.put(MESSAGE, message); - } - - public void setColor(String color) { - eventMap.put(COLOR, color); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AbstractParticipantRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AbstractParticipantRecordEvent.java deleted file mode 100755 index 48c735b0a4..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AbstractParticipantRecordEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.participants; - -import org.bigbluebutton.conference.service.recorder.RecordEvent; - -public abstract class AbstractParticipantRecordEvent extends RecordEvent { - - public AbstractParticipantRecordEvent() { - setModule("PARTICIPANT"); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AssignPresenterRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AssignPresenterRecordEvent.java deleted file mode 100755 index f23c441914..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AssignPresenterRecordEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.participants; - -public class AssignPresenterRecordEvent extends AbstractParticipantRecordEvent { - - public AssignPresenterRecordEvent() { - super(); - setEvent("AssignPresenterEvent"); - } - - public void setUserId(String userid) { - eventMap.put("userid", userid); - } - - public void setName(String name) { - eventMap.put("name", name); - } - - public void setAssignedBy(String by) { - eventMap.put("assignedBy", by); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantEndAndKickAllRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantEndAndKickAllRecordEvent.java deleted file mode 100755 index 46de9dd422..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantEndAndKickAllRecordEvent.java +++ /dev/null @@ -1,27 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.participants; - -public class ParticipantEndAndKickAllRecordEvent extends AbstractParticipantRecordEvent { - - public ParticipantEndAndKickAllRecordEvent() { - super(); - setEvent("EndAndKickAllEvent"); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantJoinRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantJoinRecordEvent.java deleted file mode 100755 index fe22c8c7d2..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantJoinRecordEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.participants; - -public class ParticipantJoinRecordEvent extends AbstractParticipantRecordEvent { - - public ParticipantJoinRecordEvent() { - super(); - setEvent("ParticipantJoinEvent"); - } - - public void setUserId(String userId) { - eventMap.put("userId", userId); - } - - public void setName(String name){ - eventMap.put("name",name); - } - - /** - * Sets the role of the user as MODERATOR or VIEWER - * @param role - */ - public void setRole(String role) { - eventMap.put("role", role); - } - - public void setStatus(String status) { - eventMap.put("status", status); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantLeftRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantLeftRecordEvent.java deleted file mode 100755 index 90812dd22d..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantLeftRecordEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.participants; - -public class ParticipantLeftRecordEvent extends AbstractParticipantRecordEvent { - - public ParticipantLeftRecordEvent() { - super(); - setEvent("ParticipantLeftEvent"); - } - - public void setUserId(String userId) { - eventMap.put("userId", userId); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantStatusChangeRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantStatusChangeRecordEvent.java deleted file mode 100755 index e8c6e9048b..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantStatusChangeRecordEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.participants; - -public class ParticipantStatusChangeRecordEvent extends AbstractParticipantRecordEvent { - - public ParticipantStatusChangeRecordEvent() { - super(); - setEvent("ParticipantStatusChangeEvent"); - } - - public void setUserId(String userId) { - eventMap.put("userId", userId); - } - - public void setStatus(String status) { - eventMap.put("status", status); - } - - public void setValue(String value) { - eventMap.put("value", value); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/RecordStatusRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/RecordStatusRecordEvent.java deleted file mode 100644 index a00e60fafc..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/RecordStatusRecordEvent.java +++ /dev/null @@ -1,35 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.participants; - -public class RecordStatusRecordEvent extends AbstractParticipantRecordEvent { - - public RecordStatusRecordEvent() { - super(); - setEvent("RecordStatusEvent"); - } - - public void setUserId(String userId) { - eventMap.put("userId", userId); - } - - public void setRecordingStatus(String status) { - eventMap.put("status", status); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/AbstractPollRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/AbstractPollRecordEvent.java deleted file mode 100755 index b95e18e37a..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/AbstractPollRecordEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.polling; - -import org.bigbluebutton.conference.service.recorder.RecordEvent; - -public abstract class AbstractPollRecordEvent extends RecordEvent { - - public AbstractPollRecordEvent() { - setModule("POLL"); - } -} - diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollClearedRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollClearedRecordEvent.java deleted file mode 100755 index 3eb9b25730..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollClearedRecordEvent.java +++ /dev/null @@ -1,35 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.polling; - - -public class PollClearedRecordEvent extends AbstractPollRecordEvent { - - private static final String POLL_ID = "pollID"; - - public PollClearedRecordEvent(){ - super(); - setEvent("PollClearedEvent"); - } - - public void setPollID(String pollID) { - eventMap.put(POLL_ID, pollID); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollCreatedRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollCreatedRecordEvent.java deleted file mode 100755 index d1003abdef..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollCreatedRecordEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.polling; - - -public class PollCreatedRecordEvent extends AbstractPollRecordEvent { - - private static final String POLL_ID = "pollID"; - private static final String TITLE = "title"; - - private static final String QUESTION_PATTERN = "question"; - private static final String QUESTION_TEXT = "text"; - private static final String QUESTION_MULTIRESPONSE = "multiresponse"; - - private static final String RESPONSE_PATTERN = "response"; - private static final String RESPONSE_TEXT = "text"; - - private static final String RESPONDER_PATTERN = "responder"; - private static final String RESPONDER_USER = "user"; - - private static final String SEPARATOR = "-"; - - - public PollCreatedRecordEvent() { - super(); - setEvent("PollCreatedEvent"); - } - - public void setPollID(String pollID) { - eventMap.put(POLL_ID, pollID); - } - - public void setTitle(String title) { - eventMap.put(TITLE, title); - } - - public void addQuestion(String id, String question, Boolean multiresponse) { - eventMap.put(QUESTION_PATTERN + SEPARATOR + id + SEPARATOR + QUESTION_TEXT, question); - eventMap.put(QUESTION_PATTERN + SEPARATOR + id + SEPARATOR + QUESTION_MULTIRESPONSE, multiresponse.toString()); - } - - public void addResponse(String questionID, String responseID, String response) { - eventMap.put(QUESTION_PATTERN + SEPARATOR + questionID + SEPARATOR + RESPONSE_PATTERN + SEPARATOR + responseID + RESPONSE_TEXT, response); - } - - /*public void addResponder(String questionID, String responseID, String responderID, String userID) { - eventMap.put(QUESTION_PATTERN + SEPARATOR + questionID + SEPARATOR + RESPONSE_PATTERN + SEPARATOR + responseID + RESPONSE_TEXT, response); - }*/ - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollRemovedRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollRemovedRecordEvent.java deleted file mode 100755 index 2b4b445d34..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollRemovedRecordEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.polling; - - -public class PollRemovedRecordEvent extends AbstractPollRecordEvent { - - private static final String POLL_ID = "pollID"; - - public PollRemovedRecordEvent(){ - super(); - setEvent("PollRemovedEvent"); - } - - public void setPollID(String pollID) { - eventMap.put(POLL_ID, pollID); - } - -} - - diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollStartedRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollStartedRecordEvent.java deleted file mode 100755 index b86592ee5a..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollStartedRecordEvent.java +++ /dev/null @@ -1,35 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.polling; - - -public class PollStartedRecordEvent extends AbstractPollRecordEvent { - - private static final String POLL_ID = "pollID"; - - public PollStartedRecordEvent(){ - super(); - setEvent("PollStartedEvent"); - } - - public void setPollID(String pollID) { - eventMap.put(POLL_ID, pollID); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollStoppedRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollStoppedRecordEvent.java deleted file mode 100755 index efe04ba4de..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollStoppedRecordEvent.java +++ /dev/null @@ -1,35 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.polling; - - -public class PollStoppedRecordEvent extends AbstractPollRecordEvent { - - private static final String POLL_ID = "pollID"; - - public PollStoppedRecordEvent(){ - super(); - setEvent("PollStoppedEvent"); - } - - public void setPollID(String pollID) { - eventMap.put(POLL_ID, pollID); - } - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollUpdatedRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollUpdatedRecordEvent.java deleted file mode 100755 index f26b1eef8e..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/polling/PollUpdatedRecordEvent.java +++ /dev/null @@ -1,60 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.polling; - - -public class PollUpdatedRecordEvent extends AbstractPollRecordEvent { - private static final String POLL_ID = "pollID"; - private static final String TITLE = "title"; - - private static final String QUESTION_PATTERN = "question"; - private static final String QUESTION_TEXT = "text"; - private static final String QUESTION_MULTIRESPONSE = "multiresponse"; - - private static final String RESPONSE_PATTERN = "response"; - private static final String RESPONSE_TEXT = "text"; - - private static final String RESPONDER_PATTERN = "responder"; - private static final String RESPONDER_USER = "user"; - - private static final String SEPARATOR = "-"; - - public PollUpdatedRecordEvent(){ - super(); - setEvent("PollUpdatedEvent"); - } - - public void setPollID(String pollID) { - eventMap.put(POLL_ID, pollID); - } - - public void setTitle(String title) { - eventMap.put(TITLE, title); - } - - public void addQuestion(String id, String question, Boolean multiresponse) { - eventMap.put(QUESTION_PATTERN + SEPARATOR + id + SEPARATOR + QUESTION_TEXT, question); - eventMap.put(QUESTION_PATTERN + SEPARATOR + id + SEPARATOR + QUESTION_MULTIRESPONSE, multiresponse.toString()); - } - - public void addResponse(String questionID, String responseID, String response) { - eventMap.put(QUESTION_PATTERN + SEPARATOR + questionID + SEPARATOR + RESPONSE_PATTERN + SEPARATOR + responseID + RESPONSE_TEXT, response); - } - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/AbstractPresentationRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/AbstractPresentationRecordEvent.java deleted file mode 100755 index fc26c2243e..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/AbstractPresentationRecordEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.presentation; - -import org.bigbluebutton.conference.service.recorder.RecordEvent; - -public abstract class AbstractPresentationRecordEvent extends RecordEvent { - - public AbstractPresentationRecordEvent() { - setModule("PRESENTATION"); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/ConversionCompletedPresentationRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/ConversionCompletedPresentationRecordEvent.java deleted file mode 100755 index a134d7e4c1..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/ConversionCompletedPresentationRecordEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.presentation; - -public class ConversionCompletedPresentationRecordEvent extends - AbstractPresentationRecordEvent { - - public ConversionCompletedPresentationRecordEvent() { - super(); - setEvent("ConversionCompletedEvent"); - } - - public void setPresentationName(String name) { - eventMap.put("presentationName", name); - } - - public void setOriginalFilename(String name) { - eventMap.put("originalFilename", name); - } - - public void setSlidesInfo(String slidesInfo) { - eventMap.put("slidesInfo", slidesInfo); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/CursorUpdateRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/CursorUpdateRecordEvent.java deleted file mode 100755 index 9964bbf617..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/CursorUpdateRecordEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.presentation; - -public class CursorUpdateRecordEvent extends AbstractPresentationRecordEvent{ - - public CursorUpdateRecordEvent() { - super(); - setEvent("CursorMoveEvent"); - } - - public void setXPercent(double percent) { - eventMap.put("xOffset", Double.toString(percent)); - } - - public void setYPercent(double percent) { - eventMap.put("yOffset", Double.toString(percent)); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/GenerateSlidePresentationRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/GenerateSlidePresentationRecordEvent.java deleted file mode 100755 index 171fdb9a09..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/GenerateSlidePresentationRecordEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.presentation; - -public class GenerateSlidePresentationRecordEvent extends - AbstractPresentationRecordEvent { - - public GenerateSlidePresentationRecordEvent() { - super(); - setEvent("GenerateSlideEvent"); - } - - public void setPresentationName(String name) { - eventMap.put("presentationName", name); - } - - public void setNumberOfPages(int numPages) { - eventMap.put("numberOfPages", Integer.toString(numPages)); - } - - public void setPagesCompleted(int pagesCompleted) { - eventMap.put("pagesCompleted", Integer.toString(pagesCompleted)); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/GotoSlidePresentationRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/GotoSlidePresentationRecordEvent.java deleted file mode 100644 index a58f2d3b1a..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/GotoSlidePresentationRecordEvent.java +++ /dev/null @@ -1,81 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.presentation; - -public class GotoSlidePresentationRecordEvent extends - AbstractPresentationRecordEvent { - - public GotoSlidePresentationRecordEvent() { - super(); - setEvent("GotoSlideEvent"); - } - - public void setSlide(int slide) { - /** - * Subtract 1 from the page number to be zero-based to be - * compatible with 0.81 and earlier. (ralam Sept 2, 2014) - */ - eventMap.put("slide", Integer.toString(slide - 1)); - } - - public void setId(String id) { - eventMap.put("id", id); - } - - public void setNum(int num) { - - eventMap.put("num", Integer.toString(num)); - } - - public void setCurrent(boolean current) { - eventMap.put("current", Boolean.toString(current)); - } - - public void setThumbUri(String thumbUri) { - eventMap.put("thumbUri", thumbUri); - } - - public void setSwfUri(String swfUri) { - eventMap.put("swfUri", swfUri); - } - - public void setTxtUri(String txtUri) { - eventMap.put("txtUri", txtUri); - } - - public void setPngUri(String pngUri) { - eventMap.put("pngUri", pngUri); - } - - public void setXOffset(double offset) { - eventMap.put("xOffset", Double.toString(offset)); - } - - public void setYOffset(double offset) { - eventMap.put("yOffset", Double.toString(offset)); - } - - public void setWidthRatio(double ratio) { - eventMap.put("widthRatio", Double.toString(ratio)); - } - - public void setHeightRatio(double ratio) { - eventMap.put("heightRatio", Double.toString(ratio)); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/RemovePresentationPresentationRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/RemovePresentationPresentationRecordEvent.java deleted file mode 100755 index 01d371cc7d..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/RemovePresentationPresentationRecordEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.presentation; - -public class RemovePresentationPresentationRecordEvent extends - AbstractPresentationRecordEvent { - - public RemovePresentationPresentationRecordEvent() { - super(); - setEvent("RemovePresentationEvent"); - } - - public void setPresentationName(String name) { - eventMap.put("presentationName", name); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/ResizeAndMoveSlidePresentationRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/ResizeAndMoveSlidePresentationRecordEvent.java deleted file mode 100644 index bf55a97ce2..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/ResizeAndMoveSlidePresentationRecordEvent.java +++ /dev/null @@ -1,72 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.presentation; - -public class ResizeAndMoveSlidePresentationRecordEvent extends - AbstractPresentationRecordEvent { - - public ResizeAndMoveSlidePresentationRecordEvent() { - super(); - setEvent("ResizeAndMoveSlideEvent"); - } - - public void setId(String id) { - eventMap.put("id", id); - } - - public void setNum(int num) { - eventMap.put("num", Integer.toString(num)); - } - - public void setCurrent(boolean current) { - eventMap.put("current", Boolean.toString(current)); - } - - public void setThumbUri(String thumbUri) { - eventMap.put("thumbUri", thumbUri); - } - - public void setSwfUri(String swfUri) { - eventMap.put("swfUri", swfUri); - } - - public void setTxtUri(String txtUri) { - eventMap.put("txtUri", txtUri); - } - - public void setPngUri(String pngUri) { - eventMap.put("pngUri", pngUri); - } - - public void setXOffset(double offset) { - eventMap.put("xOffset", Double.toString(offset)); - } - - public void setYOffset(double offset) { - eventMap.put("yOffset", Double.toString(offset)); - } - - public void setWidthRatio(double ratio) { - eventMap.put("widthRatio", Double.toString(ratio)); - } - - public void setHeightRatio(double ratio) { - eventMap.put("heightRatio", Double.toString(ratio)); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/SharePresentationPresentationRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/SharePresentationPresentationRecordEvent.java deleted file mode 100755 index 0efd6273fc..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/SharePresentationPresentationRecordEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.recorder.presentation; - -public class SharePresentationPresentationRecordEvent extends - AbstractPresentationRecordEvent { - - public SharePresentationPresentationRecordEvent() { - super(); - setEvent("SharePresentationEvent"); - } - - public void setPresentationName(String name) { - eventMap.put("presentationName", name); - } - - public void setOriginalFilename(String name) { - eventMap.put("originalFilename", name); - } - - public void setShare(boolean share) { - eventMap.put("share", Boolean.toString(share)); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceMessageListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceMessageListener.java deleted file mode 100755 index a364afd3f4..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceMessageListener.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.bigbluebutton.conference.service.voice; - -import org.bigbluebutton.common.messages.MessagingConstants; -import org.bigbluebutton.conference.service.messaging.redis.MessageHandler; -import org.bigbluebutton.core.api.IBigBlueButtonInGW; - -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; - -public class VoiceMessageListener implements MessageHandler{ - - private IBigBlueButtonInGW bbbGW; - - public void setBigBlueButtonInGW(IBigBlueButtonInGW bbbGW) { - this.bbbGW = bbbGW; - } - - @Override - public void handleMessage(String pattern, String channel, String message) { - if (channel.equalsIgnoreCase(MessagingConstants.TO_VOICE_CHANNEL)) { - - JsonParser parser = new JsonParser(); - JsonObject obj = (JsonObject) parser.parse(message); - JsonObject headerObject = (JsonObject) obj.get("header"); - JsonObject payloadObject = (JsonObject) obj.get("payload"); - - String eventName = headerObject.get("name").toString().replace("\"", ""); - - if (eventName.equalsIgnoreCase(MessagingConstants.MUTE_USER_REQUEST)){ - - String meetingID = payloadObject.get("meeting_id").toString().replace("\"", ""); - String requesterID = payloadObject.get("requester_id").toString().replace("\"", ""); - String userID = payloadObject.get("userid").toString().replace("\"", ""); - String muteString = payloadObject.get(VoiceKeyUtil.MUTE).toString().replace("\"", ""); - Boolean mute = Boolean.valueOf(muteString); - - System.out.println("handling mute_user_request"); - bbbGW.muteUser(meetingID, requesterID, userID, mute); - } - else if (eventName.equalsIgnoreCase(MessagingConstants.USER_LEFT_VOICE_REQUEST)){ - - String meetingID = payloadObject.get("meeting_id").toString().replace("\"", ""); - String userID = payloadObject.get("userid").toString().replace("\"", ""); - - System.out.println("handling user_left_voice_request"); - bbbGW.voiceUserLeft(meetingID, userID); - } - } - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardListener.java deleted file mode 100755 index eff8a6434e..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardListener.java +++ /dev/null @@ -1,68 +0,0 @@ - -package org.bigbluebutton.conference.service.whiteboard; - - -import org.bigbluebutton.common.messages.ClearWhiteboardRequestMessage; -import org.bigbluebutton.common.messages.EnableWhiteboardRequestMessage; -import org.bigbluebutton.common.messages.IsWhiteboardEnabledRequestMessage; -import org.bigbluebutton.common.messages.MessagingConstants; -import org.bigbluebutton.common.messages.RequestWhiteboardAnnotationHistoryRequestMessage; -import org.bigbluebutton.common.messages.SendWhiteboardAnnotationRequestMessage; -import org.bigbluebutton.common.messages.UndoWhiteboardRequest; -import org.bigbluebutton.conference.service.messaging.redis.MessageHandler; -import org.bigbluebutton.core.api.IBigBlueButtonInGW; -import org.bigbluebutton.core.api.Red5BBBInGw; - -import com.google.gson.JsonParser; -import com.google.gson.JsonObject; - -public class WhiteboardListener implements MessageHandler{ - - private IBigBlueButtonInGW bbbInGW; - - public void setBigBlueButtonInGW(IBigBlueButtonInGW bbbInGW) { - this.bbbInGW = bbbInGW; - } - - @Override - public void handleMessage(String pattern, String channel, String message) { - if (channel.equalsIgnoreCase(MessagingConstants.TO_WHITEBOARD_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 (UndoWhiteboardRequest.UNDO_WHITEBOARD_REQUEST.equals(messageName)) { - System.out.println("inListener:UNDO_WHITEBOARD_REQUEST"); - UndoWhiteboardRequest msg = UndoWhiteboardRequest.fromJson(message); - bbbInGW.undoWhiteboard(msg.meetingId, msg.requesterId, msg.whiteboardId); - } else if (ClearWhiteboardRequestMessage.CLEAR_WHITEBOARD_REQUEST.equals(messageName)) { - System.out.println("inListener:CLEAR_WHITEBOARD_REQUEST"); - ClearWhiteboardRequestMessage msg = ClearWhiteboardRequestMessage.fromJson(message); - bbbInGW.clearWhiteboard(msg.meetingId, msg.requesterId, msg.whiteboardId); - } else if (RequestWhiteboardAnnotationHistoryRequestMessage.REQUEST_WHITEBOARD_ANNOTATION_HISTORY_REQUEST.equals(messageName)) { - System.out.println("inListener:REQUEST_WHITEBOARD_ANNOTATION_HISTORY_REQUEST"); - RequestWhiteboardAnnotationHistoryRequestMessage msg = RequestWhiteboardAnnotationHistoryRequestMessage.fromJson(message); - bbbInGW.requestWhiteboardAnnotationHistory(msg.meetingId, msg.requesterId, msg.whiteboardId, msg.replyTo); - } else if (IsWhiteboardEnabledRequestMessage.IS_WHITEBOARD_ENABLED_REQUEST.equals(messageName)) { - System.out.println("inListener: IS_WHITEBOARD_ENABLED_REQUEST"); - IsWhiteboardEnabledRequestMessage msg = IsWhiteboardEnabledRequestMessage.fromJson(message); - bbbInGW.isWhiteboardEnabled(msg.meetingId, msg.requesterId, msg.replyTo); - } else if (EnableWhiteboardRequestMessage.ENABLE_WHITEBOARD_REQUEST.equals(messageName)) { - System.out.println("inListener: ENABLE_WHITEBOARD_REQUEST"); - EnableWhiteboardRequestMessage msg = EnableWhiteboardRequestMessage.fromJson(message); - bbbInGW.enableWhiteboard(msg.meetingId, msg.requesterId, msg.enable); - } else if (SendWhiteboardAnnotationRequestMessage.SEND_WHITEBOARD_ANNOTATION_REQUEST.equals(messageName)) { - System.out.println("inListener: SEND_WHITEBOARD_ANNOTATION_REQUEST"); - SendWhiteboardAnnotationRequestMessage msg = SendWhiteboardAnnotationRequestMessage.fromJson(message); - bbbInGW.sendWhiteboardAnnotation(msg.meetingId, msg.requesterId, msg.annotation); - } - } - } - } - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AbstractWhiteboardRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AbstractWhiteboardRecordEvent.java deleted file mode 100644 index aed2b1c94b..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AbstractWhiteboardRecordEvent.java +++ /dev/null @@ -1,46 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.whiteboard.redis; - -import org.bigbluebutton.conference.service.recorder.RecordEvent; - -public abstract class AbstractWhiteboardRecordEvent extends RecordEvent { - - public AbstractWhiteboardRecordEvent() { - setModule("WHITEBOARD"); - } - - public void setPresentation(String name) { - eventMap.put("presentation", name); - } - - public void setPageNumber(String page) { - /** - * Subtract 1 from the page number to be zero-based to be - * compatible with 0.81 and earlier. (ralam Sept 2, 2014) - */ - Integer num = new Integer(page); -// System.out.println("WB Page Number real pagenum=[" + num + "] rec pagenum=[" + (num - 1) + "]"); - eventMap.put("pageNumber", new Integer(num - 1).toString()); - } - - public void setWhiteboardId(String id) { - eventMap.put("whiteboardId", id); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AddShapeWhiteboardRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AddShapeWhiteboardRecordEvent.java deleted file mode 100755 index fa667798c6..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AddShapeWhiteboardRecordEvent.java +++ /dev/null @@ -1,69 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.whiteboard.redis; - -import java.util.ArrayList; -import java.util.Map; - -public class AddShapeWhiteboardRecordEvent extends AbstractWhiteboardRecordEvent { - - public AddShapeWhiteboardRecordEvent() { - super(); - setEvent("AddShapeEvent"); - } - - public void addAnnotation(Map annotation) { - for (Map.Entry entry : annotation.entrySet()) { - String key = entry.getKey(); - - if (key.equals("points")) { - eventMap.put("dataPoints", pointsToString((ArrayList)entry.getValue())); - } else { - Object value = entry.getValue(); - eventMap.put(key, value.toString()); - } - } - } - - private String pointsToString(ArrayList points){ - String datapoints = ""; - for (int i = 0; i < points.size(); i++) { - datapoints += (points.get(i)).toString() + ","; - } - // Trim the trailing comma - return datapoints.substring(0, datapoints.length() - 1); - } - - public void setFillColor(int fillColor) { - eventMap.put("fillColor", Integer.toString(fillColor)); - } - - public void setThickness(int thickness) { - eventMap.put("thickness", Integer.toString(thickness)); - } - - public void setFill(boolean fill) { - eventMap.put("fill", Boolean.toString(fill)); - } - - public void setTransparent(boolean transparent) { - eventMap.put("transparent", Boolean.toString(transparent)); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AddTextWhiteboardRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AddTextWhiteboardRecordEvent.java deleted file mode 100755 index fc3c0b4fcf..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/AddTextWhiteboardRecordEvent.java +++ /dev/null @@ -1,54 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.whiteboard.redis; - -import java.util.ArrayList; -import java.util.Map; - -public class AddTextWhiteboardRecordEvent extends AbstractWhiteboardRecordEvent { - - public AddTextWhiteboardRecordEvent() { - super(); - setEvent("AddTextEvent"); - } - - public void addAnnotation(Map annotation) { - for (Map.Entry entry : annotation.entrySet()) { - String key = entry.getKey(); - - if (key.equals("points")) { - ArrayList value = (ArrayList)entry.getValue(); - eventMap.put("dataPoints", pointsToString(value)); - } else { - Object value = entry.getValue(); - eventMap.put(key, value.toString()); - } - } - } - - private String pointsToString(ArrayList points){ - String datapoints = ""; - for (Double i : points) { - datapoints += i + ","; - } - // Trim the trailing comma - return datapoints.substring(0, datapoints.length() - 1); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ClearPageWhiteboardRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ClearPageWhiteboardRecordEvent.java deleted file mode 100755 index 583d374470..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ClearPageWhiteboardRecordEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.whiteboard.redis; - -public class ClearPageWhiteboardRecordEvent extends - AbstractWhiteboardRecordEvent { - - public ClearPageWhiteboardRecordEvent() { - super(); - setEvent("ClearPageEvent"); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ModifyTextWhiteboardRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ModifyTextWhiteboardRecordEvent.java deleted file mode 100755 index ca6f398f3b..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ModifyTextWhiteboardRecordEvent.java +++ /dev/null @@ -1,53 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.whiteboard.redis; - -import java.util.ArrayList; -import java.util.Map; - -public class ModifyTextWhiteboardRecordEvent extends AbstractWhiteboardRecordEvent { - - public ModifyTextWhiteboardRecordEvent() { - super(); - setEvent("ModifyTextEvent"); - } - - public void addAnnotation(Map annotation) { - for (Map.Entry entry : annotation.entrySet()) { - String key = entry.getKey(); - - if (key.equals("points")) { - ArrayList value = (ArrayList)entry.getValue(); - eventMap.put("dataPoints", pointsToString(value)); - } else { - Object value = entry.getValue(); - eventMap.put(key, value.toString()); - } - } - } - - private String pointsToString(ArrayList points){ - String datapoints = ""; - for (Double i : points) { - datapoints += i + ","; - } - // Trim the trailing comma - return datapoints.substring(0, datapoints.length() - 1); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ToggleGridWhiteboardRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ToggleGridWhiteboardRecordEvent.java deleted file mode 100755 index 1b68d43f7a..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/ToggleGridWhiteboardRecordEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.whiteboard.redis; - -public class ToggleGridWhiteboardRecordEvent extends - AbstractWhiteboardRecordEvent { - - public ToggleGridWhiteboardRecordEvent() { - super(); - setEvent("ToggleGridEvent"); - } - - public void setGridEnabled(boolean enabled) { - eventMap.put("gridEnabled", Boolean.toString(enabled)); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/UndoShapeWhiteboardRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/UndoShapeWhiteboardRecordEvent.java deleted file mode 100755 index 0d9cbd4ef6..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/redis/UndoShapeWhiteboardRecordEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.conference.service.whiteboard.redis; - -public class UndoShapeWhiteboardRecordEvent extends - AbstractWhiteboardRecordEvent { - - public UndoShapeWhiteboardRecordEvent() { - super(); - setEvent("UndoShapeEvent"); - } - - public void setShapeId(String id) { - eventMap.put("shapeId", id); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/IDispatcher.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/IDispatcher.java deleted file mode 100755 index fa1b97c3c6..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/IDispatcher.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.bigbluebutton.core.api; - -public interface IDispatcher { - - void dispatch(String jsonMessage); -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/IOutMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/IOutMessage.java deleted file mode 100755 index 94939235e2..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/IOutMessage.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.bigbluebutton.core.api; - -public interface IOutMessage { - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/MessageOutGateway.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/MessageOutGateway.java deleted file mode 100755 index 4f3766c71d..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/MessageOutGateway.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.bigbluebutton.core.api; - -import java.util.Set; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class MessageOutGateway { - private static Logger log = Red5LoggerFactory.getLogger(MessageOutGateway.class, "bigbluebutton"); - - private Set listeners; - - public void send(IOutMessage msg) { -// log.debug("before listeners send. check message:" + msg); - for (OutMessageListener2 l : listeners) { -// log.debug("listener " + l); - l.handleMessage(msg); - } - } - - public void setListeners(Set listeners) { - this.listeners = listeners; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/OutMessageListener2.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/OutMessageListener2.java deleted file mode 100755 index ec6d099a45..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/OutMessageListener2.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.bigbluebutton.core.api; - -public interface OutMessageListener2 { - - void handleMessage(IOutMessage msg); -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/Red5BBBInGw.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/Red5BBBInGw.java index 8e03676031..b812566120 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/Red5BBBInGw.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/Red5BBBInGw.java @@ -48,9 +48,7 @@ import org.bigbluebutton.common.messages.UserRaisedHandMessage; import org.bigbluebutton.common.messages.UserShareWebcamRequestMessage; import org.bigbluebutton.common.messages.UserUnshareWebcamRequestMessage; import org.bigbluebutton.common.messages.ValidateAuthTokenMessage; -import org.bigbluebutton.conference.service.messaging.redis.MessageSender; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import org.bigbluebutton.red5.pubsub.redis.MessageSender; public class Red5BBBInGw implements IBigBlueButtonInGW { @@ -351,7 +349,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void removePresentation(String meetingID, String presentationID) { - System.out.println("~~removePresentation in Red5BBBInGw"); RemovePresentationMessage msg = new RemovePresentationMessage(meetingID, presentationID); sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson()); } @@ -361,7 +358,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { String replyTo) { GetPresentationInfoMessage msg = new GetPresentationInfoMessage(meetingID, requesterID, replyTo); - System.out.println("~~getPresentationInfo in Red5BBBInGw"); sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson()); } @@ -379,7 +375,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { public void resizeAndMoveSlide(String meetingID, double xOffset, double yOffset, double widthRatio, double heightRatio) { - System.out.println("~~resizeAndMoveSlide in Red5BBBInGw"); ResizeAndMoveSlideMessage msg = new ResizeAndMoveSlideMessage(meetingID, xOffset, yOffset, widthRatio, heightRatio); sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson()); @@ -387,7 +382,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void gotoSlide(String meetingID, String page) { - System.out.println("~~gotoSlide in Red5BBBInGw"); GoToSlideMessage msg = new GoToSlideMessage(meetingID, page); sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson()); } @@ -395,7 +389,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void sharePresentation(String meetingID, String presentationID, boolean share) { - System.out.println("~~sharePresentation in Red5BBBInGw"); SharePresentationMessage msg = new SharePresentationMessage(meetingID, presentationID, share); sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson()); } @@ -403,7 +396,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void getSlideInfo(String meetingID, String requesterID, String replyTo) { - System.out.println("~~getSlideInfo in Red5BBBInGw"); GetSlideInfoMessage msg = new GetSlideInfoMessage(meetingID, requesterID, replyTo); sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson()); @@ -412,7 +404,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void sendConversionUpdate(String messageKey, String meetingId, String code, String presId, String presName) { - System.out.println("~~sendConversionUpdate in Red5BBBInGw"); SendConversionUpdateMessage msg = new SendConversionUpdateMessage(messageKey, meetingId, code, presId, presName); sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson()); @@ -422,7 +413,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { public void sendPageCountError(String messageKey, String meetingId, String code, String presId, int numberOfPages, int maxNumberPages, String presName) { - System.out.println("~~sendPageCountError in Red5BBBInGw"); SendPageCountErrorMessage msg = new SendPageCountErrorMessage(messageKey, meetingId, code, presId, numberOfPages, maxNumberPages, presName); @@ -433,7 +423,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { public void sendSlideGenerated(String messageKey, String meetingId, String code, String presId, int numberOfPages, int pagesCompleted, String presName) { - System.out.println("~~sendSlideGenerated in Red5BBBInGw"); SendSlideGeneratedMessage msg = new SendSlideGeneratedMessage(messageKey, meetingId, code, presId, numberOfPages, pagesCompleted, presName); sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson()); @@ -443,7 +432,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { public void sendConversionCompleted(String messageKey, String meetingId, String code, String presId, int numPages, String presName, String presBaseUrl) { - System.out.println("~~sendConversionCompleted in Red5BBBInGw"); SendConversionCompletedMessage msg = new SendConversionCompletedMessage(messageKey, meetingId, code, presId, numPages, presName, presBaseUrl); sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson()); @@ -513,7 +501,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void getChatHistory(String meetingID, String requesterID, String replyTo) { - System.out.println("~~getChatHistory in Red5BBBInGw"); GetChatHistoryRequestMessage msg = new GetChatHistoryRequestMessage(meetingID, requesterID, replyTo); sender.send(MessagingConstants.TO_CHAT_CHANNEL, msg.toJson()); } @@ -521,7 +508,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void sendPublicMessage(String meetingID, String requesterID, Map message) { - System.out.println("~~sendPublicMessage in Red5BBBInGw"); SendPublicChatMessage msg = new SendPublicChatMessage(meetingID, requesterID, message); sender.send(MessagingConstants.TO_CHAT_CHANNEL, msg.toJson()); } @@ -529,7 +515,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void sendPrivateMessage(String meetingID, String requesterID, Map message) { - System.out.println("~~sendPrivateMessage in Red5BBBInGw"); SendPrivateChatMessage msg = new SendPrivateChatMessage(meetingID, requesterID, message); sender.send(MessagingConstants.TO_CHAT_CHANNEL, msg.toJson()); } @@ -537,7 +522,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void sendWhiteboardAnnotation(String meetingID, String requesterID, Map annotation) { - System.out.println("~~sendWhiteboardAnnotation in Red5BBBInGw"); SendWhiteboardAnnotationRequestMessage msg = new SendWhiteboardAnnotationRequestMessage(meetingID, requesterID, annotation); sender.send(MessagingConstants.TO_WHITEBOARD_CHANNEL, msg.toJson()); } @@ -545,7 +529,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void requestWhiteboardAnnotationHistory(String meetingID, String requesterID, String whiteboardId, String replyTo) { - System.out.println("~~requestWhiteboardAnnotationHistory in Red5BBBInGw"); RequestWhiteboardAnnotationHistoryRequestMessage msg = new RequestWhiteboardAnnotationHistoryRequestMessage(meetingID, requesterID, whiteboardId, replyTo); sender.send(MessagingConstants.TO_WHITEBOARD_CHANNEL, msg.toJson()); @@ -554,7 +537,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void clearWhiteboard(String meetingID, String requesterID, String whiteboardId) { - System.out.println("~~ClearWhiteboardRequestMessage in Red5BBBInGw"); ClearWhiteboardRequestMessage msg = new ClearWhiteboardRequestMessage(meetingID, requesterID, whiteboardId); sender.send(MessagingConstants.TO_WHITEBOARD_CHANNEL, msg.toJson()); @@ -563,7 +545,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void undoWhiteboard(String meetingID, String requesterID, String whiteboardId) { - System.out.println("~~undoWhiteboard in Red5BBBInGw"); org.bigbluebutton.common.messages.UndoWhiteboardRequest msg = new org.bigbluebutton.common.messages.UndoWhiteboardRequest(meetingID, requesterID, whiteboardId); sender.send(MessagingConstants.TO_WHITEBOARD_CHANNEL, msg.toJson()); } @@ -571,7 +552,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void enableWhiteboard(String meetingID, String requesterID, Boolean enable) { - System.out.println("~~enableWhiteboard in Red5BBBInGw"); EnableWhiteboardRequestMessage msg = new EnableWhiteboardRequestMessage(meetingID, requesterID, enable); sender.send(MessagingConstants.TO_WHITEBOARD_CHANNEL, msg.toJson()); } @@ -579,7 +559,6 @@ public class Red5BBBInGw implements IBigBlueButtonInGW { @Override public void isWhiteboardEnabled(String meetingID, String requesterID, String replyTo) { - System.out.println("~~isWhiteboardEnabled in Red5BBBInGw"); IsWhiteboardEnabledRequestMessage msg = new IsWhiteboardEnabledRequestMessage(meetingID, requesterID, replyTo); sender.send(MessagingConstants.TO_WHITEBOARD_CHANNEL, msg.toJson()); diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/RedisLpushDispatcher.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/RedisLpushDispatcher.java deleted file mode 100755 index 68ed47975d..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/RedisLpushDispatcher.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.bigbluebutton.core.api; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; - -public class RedisLpushDispatcher implements IDispatcher { - private static final int NTHREADS = 1; - private static final Executor exec = Executors.newFixedThreadPool(NTHREADS); - - private static final String BBBMESSAGES = "bbb:meeting:messages"; - - private BlockingQueue messages; - private volatile boolean dispatchEvents = false; - - private JedisPool redisPool; - - public RedisLpushDispatcher() { - messages = new LinkedBlockingQueue(); - } - - @Override - public void dispatch(String jsonMessage) { - messages.offer(jsonMessage); - } - - private void saveMessage(String msg) { - Jedis jedis = redisPool.getResource(); - try { - jedis.lpush(BBBMESSAGES, msg); - } finally { - redisPool.returnResource(jedis); - } - } - - public void start() { - dispatchEvents = true; - Runnable sender = new Runnable() { - public void run() { - while (dispatchEvents) { - String message; - try { - message = messages.take(); - saveMessage(message); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - } - }; - exec.execute(sender); - } - - public void stop() { - dispatchEvents = false; - } - - public void setRedisPool(JedisPool redisPool) { - this.redisPool = redisPool; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageDistributor.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageDistributor.java deleted file mode 100755 index 10e6f9332c..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageDistributor.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.bigbluebutton.freeswitch.pubsub.redis; - -import java.util.Set; - -public class MessageDistributor { - private ReceivedMessageHandler handler; - private Set listeners; - - public void setMessageListeners(Set listeners) { - this.listeners = listeners; - } - - public void setMessageHandler(ReceivedMessageHandler handler) { - this.handler = handler; - if (handler != null) { - handler.setMessageDistributor(this); - } - } - - public void notifyListeners(String pattern, String channel, String message) { - for (MessageHandler listener : listeners) { - listener.handleMessage(pattern, channel, message); - } - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageHandler.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageHandler.java deleted file mode 100755 index 751f7e87e5..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.freeswitch.pubsub.redis; - -public interface MessageHandler { - void handleMessage(String pattern, String channel, String message); -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageReceiver.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageReceiver.java deleted file mode 100755 index 9f99b01ac0..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageReceiver.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.bigbluebutton.freeswitch.pubsub.redis; - -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; - -import org.bigbluebutton.common.messages.MessagingConstants; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; -import redis.clients.jedis.JedisPubSub; - -public class MessageReceiver { - private static Logger log = Red5LoggerFactory.getLogger(MessageReceiver.class, "bigbluebutton"); - - private ReceivedMessageHandler handler; - - private JedisPool redisPool; - private volatile boolean receiveMessage = false; - - private final Executor msgReceiverExec = Executors.newSingleThreadExecutor(); - - public void stop() { - receiveMessage = false; - } - - public void start() { - log.info("Ready to receive messages from Redis pubsub."); - try { - receiveMessage = true; - final Jedis jedis = redisPool.getResource(); - - Runnable messageReceiver = new Runnable() { - public void run() { - if (receiveMessage) { - jedis.psubscribe(new PubSubListener(), - MessagingConstants.FROM_BBB_APPS_PATTERN); - } - } - }; - msgReceiverExec.execute(messageReceiver); - } catch (Exception e) { - log.error("Error subscribing to channels: " + e.getMessage()); - } - } - - public void setRedisPool(JedisPool redisPool){ - this.redisPool = redisPool; - } - - public void setMessageHandler(ReceivedMessageHandler handler) { - this.handler = handler; - } - - private class PubSubListener extends JedisPubSub { - - public PubSubListener() { - super(); - } - - @Override - public void onMessage(String channel, String message) { - // Not used. - } - - @Override - public void onPMessage(String pattern, String channel, String message) { - handler.handleMessage(pattern, channel, message); - } - - @Override - public void onPSubscribe(String pattern, int subscribedChannels) { - log.debug("Subscribed to the pattern: " + pattern); - } - - @Override - public void onPUnsubscribe(String pattern, int subscribedChannels) { - // Not used. - } - - @Override - public void onSubscribe(String channel, int subscribedChannels) { - // Not used. - } - - @Override - public void onUnsubscribe(String channel, int subscribedChannels) { - // Not used. - } - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageSender.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageSender.java deleted file mode 100755 index 93229c8c05..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageSender.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.bigbluebutton.freeswitch.pubsub.redis; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; - -public class MessageSender { - private static Logger log = Red5LoggerFactory.getLogger(MessageSender.class, "bigbluebutton"); - - private JedisPool redisPool; - private volatile boolean sendMessage = false; - - private final Executor msgSenderExec = Executors.newSingleThreadExecutor(); - private final Executor runExec = Executors.newSingleThreadExecutor(); - private BlockingQueue messages = new LinkedBlockingQueue(); - - public void stop() { - sendMessage = false; - } - - public void start() { - log.info("Redis message publisher starting!"); - try { - sendMessage = true; - - Runnable messageSender = new Runnable() { - public void run() { - while (sendMessage) { - try { - MessageToSend msg = messages.take(); - publish(msg.getChannel(), msg.getMessage()); - } catch (InterruptedException e) { - log.warn("Failed to get message from queue."); - } - } - } - }; - msgSenderExec.execute(messageSender); - } catch (Exception e) { - log.error("Error subscribing to channels: " + e.getMessage()); - } - } - - public void send(String channel, String message) { - MessageToSend msg = new MessageToSend(channel, message); - messages.add(msg); - } - - private void publish(final String channel, final String message) { - Runnable task = new Runnable() { - public void run() { - Jedis jedis = redisPool.getResource(); - try { - jedis.publish(channel, message); - } catch(Exception e){ - log.warn("Cannot publish the message to redis", e); - } finally { - redisPool.returnResource(jedis); - } - } - }; - - runExec.execute(task); - } - - public void setRedisPool(JedisPool redisPool){ - this.redisPool = redisPool; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageToSend.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageToSend.java deleted file mode 100755 index eae5c116ed..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/MessageToSend.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.bigbluebutton.freeswitch.pubsub.redis; - -public class MessageToSend { - private final String channel; - private final String message; - - public MessageToSend(String channel, String message) { - this.channel = channel; - this.message = message; - } - - public String getChannel() { - return channel; - } - - public String getMessage() { - return message; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/ReceivedMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/ReceivedMessage.java deleted file mode 100755 index 77b92d7ffc..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/ReceivedMessage.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.bigbluebutton.freeswitch.pubsub.redis; - -public class ReceivedMessage { - - private final String pattern; - private final String channel; - private final String message; - - public ReceivedMessage(String pattern, String channel, String message) { - this.pattern = pattern; - this.channel = channel; - this.message = message; - } - - public String getPattern() { - return pattern; - } - - public String getChannel() { - return channel; - } - - public String getMessage() { - return message; - } - - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/ReceivedMessageHandler.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/ReceivedMessageHandler.java deleted file mode 100755 index 1f3849bb2f..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/ReceivedMessageHandler.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.bigbluebutton.freeswitch.pubsub.redis; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; - -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class ReceivedMessageHandler { - private static Logger log = Red5LoggerFactory.getLogger(ReceivedMessageHandler.class, "bigbluebutton"); - - private BlockingQueue receivedMessages = new LinkedBlockingQueue(); - - private volatile boolean processMessage = false; - - private final Executor msgProcessorExec = Executors.newSingleThreadExecutor(); - private final Executor runExec = Executors.newSingleThreadExecutor(); - - private MessageDistributor handler; - - public void stop() { - processMessage = false; - } - - public void start() { - log.info("Ready to handle messages from Redis pubsub!"); - - try { - processMessage = true; - - Runnable messageProcessor = new Runnable() { - public void run() { - while (processMessage) { - try { - ReceivedMessage msg = receivedMessages.take(); - processMessage(msg); - } catch (InterruptedException e) { - log.warn("Error while taking received message from queue."); - } - } - } - }; - msgProcessorExec.execute(messageProcessor); - } catch (Exception e) { - log.error("Error subscribing to channels: " + e.getMessage()); - } - } - - private void processMessage(final ReceivedMessage msg) { - Runnable task = new Runnable() { - public void run() { - if (handler != null) { - handler.notifyListeners(msg.getPattern(), msg.getChannel(), msg.getMessage()); - } else { - log.info("No listeners interested in messages from Redis!"); - } - } - }; - runExec.execute(task); - } - - public void handleMessage(String pattern, String channel, String message) { - ReceivedMessage rm = new ReceivedMessage(pattern, channel, message); - receivedMessages.add(rm); - } - - public void setMessageDistributor(MessageDistributor h) { - this.handler = h; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/RedisPubSubMessageHandler.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/RedisPubSubMessageHandler.java deleted file mode 100755 index a85000f997..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/freeswitch/pubsub/redis/RedisPubSubMessageHandler.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.bigbluebutton.freeswitch.pubsub.redis; - -import org.bigbluebutton.common.messages.MessagingConstants; -import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService; -import org.bigbluebutton.red5.client.MeetingClientMessageSender; -import org.bigbluebutton.red5.client.PresentationClientMessageSender; -import org.bigbluebutton.red5.client.UserClientMessageSender; -import org.bigbluebutton.red5.client.ChatClientMessageSender; -import org.bigbluebutton.red5.client.WhiteboardClientMessageSender; - -public class RedisPubSubMessageHandler implements MessageHandler { - - private ConnectionInvokerService service; - private UserClientMessageSender userMessageSender; - private MeetingClientMessageSender meetingMessageSender; - private ChatClientMessageSender chatMessageSender; - private PresentationClientMessageSender presentationMessageSender; - - private WhiteboardClientMessageSender whiteboardMessageSender; - - public void setConnectionInvokerService(ConnectionInvokerService s) { - this.service = s; - userMessageSender = new UserClientMessageSender(service); - meetingMessageSender = new MeetingClientMessageSender(service); - chatMessageSender = new ChatClientMessageSender(service); - presentationMessageSender = new PresentationClientMessageSender(service); - whiteboardMessageSender = new WhiteboardClientMessageSender(service); - } - - @Override - public void handleMessage(String pattern, String channel, String message) { - if (channel.equalsIgnoreCase(MessagingConstants.FROM_CHAT_CHANNEL)) { - chatMessageSender.handleChatMessage(message); - } else if (channel.equalsIgnoreCase(MessagingConstants.FROM_PRESENTATION_CHANNEL)) { - presentationMessageSender.handlePresentationMessage(message); - } else if (channel.equalsIgnoreCase(MessagingConstants.FROM_MEETING_CHANNEL)) { - meetingMessageSender.handleMeetingMessage(message); - } else if (channel.equalsIgnoreCase(MessagingConstants.FROM_USERS_CHANNEL)) { - userMessageSender.handleUsersMessage(message); - } else if (channel.equalsIgnoreCase(MessagingConstants.FROM_WHITEBOARD_CHANNEL)) { - System.out.println("the message FROM_WHITEBOARD_CHANNEL is:"+message); - whiteboardMessageSender.handleWhiteboardMessage(message); - } - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/BigBlueButtonApplication.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/BigBlueButtonApplication.java similarity index 94% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/BigBlueButtonApplication.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/BigBlueButtonApplication.java index 552a7ae821..eb4471e18b 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/BigBlueButtonApplication.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/BigBlueButtonApplication.java @@ -16,16 +16,15 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference; +package org.bigbluebutton.red5; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; -import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService; -import org.bigbluebutton.conference.service.recorder.RecorderApplication; import org.bigbluebutton.core.api.IBigBlueButtonInGW; +import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.red5.logging.Red5LoggerFactory; import org.red5.server.adapter.IApplication; import org.red5.server.adapter.MultiThreadedApplicationAdapter; @@ -40,7 +39,6 @@ import com.google.gson.Gson; public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter { private static Logger log = Red5LoggerFactory.getLogger(BigBlueButtonApplication.class, "bigbluebutton"); - private RecorderApplication recorderApplication; private ConnectionInvokerService connInvokerService; private IBigBlueButtonInGW red5InGW; @@ -96,7 +94,6 @@ public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter { @Override public void roomStop(IScope room) { - recorderApplication.destroyRecordSession(room.getName()); super.roomStop(room); } @@ -126,11 +123,7 @@ public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter { lsMap = new HashMap(); } } - - if (record == true) { - recorderApplication.createRecordSession(room); - } - + String userId = internalUserID; String sessionId = CONN + userId; BigBlueButtonSession bbbSession = new BigBlueButtonSession(room, internalUserID, username, role, @@ -253,11 +246,7 @@ public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter { log.info("User validate token bbb-apps: data={}", logStr); red5InGW.validateAuthToken(meetingId, userId, token, meetingId + "/" + userId, sessionId); } - - public void setRecorderApplication(RecorderApplication a) { - recorderApplication = a; - } - + public void setApplicationListeners(Set listeners) { Iterator iter = listeners.iterator(); while (iter.hasNext()) { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/BigBlueButtonSession.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/BigBlueButtonSession.java similarity index 98% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/BigBlueButtonSession.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/BigBlueButtonSession.java index 74a1c969e5..0d4de10fa1 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/BigBlueButtonSession.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/BigBlueButtonSession.java @@ -17,7 +17,7 @@ * */ -package org.bigbluebutton.conference; +package org.bigbluebutton.red5; public class BigBlueButtonSession { private final String username; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/Constants.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/Constants.java similarity index 96% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/Constants.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/Constants.java index 3b2d4cfb33..f1f74d195f 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/Constants.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/Constants.java @@ -17,7 +17,7 @@ * */ -package org.bigbluebutton.conference; +package org.bigbluebutton.red5; public class Constants{ diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/ChatClientMessageSender.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/ChatClientMessageSender.java index fea3d5f820..8f84100418 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/ChatClientMessageSender.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/ChatClientMessageSender.java @@ -6,9 +6,9 @@ import java.util.Map; import org.bigbluebutton.common.messages.GetChatHistoryReplyMessage; import org.bigbluebutton.common.messages.SendPrivateChatMessage; import org.bigbluebutton.common.messages.SendPublicChatMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.BroadcastClientMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService; -import org.bigbluebutton.conference.service.chat.ChatKeyUtil; +import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; +import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; +import org.bigbluebutton.red5.service.ChatKeyUtil; import com.google.gson.Gson; import com.google.gson.JsonObject; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/MeetingClientMessageSender.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/MeetingClientMessageSender.java index e8adc188bd..55f6e70f6f 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/MeetingClientMessageSender.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/MeetingClientMessageSender.java @@ -12,11 +12,11 @@ import org.bigbluebutton.common.messages.MeetingMutedMessage; import org.bigbluebutton.common.messages.MeetingStateMessage; import org.bigbluebutton.common.messages.NewPermissionsSettingMessage; import org.bigbluebutton.common.messages.UserLockedMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.BroadcastClientMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService; -import org.bigbluebutton.conference.meeting.messaging.red5.DirectClientMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.DisconnectAllClientsMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.DisconnectClientMessage; +import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; +import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; +import org.bigbluebutton.red5.client.messaging.DirectClientMessage; +import org.bigbluebutton.red5.client.messaging.DisconnectAllClientsMessage; +import org.bigbluebutton.red5.client.messaging.DisconnectClientMessage; import com.google.gson.Gson; import com.google.gson.JsonObject; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/PresentationClientMessageSender.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/PresentationClientMessageSender.java index 46afc22be0..91ea7d08b7 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/PresentationClientMessageSender.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/PresentationClientMessageSender.java @@ -6,9 +6,9 @@ import java.util.Map; import org.bigbluebutton.common.messages.GetPresentationInfoReplyMessage; import org.bigbluebutton.common.messages.GoToSlideMessage; import org.bigbluebutton.common.messages.PresentationRemovedMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.BroadcastClientMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService; -import org.bigbluebutton.conference.meeting.messaging.red5.DirectClientMessage; +import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; +import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; +import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import com.google.gson.Gson; import com.google.gson.JsonObject; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/UserClientMessageSender.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/UserClientMessageSender.java index 8dc0b454b7..7b39c615e0 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/UserClientMessageSender.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/UserClientMessageSender.java @@ -25,9 +25,9 @@ import org.bigbluebutton.common.messages.UserVoiceMutedMessage; import org.bigbluebutton.common.messages.UserVoiceTalkingMessage; import org.bigbluebutton.common.messages.ValidateAuthTokenReplyMessage; import org.bigbluebutton.common.messages.ValidateAuthTokenTimeoutMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.BroadcastClientMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService; -import org.bigbluebutton.conference.meeting.messaging.red5.DirectClientMessage; +import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; +import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; +import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import com.google.gson.Gson; import com.google.gson.JsonObject; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/WhiteboardClientMessageSender.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/WhiteboardClientMessageSender.java index 878fe13c52..d683e21211 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/WhiteboardClientMessageSender.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/WhiteboardClientMessageSender.java @@ -9,9 +9,9 @@ import org.bigbluebutton.common.messages.GetWhiteboardShapesReplyMessage; import org.bigbluebutton.common.messages.IsWhiteboardEnabledReplyMessage; import org.bigbluebutton.common.messages.SendWhiteboardAnnotationReplyMessage; import org.bigbluebutton.common.messages.UndoWhiteboardReplyMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.BroadcastClientMessage; -import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService; -import org.bigbluebutton.conference.meeting.messaging.red5.DirectClientMessage; +import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; +import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; +import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import com.google.gson.Gson; import com.google.gson.JsonObject; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/BroadcastClientMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/BroadcastClientMessage.java similarity index 92% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/BroadcastClientMessage.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/BroadcastClientMessage.java index ce005c2fed..aeeafc6484 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/BroadcastClientMessage.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/BroadcastClientMessage.java @@ -16,7 +16,7 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.meeting.messaging.red5; +package org.bigbluebutton.red5.client.messaging; import java.util.Map; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/ClientMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/ClientMessage.java similarity index 91% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/ClientMessage.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/ClientMessage.java index 5194eca8d4..627712d50b 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/ClientMessage.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/ClientMessage.java @@ -16,7 +16,7 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.meeting.messaging.red5; +package org.bigbluebutton.red5.client.messaging; public interface ClientMessage { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/ConnectionInvokerService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/ConnectionInvokerService.java similarity index 96% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/ConnectionInvokerService.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/ConnectionInvokerService.java index 9988ef9e79..9b9a57fdd6 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/ConnectionInvokerService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/ConnectionInvokerService.java @@ -16,7 +16,7 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.meeting.messaging.red5; +package org.bigbluebutton.red5.client.messaging; import java.util.Set; import java.util.ArrayList; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/DirectClientMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/DirectClientMessage.java similarity index 93% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/DirectClientMessage.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/DirectClientMessage.java index 3edf12c747..88aa33796e 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/DirectClientMessage.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/DirectClientMessage.java @@ -16,7 +16,7 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.meeting.messaging.red5; +package org.bigbluebutton.red5.client.messaging; import java.util.Map; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/DisconnectAllClientsMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/DisconnectAllClientsMessage.java similarity index 77% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/DisconnectAllClientsMessage.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/DisconnectAllClientsMessage.java index c9dd6aee65..ddedc077c5 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/DisconnectAllClientsMessage.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/DisconnectAllClientsMessage.java @@ -1,4 +1,4 @@ -package org.bigbluebutton.conference.meeting.messaging.red5; +package org.bigbluebutton.red5.client.messaging; public class DisconnectAllClientsMessage implements ClientMessage { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/DisconnectClientMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/DisconnectClientMessage.java similarity index 81% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/DisconnectClientMessage.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/DisconnectClientMessage.java index a43468f025..f0a9ba73ff 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/DisconnectClientMessage.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/DisconnectClientMessage.java @@ -1,4 +1,4 @@ -package org.bigbluebutton.conference.meeting.messaging.red5; +package org.bigbluebutton.red5.client.messaging; public class DisconnectClientMessage implements ClientMessage { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/SharedObjectClientMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/SharedObjectClientMessage.java similarity index 93% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/SharedObjectClientMessage.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/SharedObjectClientMessage.java index 33abc80a67..7c4c4471d1 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/meeting/messaging/red5/SharedObjectClientMessage.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/client/messaging/SharedObjectClientMessage.java @@ -16,7 +16,7 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.meeting.messaging.red5; +package org.bigbluebutton.red5.client.messaging; import java.util.ArrayList; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/GenericObjectPoolConfigWrapper.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/pubsub/redis/GenericObjectPoolConfigWrapper.java similarity index 95% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/GenericObjectPoolConfigWrapper.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/pubsub/redis/GenericObjectPoolConfigWrapper.java index 416b341293..0fc77788e9 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/GenericObjectPoolConfigWrapper.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/pubsub/redis/GenericObjectPoolConfigWrapper.java @@ -16,7 +16,7 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.service.recorder; +package org.bigbluebutton.red5.pubsub.redis; import org.apache.commons.pool.impl.GenericObjectPool; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/pubsub/redis/RedisPubSubMessageHandler.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/pubsub/redis/RedisPubSubMessageHandler.java index 819dc05cbd..540002dc1d 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/pubsub/redis/RedisPubSubMessageHandler.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/pubsub/redis/RedisPubSubMessageHandler.java @@ -1,12 +1,12 @@ package org.bigbluebutton.red5.pubsub.redis; import org.bigbluebutton.common.messages.MessagingConstants; -import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService; import org.bigbluebutton.red5.client.MeetingClientMessageSender; import org.bigbluebutton.red5.client.PresentationClientMessageSender; import org.bigbluebutton.red5.client.UserClientMessageSender; import org.bigbluebutton.red5.client.ChatClientMessageSender; import org.bigbluebutton.red5.client.WhiteboardClientMessageSender; +import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; public class RedisPubSubMessageHandler implements MessageHandler { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatKeyUtil.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/ChatKeyUtil.java similarity index 89% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatKeyUtil.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/ChatKeyUtil.java index babdde091d..f8124cb30d 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatKeyUtil.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/ChatKeyUtil.java @@ -1,4 +1,4 @@ -package org.bigbluebutton.conference.service.chat; +package org.bigbluebutton.red5.service; public class ChatKeyUtil { public static final String CHAT_TYPE = "chatType"; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/ChatService.java similarity index 96% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatService.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/ChatService.java index a058aa04e7..da1b7c907a 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/ChatService.java @@ -16,15 +16,15 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.service.chat; +package org.bigbluebutton.red5.service; import java.util.HashMap; import java.util.Map; import org.slf4j.Logger; -import org.bigbluebutton.conference.BigBlueButtonSession; -import org.bigbluebutton.conference.Constants; import org.bigbluebutton.core.api.Red5BBBInGw; +import org.bigbluebutton.red5.BigBlueButtonSession; +import org.bigbluebutton.red5.Constants; import org.red5.logging.Red5LoggerFactory; import org.red5.server.api.Red5; public class ChatService { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/layout/LayoutService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/LayoutService.java similarity index 94% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/layout/LayoutService.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/LayoutService.java index 8df3bcbb80..834ee1655e 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/layout/LayoutService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/LayoutService.java @@ -16,13 +16,13 @@ * with BigBlueButton; if not, see . * Author: Felipe Cecagno */ -package org.bigbluebutton.conference.service.layout; +package org.bigbluebutton.red5.service; import java.util.Map; -import org.bigbluebutton.conference.BigBlueButtonSession; -import org.bigbluebutton.conference.Constants; import org.bigbluebutton.core.api.IBigBlueButtonInGW; +import org.bigbluebutton.red5.BigBlueButtonSession; +import org.bigbluebutton.red5.Constants; import org.red5.logging.Red5LoggerFactory; import org.red5.server.api.Red5; import org.slf4j.Logger; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/lock/LockService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/LockService.java similarity index 95% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/lock/LockService.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/LockService.java index 2520dd4abd..d15f5c372c 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/lock/LockService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/LockService.java @@ -16,14 +16,14 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.service.lock; +package org.bigbluebutton.red5.service; import java.util.ArrayList; import java.util.Map; -import org.bigbluebutton.conference.BigBlueButtonSession; -import org.bigbluebutton.conference.Constants; import org.bigbluebutton.core.api.Red5BBBInGw; +import org.bigbluebutton.red5.BigBlueButtonSession; +import org.bigbluebutton.red5.Constants; import org.red5.logging.Red5LoggerFactory; import org.red5.server.api.Red5; import org.slf4j.Logger; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/ParticipantsService.java similarity index 96% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsService.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/ParticipantsService.java index 7b19022ac1..3cdf879387 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/ParticipantsService.java @@ -17,7 +17,7 @@ * */ -package org.bigbluebutton.conference.service.participants; +package org.bigbluebutton.red5.service; import org.slf4j.Logger; import org.red5.logging.Red5LoggerFactory; @@ -26,9 +26,9 @@ import org.red5.server.api.scope.IScope; import java.util.Map; -import org.bigbluebutton.conference.BigBlueButtonSession; -import org.bigbluebutton.conference.Constants; import org.bigbluebutton.core.api.IBigBlueButtonInGW; +import org.bigbluebutton.red5.BigBlueButtonSession; +import org.bigbluebutton.red5.Constants; public class ParticipantsService { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/PresentationApplication.java similarity index 98% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/PresentationApplication.java index 64f6bb52be..11ec53b980 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/PresentationApplication.java @@ -16,7 +16,7 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.service.presentation; +package org.bigbluebutton.red5.service; import org.slf4j.Logger; import org.bigbluebutton.core.api.Red5BBBInGw; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/PresentationService.java similarity index 96% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationService.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/PresentationService.java index 0873b641ed..5a3aca7cb9 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/PresentationService.java @@ -16,7 +16,7 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.service.presentation; +package org.bigbluebutton.red5.service; import java.util.Map; @@ -24,8 +24,8 @@ import org.slf4j.Logger; import org.red5.logging.Red5LoggerFactory; import org.red5.server.api.Red5; import org.red5.server.api.scope.IScope; -import org.bigbluebutton.conference.BigBlueButtonSession; -import org.bigbluebutton.conference.Constants; +import org.bigbluebutton.red5.BigBlueButtonSession; +import org.bigbluebutton.red5.Constants; public class PresentationService { private static Logger log = Red5LoggerFactory.getLogger( PresentationService.class, "bigbluebutton" ); diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceKeyUtil.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/VoiceKeyUtil.java old mode 100644 new mode 100755 similarity index 69% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceKeyUtil.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/VoiceKeyUtil.java index 9bc1fd75bc..f0f60a24bd --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceKeyUtil.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/VoiceKeyUtil.java @@ -1,4 +1,4 @@ -package org.bigbluebutton.conference.service.voice; +package org.bigbluebutton.red5.service; public class VoiceKeyUtil { public static final String MUTE = "mute"; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/VoiceService.java similarity index 95% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/VoiceService.java index aac38a1697..7e0842903a 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/voice/VoiceService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/VoiceService.java @@ -16,12 +16,12 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.service.voice; +package org.bigbluebutton.red5.service; import java.util.Map; -import org.bigbluebutton.conference.BigBlueButtonSession; -import org.bigbluebutton.conference.Constants; import org.bigbluebutton.core.api.IBigBlueButtonInGW; +import org.bigbluebutton.red5.BigBlueButtonSession; +import org.bigbluebutton.red5.Constants; import org.red5.logging.Red5LoggerFactory; import org.red5.server.api.Red5; import org.slf4j.Logger; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardApplication.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/WhiteboardApplication.java similarity index 95% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardApplication.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/WhiteboardApplication.java index 5020a228c7..f93f4d6634 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardApplication.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/WhiteboardApplication.java @@ -16,7 +16,7 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.service.whiteboard; +package org.bigbluebutton.red5.service; import org.red5.logging.Red5LoggerFactory; import org.red5.server.adapter.IApplication; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardKeyUtil.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/WhiteboardKeyUtil.java similarity index 88% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardKeyUtil.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/WhiteboardKeyUtil.java index 7d635ba285..e80cb0efa4 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardKeyUtil.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/WhiteboardKeyUtil.java @@ -1,4 +1,4 @@ -package org.bigbluebutton.conference.service.whiteboard; +package org.bigbluebutton.red5.service; public class WhiteboardKeyUtil { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/WhiteboardService.java similarity index 93% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardService.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/WhiteboardService.java index 25ef5a82d5..f54fdcea84 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/red5/service/WhiteboardService.java @@ -16,12 +16,12 @@ * with BigBlueButton; if not, see . * */ -package org.bigbluebutton.conference.service.whiteboard; +package org.bigbluebutton.red5.service; import java.util.Map; -import org.bigbluebutton.conference.BigBlueButtonSession; -import org.bigbluebutton.conference.Constants; +import org.bigbluebutton.red5.BigBlueButtonSession; +import org.bigbluebutton.red5.Constants; import org.red5.logging.Red5LoggerFactory; import org.red5.server.api.Red5; import org.slf4j.Logger; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/service/recording/RecordMessage.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/service/recording/RecordMessage.java deleted file mode 100755 index e8bf93bee4..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/service/recording/RecordMessage.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.bigbluebutton.service.recording; - -public class RecordMessage { - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/service/recording/RedisListRecorder.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/service/recording/RedisListRecorder.java deleted file mode 100644 index bead66f1fc..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/service/recording/RedisListRecorder.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.bigbluebutton.service.recording; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; - -import org.bigbluebutton.conference.service.recorder.RecordEvent; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -import com.google.gson.Gson; - -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; - -public class RedisListRecorder { - private static Logger log = Red5LoggerFactory.getLogger(RedisListRecorder.class, "bigbluebutton"); - private static final int NTHREADS = 1; - private static final Executor exec = Executors.newFixedThreadPool(NTHREADS); - private static final Executor runExec = Executors.newFixedThreadPool(NTHREADS); - private BlockingQueue messages = new LinkedBlockingQueue(); - private volatile boolean recordEvents = false; - - JedisPool redisPool; - - public void start() { - recordEvents = true; - Runnable sender = new Runnable() { - public void run() { - while (recordEvents) { - RecordEvent message; - try { - message = messages.take(); - recordEvent(message); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - } - }; - exec.execute(sender); - } - - public void stop() { - recordEvents = false; - } - - private void recordEvent(final RecordEvent message) { - Runnable task = new Runnable() { - public void run() { - Jedis jedis = redisPool.getResource(); - try { - String key = "bbb:recording:" + message.getMeetingID(); - Gson gson= new Gson(); - jedis.rpush(key, gson.toJson(message.toMap())); - } finally { - redisPool.returnResource(jedis); - } - } - }; - runExec.execute(task); - } - - public void record(RecordEvent message) { - messages.offer(message); - } - - public JedisPool getRedisPool() { - return redisPool; - } - - public void setRedisPool(JedisPool redisPool) { - this.redisPool = redisPool; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/AbstractVoiceRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/AbstractVoiceRecordEvent.java deleted file mode 100755 index 9f03321ce0..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/AbstractVoiceRecordEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -import org.bigbluebutton.conference.service.recorder.RecordEvent; - -public abstract class AbstractVoiceRecordEvent extends RecordEvent { - - public AbstractVoiceRecordEvent() { - setModule("VOICE"); - } - - public void setBridge(String bridge) { - eventMap.put("bridge", bridge); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ConferenceServerListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ConferenceServerListener.java deleted file mode 100755 index 1e4616ef56..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ConferenceServerListener.java +++ /dev/null @@ -1,26 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -public interface ConferenceServerListener { - public void joined(String room, Integer participant, String name, Boolean muted, Boolean talking); - public void left(String room, Integer participant); - public void muted(String room, Integer participant, Boolean muted); - public void talking(String room, Integer participant, Boolean talking); -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ConferenceServiceProvider.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ConferenceServiceProvider.java deleted file mode 100755 index ffebb366ee..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ConferenceServiceProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -public interface ConferenceServiceProvider { - public void populateRoom(String room); - public void mute(String room, String participant, Boolean mute); - public void eject(String room, String participant); - public void ejectAll(String room); - public void record(String room, String meetingid); - public void broadcast(String room, String meetingid); -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/FreeswitchConferenceEventListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/FreeswitchConferenceEventListener.java deleted file mode 100644 index f24a4de2e5..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/FreeswitchConferenceEventListener.java +++ /dev/null @@ -1,115 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; -import org.bigbluebutton.webconference.voice.events.VoiceConferenceEvent; -import org.bigbluebutton.webconference.voice.events.ConferenceEventListener; -import org.bigbluebutton.webconference.voice.events.VoiceUserJoinedEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserLeftEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserMutedEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserTalkingEvent; -import org.bigbluebutton.webconference.voice.events.VoiceStartRecordingEvent; - -public class FreeswitchConferenceEventListener implements ConferenceEventListener { - private static final int SENDERTHREADS = 1; - private static final Executor msgSenderExec = Executors.newFixedThreadPool(SENDERTHREADS); - private static final Executor runExec = Executors.newFixedThreadPool(SENDERTHREADS); - private BlockingQueue messages = new LinkedBlockingQueue(); - - private volatile boolean sendMessages = false; - private IVoiceConferenceService vcs; - - public void setVoiceConferenceService(IVoiceConferenceService vcs) { - this.vcs = vcs; - } - - private void queueMessage(VoiceConferenceEvent event) { - try { - messages.offer(event, 5, TimeUnit.SECONDS); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - private void sendMessageToBigBlueButton(final VoiceConferenceEvent event) { - Runnable task = new Runnable() { - public void run() { - if (event instanceof VoiceUserJoinedEvent) { - System.out.println("************** FreeswitchConferenceEventListener received voiceUserJoined "); - VoiceUserJoinedEvent evt = (VoiceUserJoinedEvent) event; - vcs.voiceUserJoined(evt.getVoiceUserId(), evt.getUserId(), evt.getRoom(), - evt.getCallerIdNum(), evt.getCallerIdName(), - evt.getMuted(), evt.getSpeaking()); - } else if (event instanceof VoiceUserLeftEvent) { - System.out.println("************** FreeswitchConferenceEventListener received VoiceUserLeftEvent "); - VoiceUserLeftEvent evt = (VoiceUserLeftEvent) event; - vcs.voiceUserLeft(evt.getUserId(), evt.getRoom()); - } else if (event instanceof VoiceUserMutedEvent) { - System.out.println("************** FreeswitchConferenceEventListener VoiceUserMutedEvent "); - VoiceUserMutedEvent evt = (VoiceUserMutedEvent) event; - vcs.voiceUserMuted(evt.getUserId(), evt.getRoom(), evt.isMuted()); - } else if (event instanceof VoiceUserTalkingEvent) { - System.out.println("************** FreeswitchConferenceEventListener VoiceUserTalkingEvent "); - VoiceUserTalkingEvent evt = (VoiceUserTalkingEvent) event; - vcs.voiceUserTalking(evt.getUserId(), evt.getRoom(), evt.isTalking()); - } else if (event instanceof VoiceStartRecordingEvent) { - VoiceStartRecordingEvent evt = (VoiceStartRecordingEvent) event; - System.out.println("************** FreeswitchConferenceEventListener VoiceStartRecordingEvent recording=[" + evt.startRecord() + "]"); - vcs.voiceStartedRecording(evt.getRoom(), evt.getRecordingFilename(), evt.getTimestamp(), evt.startRecord()); - } - } - }; - - runExec.execute(task); - } - - public void start() { - sendMessages = true; - Runnable sender = new Runnable() { - public void run() { - while (sendMessages) { - VoiceConferenceEvent message; - try { - message = messages.take(); - sendMessageToBigBlueButton(message); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - }; - msgSenderExec.execute(sender); - } - - public void stop() { - sendMessages = false; - } - - public void handleConferenceEvent(VoiceConferenceEvent event) { - queueMessage(event); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/IVoiceConferenceService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/IVoiceConferenceService.java deleted file mode 100755 index f26f38b458..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/IVoiceConferenceService.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.bigbluebutton.webconference.voice; - -public interface IVoiceConferenceService { - void voiceUserJoined(String userId, String webUserId, String conference, - String callerIdNum, String callerIdName, - Boolean muted, Boolean speaking); - void voiceUserLeft(String meetingId, String userId); - void voiceUserLocked(String meetingId, String userId, Boolean locked); - void voiceUserMuted(String meetingId, String userId, Boolean muted); - void voiceUserTalking(String meetingId, String userId, Boolean talking); - void voiceStartedRecording(String conference, String recordingFile, - String timestamp, Boolean recording); -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantJoinedVoiceRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantJoinedVoiceRecordEvent.java deleted file mode 100755 index 7417a522af..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantJoinedVoiceRecordEvent.java +++ /dev/null @@ -1,51 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -public class ParticipantJoinedVoiceRecordEvent extends AbstractVoiceRecordEvent { - - public ParticipantJoinedVoiceRecordEvent() { - super(); - setEvent("ParticipantJoinedEvent"); - } - - public void setParticipant(String p) { - eventMap.put("participant", p); - } - - public void setCallerName(String name) { - eventMap.put("callername", name); - } - - public void setCallerNumber(String name) { - eventMap.put("callernumber", name); - } - - public void setMuted(boolean muted) { - eventMap.put("muted", Boolean.toString(muted)); - } - - public void setTalking(boolean talking) { - eventMap.put("talking", Boolean.toString(talking)); - } - - public void setLocked(boolean locked) { - eventMap.put("locked", Boolean.toString(locked)); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantLeftVoiceRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantLeftVoiceRecordEvent.java deleted file mode 100755 index 0b3bfaa25c..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantLeftVoiceRecordEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -public class ParticipantLeftVoiceRecordEvent extends AbstractVoiceRecordEvent { - - public ParticipantLeftVoiceRecordEvent() { - super(); - setEvent("ParticipantLeftEvent"); - } - - public void setParticipant(String p) { - eventMap.put("participant", p); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantLockedVoiceRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantLockedVoiceRecordEvent.java deleted file mode 100755 index ff7be6cbd5..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantLockedVoiceRecordEvent.java +++ /dev/null @@ -1,35 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -public class ParticipantLockedVoiceRecordEvent extends AbstractVoiceRecordEvent { - - public ParticipantLockedVoiceRecordEvent() { - super(); - setEvent("ParticipantLockedEvent"); - } - - public void setParticipant(String p) { - eventMap.put("participant", p); - } - - public void setLocked(boolean locked) { - eventMap.put("locked", Boolean.toString(locked)); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantMutedVoiceRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantMutedVoiceRecordEvent.java deleted file mode 100755 index eb23d6bc70..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantMutedVoiceRecordEvent.java +++ /dev/null @@ -1,35 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -public class ParticipantMutedVoiceRecordEvent extends AbstractVoiceRecordEvent { - - public ParticipantMutedVoiceRecordEvent() { - super(); - setEvent("ParticipantMutedEvent"); - } - - public void setParticipant(String p) { - eventMap.put("participant", p); - } - - public void setMuted(boolean muted) { - eventMap.put("muted", Boolean.toString(muted)); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantTalkingVoiceRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantTalkingVoiceRecordEvent.java deleted file mode 100755 index e0b2814349..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/ParticipantTalkingVoiceRecordEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -public class ParticipantTalkingVoiceRecordEvent extends AbstractVoiceRecordEvent { - - public ParticipantTalkingVoiceRecordEvent() { - super(); - setEvent("ParticipantTalkingEvent"); - } - - public void setParticipant(String p) { - eventMap.put("participant", p); - } - - public void setTalking(boolean talking) { - eventMap.put("talking", Boolean.toString(talking)); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/StartRecordingVoiceRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/StartRecordingVoiceRecordEvent.java deleted file mode 100755 index 7c46b0f0bf..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/StartRecordingVoiceRecordEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -public class StartRecordingVoiceRecordEvent extends AbstractVoiceRecordEvent { - - public StartRecordingVoiceRecordEvent(boolean record) { - super(); - if (record) - setEvent("StartRecordingEvent"); - else - setEvent("StopRecordingEvent"); - } - - public void setRecordingTimestamp(String timestamp) { - eventMap.put("recordingTimestamp", timestamp); - } - - public void setFilename(String filename) { - eventMap.put("filename", filename); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/VoiceEventRecorder.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/VoiceEventRecorder.java deleted file mode 100644 index 4eb041e569..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/VoiceEventRecorder.java +++ /dev/null @@ -1,144 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice; - -import java.util.concurrent.TimeUnit; - -import org.bigbluebutton.conference.service.recorder.RecorderApplication; -import org.bigbluebutton.webconference.voice.events.VoiceConferenceEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserJoinedEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserLeftEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserLockedEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserMutedEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserTalkingEvent; -import org.bigbluebutton.webconference.voice.events.VoiceStartRecordingEvent; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class VoiceEventRecorder { - private static final Logger log = Red5LoggerFactory.getLogger(VoiceEventRecorder.class, "bigbluebutton"); - - private RecorderApplication recorder; - - private Long genTimestamp() { - return TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - } - - public void recordConferenceEvent(VoiceConferenceEvent event, String room) { - if (event instanceof VoiceUserJoinedEvent) { - recordParticipantJoinedEvent(event, room); - } else if (event instanceof VoiceUserLeftEvent) { - recordParticipantLeftEvent(event, room); - } else if (event instanceof VoiceUserMutedEvent) { - recordParticipantMutedEvent(event, room); - } else if (event instanceof VoiceUserTalkingEvent) { - recordParticipantTalkingEvent(event, room); - } else if (event instanceof VoiceUserLockedEvent) { - recordParticipantLockedEvent(event, room); - } else if (event instanceof VoiceStartRecordingEvent) { - recordStartRecordingEvent(event, room); - } else { - log.debug("Processing UnknownEvent " + event.getClass().getName() + " for room: " + event.getRoom() ); - } - } - - private void recordStartRecordingEvent(VoiceConferenceEvent event, String room) { - VoiceStartRecordingEvent sre = (VoiceStartRecordingEvent) event; - StartRecordingVoiceRecordEvent evt = new StartRecordingVoiceRecordEvent(sre.startRecord()); - evt.setMeetingId(room); - evt.setTimestamp(genTimestamp()); - evt.setBridge(event.getRoom()); - evt.setRecordingTimestamp(sre.getTimestamp()); - evt.setFilename(sre.getRecordingFilename()); - System.out.println("*** Recording voice " + sre.startRecord() + " timestamp: " + evt.toMap().get("recordingTimestamp") + " file: " + evt.toMap().get("filename")); - recorder.record(room, evt); - } - - private void recordParticipantJoinedEvent(VoiceConferenceEvent event, String room) { - VoiceUserJoinedEvent pje = (VoiceUserJoinedEvent) event; - - ParticipantJoinedVoiceRecordEvent evt = new ParticipantJoinedVoiceRecordEvent(); - evt.setMeetingId(room); - evt.setTimestamp(genTimestamp()); - evt.setBridge(event.getRoom()); - evt.setParticipant(pje.getUserId().toString()); - evt.setCallerName(pje.getCallerIdName()); - evt.setCallerNumber(pje.getCallerIdName()); - evt.setMuted(pje.getMuted()); - evt.setTalking(pje.getSpeaking()); - - recorder.record(room, evt); - } - - private void recordParticipantLeftEvent(VoiceConferenceEvent event, String room) { - - ParticipantLeftVoiceRecordEvent evt = new ParticipantLeftVoiceRecordEvent(); - evt.setMeetingId(room); - evt.setTimestamp(genTimestamp()); - evt.setBridge(event.getRoom()); - - - evt.setParticipant(((VoiceUserLeftEvent)event).getUserId().toString()); - - recorder.record(room, evt); - } - - private void recordParticipantMutedEvent(VoiceConferenceEvent event, String room) { - VoiceUserMutedEvent pme = (VoiceUserMutedEvent) event; - - ParticipantMutedVoiceRecordEvent evt = new ParticipantMutedVoiceRecordEvent(); - evt.setMeetingId(room); - evt.setTimestamp(genTimestamp()); - evt.setBridge(event.getRoom()); - evt.setParticipant(((VoiceUserMutedEvent)event).getUserId().toString()); - evt.setMuted(pme.isMuted()); - - recorder.record(room, evt); - } - - private void recordParticipantTalkingEvent(VoiceConferenceEvent event, String room) { - VoiceUserTalkingEvent pte = (VoiceUserTalkingEvent) event; - - ParticipantTalkingVoiceRecordEvent evt = new ParticipantTalkingVoiceRecordEvent(); - evt.setMeetingId(room); - evt.setTimestamp(genTimestamp()); - evt.setBridge(event.getRoom()); - evt.setParticipant(((VoiceUserTalkingEvent)event).getUserId().toString()); - evt.setTalking(pte.isTalking()); - - recorder.record(room, evt); - } - - private void recordParticipantLockedEvent(VoiceConferenceEvent event, String room) { - VoiceUserLockedEvent ple = (VoiceUserLockedEvent) event; - - ParticipantLockedVoiceRecordEvent evt = new ParticipantLockedVoiceRecordEvent(); - evt.setMeetingId(room); - evt.setTimestamp(genTimestamp()); - evt.setBridge(event.getRoom()); - evt.setParticipant(((VoiceUserLockedEvent)event).getUserId().toString()); - evt.setLocked(ple.isLocked()); - - recorder.record(room, evt); - } - - public void setRecorderApplication(RecorderApplication recorder) { - this.recorder = recorder; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/ConferenceCommand.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/ConferenceCommand.java deleted file mode 100755 index d0402213cc..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/ConferenceCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.commands; - -public abstract class ConferenceCommand { - - private final String room; - private final Integer requesterId; - - public ConferenceCommand(String room, Integer requesterId) { - this.room = room; - this.requesterId = requesterId; - } - - public String getRoom() { - return room; - } - - public Integer getRequesterId() { - return requesterId; - } - - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/ConferenceCommandResult.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/ConferenceCommandResult.java deleted file mode 100755 index e9b6c0f3be..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/ConferenceCommandResult.java +++ /dev/null @@ -1,56 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.commands; - -public class ConferenceCommandResult { - - private final String room; - private final Integer requesterId; - private boolean success = false; - private String message = ""; - - public ConferenceCommandResult(String room, Integer requesterId) { - this.room = room; - this.requesterId = requesterId; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public String getRoom() { - return room; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public Integer getRequesterId() { - return requesterId; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/EjectParticipantCommand.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/EjectParticipantCommand.java deleted file mode 100755 index 140b26a75f..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/EjectParticipantCommand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.commands; - -public class EjectParticipantCommand extends ConferenceCommand { - - private final Integer participantId; - - public EjectParticipantCommand(String room, Integer requesterId, Integer participantId) { - super(room, requesterId); - this.participantId = participantId; - } - - public Integer getParticipantId() { - return participantId; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/GetParticipantsCommand.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/GetParticipantsCommand.java deleted file mode 100755 index ff774f702d..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/GetParticipantsCommand.java +++ /dev/null @@ -1,27 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.commands; - -public class GetParticipantsCommand extends ConferenceCommand { - - public GetParticipantsCommand(String room, Integer requesterId) { - super(room, requesterId); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/MuteParticipantCommand.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/MuteParticipantCommand.java deleted file mode 100755 index 789a355cde..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/commands/MuteParticipantCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.commands; - -public class MuteParticipantCommand extends ConferenceCommand { - - private final Integer participantId; - private final boolean mute; - - public MuteParticipantCommand(String room, Integer requesterId, Integer participantId, boolean mute) { - super(room, requesterId); - this.participantId = participantId; - this.mute = mute; - } - - public Integer getParticipantId() { - return participantId; - } - - public boolean isMute() { - return mute; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ConferenceEventListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ConferenceEventListener.java deleted file mode 100755 index 15800e757d..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/ConferenceEventListener.java +++ /dev/null @@ -1,25 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.events; - - -public interface ConferenceEventListener { - public void handleConferenceEvent(VoiceConferenceEvent event); - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/UnknownConferenceEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/UnknownConferenceEvent.java deleted file mode 100755 index 735180a415..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/UnknownConferenceEvent.java +++ /dev/null @@ -1,27 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.events; - -public class UnknownConferenceEvent extends VoiceConferenceEvent { - - public UnknownConferenceEvent(String participantId, String room) { - super(room); - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceConferenceEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceConferenceEvent.java deleted file mode 100755 index d1ee12a966..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceConferenceEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.events; - -public abstract class VoiceConferenceEvent { - private final String room; - - public VoiceConferenceEvent(String room) { - this.room = room; - } - - public String getRoom() { - return room; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceStartRecordingEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceStartRecordingEvent.java deleted file mode 100755 index 0e2b8bcc90..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceStartRecordingEvent.java +++ /dev/null @@ -1,51 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.events; - -public class VoiceStartRecordingEvent extends VoiceConferenceEvent { - - private String timestamp; - private String filename; - private boolean record; - - public VoiceStartRecordingEvent(String room, boolean record) { - super(room); - this.record = record; - } - - public void setTimestamp(String timestamp) { - this.timestamp = timestamp; - } - - public void setRecordingFilename(String filename) { - this.filename = filename; - } - - public String getTimestamp() { - return timestamp; - } - - public String getRecordingFilename() { - return filename; - } - - public boolean startRecord() { - return record; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserJoinedEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserJoinedEvent.java deleted file mode 100755 index 1a721c5015..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserJoinedEvent.java +++ /dev/null @@ -1,70 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.events; - -public class VoiceUserJoinedEvent extends VoiceConferenceEvent { - - private final String voiceUserId; - private final String callerIdNum; - private final String callerIdName; - private final Boolean muted; - private final Boolean speaking; - private final Boolean locked = false; - private final String userId; - - public VoiceUserJoinedEvent(String userId, String voiceUserId, String room, - String callerIdNum, String callerIdName, - Boolean muted, Boolean speaking) { - super(room); - this.userId = userId; - this.voiceUserId = voiceUserId; - this.callerIdName = callerIdName; - this.callerIdNum = callerIdNum; - this.muted = muted; - this.speaking = speaking; - } - - public String getUserId() { - return userId; - } - - public String getVoiceUserId() { - return voiceUserId; - } - - public String getCallerIdNum() { - return callerIdNum; - } - - public String getCallerIdName() { - return callerIdName; - } - - public Boolean getMuted() { - return muted; - } - - public Boolean getSpeaking() { - return speaking; - } - - public Boolean isLocked() { - return locked; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserLeftEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserLeftEvent.java deleted file mode 100755 index f5371e5620..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserLeftEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.events; - -public class VoiceUserLeftEvent extends VoiceConferenceEvent { - - private final String userId; - - public VoiceUserLeftEvent(String userId, String room) { - super(room); - this.userId = userId; - } - - public String getUserId() { - return userId; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserLockedEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserLockedEvent.java deleted file mode 100755 index 414be991c6..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserLockedEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.events; - -public class VoiceUserLockedEvent extends VoiceConferenceEvent { - - private final boolean locked; - private final String userId; - - public VoiceUserLockedEvent(String userId, String room, boolean locked) { - super(room); - this.locked = locked; - this.userId = userId; - } - - public String getUserId() { - return userId; - } - - public boolean isLocked() { - return locked; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserMutedEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserMutedEvent.java deleted file mode 100755 index 203e93743c..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserMutedEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.events; - -public class VoiceUserMutedEvent extends VoiceConferenceEvent { - - private final boolean muted; - private final String userId; - - public VoiceUserMutedEvent(String userId, String room, boolean muted) { - super(room); - this.muted = muted; - this.userId = userId; - } - - public String getUserId() { - return userId; - } - - public boolean isMuted() { - return muted; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserTalkingEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserTalkingEvent.java deleted file mode 100755 index 3ecd6759e4..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/events/VoiceUserTalkingEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.events; - -public class VoiceUserTalkingEvent extends VoiceConferenceEvent { - - private final boolean talking; - private final String userId; - - public VoiceUserTalkingEvent(String userId, String room, boolean talking) { - super(room); - this.talking = talking; - this.userId = userId; - } - - public String getUserId() { - return userId; - } - - public boolean isTalking() { - return talking; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/ConnectionManager.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/ConnectionManager.java deleted file mode 100755 index 63f859c3e5..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/ConnectionManager.java +++ /dev/null @@ -1,157 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.freeswitch; - -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import org.bigbluebutton.webconference.voice.events.ConferenceEventListener; -import org.bigbluebutton.webconference.voice.freeswitch.actions.BroadcastConferenceCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.EjectAllUsersCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.EjectParticipantCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.MuteParticipantCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.PopulateRoomCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.RecordConferenceCommand; -import org.freeswitch.esl.client.inbound.Client; -import org.freeswitch.esl.client.inbound.InboundConnectionFailure; -import org.freeswitch.esl.client.manager.ManagerConnection; -import org.freeswitch.esl.client.transport.message.EslMessage; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class ConnectionManager { - private static Logger log = Red5LoggerFactory.getLogger(ConnectionManager.class, "bigbluebutton"); - private static final String EVENT_NAME = "Event-Name"; - - private static final ScheduledExecutorService connExec = Executors.newSingleThreadScheduledExecutor(); - - private ManagerConnection manager; - private ScheduledFuture connectTask; - - private volatile boolean subscribed = false; - - private ConferenceEventListener conferenceEventListener; - private ESLEventListener eslEventListener; - - private void connect() { - try { - Client c = manager.getESLClient(); - if (! c.canSend()) { - log.info("Attempting to connect to FreeSWITCH ESL"); - subscribed = false; - manager.connect(); - } else { - if (!subscribed) { - log.info("Subscribing for ESL events."); - c.cancelEventSubscriptions(); - c.addEventListener(eslEventListener); - c.setEventSubscriptions( "plain", "all" ); - c.addEventFilter( EVENT_NAME, "heartbeat" ); - c.addEventFilter( EVENT_NAME, "custom" ); - c.addEventFilter( EVENT_NAME, "background_job" ); - subscribed = true; - } - } - } catch (InboundConnectionFailure e) { - System.out.println("Failed to connect to ESL"); - log.error("Failed to connect to ESL"); - } - } - - public void start() { - log.info("Starting FreeSWITCH ESL connection manager."); - System.out.println("***************** Starting FreeSWITCH ESL connection manager."); - ConnectThread connector = new ConnectThread(); - connectTask = (ScheduledFuture) connExec.scheduleAtFixedRate(connector, 5, 5, TimeUnit.SECONDS); - } - - public void stop() { - if (connectTask != null) { - connectTask.cancel(true); - } - } - - private class ConnectThread implements Runnable { - public void run() { - connect(); - } - } - - - public void broadcast(BroadcastConferenceCommand rcc) { - Client c = manager.getESLClient(); - if (c.canSend()) { - EslMessage response = c.sendSyncApiCommand(rcc.getCommand(), rcc.getCommandArgs()); - rcc.handleResponse(response, conferenceEventListener); - } - } - - public void getUsers(PopulateRoomCommand prc) { - Client c = manager.getESLClient(); - if (c.canSend()) { - EslMessage response = c.sendSyncApiCommand(prc.getCommand(), prc.getCommandArgs()); - prc.handleResponse(response, conferenceEventListener); - } - } - - public void mute(MuteParticipantCommand mpc) { - System.out.println("Got mute request from FSApplication."); - Client c = manager.getESLClient(); - if (c.canSend()) { - System.out.println("Issuing command to FS ESL."); - c.sendAsyncApiCommand( mpc.getCommand(), mpc.getCommandArgs()); - } - } - - public void eject(EjectParticipantCommand mpc) { - Client c = manager.getESLClient(); - if (c.canSend()) { - c.sendAsyncApiCommand( mpc.getCommand(), mpc.getCommandArgs()); - } - } - - public void ejectAll(EjectAllUsersCommand mpc) { - Client c = manager.getESLClient(); - if (c.canSend()) { - c.sendAsyncApiCommand( mpc.getCommand(), mpc.getCommandArgs()); - } - } - - public void record(RecordConferenceCommand rcc) { - Client c = manager.getESLClient(); - if (c.canSend()) { - EslMessage response = c.sendSyncApiCommand(rcc.getCommand(), rcc.getCommandArgs()); - rcc.handleResponse(response, conferenceEventListener); - } - } - - public void setManagerConnection(ManagerConnection manager) { - this.manager = manager; - } - - public void setESLEventListener(ESLEventListener listener) { - this.eslEventListener = listener; - } - - public void setConferenceEventListener(ConferenceEventListener listener) { - this.conferenceEventListener = listener; - } - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/ESLEventListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/ESLEventListener.java deleted file mode 100644 index 92400799d3..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/ESLEventListener.java +++ /dev/null @@ -1,208 +0,0 @@ -package org.bigbluebutton.webconference.voice.freeswitch; - - -import java.util.Map; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.bigbluebutton.webconference.voice.events.ConferenceEventListener; -import org.bigbluebutton.webconference.voice.events.VoiceStartRecordingEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserJoinedEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserLeftEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserMutedEvent; -import org.bigbluebutton.webconference.voice.events.VoiceUserTalkingEvent; -import org.freeswitch.esl.client.IEslEventListener; -import org.freeswitch.esl.client.transport.event.EslEvent; -import org.jboss.netty.channel.ExceptionEvent; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class ESLEventListener implements IEslEventListener { - private static Logger log = Red5LoggerFactory.getLogger(ESLEventListener.class, "bigbluebutton"); - - private static final String START_TALKING_EVENT = "start-talking"; - private static final String STOP_TALKING_EVENT = "stop-talking"; - private static final String START_RECORDING_EVENT = "start-recording"; - private static final String STOP_RECORDING_EVENT = "stop-recording"; - - private ConferenceEventListener conferenceEventListener; - - @Override - public void conferenceEventPlayFile(String uniqueId, String confName, int confSize, EslEvent event) { - //Ignored, Noop - } - - @Override - public void backgroundJobResultReceived(EslEvent event) { - log.debug( "Background job result received [{}]", event ); - } - - @Override - public void exceptionCaught(ExceptionEvent e) { -// setChanged(); -// notifyObservers(e); - } - - private static final Pattern GLOBAL_AUDION_PATTERN = Pattern.compile("(GLOBAL_AUDIO)_(.*)$"); - private static final Pattern CALLERNAME_PATTERN = Pattern.compile("(.*)-bbbID-(.*)$"); - - @Override - public void conferenceEventJoin(String uniqueId, String confName, int confSize, EslEvent event) { - - Integer memberId = this.getMemberIdFromEvent(event); - Map headers = event.getEventHeaders(); - String callerId = this.getCallerIdFromEvent(event); - String callerIdName = this.getCallerIdNameFromEvent(event); - boolean muted = headers.get("Speak").equals("true") ? false : true; //Was inverted which was causing a State issue - boolean speaking = headers.get("Talking").equals("true") ? true : false; - - String voiceUserId = callerIdName; - - log.info("User joined voice conference, user=[" + callerIdName + "], conf=[" + confName + "]"); - - Matcher gapMatcher = GLOBAL_AUDION_PATTERN.matcher(callerIdName); - if (gapMatcher.matches()) { - log.debug("Ignoring GLOBAL AUDIO USER [{}]", callerIdName); - return; - } - - Matcher matcher = CALLERNAME_PATTERN.matcher(callerIdName); - if (matcher.matches()) { - voiceUserId = matcher.group(1).trim(); - callerIdName = matcher.group(2).trim(); - } - - VoiceUserJoinedEvent pj = new VoiceUserJoinedEvent(voiceUserId, memberId.toString(), confName, callerId, callerIdName, muted, speaking); - conferenceEventListener.handleConferenceEvent(pj); - } - - @Override - public void conferenceEventLeave(String uniqueId, String confName, int confSize, EslEvent event) { - Integer memberId = this.getMemberIdFromEvent(event); - log.info("User left voice conference, user=[" + memberId.toString() + "], conf=[" + confName + "]"); - VoiceUserLeftEvent pl = new VoiceUserLeftEvent(memberId.toString(), confName); - conferenceEventListener.handleConferenceEvent(pl); - } - - @Override - public void conferenceEventMute(String uniqueId, String confName, int confSize, EslEvent event) { - Integer memberId = this.getMemberIdFromEvent(event); - System.out.println("******************** Received Conference Muted Event from FreeSWITCH user[" + memberId.toString() + "]"); - log.info("User muted voice conference, user=[" + memberId.toString() + "], conf=[" + confName + "]"); - VoiceUserMutedEvent pm = new VoiceUserMutedEvent(memberId.toString(), confName, true); - conferenceEventListener.handleConferenceEvent(pm); - } - - @Override - public void conferenceEventUnMute(String uniqueId, String confName, int confSize, EslEvent event) { - Integer memberId = this.getMemberIdFromEvent(event); - System.out.println("******************** Received ConferenceUnmuted Event from FreeSWITCH user[" + memberId.toString() + "]"); - log.info("User unmuted voice conference, user=[" + memberId.toString() + "], conf=[" + confName + "]"); - VoiceUserMutedEvent pm = new VoiceUserMutedEvent(memberId.toString(), confName, false); - conferenceEventListener.handleConferenceEvent(pm); - } - - @Override - public void conferenceEventAction(String uniqueId, String confName, int confSize, String action, EslEvent event) { - Integer memberId = this.getMemberIdFromEvent(event); - VoiceUserTalkingEvent pt; - - System.out.println("******************** Receive conference Action [" + action + "]"); - - if (action == null) { - return; - } - - if (action.equals(START_TALKING_EVENT)) { - pt = new VoiceUserTalkingEvent(memberId.toString(), confName, true); - conferenceEventListener.handleConferenceEvent(pt); - } else if (action.equals(STOP_TALKING_EVENT)) { - pt = new VoiceUserTalkingEvent(memberId.toString(), confName, false); - conferenceEventListener.handleConferenceEvent(pt); - } else { - log.debug("Unknown conference Action [{}]", action); - System.out.println("Unknown conference Action [" + action + "]"); - } - } - - @Override - public void conferenceEventTransfer(String uniqueId, String confName, int confSize, EslEvent event) { - //Ignored, Noop - } - - @Override - public void conferenceEventThreadRun(String uniqueId, String confName, int confSize, EslEvent event) { - - } - - //@Override - public void conferenceEventRecord(String uniqueId, String confName, int confSize, EslEvent event) { - String action = event.getEventHeaders().get("Action"); - - if(action == null) { - return; - } - - if (log.isDebugEnabled()) - log.debug("Handling conferenceEventRecord " + action); - - if (action.equals(START_RECORDING_EVENT)) { - VoiceStartRecordingEvent sre = new VoiceStartRecordingEvent(confName, true); - sre.setRecordingFilename(getRecordFilenameFromEvent(event)); - sre.setTimestamp(genTimestamp().toString()); - - log.info("Voice conference recording started. file=[" + getRecordFilenameFromEvent(event) + "], conf=[" + confName + "]"); - - conferenceEventListener.handleConferenceEvent(sre); - } else if (action.equals(STOP_RECORDING_EVENT)) { - VoiceStartRecordingEvent srev = new VoiceStartRecordingEvent(confName, false); - srev.setRecordingFilename(getRecordFilenameFromEvent(event)); - srev.setTimestamp(genTimestamp().toString()); - - log.info("Voice conference recording stopped. file=[" + getRecordFilenameFromEvent(event) + "], conf=[" + confName + "]"); - conferenceEventListener.handleConferenceEvent(srev); - } else { - if (log.isDebugEnabled()) - log.warn("Processing UNKNOWN conference Action {}", action); - } - } - - private Long genTimestamp() { - return TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - } - - @Override - public void eventReceived(EslEvent event) { - System.out.println("ESL Event Listener received event=[" + event.getEventName() + "]"); -// if (event.getEventName().equals(FreeswitchHeartbeatMonitor.EVENT_HEARTBEAT)) { -//// setChanged(); -// notifyObservers(event); -// return; -// } - } - - private Integer getMemberIdFromEvent(EslEvent e) { - return new Integer(e.getEventHeaders().get("Member-ID")); - } - - private String getCallerIdFromEvent(EslEvent e) { - return e.getEventHeaders().get("Caller-Caller-ID-Number"); - } - - private String getCallerIdNameFromEvent(EslEvent e) { - return e.getEventHeaders().get("Caller-Caller-ID-Name"); - } - - private String getRecordFilenameFromEvent(EslEvent e) { - return e.getEventHeaders().get("Path"); - } - - /*private String getRecordTimestampFromEvent(EslEvent e) { - return e.getEventHeaders().get("Event-Date-Timestamp"); - }*/ - - public void setConferenceEventListener(ConferenceEventListener listener) { - this.conferenceEventListener = listener; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java deleted file mode 100644 index 42b4eb6574..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/FreeswitchApplication.java +++ /dev/null @@ -1,205 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.freeswitch; - -import java.io.File; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; -import org.bigbluebutton.webconference.voice.ConferenceServiceProvider; -import org.bigbluebutton.webconference.voice.freeswitch.actions.BroadcastConferenceCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.EjectAllUsersCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.EjectParticipantCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.FreeswitchCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.PopulateRoomCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.MuteParticipantCommand; -import org.bigbluebutton.webconference.voice.freeswitch.actions.RecordConferenceCommand; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class FreeswitchApplication implements ConferenceServiceProvider { - private static Logger log = Red5LoggerFactory.getLogger( FreeswitchApplication.class, "bigbluebutton" ); - - private static final int SENDERTHREADS = 1; - private static final Executor msgSenderExec = Executors.newFixedThreadPool(SENDERTHREADS); - private static final Executor runExec = Executors.newFixedThreadPool(SENDERTHREADS); - private BlockingQueue messages = new LinkedBlockingQueue(); - private ConnectionManager manager; - - private String icecastProtocol = "shout"; - private String icecastHost = "localhost"; - private int icecastPort = 8000; - private String icecastUsername = "source"; - private String icecastPassword = "hackme"; - private String icecastStreamExtension = ".mp3"; - private Boolean icecastBroadcast = false; - - private final String USER = "0"; /* not used for now */ - - private volatile boolean sendMessages = false; - - private void queueMessage(FreeswitchCommand command) { - try { - messages.offer(command, 5, TimeUnit.SECONDS); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @Override - public void populateRoom(String room) { - PopulateRoomCommand prc = new PopulateRoomCommand(room, USER); - queueMessage(prc); - } - - public void mute(String room, String participant, Boolean mute) { - MuteParticipantCommand mpc = new MuteParticipantCommand(room, participant, mute, USER); - queueMessage(mpc); - } - - public void eject(String room, String participant) { - EjectParticipantCommand mpc = new EjectParticipantCommand(room, participant, USER); - queueMessage(mpc); - } - - @Override - public void ejectAll(String room) { - EjectAllUsersCommand mpc = new EjectAllUsersCommand(room, USER); - queueMessage(mpc); - } - - private Long genTimestamp() { - return TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - } - - @Override - public void record(String room, String meetingid){ - String RECORD_DIR = "/var/freeswitch/meetings"; - String voicePath = RECORD_DIR + File.separatorChar + meetingid + "-" + genTimestamp() + ".wav"; - - RecordConferenceCommand rcc = new RecordConferenceCommand(room, USER, true, voicePath); - queueMessage(rcc); - } - - @Override - public void broadcast(String room, String meetingid) { - if (icecastBroadcast) { - broadcastToIcecast(room, meetingid); - } - } - - private void broadcastToIcecast(String room, String meetingid) { - String shoutPath = icecastProtocol + "://" + icecastUsername + ":" + icecastPassword + "@" + icecastHost + ":" + icecastPort - + File.separatorChar + meetingid + "." + icecastStreamExtension; - - BroadcastConferenceCommand rcc = new BroadcastConferenceCommand(room, USER, true, shoutPath); - queueMessage(rcc); - } - - public void setConnectionManager(ConnectionManager manager) { - this.manager = manager; - } - - public void setIcecastProtocol(String protocol) { - icecastProtocol = protocol; - } - - public void setIcecastHost(String host) { - icecastHost = host; - } - - public void setIcecastPort(int port) { - icecastPort = port; - } - - public void setIcecastUsername(String username) { - icecastUsername = username; - } - - public void setIcecastPassword(String password) { - icecastPassword = password; - } - - public void setIcecastBroadcast(Boolean broadcast) { - icecastBroadcast = broadcast; - } - - public void setIcecastStreamExtension(String ext) { - icecastStreamExtension = ext; - } - - private void sendMessageToFreeswitch(final FreeswitchCommand command) { - Runnable task = new Runnable() { - public void run() { - if (command instanceof PopulateRoomCommand) { - PopulateRoomCommand cmd = (PopulateRoomCommand) command; - log.debug("Sending PopulateRoomCommand for conference = [" + cmd.getRoom() + "]"); - manager.getUsers(cmd); - } else if (command instanceof MuteParticipantCommand) { - MuteParticipantCommand cmd = (MuteParticipantCommand) command; - log.debug("Sending MuteParticipantCommand for conference = [" + cmd.getRoom() + "]"); - System.out.println("Sending MuteParticipantCommand for conference = [" + cmd.getRoom() + "]"); - manager.mute(cmd); - } else if (command instanceof EjectParticipantCommand) { - EjectParticipantCommand cmd = (EjectParticipantCommand) command; - log.debug("Sending EjectParticipantCommand for conference = [" + cmd.getRoom() + "]"); - manager.eject(cmd); - } else if (command instanceof EjectAllUsersCommand) { - EjectAllUsersCommand cmd = (EjectAllUsersCommand) command; - log.debug("Sending EjectAllUsersCommand for conference = [" + cmd.getRoom() + "]"); - manager.ejectAll(cmd); - } else if (command instanceof RecordConferenceCommand) { - manager.record((RecordConferenceCommand) command); - } else if (command instanceof BroadcastConferenceCommand) { - manager.broadcast((BroadcastConferenceCommand) command); - } - } - }; - - runExec.execute(task); - } - - public void start() { - sendMessages = true; - Runnable sender = new Runnable() { - public void run() { - while (sendMessages) { - FreeswitchCommand message; - try { - message = messages.take(); - sendMessageToFreeswitch(message); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - } - }; - msgSenderExec.execute(sender); - } - - public void stop() { - sendMessages = false; - } - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/BroadcastConferenceCommand.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/BroadcastConferenceCommand.java deleted file mode 100755 index ad8c7e5f71..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/BroadcastConferenceCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.freeswitch.actions; - -import org.bigbluebutton.webconference.voice.events.ConferenceEventListener; -import org.freeswitch.esl.client.transport.message.EslMessage; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class BroadcastConferenceCommand extends FreeswitchCommand { - - private static Logger log = Red5LoggerFactory.getLogger(BroadcastConferenceCommand.class, "bigbluebutton"); - private boolean record; - private String icecastPath; - - public BroadcastConferenceCommand(String room, String requesterId, boolean record, String icecastPath){ - super(room, requesterId); - this.record = record; - this.icecastPath = icecastPath; - } - - - @Override - public String getCommandArgs() { - String action = "norecord"; - if (record) - action = "record"; - - return SPACE + getRoom() + SPACE + action + SPACE + icecastPath; - } - - public void handleResponse(EslMessage response, ConferenceEventListener eventListener) { - - //Test for Known Conference - - - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/EjectAllUsersCommand.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/EjectAllUsersCommand.java deleted file mode 100755 index e4826d72ea..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/EjectAllUsersCommand.java +++ /dev/null @@ -1,31 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.freeswitch.actions; - -public class EjectAllUsersCommand extends FreeswitchCommand { - - public EjectAllUsersCommand(String room, String requesterId) { - super(room, requesterId); - } - - @Override - public String getCommandArgs() { - return room + " kick all"; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/EjectParticipantCommand.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/EjectParticipantCommand.java deleted file mode 100755 index 0924b164eb..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/EjectParticipantCommand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.freeswitch.actions; - -public class EjectParticipantCommand extends FreeswitchCommand { - - private final String participant; - - public EjectParticipantCommand(String room, String participant, String requesterId) { - super(room, requesterId); - this.participant = participant; - } - - @Override - public String getCommandArgs() { - return room + " kick " + participant; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/FreeswitchCommand.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/FreeswitchCommand.java deleted file mode 100755 index db9800fa93..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/FreeswitchCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.freeswitch.actions; - -public abstract class FreeswitchCommand { - public static final String SPACE = " "; - - protected final String room; - protected final String requesterId; - - public FreeswitchCommand(String room, String requesterId) { - this.room = room; - this.requesterId = requesterId; - } - - public String getCommand() { - return "conference"; //conference is default, override if needed. - } - - public abstract String getCommandArgs(); - - public String getRoom() { - return room; - } - - public String getRequesterId() { - return requesterId; - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/MuteParticipantCommand.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/MuteParticipantCommand.java deleted file mode 100755 index a54ab6dacc..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/MuteParticipantCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.freeswitch.actions; - -public class MuteParticipantCommand extends FreeswitchCommand { - - private final String participant; - private final Boolean mute; - - public MuteParticipantCommand(String room, String participant, Boolean mute, String requesterId) { - super(room, requesterId); - this.participant = participant; - this.mute = mute; - } - - @Override - public String getCommandArgs() { - String action = "unmute"; - if (mute) action = "mute"; - - return room + SPACE + action + SPACE + participant; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/PopulateRoomCommand.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/PopulateRoomCommand.java deleted file mode 100755 index 1aeb7f64a7..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/actions/PopulateRoomCommand.java +++ /dev/null @@ -1,119 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.freeswitch.actions; - -import org.freeswitch.esl.client.transport.message.EslMessage; -import org.bigbluebutton.webconference.voice.events.ConferenceEventListener; -import org.bigbluebutton.webconference.voice.events.VoiceUserJoinedEvent; -import org.bigbluebutton.webconference.voice.freeswitch.response.XMLResponseConferenceListParser; -import org.bigbluebutton.webconference.voice.freeswitch.response.ConferenceMember; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; -import org.xml.sax.SAXException; - -public class PopulateRoomCommand extends FreeswitchCommand { - private static Logger log = Red5LoggerFactory.getLogger(PopulateRoomCommand.class, "bigbluebutton"); - - public PopulateRoomCommand(String room, String requesterId) { - super(room, requesterId); - } - - @Override - public String getCommandArgs() { - return getRoom() + SPACE + "xml_list"; - } - - private static final Pattern CALLERNAME_PATTERN = Pattern.compile("(.*)-bbbID-(.*)$"); - - public void handleResponse(EslMessage response, ConferenceEventListener eventListener) { - - //Test for Known Conference - - String firstLine = response.getBodyLines().get(0); - - //E.g. Conference 85115 not found - - if(!firstLine.startsWith(". -* -*/ -package org.bigbluebutton.webconference.voice.freeswitch.actions; - -import org.bigbluebutton.webconference.voice.events.ConferenceEventListener; -import org.freeswitch.esl.client.transport.message.EslMessage; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class RecordConferenceCommand extends FreeswitchCommand { - - private static Logger log = Red5LoggerFactory.getLogger(RecordConferenceCommand.class, "bigbluebutton"); - private boolean record; - private String recordPath; - - public RecordConferenceCommand(String room, String requesterId, boolean record, String recordPath){ - super(room, requesterId); - this.record = record; - this.recordPath = recordPath; - } - - - @Override - public String getCommandArgs() { - String action = "norecord"; - if (record) - action = "record"; - - return SPACE + getRoom() + SPACE + action + SPACE + recordPath; - } - - public void handleResponse(EslMessage response, ConferenceEventListener eventListener) { - - //Test for Known Conference - - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/ConferenceMember.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/ConferenceMember.java deleted file mode 100755 index 4e6caf9050..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/ConferenceMember.java +++ /dev/null @@ -1,88 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ - -package org.bigbluebutton.webconference.voice.freeswitch.response; - -/** - * - * @author leif - */ -public class ConferenceMember { - - protected Integer memberId; - protected ConferenceMemberFlags flags; - protected String uuid; - protected String callerIdName; - protected String callerId; - protected Integer joinTime; - protected Integer lastTalking; - - public Integer getId() { - return memberId; - } - - public ConferenceMemberFlags getFlags() { - return flags; - } - - public String getCallerId() { - return callerId; - } - - public String getCallerIdName() { - return callerIdName; - } - - public boolean getMuted() { - return flags.getIsMuted(); - } - - public boolean getSpeaking() { - return flags.getIsSpeaking(); - } - - public void setFlags(ConferenceMemberFlags flags) { - this.flags = flags; - } - - public void setId(int parseInt) { - memberId = parseInt; - } - - public void setUUID(String tempVal) { - this.uuid = tempVal; - } - - public void setCallerIdName(String tempVal) { - this.callerIdName = tempVal; - } - - public void setCallerId(String tempVal) { - this.callerId = tempVal; - } - - public void setJoinTime(int parseInt) { - this.joinTime = parseInt; - } - - void setLastTalking(int parseInt) { - this.lastTalking = parseInt; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/ConferenceMemberFlags.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/ConferenceMemberFlags.java deleted file mode 100755 index be507e2c0d..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/ConferenceMemberFlags.java +++ /dev/null @@ -1,54 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ - -package org.bigbluebutton.webconference.voice.freeswitch.response; - -/** - * - * @author leif - */ -public class ConferenceMemberFlags { - //private boolean canHear = false; - private boolean canSpeak = false; - private boolean talking = false; - //private boolean hasVideo = false; - //private boolean hasFloor = false; - //private boolean isModerator = false; - //private boolean endConference = false; - - boolean getIsSpeaking() { - return talking; - } - - boolean getIsMuted() { - if(canSpeak == true) { - return false; - } - return true; - } - - void setCanSpeak(String tempVal) { - canSpeak = tempVal.equals("true") ? true : false; - } - - void setTalking(String tempVal) { - talking = tempVal.equals("true") ? true : false; - } - -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/XMLResponseConferenceListParser.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/XMLResponseConferenceListParser.java deleted file mode 100755 index 4a0b9db710..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/freeswitch/response/XMLResponseConferenceListParser.java +++ /dev/null @@ -1,164 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ -package org.bigbluebutton.webconference.voice.freeswitch.response; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -/** - * - * @author leif - */ -public class XMLResponseConferenceListParser extends DefaultHandler { - private static Logger log = Red5LoggerFactory.getLogger(XMLResponseConferenceListParser.class, "bigbluebutton"); - - private List myConfrenceMembers; - private String tempVal; - private ConferenceMember tempMember; - private ConferenceMemberFlags tempFlags; - private String room; - private boolean inFlags = false; - - public XMLResponseConferenceListParser() { - myConfrenceMembers = new ArrayList(); - } - - public String getConferenceRoom() { - return room; - } - - public void printConferneceMemebers() { - log.info("Number of Members found in room [{}] was ({}).", room, myConfrenceMembers.size()); - Iterator it = myConfrenceMembers.iterator(); - while(it.hasNext()) { - log.info("room [{}] member: [{}]", room, it.next().toString()); - } - } - - public List getConferenceList() { - return myConfrenceMembers; - } - - /* - - - - - - 6 - - true - true - false - false - true - false - false - - 3a16f061-0df6-45d5-b401-d8e977e08a5c - 1001 - 1001 - 65 - 4 - - - - - - */ - - - //SAX Event Handlers - @Override - public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { - //reset - inFlags = false; - tempVal = ""; - if(qName.equalsIgnoreCase("member")) { - //create a new instance of ConferenceMember - tempMember = new ConferenceMember(); - } - - if(qName.equalsIgnoreCase("flags")) { - //create a new instance of ConferenceMember - tempFlags = new ConferenceMemberFlags(); - inFlags = true; - } - - if(qName.equalsIgnoreCase("conference")) { - room = attributes.getValue("name"); - } - } - - - @Override - public void characters(char[] ch, int start, int length) throws SAXException { - tempVal = new String(ch,start,length); - } - - @Override - public void endElement(String uri, String localName, String qName) throws SAXException { - - if(qName.equalsIgnoreCase("member")) { - //add it to the list - myConfrenceMembers.add(tempMember); - }else if(qName.equalsIgnoreCase("flags")) { - tempMember.setFlags(tempFlags); - inFlags = false; - }else if(inFlags) { - if (qName.equalsIgnoreCase("can_speak")) { - tempFlags.setCanSpeak(tempVal); - }else if (qName.equalsIgnoreCase("talking")) { - tempFlags.setTalking(tempVal); - } - }else if (qName.equalsIgnoreCase("id")) { - try { - tempMember.setId(Integer.parseInt(tempVal)); - } catch(NumberFormatException nfe) { - log.error("cannot set ConferenceMember Id value [{}] NFE.", tempVal); - } - }else if (qName.equalsIgnoreCase("uuid")) { - tempMember.setUUID(tempVal); - }else if (qName.equalsIgnoreCase("caller_id_name")) { - tempMember.setCallerIdName(tempVal); - }else if (qName.equalsIgnoreCase("caller_id_number")) { - tempMember.setCallerId(tempVal); - }else if (qName.equalsIgnoreCase("join_time")) { - try { - tempMember.setJoinTime(Integer.parseInt(tempVal)); - } catch(NumberFormatException nfe) { - log.debug("cannot set setJoinTime value [{}] NFE.", tempVal); - } - }else if (qName.equalsIgnoreCase("last_talking")) { - try { - tempMember.setLastTalking(Integer.parseInt(tempVal)); - } catch(NumberFormatException nfe) { - log.debug("cannot set setLastTalking value [{}] NFE.", tempVal); - } - } - - } -} diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/conference/voice/freeswitch/HeartbeatMonitor.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/conference/voice/freeswitch/HeartbeatMonitor.scala deleted file mode 100755 index a4e615328d..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/conference/voice/freeswitch/HeartbeatMonitor.scala +++ /dev/null @@ -1,5 +0,0 @@ -package org.bigbluebutton.conference.voice.freeswitch - -class HeartbeatMonitor() { - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala deleted file mode 100755 index 71fa36db39..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala +++ /dev/null @@ -1,182 +0,0 @@ -package org.bigbluebutton.core - -import akka.actor._ -import akka.actor.ActorLogging -import akka.pattern.{ask, pipe} -import akka.util.Timeout -import scala.concurrent.duration._ -import scala.collection.mutable.HashMap -import org.bigbluebutton.core.api._ -import org.bigbluebutton.core.util._ -import org.bigbluebutton.core.api.ValidateAuthTokenTimedOut -import scala.util.Success -import scala.util.Failure - -object BigBlueButtonActor extends SystemConfiguration { - def props(system: ActorSystem, outGW: MessageOutGateway): Props = - Props(classOf[BigBlueButtonActor], system, outGW) -} - -class BigBlueButtonActor(val system: ActorSystem, outGW: MessageOutGateway) extends Actor with ActorLogging { - def actorRefFactory = context - implicit def executionContext = actorRefFactory.dispatcher - implicit val timeout = Timeout(5 seconds) - - //private var meetings = new HashMap[String, MeetingActor] - private var meetings = new collection.immutable.HashMap[String, RunningMeeting] - - def receive = { - case msg: CreateMeeting => handleCreateMeeting(msg) - case msg: DestroyMeeting => handleDestroyMeeting(msg) - case msg: KeepAliveMessage => handleKeepAliveMessage(msg) - case msg: ValidateAuthToken => handleValidateAuthToken(msg) - case msg: GetAllMeetingsRequest => handleGetAllMeetingsRequest(msg) - case msg: InMessage => handleMeetingMessage(msg) - case _ => // do nothing - } - - private def handleValidateAuthToken(msg: ValidateAuthToken) { - meetings.get(msg.meetingID) foreach { m => - val future = m.actorRef.ask(msg)(5 seconds) - - future onComplete { - case Success(result) => { - log.debug("Got response from meeting=" + msg.meetingID + "].") - /** - * Received a reply from MeetingActor which means hasn't hung! - * Sometimes, the actor seems to hang and doesn't anymore accept messages. This is a simple - * audit to check whether the actor is still alive. (ralam feb 25, 2015) - */ - } - case Failure(failure) => { - log.warning("Failed to get response to from meeting=" + msg.meetingID + "]. Meeting has probably hung.") - outGW.send(new ValidateAuthTokenTimedOut(msg.meetingID, msg.userId, msg.token, false, msg.correlationId, msg.sessionId)) - } - } - } - } - - private def handleMeetingMessage(msg: InMessage):Unit = { - msg match { - case ucm: UserConnectedToGlobalAudio => { - val m = meetings.values.find( m => m.voiceBridge == ucm.voiceConf) - m foreach {mActor => mActor.actorRef ! ucm} - } - case udm: UserDisconnectedFromGlobalAudio => { - val m = meetings.values.find( m => m.voiceBridge == udm.voiceConf) - m foreach {mActor => mActor.actorRef ! udm} - } - case allOthers => { - meetings.get(allOthers.meetingID) match { - case None => handleMeetingNotFound(allOthers) - case Some(m) => { - // log.debug("Forwarding message [{}] to meeting [{}]", msg.meetingID) - m.actorRef ! allOthers - } - } - } - } - } - - private def handleMeetingNotFound(msg: InMessage) { - msg match { - case vat:ValidateAuthToken => { - log.info("No meeting [" + vat.meetingID + "] for auth token [" + vat.token + "]") - outGW.send(new ValidateAuthTokenReply(vat.meetingID, vat.userId, vat.token, false, vat.correlationId, vat.sessionId)) - } - case _ => { - log.info("No meeting [" + msg.meetingID + "] for message type [" + msg.getClass() + "]") - // do nothing - } - } - } - - private def handleKeepAliveMessage(msg: KeepAliveMessage):Unit = { - outGW.send(new KeepAliveMessageReply(msg.aliveID)) - } - - private def handleDestroyMeeting(msg: DestroyMeeting) { - log.info("BBBActor received DestroyMeeting message for meeting id [" + msg.meetingID + "]") - meetings.get(msg.meetingID) match { - case None => println("Could not find meeting id[" + msg.meetingID + "] to destroy.") - case Some(m) => { - m.actorRef ! StopMeetingActor - meetings -= msg.meetingID - log.info("Kick everyone out on meeting id[" + msg.meetingID + "].") - outGW.send(new EndAndKickAll(msg.meetingID, m.recorded)) - outGW.send(new DisconnectAllUsers(msg.meetingID)) - log.info("Destroyed meeting id[" + msg.meetingID + "].") - outGW.send(new MeetingDestroyed(msg.meetingID)) - } - } - } - - private def handleCreateMeeting(msg: CreateMeeting):Unit = { - meetings.get(msg.meetingID) match { - case None => { - log.info("New meeting create request [" + msg.meetingName + "]") - var m = RunningMeeting(msg.meetingID, msg.externalMeetingID, msg.meetingName, msg.recorded, - msg.voiceBridge, msg.duration, - msg.autoStartRecording, msg.allowStartStopRecording, msg.moderatorPass, - msg.viewerPass, msg.createTime, msg.createDate, - outGW) - - meetings += m.meetingID -> m - outGW.send(new MeetingCreated(m.meetingID, m.externalMeetingID, m.recorded, m.meetingName, m.voiceBridge, msg.duration, - msg.moderatorPass, msg.viewerPass, msg.createTime, msg.createDate)) - - m.actorRef ! new InitializeMeeting(m.meetingID, m.recorded) - m.actorRef ! "StartTimer" - } - case Some(m) => { - log.info("Meeting already created [" + msg.meetingName + "]") - // do nothing - } - } - } - - private def handleGetAllMeetingsRequest(msg: GetAllMeetingsRequest) { - - var len = meetings.keys.size - println("meetings.size=" + meetings.size) - println("len_=" + len) - - val set = meetings.keySet - val arr : Array[String] = new Array[String](len) - set.copyToArray(arr) - val resultArray : Array[MeetingInfo] = new Array[MeetingInfo](len) - - for(i <- 0 until arr.length) { - val id = arr(i) - val duration = meetings.get(arr(i)).head.duration - val name = meetings.get(arr(i)).head.meetingName - val recorded = meetings.get(arr(i)).head.recorded - val voiceBridge = meetings.get(arr(i)).head.voiceBridge - - var info = new MeetingInfo(id, name, recorded, voiceBridge, duration) - resultArray(i) = info - - //remove later - println("for a meeting:" + id) - println("Meeting Name = " + meetings.get(id).head.meetingName) - println("isRecorded = " + meetings.get(id).head.recorded) - println("voiceBridge = " + voiceBridge) - println("duration = " + duration) - - //send the users - self ! (new GetUsers(id, "nodeJSapp")) - - //send the presentation - self ! (new GetPresentationInfo(id, "nodeJSapp", "nodeJSapp")) - - //send chat history - self ! (new GetChatHistoryRequest(id, "nodeJSapp", "nodeJSapp")) - - //send lock settings - self ! (new GetLockSettings(id, "nodeJSapp")) - } - - outGW.send(new GetAllMeetingsReply(resultArray)) - } - -} diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonGateway.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonGateway.scala deleted file mode 100755 index f5cadeeaac..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonGateway.scala +++ /dev/null @@ -1,23 +0,0 @@ -package org.bigbluebutton.core - -import org.bigbluebutton.core.api._ -import java.util.concurrent.CountDownLatch -import akka.actor.{ ActorSystem, Props } - -class BigBlueButtonGateway(outGW: MessageOutGateway) { - - implicit val system = ActorSystem("bigbluebutton-apps-system") - - val bbbActor = system.actorOf( - BigBlueButtonActor.props(system, outGW), - "bigbluebutton-actor") - - def accept(msg: InMessage):Unit = { - bbbActor ! msg - } - - def acceptKeepAlive(msg: KeepAliveMessage):Unit = { - bbbActor ! msg - } - -} diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonInGW.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonInGW.scala deleted file mode 100755 index 971b512f44..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonInGW.scala +++ /dev/null @@ -1,469 +0,0 @@ -package org.bigbluebutton.core - -import org.bigbluebutton.core.api._ -import org.bigbluebutton.conference.service.presentation.PreuploadedPresentationsUtil -import scala.collection.JavaConversions._ -import org.bigbluebutton.core.apps.poll.PollInGateway -import org.bigbluebutton.core.apps.layout.LayoutInGateway -import org.bigbluebutton.core.apps.chat.ChatInGateway -import scala.collection.JavaConversions._ -import org.bigbluebutton.core.apps.whiteboard.WhiteboardInGateway -import org.bigbluebutton.core.apps.voice.VoiceInGateway -import java.util.ArrayList -import scala.collection.mutable.ArrayBuffer -import org.bigbluebutton.core.apps.presentation.Page -import org.bigbluebutton.core.apps.presentation.Presentation - -class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway, presUtil: PreuploadedPresentationsUtil) extends IBigBlueButtonInGW { - - // Meeting - def createMeeting2(meetingID: String, externalMeetingID:String, meetingName: String, record: Boolean, - voiceBridge: String, duration: Long, autoStartRecording: Boolean, - allowStartStopRecording: Boolean, moderatorPass: String, viewerPass: String, - createTime: Long, createDate: String) { -// println("******************** CREATING MEETING [" + meetingID + "] ***************************** ") - bbbGW.accept(new CreateMeeting(meetingID, externalMeetingID, meetingName, record, - voiceBridge, duration, autoStartRecording, - allowStartStopRecording, moderatorPass, viewerPass, - createTime, createDate)) - } - - def destroyMeeting(meetingID: String) { -// println("******************** DESTROY MEETING [" + meetingID + "] ***************************** ") - bbbGW.accept(new DestroyMeeting(meetingID)) - } - - def getAllMeetings(meetingID: String) { - println("******************** GET ALL MEETINGS ***************************** ") - bbbGW.accept(new GetAllMeetingsRequest("meetingId")) - } - - def isAliveAudit(aliveId:String) { - bbbGW.acceptKeepAlive(new KeepAliveMessage(aliveId)); - } - - def lockSettings(meetingID: String, locked: java.lang.Boolean, - lockSettings: java.util.Map[String, java.lang.Boolean]) { - - } - - def statusMeetingAudit(meetingID: String) { - - } - - def endMeeting(meetingID: String) { -// println("******************** END MEETING [" + meetingID + "] ***************************** ") - bbbGW.accept(new EndMeeting(meetingID)) - } - - def endAllMeetings() { - - } - - /************************************************************* - * Message Interface for Users - *************************************************************/ - def validateAuthToken(meetingId: String, userId: String, token: String, correlationId: String, sessionId: String) { -// println("******************** VALIDATE TOKEN [" + token + "] ***************************** ") - bbbGW.accept(new ValidateAuthToken(meetingId, userId, token, correlationId, sessionId)) - } - - def registerUser(meetingID: String, userID: String, name: String, role: String, extUserID: String, authToken: String):Unit = { - val userRole = if (role == "MODERATOR") Role.MODERATOR else Role.VIEWER - bbbGW.accept(new RegisterUser(meetingID, userID, name, userRole, extUserID, authToken)) - } - - def sendLockSettings(meetingID: String, userId: String, settings: java.util.Map[String, java.lang.Boolean]) { - // Convert java.util.Map to scala.collection.immutable.Map - // settings.mapValues -> convaert java Map to scala mutable Map - // v => v.booleanValue() -> convert java Boolean to Scala Boolean - // toMap -> converts from scala mutable map to scala immutable map - val s = settings.mapValues (v => v.booleanValue() /* convert java Boolean to Scala Boolean */).toMap - val disableCam = s.getOrElse("disableCam", false) - val disableMic = s.getOrElse("disableMic", false) - val disablePrivChat = s.getOrElse("disablePrivateChat", false) - val disablePubChat = s.getOrElse("disablePublicChat", false) - val lockedLayout = s.getOrElse("lockedLayout", false) - var lockOnJoin = s.getOrElse("lockOnJoin", false) - var lockOnJoinConfigurable = s.getOrElse("lockOnJoinConfigurable", false) - - val permissions = new Permissions(disableCam = disableCam, - disableMic = disableMic, - disablePrivChat = disablePrivChat, - disablePubChat = disablePubChat, - lockedLayout = lockedLayout, - lockOnJoin = lockOnJoin, - lockOnJoinConfigurable = lockOnJoinConfigurable) - - bbbGW.accept(new SetLockSettings(meetingID, userId, permissions)) - } - - def initLockSettings(meetingID: String, settings: java.util.Map[String, java.lang.Boolean]) { - // Convert java.util.Map to scala.collection.immutable.Map - // settings.mapValues -> convert java Map to scala mutable Map - // v => v.booleanValue() -> convert java Boolean to Scala Boolean - // toMap -> converts from scala mutable map to scala immutable map - val s = settings.mapValues (v => v.booleanValue() /* convert java Boolean to Scala Boolean */).toMap - val disableCam = s.getOrElse("disableCam", false) - val disableMic = s.getOrElse("disableMic", false) - val disablePrivChat = s.getOrElse("disablePrivateChat", false) - val disablePubChat = s.getOrElse("disablePublicChat", false) - val lockedLayout = s.getOrElse("lockedLayout", false) - val lockOnJoin = s.getOrElse("lockOnJoin", false) - val lockOnJoinConfigurable = s.getOrElse("lockOnJoinConfigurable", false) - val permissions = new Permissions(disableCam = disableCam, - disableMic = disableMic, - disablePrivChat = disablePrivChat, - disablePubChat = disablePubChat, - lockedLayout = lockedLayout, - lockOnJoin = lockOnJoin, - lockOnJoinConfigurable = lockOnJoinConfigurable) - - bbbGW.accept(new InitLockSettings(meetingID, permissions)) - } - - - - def initAudioSettings(meetingID: String, requesterID: String, muted: java.lang.Boolean) { - bbbGW.accept(new InitAudioSettings(meetingID, requesterID, muted.booleanValue())) - } - - def getLockSettings(meetingId: String, userId: String) { - bbbGW.accept(new GetLockSettings(meetingId, userId)) - } - - def lockUser(meetingId: String, requesterID: String, lock: Boolean, userId: String) { - bbbGW.accept(new LockUserRequest(meetingId, requesterID, userId, lock)) - } - - def setRecordingStatus(meetingId: String, userId: String, recording: java.lang.Boolean) { - bbbGW.accept(new SetRecordingStatus(meetingId, userId, recording.booleanValue())) - } - - def getRecordingStatus(meetingId: String, userId: String) { - bbbGW.accept(new GetRecordingStatus(meetingId, userId)) - } - - - // Users - def userRaiseHand(meetingId: String, userId: String) { - bbbGW.accept(new UserRaiseHand(meetingId, userId)) - } - - def lowerHand(meetingId: String, userId: String, loweredBy: String) { - bbbGW.accept(new UserLowerHand(meetingId, userId, loweredBy)) - } - - def ejectUserFromMeeting(meetingId: String, userId: String, ejectedBy: String) { - bbbGW.accept(new EjectUserFromMeeting(meetingId, userId, ejectedBy)) - } - - def shareWebcam(meetingId: String, userId: String, stream: String) { - bbbGW.accept(new UserShareWebcam(meetingId, userId, stream)) - } - - def unshareWebcam(meetingId: String, userId: String, stream:String) { - bbbGW.accept(new UserUnshareWebcam(meetingId, userId, stream)) - } - - def setUserStatus(meetingID: String, userID: String, status: String, value: Object):Unit = { - bbbGW.accept(new ChangeUserStatus(meetingID, userID, status, value)); - } - - def getUsers(meetingID: String, requesterID: String):Unit = { - bbbGW.accept(new GetUsers(meetingID, requesterID)) - } - - def userLeft(meetingID: String, userID: String, sessionId: String):Unit = { - bbbGW.accept(new UserLeaving(meetingID, userID, sessionId)) - } - - def userJoin(meetingID: String, userID: String, authToken: String):Unit = { - bbbGW.accept(new UserJoining(meetingID, userID, authToken)) - } - - def assignPresenter(meetingID: String, newPresenterID: String, newPresenterName: String, assignedBy: String):Unit = { - bbbGW.accept(new AssignPresenter(meetingID, newPresenterID, newPresenterName, assignedBy)) - } - - def getCurrentPresenter(meetingID: String, requesterID: String):Unit = { - // do nothing - } - - def userConnectedToGlobalAudio(voiceConf: String, userid: String, name: String) { - // we are required to pass the meeting_id as first parameter (just to satisfy trait) - // but it's not used anywhere. That's why we pass voiceConf twice instead - bbbGW.accept(new UserConnectedToGlobalAudio(voiceConf, voiceConf, userid, name)) - } - - def userDisconnectedFromGlobalAudio(voiceConf: String, userid: String, name: String) { - // we are required to pass the meeting_id as first parameter (just to satisfy trait) - // but it's not used anywhere. That's why we pass voiceConf twice instead - bbbGW.accept(new UserDisconnectedFromGlobalAudio(voiceConf, voiceConf, userid, name)) - } - - /************************************************************************************** - * Message Interface for Presentation - **************************************************************************************/ - - def clear(meetingID: String) { - bbbGW.accept(new ClearPresentation(meetingID)) - } - - def sendConversionUpdate(messageKey: String, meetingId: String, - code: String, presentationId: String, presName: String) { - bbbGW.accept(new PresentationConversionUpdate(meetingId, messageKey, - code, presentationId, presName)) - } - - def sendPageCountError(messageKey: String, meetingId: String, - code: String, presentationId: String, numberOfPages: Int, - maxNumberPages: Int, presName: String) { - bbbGW.accept(new PresentationPageCountError(meetingId, messageKey, - code, presentationId, numberOfPages, maxNumberPages, presName)) - } - - def sendSlideGenerated(messageKey: String, meetingId: String, - code: String, presentationId: String, numberOfPages: Int, - pagesCompleted: Int, presName: String) { - bbbGW.accept(new PresentationSlideGenerated(meetingId, messageKey, - code, presentationId, numberOfPages, pagesCompleted, presName)) - } - - def generatePresentationPages(presId: String, numPages: Int, presBaseUrl: String):scala.collection.immutable.HashMap[String, Page] = { - var pages = new scala.collection.immutable.HashMap[String, Page] - val baseUrl = - for (i <- 1 to numPages) { - val id = presId + "/" + i - val num = i; - val current = if (i == 1) true else false - val thumbnail = presBaseUrl + "/thumbnail/" + i - val swfUri = presBaseUrl + "/slide/" + i - - val txtUri = presBaseUrl + "/textfiles/" + i - val pngUri = presBaseUrl + "/png/" + i - - val p = new Page(id=id, num=num, thumbUri=thumbnail, swfUri=swfUri, - txtUri=txtUri, pngUri=pngUri, - current=current) - pages += (p.id -> p) - } - - pages - } - - def sendConversionCompleted(messageKey: String, meetingId: String, - code: String, presentationId: String, numPages: Int, - presName: String, presBaseUrl: String) { -// println("******************** PRESENTATION CONVERSION COMPLETED MESSAGE ***************************** ") - val pages = generatePresentationPages(presentationId, numPages, presBaseUrl) - - val presentation = new Presentation(id=presentationId, name=presName, pages=pages) - bbbGW.accept(new PresentationConversionCompleted(meetingId, messageKey, - code, presentation)) - - } - - def removePresentation(meetingID: String, presentationID: String) { - bbbGW.accept(new RemovePresentation(meetingID, presentationID)) - } - - def getPresentationInfo(meetingID: String, requesterID: String, replyTo: String) { -// println("**** Forwarding GetPresentationInfo for meeting[" + meetingID + "] ****") - bbbGW.accept(new GetPresentationInfo(meetingID, requesterID, replyTo)) - } - - def sendCursorUpdate(meetingID: String, xPercent: Double, yPercent: Double) { - bbbGW.accept(new SendCursorUpdate(meetingID, xPercent, yPercent)) - } - - def resizeAndMoveSlide(meetingID: String, xOffset: Double, yOffset: Double, widthRatio: Double, heightRatio: Double) { - bbbGW.accept(new ResizeAndMoveSlide(meetingID, xOffset, yOffset, widthRatio, heightRatio)) - } - - def gotoSlide(meetingID: String, pageId: String) { -// println("**** Forwarding GotoSlide for meeting[" + meetingID + "] ****") - bbbGW.accept(new GotoSlide(meetingID, pageId)) - } - - def sharePresentation(meetingID: String, presentationID: String, share: Boolean) { - bbbGW.accept(new SharePresentation(meetingID, presentationID, share)) - } - - def getSlideInfo(meetingID: String, requesterID: String, replyTo: String) { - bbbGW.accept(new GetSlideInfo(meetingID, requesterID, replyTo)) - } - - /************************************************************** - * Message Interface Polling - **************************************************************/ - val pollGW = new PollInGateway(bbbGW) - - def getPolls(meetingID: String, requesterID: String) { - pollGW.getPolls(meetingID, requesterID) - } - - def preCreatedPoll(meetingID: String, msg: String) { - pollGW.preCreatedPoll(meetingID, msg) - } - - def createPoll(meetingID: String, requesterID: String, msg: String) { - pollGW.createPoll(meetingID, requesterID, msg) - } - - def updatePoll(meetingID: String, requesterID: String, msg: String) { - pollGW.updatePoll(meetingID, requesterID, msg) - } - - def startPoll(meetingID: String, requesterID: String, msg: String) { - pollGW.startPoll(meetingID, requesterID, msg) - } - - def stopPoll(meetingID: String, requesterID: String, msg: String) { - pollGW.stopPoll(meetingID, requesterID, msg) - } - - def removePoll(meetingID: String, requesterID: String, msg: String) { - pollGW.removePoll(meetingID, requesterID, msg) - } - - def respondPoll(meetingID: String, requesterID: String, msg: String) { - pollGW.respondPoll(meetingID, requesterID, msg) - } - - def showPollResult(meetingID: String, requesterID: String, msg: String) { - pollGW.showPollResult(meetingID, requesterID, msg) - } - - def hidePollResult(meetingID: String, requesterID: String, msg: String) { - pollGW.hidePollResult(meetingID, requesterID, msg) - } - - /************************************************************************* - * Message Interface for Layout - *********************************************************************/ - val layoutGW = new LayoutInGateway(bbbGW) - - def getCurrentLayout(meetingID: String, requesterID: String) { - layoutGW.getCurrentLayout(meetingID, requesterID) - } - - def broadcastLayout(meetingID: String, requesterID: String, layout: String) { - layoutGW.broadcastLayout(meetingID, requesterID, layout) - } - - def lockLayout(meetingId: String, setById: String, - lock: Boolean, viewersOnly: Boolean, - layout: String) { - layoutGW.lockLayout(meetingId, setById, lock, viewersOnly, layout) - - } - - /********************************************************************* - * Message Interface for Chat - *******************************************************************/ - val chatGW = new ChatInGateway(bbbGW) - - def getChatHistory(meetingID: String, requesterID: String, replyTo: String) { - chatGW.getChatHistory(meetingID, requesterID, replyTo) - } - - def sendPublicMessage(meetingID: String, requesterID: String, message: java.util.Map[String, String]) { - // Convert java Map to Scala Map, then convert Mutable map to immutable map - chatGW.sendPublicMessage(meetingID, requesterID, mapAsScalaMap(message).toMap) - } - - def sendPrivateMessage(meetingID: String, requesterID: String, message: java.util.Map[String, String]) { - chatGW.sendPrivateMessage(meetingID, requesterID, mapAsScalaMap(message).toMap) - } - - /********************************************************************* - * Message Interface for Whiteboard - *******************************************************************/ - val wbGW = new WhiteboardInGateway(bbbGW) - - def sendWhiteboardAnnotation(meetingID: String, requesterID: String, annotation: java.util.Map[String, Object]) { - wbGW.sendWhiteboardAnnotation(meetingID, requesterID, mapAsScalaMap(annotation).toMap) - } - - def requestWhiteboardAnnotationHistory(meetingID: String, requestedID: String, whiteboardId: String, replyTo: String) { - wbGW.requestWhiteboardAnnotationHistory(meetingID, requestedID, whiteboardId, replyTo) - } - - def clearWhiteboard(meetingID: String, requestedID: String, whiteboardId: String) { - wbGW.clearWhiteboard(meetingID, requestedID, whiteboardId); - } - - def undoWhiteboard(meetingID: String, requestedID: String, whiteboardId: String) { - wbGW.undoWhiteboard(meetingID, requestedID, whiteboardId) - } - - def enableWhiteboard(meetingID: String, requestedID: String, enable: java.lang.Boolean) { - wbGW.enableWhiteboard(meetingID, requestedID, enable) - } - - def isWhiteboardEnabled(meetingID: String, requestedID: String, replyTo: String) { - wbGW.isWhiteboardEnabled(meetingID, requestedID, replyTo) - } - - /********************************************************************* - * Message Interface for Voice - *******************************************************************/ - val voiceGW = new VoiceInGateway(bbbGW) - - def muteAllExceptPresenter(meetingID: String, requesterID: String, mute: java.lang.Boolean) { - voiceGW.muteAllExceptPresenter(meetingID, requesterID, mute) - } - - def muteAllUsers(meetingID: String, requesterID: String, mute: java.lang.Boolean) { - voiceGW.muteAllUsers(meetingID, requesterID, mute) - } - - def isMeetingMuted(meetingID: String, requesterID: String) { - voiceGW.isMeetingMuted(meetingID, requesterID) - } - - def muteUser(meetingID: String, requesterID: String, userID: String, mute: java.lang.Boolean) { - voiceGW.muteUser(meetingID, requesterID, userID, mute) - } - - def lockMuteUser(meetingID: String, requesterID: String, userID: String, lock: java.lang.Boolean) { - voiceGW.lockUser(meetingID, requesterID, userID, lock) - } - - def ejectUserFromVoice(meetingId: String, userId: String, ejectedBy: String) { - voiceGW.ejectUserFromVoice(meetingId, userId, ejectedBy) - } - - def voiceUserJoined(meetingId: String, userId: String, webUserId: String, - conference: String, callerIdNum: String, - callerIdName: String, - muted: java.lang.Boolean, speaking: java.lang.Boolean) { - - voiceGW.voiceUserJoined(meetingId, userId, webUserId, - conference, callerIdNum, - callerIdName, muted, speaking) - } - - def voiceUserLeft(meetingId: String, userId: String) { - voiceGW.voiceUserLeft(meetingId, userId) - } - - def voiceUserLocked(meetingId: String, userId: String, locked: java.lang.Boolean) { - voiceGW.voiceUserLocked(meetingId, userId, locked) - } - - def voiceUserMuted(meetingId: String, userId: String, muted: java.lang.Boolean) { - voiceGW.voiceUserMuted(meetingId, userId, muted) - } - - def voiceUserTalking(meetingId: String, userId: String, talking: java.lang.Boolean) { - voiceGW.voiceUserTalking(meetingId, userId, talking) - } - - def voiceRecording(meetingId: String, recordingFile: String, - timestamp: String, recording: java.lang.Boolean) { - voiceGW.voiceRecording(meetingId, recordingFile, - timestamp, recording) - } -} diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/CollectorActor.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/CollectorActor.scala deleted file mode 100755 index 08c96838d4..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/CollectorActor.scala +++ /dev/null @@ -1,2163 +0,0 @@ -package org.bigbluebutton.core - -import akka.actor._ -import akka.actor.ActorLogging -import org.bigbluebutton.core.api._ -import com.google.gson.Gson -import scala.collection.mutable.HashMap -import collection.JavaConverters._ -import scala.collection.JavaConversions._ -import java.util.ArrayList -import org.bigbluebutton.core.apps.poll.PollVO -import org.bigbluebutton.core.apps.presentation.Page -import org.bigbluebutton.core.apps.presentation.Presentation -import org.bigbluebutton.core.apps.chat.redis.ChatMessageToJsonConverter -import org.bigbluebutton.core.apps.presentation.redis.PesentationMessageToJsonConverter -import org.bigbluebutton.core.apps.whiteboard.redis.WhiteboardMessageToJsonConverter -import org.bigbluebutton.core.meeting.MeetingMessageToJsonConverter -import org.bigbluebutton.core.apps.users.redis.UsersMessageToJsonConverter - -class CollectorActor(dispatcher: IDispatcher) extends Actor { - - def receive = { - //IN MESSAGES - case msg: CreateMeeting => handleCreateMeeting(msg) - case msg: InitializeMeeting => handleInitializeMeeting(msg) - case msg: DestroyMeeting => handleDestroyMeeting(msg) - case msg: StartMeeting => handleStartMeeting(msg) - case msg: EndMeeting => handleEndMeeting(msg) - case msg: LockSetting => handleLockSetting(msg) - case msg: LockUser => handleLockUser(msg) - case msg: InitLockSettings => handleInitLockSettings(msg) - case msg: InitAudioSettings => handleInitAudioSettings(msg) - case msg: SetLockSettings => handleSetLockSettings(msg) - case msg: GetLockSettings => handleGetLockSettings(msg) - case msg: ValidateAuthToken => handleValidateAuthToken(msg) - case msg: RegisterUser => handleRegisterUser(msg) - case msg: UserJoining => handleUserJoining(msg) - case msg: UserLeaving => handleUserLeaving(msg) - case msg: GetUsers => handleGetUsers(msg) - case msg: UserRaiseHand => handleUserRaiseHand(msg) - case msg: UserLowerHand => handleUserLowerHand(msg) - case msg: UserShareWebcam => handleUserShareWebcam(msg) - case msg: UserUnshareWebcam => handleUserUnshareWebcam(msg) - case msg: ChangeUserStatus => handleChangeUserStatus(msg) - case msg: AssignPresenter => handleAssignPresenter(msg) - case msg: SetRecordingStatus => handleSetRecordingStatus(msg) - case msg: GetChatHistoryRequest => handleGetChatHistoryRequest(msg) - case msg: SendPublicMessageRequest => handleSendPublicMessageRequest(msg) - case msg: SendPrivateMessageRequest => handleSendPrivateMessageRequest(msg) - case msg: GetCurrentLayoutRequest => handleGetCurrentLayoutRequest(msg) - case msg: BroadcastLayoutRequest => handleBroadcastLayoutRequest(msg) - case msg: PreCreatedPoll => handlePreCreatedPoll(msg) - case msg: CreatePoll => handleCreatePoll(msg) - case msg: UpdatePoll => handleUpdatePoll(msg) - case msg: GetPolls => handleGetPolls(msg) - case msg: DestroyPoll => handleDestroyPoll(msg) - case msg: RemovePoll => handleRemovePoll(msg) - case msg: SharePoll => handleSharePoll(msg) - case msg: ShowPollResult => handleShowPollResult(msg) - case msg: HidePollResult => handleHidePollResult(msg) - case msg: StopPoll => handleStopPoll(msg) - case msg: StartPoll => handleStartPoll(msg) - case msg: ClearPoll => handleClearPoll(msg) - case msg: GetPollResult => handleGetPollResult(msg) - case msg: RespondToPoll => handleRespondToPoll(msg) - case msg: ClearPresentation => handleClearPresentation(msg) - case msg: RemovePresentation => handleRemovePresentation(msg) - case msg: GetPresentationInfo => handleGetPresentationInfo(msg) - //case msg: SendCursorUpdate => handleSendCursorUpdate(msg) - case msg: ResizeAndMoveSlide => handleResizeAndMoveSlide(msg) - case msg: GotoSlide => handleGotoSlide(msg) - case msg: SharePresentation => handleSharePresentation(msg) - case msg: GetSlideInfo => handleGetSlideInfo(msg) - case msg: PreuploadedPresentations => handlePreuploadedPresentations(msg) - case msg: PresentationConversionUpdate => handlePresentationConversionUpdate(msg) - case msg: PresentationPageCountError => handlePresentationPageCountError(msg) - case msg: PresentationSlideGenerated => handlePresentationSlideGenerated(msg) - case msg: PresentationConversionCompleted => handlePresentationConversionCompleted(msg) - case msg: SendVoiceUsersRequest => handleSendVoiceUsersRequest(msg) - case msg: MuteMeetingRequest => handleMuteMeetingRequest(msg) - case msg: IsMeetingMutedRequest => handleIsMeetingMutedRequest(msg) - case msg: MuteUserRequest => handleMuteUserRequest(msg) - case msg: LockUserRequest => handleLockUserRequest(msg) - case msg: EjectUserFromVoiceRequest => handleEjectUserFromVoiceRequest(msg) - case msg: VoiceUserJoinedMessage => handleVoiceUserJoinedMessage(msg) - case msg: VoiceUserJoined => handleVoiceUserJoined(msg) - case msg: VoiceUserLeft => handleVoiceUserLeft(msg) - case msg: VoiceUserLocked => handleVoiceUserLocked(msg) - case msg: VoiceUserMuted => handleVoiceUserMuted(msg) - case msg: VoiceUserTalking => handleVoiceUserTalking(msg) - case msg: VoiceRecording => handleVoiceRecording(msg) - case msg: SendWhiteboardAnnotationRequest => handleSendWhiteboardAnnotationRequest(msg) - case msg: GetWhiteboardShapesRequest => handleGetWhiteboardShapesRequest(msg) - case msg: ClearWhiteboardRequest => handleClearWhiteboardRequest(msg) - case msg: UndoWhiteboardRequest => handleUndoWhiteboardRequest(msg) - case msg: EnableWhiteboardRequest => handleEnableWhiteboardRequest(msg) - case msg: IsWhiteboardEnabledRequest => handleIsWhiteboardEnabledRequest(msg) - case msg: GetAllMeetingsRequest => handleGetAllMeetingsRequest(msg) - - //OUT MESSAGES - case msg: MeetingCreated => handleMeetingCreated(msg) - case msg: VoiceRecordingStarted => handleVoiceRecordingStarted(msg) - case msg: VoiceRecordingStopped => handleVoiceRecordingStopped(msg) - case msg: RecordingStatusChanged => handleRecordingStatusChanged(msg) - case msg: GetRecordingStatusReply => handleGetRecordingStatusReply(msg) - case msg: MeetingEnded => handleMeetingEnded(msg) - case msg: MeetingHasEnded => handleMeetingHasEnded(msg) - case msg: MeetingDestroyed => handleMeetingDestroyed(msg) - case msg: DisconnectAllUsers => handleDisconnectAllUsers(msg) - case msg: DisconnectUser => handleDisconnectUser(msg) - case msg: PermissionsSettingInitialized => handlePermissionsSettingInitialized(msg) - case msg: NewPermissionsSetting => handleNewPermissionsSetting(msg) - case msg: UserLocked => handleUserLocked(msg) - case msg: GetPermissionsSettingReply => handleGetPermissionsSettingReply(msg) - case msg: UserRegistered => handleUserRegistered(msg) - case msg: UserLeft => handleUserLeft(msg) - case msg: PresenterAssigned => handlePresenterAssigned(msg) - case msg: EndAndKickAll => handleEndAndKickAll(msg) - case msg: GetUsersReply => handleGetUsersReply(msg) - case msg: ValidateAuthTokenReply => handleValidateAuthTokenReply(msg) - case msg: UserJoined => handleUserJoined(msg) - case msg: UserRaisedHand => handleUserRaisedHand(msg) - case msg: UserLoweredHand => handleUserLoweredHand(msg) - case msg: UserSharedWebcam => handleUserSharedWebcam(msg) - case msg: UserUnsharedWebcam => handleUserUnsharedWebcam(msg) - case msg: UserStatusChange => handleUserStatusChange(msg) - case msg: MuteVoiceUser => handleMuteVoiceUser(msg) - case msg: UserVoiceMuted => handleUserVoiceMuted(msg) - case msg: UserVoiceTalking => handleUserVoiceTalking(msg) - case msg: EjectVoiceUser => handleEjectVoiceUser(msg) - case msg: UserJoinedVoice => handleUserJoinedVoice(msg) - case msg: UserLeftVoice => handleUserLeftVoice(msg) - case msg: IsMeetingMutedReply => handleIsMeetingMutedReply(msg) - case msg: StartRecording => handleStartRecording(msg) - case msg: StopRecording => handleStopRecording(msg) - case msg: GetChatHistoryReply => handleGetChatHistoryReply(msg) - case msg: SendPublicMessageEvent => handleSendPublicMessageEvent(msg) - case msg: SendPrivateMessageEvent => handleSendPrivateMessageEvent(msg) - case msg: GetCurrentLayoutReply => handleGetCurrentLayoutReply(msg) - case msg: BroadcastLayoutEvent => handleBroadcastLayoutEvent(msg) - case msg: GetPollResultReply => handleGetPollResultReply(msg) - case msg: GetPollsReplyOutMsg => handleGetPollsReplyOutMsg(msg) - case msg: ClearPollFailed => handleClearPollFailed(msg) - case msg: PollClearedOutMsg => handlePollClearedOutMsg(msg) - case msg: PollStartedOutMsg => handlePollStartedOutMsg(msg) - case msg: PollStoppedOutMsg => handlePollStoppedOutMsg(msg) - case msg: PollRemovedOutMsg => handlePollRemovedOutMsg(msg) - case msg: PollUpdatedOutMsg => handlePollUpdatedOutMsg(msg) - case msg: PollCreatedOutMsg => handlePollCreatedOutMsg(msg) - case msg: PollResponseOutMsg => handlePollResponseOutMsg(msg) - case msg: PollHideResultOutMsg => handlePollHideResultOutMsg(msg) - case msg: PollShowResultOutMsg => handlePollShowResultOutMsg(msg) - case msg: ClearPresentationOutMsg => handleClearPresentationOutMsg(msg) - case msg: RemovePresentationOutMsg => handleRemovePresentationOutMsg(msg) - case msg: GetPresentationInfoOutMsg => handleGetPresentationInfoOutMsg(msg) - //case msg: SendCursorUpdateOutMsg => handleSendCursorUpdateOutMsg(msg) - case msg: ResizeAndMoveSlideOutMsg => handleResizeAndMoveSlideOutMsg(msg) - case msg: GotoSlideOutMsg => handleGotoSlideOutMsg(msg) - case msg: SharePresentationOutMsg => handleSharePresentationOutMsg(msg) - case msg: GetSlideInfoOutMsg => handleGetSlideInfoOutMsg(msg) - case msg: GetPreuploadedPresentationsOutMsg => handleGetPreuploadedPresentationsOutMsg(msg) - case msg: PresentationConversionProgress => handlePresentationConversionProgress(msg) - case msg: PresentationConversionError => handlePresentationConversionError(msg) - case msg: PresentationPageGenerated => handlePresentationPageGenerated(msg) - case msg: PresentationConversionDone => handlePresentationConversionDone(msg) - case msg: PresentationChanged => handlePresentationChanged(msg) - case msg: GetPresentationStatusReply => handleGetPresentationStatusReply(msg) - case msg: PresentationRemoved => handlePresentationRemoved(msg) - case msg: PageChanged => handlePageChanged(msg) - case msg: GetWhiteboardShapesReply => handleGetWhiteboardShapesReply(msg) - case msg: SendWhiteboardAnnotationEvent => handleSendWhiteboardAnnotationEvent(msg) - case msg: ClearWhiteboardEvent => handleClearWhiteboardEvent(msg) - case msg: UndoWhiteboardEvent => handleUndoWhiteboardEvent(msg) - case msg: WhiteboardEnabledEvent => handleWhiteboardEnabledEvent(msg) - case msg: IsWhiteboardEnabledReply => handleIsWhiteboardEnabledReply(msg) - case msg: GetAllMeetingsReply => handleGetAllMeetingsReply(msg) - - case _ => // do nothing - } - - private def buildUserHashMap(user: UserVO):java.util.HashMap[String, Object] = { - val vu = user.voiceUser - val vuser = new java.util.HashMap[String, Object]() - vuser.put(Constants.USER_ID, vu.userId) - vuser.put(Constants.WEB_USER_ID, vu.webUserId) - vuser.put(Constants.CALLER_ID_NAME, vu.callerName) - vuser.put(Constants.CALLER_ID_NUM, vu.callerNum) - vuser.put(Constants.JOINED, vu.joined:java.lang.Boolean) - vuser.put(Constants.LOCKED, vu.locked:java.lang.Boolean) - vuser.put(Constants.MUTED, vu.muted:java.lang.Boolean) - vuser.put(Constants.TALKING, vu.talking:java.lang.Boolean) - - val wuser = new java.util.HashMap[String, Object]() - wuser.put(Constants.USER_ID, user.userID) - wuser.put(Constants.EXT_USER_ID, user.externUserID) - wuser.put(Constants.NAME, user.name) - wuser.put(Constants.ROLE, user.role.toString()) - wuser.put(Constants.RAISE_HAND, user.raiseHand:java.lang.Boolean) - wuser.put(Constants.PRESENTER, user.presenter:java.lang.Boolean) - wuser.put(Constants.HAS_STREAM, user.hasStream:java.lang.Boolean) - wuser.put(Constants.LOCKED, user.locked:java.lang.Boolean) - wuser.put("webcamStream", user.webcamStreams mkString("|")) - wuser.put(Constants.PHONE_USER, user.phoneUser:java.lang.Boolean) - wuser.put(Constants.VOICE_USER, vuser) - - wuser - } - - private def buildJson(header: java.util.HashMap[String, Any], - payload: java.util.HashMap[String, Any]): String = { - - val message = new java.util.HashMap[String, java.util.HashMap[String, Any]]() - message.put(Constants.HEADER, header) - message.put(Constants.PAYLOAD, payload) - - val gson = new Gson() - gson.toJson(message) - } - - // IN MESSAGES - private def handleCreateMeeting(msg: CreateMeeting) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.EXTERNAL_MEETING_ID, msg.externalMeetingID) - payload.put(Constants.MEETING_NAME, msg.meetingName) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.VOICE_CONF, msg.voiceBridge) - payload.put(Constants.DURATION, msg.duration) - payload.put(Constants.MODERATOR_PASS, msg.moderatorPass) - payload.put(Constants.VIEWER_PASS, msg.viewerPass) - payload.put(Constants.CREATE_TIME, msg.createTime) - payload.put(Constants.CREATE_DATE, msg.createDate) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.CREATE_MEETING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING CREATE MEETING *****************") - - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleInitializeMeeting(msg: InitializeMeeting) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.INITIALIZE_MEETING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING INITIALIZE MEETING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleDestroyMeeting(msg: DestroyMeeting) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.DESTROY_MEETING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING DESTROY MEETING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleStartMeeting(msg: StartMeeting) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.START_MEETING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING START MEETING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleEndMeeting(msg: EndMeeting) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.END_MEETING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING END MEETING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleLockSetting(msg: LockSetting) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.LOCKED, msg.locked) - - val settingsMap = new java.util.HashMap[String, Boolean]() - for ((key, value) <- msg.settings) { - settingsMap.put(key, value) - } - - payload.put("settings", settingsMap) //#todo not tested - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.END_MEETING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING LOCK SETTING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleLockUser(msg: LockUser) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.LOCK, msg.lock) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.END_MEETING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING LOCK USER *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleInitLockSettings(msg: InitLockSettings) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.SETTINGS, msg.settings.toString()) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.INIT_LOCK_SETTINGS) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING INIT LOCK SETTINGS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleInitAudioSettings(msg: InitAudioSettings) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MUTED, msg.muted.toString()) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.INIT_AUDIO_SETTINGS) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING INIT LOCK SETTINGS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleSetLockSettings(msg: SetLockSettings) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.SETTINGS, msg.settings.toString()) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.SET_LOCK_SETTINGS) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING SET LOCK SETTINGS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetLockSettings(msg: GetLockSettings) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_LOCK_SETTINGS) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET LOCK SETTINGS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleValidateAuthToken(msg: ValidateAuthToken) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.AUTH_TOKEN, msg.token) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.VALIDATE_AUTH_TOKEN) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING VALIDATE AUTH TOKEN *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleRegisterUser(msg: RegisterUser) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.NAME, msg.name) - payload.put(Constants.ROLE, msg.role.toString()) - payload.put(Constants.EXT_USER_ID, msg.extUserID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.REGISTER_USER) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING REGISTER USER *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserJoining(msg: UserJoining) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_JOINING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING HANDLE USER JOINING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserLeaving(msg: UserLeaving) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_LEAVING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING HANDLE USER LEAVING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetUsers(msg: GetUsers) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_USERS) - - /** - * Let's temporarily have this convention as correlationId - */ - val replyTo = msg.meetingID + "/" + msg.requesterID - header.put(Constants.REPLY_TO, replyTo) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING HANDLE GET USERS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserRaiseHand(msg: UserRaiseHand) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.RAISE_HAND) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER RAISE HAND *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserLowerHand(msg: UserLowerHand) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.LOWERED_BY, msg.loweredBy) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.LOWER_HAND) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER LOWER HAND *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserShareWebcam(msg: UserShareWebcam) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.STREAM, msg.stream) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_SHARE_WEBCAM) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER SHARE WEBCAM *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserUnshareWebcam(msg: UserUnshareWebcam) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_UNSHARE_WEBCAM) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER UNSHARE WEBCAM *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleChangeUserStatus(msg: ChangeUserStatus) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.STATUS, msg.status) - payload.put(Constants.VALUE, msg.value) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.CHANGE_USER_STATUS) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING CHANGE USER STATUS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleAssignPresenter(msg: AssignPresenter) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.NEW_PRESENTER_ID, msg.newPresenterID) - payload.put(Constants.NEW_PRESENTER_NAME, msg.newPresenterName) - payload.put(Constants.ASSIGNED_BY, msg.assignedBy) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.ASSIGN_PRESENTER) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING ASSIGN PRESENTER *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleSetRecordingStatus(msg: SetRecordingStatus) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.RECORDING, msg.recording) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.SET_RECORDING_STATUS) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING SET RECORDING STATUS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetChatHistoryRequest(msg: GetChatHistoryRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_CHAT_HISTORY) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET CHAT HISTORY REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleSendPublicMessageRequest(msg: SendPublicMessageRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val messageMap = new java.util.HashMap[String, String]() - for ((key, value) <- msg.message) { - messageMap.put(key, value) - } - payload.put("message", messageMap) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.SEND_PUBLIC_MESSAGE) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING SEND PUBLIC MESSAGE REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleSendPrivateMessageRequest(msg: SendPrivateMessageRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val messageMap = new java.util.HashMap[String, String]() - for ((key, value) <- msg.message) { - messageMap.put(key, value) - } - payload.put("message", messageMap) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.SEND_PRIVATE_CHAT_MESSAGE) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING SEND PRIVATE MESSAGE REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetCurrentLayoutRequest(msg: GetCurrentLayoutRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_CURRENT_LAYOUT) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET CURRENT LAYOUT REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleBroadcastLayoutRequest(msg: BroadcastLayoutRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.LAYOUT, msg.layout) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.BROADCAST_LAYOUT) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleLockLayoutRequest(msg: LockLayoutRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.setById) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.UNLOCK_LAYOUT) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePreCreatedPoll(msg: PreCreatedPoll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.POLL, msg.poll) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.PRECREATED_POLL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING PRE CREATED POLL *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleCreatePoll(msg: CreatePoll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL, msg.poll) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.CREATE_POLL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING CREATE POLL *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUpdatePoll(msg: UpdatePoll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL, msg.poll) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.UPDATE_POLL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING UPDATE POLL *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetPolls(msg: GetPolls) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_POLLS) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET POLLS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleDestroyPoll(msg: DestroyPoll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.DESTROY_POLL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING DESTROY POLLS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleRemovePoll(msg: RemovePoll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.REMOVE_POLL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING REMOVE POLL *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleSharePoll(msg: SharePoll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.SHARE_POLL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING SHARE POLL *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleShowPollResult(msg: ShowPollResult) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.SHOW_POLL_RESULT) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING SHOW POLL RESULTS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleHidePollResult(msg: HidePollResult) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.HIDE_POLL_RESULT) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING HIDE POLL RESULTS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleStopPoll(msg: StopPoll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.STOP_POLL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING STOP POLL *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleStartPoll(msg: StartPoll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.START_POLL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING START POLL *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleClearPoll(msg: ClearPoll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL_ID, msg.pollID) - payload.put(Constants.FORCE, msg.force) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.CLEAR_POLL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING CLEAR POLL *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetPollResult(msg: GetPollResult) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_POLL_RESULT) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET POLL RESULT *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleRespondToPoll(msg: RespondToPoll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.RESPONSE, msg.response) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.RESPONT_TO_POLL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING RESPOND TO POLL *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleClearPresentation(msg: ClearPresentation) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.CLEAR_PRESENTATION) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING CLEAR PRESENTATION *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleRemovePresentation(msg: RemovePresentation) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PRESENTATION_ID, msg.presentationID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.REMOVE_PRESENTATION) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING REMOVE PRESENTATION *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetPresentationInfo(msg: GetPresentationInfo) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_PRESENTATION_INFO) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET PRESENTATION INFO *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - /*private def handleSendCursorUpdate(msg: SendCursorUpdate) { - var map = new java.util.HashMap[String, Any]() - map.put("meetingID", msg.meetingID) - map.put("xPercent", msg.xPercent) - map.put("yPercent", msg.yPercent) - map.put("timestamp", TimestampGenerator.generateTimestamp) - - println("***** DISPATCHING SEND CURSOR UPDATE *****************") - dispatcher.dispatch(buildJson(header, payload)) - }*/ - - private def handleResizeAndMoveSlide(msg: ResizeAndMoveSlide) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.X_OFFSET, msg.xOffset) - payload.put(Constants.Y_OFFSET, msg.yOffset) - payload.put(Constants.WIDTH_RATIO, msg.widthRatio) - payload.put(Constants.HEIGHT_RATIO, msg.heightRatio) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.RESIZE_AND_MOVE_SLIDE) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING RESIZE AND MOVE SLIDE *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGotoSlide(msg: GotoSlide) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PAGE, msg.page) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GO_TO_SLIDE) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GO TO SLIDE *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleSharePresentation(msg: SharePresentation) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PRESENTATION_ID, msg.presentationID) - payload.put(Constants.SHARE, msg.share) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.SHARE_PRESENTATION) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING SHARE PRESENTATION *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetSlideInfo(msg: GetSlideInfo) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_SLIDE_INFO) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET SLIDE INFO *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePreuploadedPresentations(msg: PreuploadedPresentations) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PRESENTATIONS, msg.presentations.toString()) //#todo not tested - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.PREUPLOADED_PRESENTATIONS) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING PREUPLOADED PRESENTATIONS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePresentationConversionUpdate(msg: PresentationConversionUpdate) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MESSAGE_KEY, msg.messageKey) - payload.put(Constants.CODE, msg.code) - payload.put(Constants.PRESENTATION_ID, msg.presentationId) - payload.put(Constants.PRESENTATION_NAME, msg.presName) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.PRESENTATION_CONVERSION_UPDATE) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING PRESENTATION CONVERSION UPDATE *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePresentationPageCountError(msg: PresentationPageCountError) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MESSAGE_KEY, msg.messageKey) - payload.put(Constants.CODE, msg.code) - payload.put(Constants.PRESENTATION_ID, msg.presentationId) - payload.put(Constants.PRESENTATION_NAME, msg.presName) - payload.put(Constants.NUM_PAGES, msg.numberOfPages) - payload.put(Constants.MAX_NUM_PAGES, msg.maxNumberPages) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.PRESENTATION_PAGE_COUNT_ERROR) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING PRESENTATION PAGE COUNT ERROR *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePresentationSlideGenerated(msg: PresentationSlideGenerated) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MESSAGE_KEY, msg.messageKey) - payload.put(Constants.CODE, msg.code) - payload.put(Constants.PRESENTATION_ID, msg.presentationId) - payload.put(Constants.PRESENTATION_NAME, msg.presName) - payload.put(Constants.NUM_PAGES, msg.numberOfPages) - payload.put(Constants.PAGES_COMPLETED, msg.pagesCompleted) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.PRESENTATION_PAGE_GENERATED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING PRESENTATION SLIDE GENERATED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePresentationConversionCompleted(msg: PresentationConversionCompleted) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MESSAGE_KEY, msg.messageKey) - payload.put(Constants.CODE, msg.code) - payload.put(Constants.PRESENTATION_ID, msg.presentation) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.PRESENTATION_CONVERSION_COMPLETED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING PRESENTATION CONVERSION COMPLETED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleSendVoiceUsersRequest(msg: SendVoiceUsersRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.SEND_VOICE_USERS_REQUEST) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING SEND VOICE USERS REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleMuteMeetingRequest(msg: MuteMeetingRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.MUTE, msg.mute) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.MUTE_MEETING_REQUEST) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING MUTE MEETING REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleIsMeetingMutedRequest(msg: IsMeetingMutedRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.IS_MEETING_MUTED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING IS MEETING MUTED REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleMuteUserRequest(msg: MuteUserRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.MUTE, msg.mute) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.MUTE_USER) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING MUTE USER REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleLockUserRequest(msg: LockUserRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.LOCK, msg.lock) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.LOCK_USER) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING LOCK USER REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleEjectUserFromVoiceRequest(msg: EjectUserFromVoiceRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.ejectedBy) - payload.put(Constants.USER_ID, msg.userId) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.EJECT_USER) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING EJECT USER REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleVoiceUserJoinedMessage(msg: VoiceUserJoinedMessage) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER, msg.user.toString()) - payload.put(Constants.VOICE_CONF, msg.voiceConfId) - payload.put(Constants.CALLER_ID_NUM, msg.callerIdNum) - payload.put(Constants.CALLER_ID_NAME, msg.callerIdName) - payload.put(Constants.MUTED, msg.muted) - payload.put(Constants.TALKING, msg.talking) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.VOICE_USER_JOINED_MESSAGE) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING VOICE USER JOINED MESSAGE *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleVoiceUserJoined(msg: VoiceUserJoined) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.VOICE_USER, msg.voiceUser) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.VOICE_USER_JOINED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING VOICE USER JOINED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleVoiceUserLeft(msg: VoiceUserLeft) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.VOICE_USER_LEFT) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING VOICE USER LEFT *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleVoiceUserLocked(msg: VoiceUserLocked) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.LOCKED, msg.locked) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.VOICE_USER_LOCKED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING VOICE USER LOCKED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleVoiceUserMuted(msg: VoiceUserMuted) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.MUTED, msg.muted) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.VOICE_USER_MUTED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING VOICE USER MUTED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleVoiceUserTalking(msg: VoiceUserTalking) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.TALKING, msg.talking) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.VOICE_USER_TALKING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING VOICE USER TALKING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleVoiceRecording(msg: VoiceRecording) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDING_FILE, msg.recordingFile) - payload.put(Constants.TIMESTAMP, msg.timestamp) - payload.put(Constants.RECORDING, msg.recording) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.VOICE_RECORDING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING VOICE RECORDING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleSendWhiteboardAnnotationRequest(msg: SendWhiteboardAnnotationRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.ANNOTATION, msg.annotation) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.SEND_WHITEBOARD_ANNOTATION) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING SEND WHITEBOARD ANNOTATION REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetWhiteboardShapesRequest(msg: GetWhiteboardShapesRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.WHITEBOARD_ID, msg.whiteboardId) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_WHITEBOARD_SHAPES) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING SEND WHITEBOARD SHAPES REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleClearWhiteboardRequest(msg: ClearWhiteboardRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.WHITEBOARD_ID, msg.whiteboardId) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.CLEAR_WHITEBOARD) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING CLEAR WHITEBOARD REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUndoWhiteboardRequest(msg: UndoWhiteboardRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.WHITEBOARD_ID, msg.whiteboardId) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.UNDO_WHITEBOARD) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING UNDO WHITEBOARD REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleEnableWhiteboardRequest(msg: EnableWhiteboardRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.ENABLE, msg.enable) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.ENABLE_WHITEBOARD) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING ENABLE WHITEBOARD REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleIsWhiteboardEnabledRequest(msg: IsWhiteboardEnabledRequest) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.IS_WHITEBOARD_ENABLED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING IS WHITEBOARD ENABLED REQUEST *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetAllMeetingsRequest(msg: GetAllMeetingsRequest) { - println("***** DISPATCHING GET ALL MEETINGS REQUEST *****************") - } - - - - // OUT MESSAGES - private def handleMeetingCreated(msg: MeetingCreated) { - val json = MeetingMessageToJsonConverter.meetingCreatedToJson(msg) - dispatcher.dispatch(json) - } - - private def handleVoiceRecordingStarted(msg: VoiceRecordingStarted) { - val json = MeetingMessageToJsonConverter.voiceRecordingStartedToJson(msg) - dispatcher.dispatch(json) - } - - private def handleVoiceRecordingStopped(msg: VoiceRecordingStopped) { - val json = MeetingMessageToJsonConverter.voiceRecordingStoppedToJson(msg) - dispatcher.dispatch(json) - } - - private def handleRecordingStatusChanged(msg: RecordingStatusChanged) { - val json = MeetingMessageToJsonConverter.recordingStatusChangedToJson(msg) - dispatcher.dispatch(json) - } - - private def handleGetRecordingStatusReply(msg: GetRecordingStatusReply) { - val json = MeetingMessageToJsonConverter.getRecordingStatusReplyToJson(msg) - dispatcher.dispatch(json) - } - - private def handleMeetingEnded(msg: MeetingEnded) { - val json = MeetingMessageToJsonConverter.meetingEndedToJson(msg) - dispatcher.dispatch(json) - } - - private def handleMeetingHasEnded(msg: MeetingHasEnded) { - val json = MeetingMessageToJsonConverter.meetingHasEndedToJson(msg) - dispatcher.dispatch(json) - } - - private def handleMeetingDestroyed(msg: MeetingDestroyed) { - val json = MeetingMessageToJsonConverter.meetingDestroyedToJson(msg) - dispatcher.dispatch(json) - } - - private def handleDisconnectAllUsers(msg: DisconnectAllUsers) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.DISCONNECT_ALL_USERS) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING DISCONNECT ALL USERS *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleDisconnectUser(msg: DisconnectUser) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.DISCONNECT_USER) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING DISCONNECT USER *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePermissionsSettingInitialized(msg: PermissionsSettingInitialized) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.SETTINGS, msg.permissions.toString()) //#todo not tested - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.PERMISSION_SETTING_INITIALIZED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING PERMISSIONS SETTING INIIALIZED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleNewPermissionsSetting(msg: NewPermissionsSetting) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.SETTINGS, msg.permissions.toString()) //#todo not tested - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.NEW_PERMISSION_SETTINGS) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING NEW PERMISSIONS SETTING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserLocked(msg: UserLocked) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.LOCKED, msg.lock) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_LOCKED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER LOCKED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetPermissionsSettingReply(msg: GetPermissionsSettingReply) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_PERMISSION_SETTINGS_REPLY) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserRegistered(msg: UserRegistered) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER, msg.user.toString()) - payload.put(Constants.RECORDED, msg.recorded) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_REGISTERED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER REGISTERED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserLeft(msg: UserLeft) { - val json = UsersMessageToJsonConverter.userLeftToJson(msg) - dispatcher.dispatch(json) - } - - private def handlePresenterAssigned(msg: PresenterAssigned) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.NEW_PRESENTER_ID, msg.presenter.presenterID); - payload.put(Constants.NEW_PRESENTER_NAME, msg.presenter.presenterName); - payload.put(Constants.ASSIGNED_BY, msg.presenter.assignedBy); - payload.put(Constants.RECORDED, msg.recorded) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.PRESENTER_ASSIGNED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING PRESENTER ASSIGNED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleEndAndKickAll(msg: EndAndKickAll) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.END_AND_KICK_ALL) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING END AND KICK ALL *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetUsersReply(msg: GetUsersReply) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val users = new ArrayList[java.util.HashMap[String, Object]]; - msg.users.foreach(uvo => { - users.add(buildUserHashMap(uvo)) - }) - - payload.put(Constants.USERS, users) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_USERS_REPLY) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET USERS REPLY *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleValidateAuthTokenReply(msg: ValidateAuthTokenReply) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterId) - payload.put(Constants.AUTH_TOKEN, msg.token) - payload.put(Constants.VALID, msg.valid) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.VALIDATE_AUTH_TOKEN_REPLY) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING VALIDATE AUTH TOKEN REPLY *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserJoined(msg: UserJoined) { - val json = UsersMessageToJsonConverter.userJoinedToJson(msg) - dispatcher.dispatch(json) - } - - private def handleUserRaisedHand(msg: UserRaisedHand) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RAISE_HAND, msg.recorded) - payload.put(Constants.USER_ID, msg.userID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_RAISED_HAND) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER RAISED HAND *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserLoweredHand(msg: UserLoweredHand) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RAISE_HAND, msg.recorded) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.LOWERED_BY, msg.loweredBy) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_LOWERED_HAND) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER LOWERED HAND *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserSharedWebcam(msg: UserSharedWebcam) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.STREAM, msg.stream) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_SHARED_WEBCAM) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER SHARED WEBCAM *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserUnsharedWebcam(msg: UserUnsharedWebcam) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.STREAM, msg.stream) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_UNSHARED_WEBCAM) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER UNSHARED WEBCAM *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserStatusChange(msg: UserStatusChange) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.STATUS, msg.status) - payload.put(Constants.VALUE, msg.value) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_STATUS_CHANGED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER STATUS CHANGE *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleMuteVoiceUser(msg: MuteVoiceUser) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.MUTE, msg.mute) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.MUTE_VOICE_USER) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING MUTE VOICE USER *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserVoiceMuted(msg: UserVoiceMuted) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER, msg.user.toString()) - payload.put(Constants.VOICE_CONF, msg.confNum) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_VOICE_MUTED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER VOICE MUTED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserVoiceTalking(msg: UserVoiceTalking) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER, msg.user.toString()) - payload.put(Constants.VOICE_CONF, msg.confNum) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_VOICE_TALKING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER VOICE TALKING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleEjectVoiceUser(msg: EjectVoiceUser) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.EJECT_VOICE_USER) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING EJECT VOICE USER *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserJoinedVoice(msg: UserJoinedVoice) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER, msg.user.toString()) - payload.put(Constants.VOICE_CONF, msg.confNum) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_JOINED_VOICE) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER JOINED VOICE *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleUserLeftVoice(msg: UserLeftVoice) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER, msg.user.toString()) - payload.put(Constants.VOICE_CONF, msg.confNum) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.USER_LEFT_VOICE) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING USER LEFT VOICE *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleIsMeetingMutedReply(msg: IsMeetingMutedReply) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.MUTED, msg.meetingMuted) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.IS_MEETING_MUTED_REPLY) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING IS MEETING MUTED REPLY *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleStartRecording(msg: StartRecording) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.START_RECORDING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING START RECORDING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleStopRecording(msg: StopRecording) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.STOP_RECORDING) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING STOP RECORDING *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetChatHistoryReply(msg: GetChatHistoryReply) { - val json = ChatMessageToJsonConverter.getChatHistoryReplyToJson(msg) - dispatcher.dispatch(json) - } - - private def handleSendPublicMessageEvent(msg: SendPublicMessageEvent) { - val json = ChatMessageToJsonConverter.sendPublicMessageEventToJson(msg) - dispatcher.dispatch(json) - } - - private def handleSendPrivateMessageEvent(msg: SendPrivateMessageEvent) { - val json = ChatMessageToJsonConverter.sendPrivateMessageEventToJson(msg) - dispatcher.dispatch(json) - } - - private def handleGetCurrentLayoutReply(msg: GetCurrentLayoutReply) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.LAYOUT_ID, msg.layoutID) - payload.put(Constants.LOCKED, msg.locked) - payload.put(Constants.SET_BY_USER_ID, msg.setByUserID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_CURRENT_LAYOUT_REPLY) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET CURRENT LAYOUT REPLY *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleBroadcastLayoutEvent(msg: BroadcastLayoutEvent) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.LAYOUT_ID, msg.layoutID) - payload.put(Constants.LOCKED, msg.locked) - payload.put(Constants.SET_BY_USER_ID, msg.setByUserID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.BROADCAST_LAYOUT_REPLY) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING BROADCAST LAYOUT EVENT *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - - private def handleGetPollResultReply(msg: GetPollResultReply) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.POLL, msg.pollVO) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_POLL_RESULT_REPLY) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET POLL RESULT REPLY *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleGetPollsReplyOutMsg(msg: GetPollsReplyOutMsg) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val collection = new ArrayList[PollVO](); - msg.polls.foreach(p => { - collection.add(p) - }) - - payload.put(Constants.POLLS, collection) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.GET_POLLS_REPLY) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING GET POLLS REPLY OUTMSG *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleClearPollFailed(msg: ClearPollFailed) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.POLL_ID, msg.pollID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.REASON, msg.reason) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.CLEAR_POLL_FAILED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING CLEAR POLL FAILED *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePollClearedOutMsg(msg: PollClearedOutMsg) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.POLL_CLEARED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING POLL CLEARED OUTMSG *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePollStartedOutMsg(msg: PollStartedOutMsg) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.POLL_STARTED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING POLL STARTED OUTMSG *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePollStoppedOutMsg(msg: PollStoppedOutMsg) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.POLL_STOPPED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING POLL STOPPED OUTMSG *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePollRemovedOutMsg(msg: PollRemovedOutMsg) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.POLL_REMOVED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING POLL REMOVED OUTMSG *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePollUpdatedOutMsg(msg: PollUpdatedOutMsg) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.POLL_ID, msg.pollID) - payload.put(Constants.POLL, msg.pollVO) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.POLL_UPDATED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING POLL UPDATED OUTMSG *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePollCreatedOutMsg(msg: PollCreatedOutMsg) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.POLL_ID, msg.pollID) - payload.put(Constants.POLL, msg.pollVO) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.POLL_CREATED) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING POLL CREATED OUTMSG *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePollResponseOutMsg(msg: PollResponseOutMsg) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RESPONDER, msg.responder) - payload.put(Constants.RESPONSE, msg.response) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.POLL_RESPONSE) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING POLL RESPONSE OUTMSG *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePollHideResultOutMsg(msg: PollHideResultOutMsg) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.POLL_HIDE_RESULT) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING POLL HIDE RESULT OUTMSG *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handlePollShowResultOutMsg(msg: PollShowResultOutMsg) { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.POLL_ID, msg.pollID) - - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, MessageNames.POLL_SHOW_RESULT) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - -// println("***** DISPATCHING POLL SHOW RESULT OUTMSG *****************") - dispatcher.dispatch(buildJson(header, payload)) - } - - private def handleClearPresentationOutMsg(msg: ClearPresentationOutMsg) { - val json = PesentationMessageToJsonConverter.clearPresentationOutMsgToJson(msg) - dispatcher.dispatch(json) - } - - private def handleRemovePresentationOutMsg(msg: RemovePresentationOutMsg) { - val json = PesentationMessageToJsonConverter.removePresentationOutMsgToJson(msg) - dispatcher.dispatch(json) - } - - private def handleGetPresentationInfoOutMsg(msg: GetPresentationInfoOutMsg) { - val json = PesentationMessageToJsonConverter.getPresentationInfoOutMsgToJson(msg) - dispatcher.dispatch(json) - } - - private def handleSendCursorUpdateOutMsg(msg: SendCursorUpdateOutMsg) { - val json = PesentationMessageToJsonConverter.sendCursorUpdateOutMsgToJson(msg) - // Comment out as we don't want to store cursor updates (ralam may 7, 2014) - //dispatcher.dispatch(json) - } - - private def handleResizeAndMoveSlideOutMsg(msg: ResizeAndMoveSlideOutMsg) { - val json = PesentationMessageToJsonConverter.resizeAndMoveSlideOutMsgToJson(msg) - dispatcher.dispatch(json) - } - - private def handleGotoSlideOutMsg(msg: GotoSlideOutMsg) { - val json = PesentationMessageToJsonConverter.gotoSlideOutMsgToJson(msg) - dispatcher.dispatch(json) - } - - private def handleSharePresentationOutMsg(msg: SharePresentationOutMsg) { - val json = PesentationMessageToJsonConverter.sharePresentationOutMsgToJson(msg) - dispatcher.dispatch(json) - } - - private def handleGetSlideInfoOutMsg(msg: GetSlideInfoOutMsg) { - val json = PesentationMessageToJsonConverter.getSlideInfoOutMsgToJson(msg) - dispatcher.dispatch(json) - } - - private def handleGetPreuploadedPresentationsOutMsg(msg: GetPreuploadedPresentationsOutMsg) { - val json = PesentationMessageToJsonConverter.getPreuploadedPresentationsOutMsgToJson(msg) - dispatcher.dispatch(json) - } - - private def handlePresentationConversionProgress(msg: PresentationConversionProgress) { - val json = PesentationMessageToJsonConverter.presentationConversionProgressToJson(msg) - dispatcher.dispatch(json) - } - - private def handlePresentationConversionError(msg: PresentationConversionError) { - val json = PesentationMessageToJsonConverter.presentationConversionErrorToJson(msg) - dispatcher.dispatch(json) - } - - private def handlePresentationPageGenerated(msg: PresentationPageGenerated) { - val json = PesentationMessageToJsonConverter.presentationPageGenerated(msg) - dispatcher.dispatch(json) - } - - private def handlePresentationConversionDone(msg: PresentationConversionDone) { - val json = PesentationMessageToJsonConverter.presentationConversionDoneToJson(msg) - dispatcher.dispatch(json) - } - - private def handlePresentationChanged(msg: PresentationChanged) { - val json = PesentationMessageToJsonConverter.presentationChangedToJson(msg) - dispatcher.dispatch(json) - } - - private def handleGetPresentationStatusReply(msg: GetPresentationStatusReply) { - val json = PesentationMessageToJsonConverter.getPresentationStatusReplyToJson(msg) - dispatcher.dispatch(json) - } - - private def handlePresentationRemoved(msg: PresentationRemoved) { - val json = PesentationMessageToJsonConverter.presentationRemovedToJson(msg) - dispatcher.dispatch(json) - } - - private def handlePageChanged(msg: PageChanged) { - val json = PesentationMessageToJsonConverter.pageChangedToJson(msg) - dispatcher.dispatch(json) - } - - private def handleGetWhiteboardShapesReply(msg: GetWhiteboardShapesReply) { - val json = WhiteboardMessageToJsonConverter.getWhiteboardShapesReplyToJson(msg) - dispatcher.dispatch(json) - } - - private def handleSendWhiteboardAnnotationEvent(msg: SendWhiteboardAnnotationEvent) { - val json = WhiteboardMessageToJsonConverter.sendWhiteboardAnnotationEventToJson(msg) - dispatcher.dispatch(json) - } - - private def handleClearWhiteboardEvent(msg: ClearWhiteboardEvent) { - val json = WhiteboardMessageToJsonConverter.clearWhiteboardEventToJson(msg) - dispatcher.dispatch(json) - } - - private def handleUndoWhiteboardEvent(msg: UndoWhiteboardEvent) { - val json = WhiteboardMessageToJsonConverter.undoWhiteboardEventToJson(msg) - dispatcher.dispatch(json) - } - - private def handleWhiteboardEnabledEvent(msg: WhiteboardEnabledEvent) { - val json = WhiteboardMessageToJsonConverter.whiteboardEnabledEventToJson(msg) - dispatcher.dispatch(json) - } - - private def handleIsWhiteboardEnabledReply(msg: IsWhiteboardEnabledReply) { - val json = WhiteboardMessageToJsonConverter.isWhiteboardEnabledReplyToJson(msg) - dispatcher.dispatch(json) - } - private def handleGetAllMeetingsReply(msg: GetAllMeetingsReply) { - val json = MeetingMessageToJsonConverter.getAllMeetingsReplyToJson(msg) - println("***** DISPATCHING GET ALL MEETINGS REPLY OUTMSG *****************") - dispatcher.dispatch(json) - } -} diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/CollectorGateway.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/CollectorGateway.scala deleted file mode 100755 index 5f21f668d1..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/CollectorGateway.scala +++ /dev/null @@ -1,22 +0,0 @@ -package org.bigbluebutton.core - -import org.bigbluebutton.core.api.IDispatcher -import org.bigbluebutton.core.api.InMessage -import org.bigbluebutton.core.api.IOutMessage -import org.bigbluebutton.core.api.OutMessageListener2 - -class CollectorGateway(dispatcher: IDispatcher) extends OutMessageListener2 { - - // FIXME -// private val collActor = new CollectorActor(dispatcher) - -// collActor.start - - def collectInMessage(msg: InMessage) { -// collActor ! msg - } - - def handleMessage(msg: IOutMessage) { -// collActor ! msg - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/MeetingActor.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/MeetingActor.scala deleted file mode 100755 index 76ce57ef8e..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/MeetingActor.scala +++ /dev/null @@ -1,260 +0,0 @@ -package org.bigbluebutton.core - -import akka.actor.Actor -import akka.actor.ActorRef -import akka.actor.ActorLogging -import akka.actor.Props -import org.bigbluebutton.core.apps.poll.Poll -import org.bigbluebutton.core.apps.poll.PollApp -import org.bigbluebutton.core.apps.users.UsersApp -import org.bigbluebutton.core.api._ -import org.bigbluebutton.core.apps.presentation.PresentationApp -import org.bigbluebutton.core.apps.layout.LayoutApp -import org.bigbluebutton.core.apps.chat.ChatApp -import org.bigbluebutton.core.apps.whiteboard.WhiteboardApp -import java.util.concurrent.TimeUnit -import org.bigbluebutton.core.util._ - -case object StopMeetingActor - -object MeetingActor { - def props(meetingID: String, externalMeetingID: String, meetingName: String, recorded: Boolean, - voiceBridge: String, duration: Long, - autoStartRecording: Boolean, allowStartStopRecording: Boolean, - moderatorPass: String, viewerPass: String, - createTime: Long, createDate: String, - outGW: MessageOutGateway): Props = - Props(classOf[MeetingActor], meetingID, externalMeetingID, meetingName, recorded, - voiceBridge, duration, - autoStartRecording, allowStartStopRecording, - moderatorPass, viewerPass, - createTime, createDate, - outGW) -} - -class MeetingActor(val meetingID: String, val externalMeetingID: String, val meetingName: String, val recorded: Boolean, - val voiceBridge: String, duration: Long, - val autoStartRecording: Boolean, val allowStartStopRecording: Boolean, - val moderatorPass: String, val viewerPass: String, - val createTime: Long, val createDate: String, - val outGW: MessageOutGateway) - extends Actor with UsersApp with PresentationApp - with PollApp with LayoutApp with ChatApp - with WhiteboardApp with ActorLogging { - - var audioSettingsInited = false - var permissionsInited = false - var permissions = new Permissions() - var recording = false; - var muted = false; - var meetingEnded = false - - val TIMER_INTERVAL = 30000 - var hasLastWebUserLeft = false - var lastWebUserLeftOn:Long = 0 - - // FIXME -// class TimerActor(val timeout: Long, val who: Actor, val reply: String) extends Actor { -// def act { -// reactWithin(timeout) { -// case TIMEOUT => who ! reply -// } -// } -// } - - def receive = { - case "StartTimer" => handleStartTimer - case "Hello" => handleHello - case "MonitorNumberOfWebUsers" => handleMonitorNumberOfWebUsers() - case msg: ValidateAuthToken => handleValidateAuthToken(msg) - case msg: RegisterUser => handleRegisterUser(msg) - case msg: VoiceUserJoined => handleVoiceUserJoined(msg) - case msg: VoiceUserLeft => handleVoiceUserLeft(msg) - case msg: VoiceUserMuted => handleVoiceUserMuted(msg) - case msg: VoiceUserTalking => handleVoiceUserTalking(msg) - case msg: UserJoining => handleUserJoin(msg) - case msg: UserLeaving => handleUserLeft(msg) - case msg: AssignPresenter => handleAssignPresenter(msg) - case msg: GetUsers => handleGetUsers(msg) - case msg: ChangeUserStatus => handleChangeUserStatus(msg) - case msg: EjectUserFromMeeting => handleEjectUserFromMeeting(msg) - case msg: UserRaiseHand => handleUserRaiseHand(msg) - case msg: UserLowerHand => handleUserLowerHand(msg) - case msg: UserShareWebcam => handleUserShareWebcam(msg) - case msg: UserUnshareWebcam => handleUserunshareWebcam(msg) - case msg: MuteMeetingRequest => handleMuteMeetingRequest(msg) - case msg: MuteAllExceptPresenterRequest => handleMuteAllExceptPresenterRequest(msg) - case msg: IsMeetingMutedRequest => handleIsMeetingMutedRequest(msg) - case msg: MuteUserRequest => handleMuteUserRequest(msg) - case msg: EjectUserFromVoiceRequest => handleEjectUserRequest(msg) - case msg: SetLockSettings => handleSetLockSettings(msg) - case msg: GetLockSettings => handleGetLockSettings(msg) - case msg: LockUserRequest => handleLockUserRequest(msg) - case msg: InitLockSettings => handleInitLockSettings(msg) - case msg: InitAudioSettings => handleInitAudioSettings(msg) - case msg: GetChatHistoryRequest => handleGetChatHistoryRequest(msg) - case msg: SendPublicMessageRequest => handleSendPublicMessageRequest(msg) - case msg: SendPrivateMessageRequest => handleSendPrivateMessageRequest(msg) - case msg: UserConnectedToGlobalAudio => handleUserConnectedToGlobalAudio(msg) - case msg: UserDisconnectedFromGlobalAudio => handleUserDisconnectedFromGlobalAudio(msg) - case msg: GetCurrentLayoutRequest => handleGetCurrentLayoutRequest(msg) - case msg: BroadcastLayoutRequest => handleBroadcastLayoutRequest(msg) - case msg: InitializeMeeting => handleInitializeMeeting(msg) - case msg: ClearPresentation => handleClearPresentation(msg) - case msg: PresentationConversionUpdate => handlePresentationConversionUpdate(msg) - case msg: PresentationPageCountError => handlePresentationPageCountError(msg) - case msg: PresentationSlideGenerated => handlePresentationSlideGenerated(msg) - case msg: PresentationConversionCompleted => handlePresentationConversionCompleted(msg) - case msg: RemovePresentation => handleRemovePresentation(msg) - case msg: GetPresentationInfo => handleGetPresentationInfo(msg) - case msg: SendCursorUpdate => handleSendCursorUpdate(msg) - case msg: ResizeAndMoveSlide => handleResizeAndMoveSlide(msg) - case msg: GotoSlide => handleGotoSlide(msg) - case msg: SharePresentation => handleSharePresentation(msg) - case msg: GetSlideInfo => handleGetSlideInfo(msg) - case msg: PreuploadedPresentations => handlePreuploadedPresentations(msg) - case msg: PreCreatedPoll => handlePreCreatedPoll(msg) - case msg: CreatePoll => handleCreatePoll(msg) - case msg: UpdatePoll => handleUpdatePoll(msg) - case msg: DestroyPoll => handleDestroyPoll(msg) - case msg: RemovePoll => handleRemovePoll(msg) - case msg: SharePoll => handleSharePoll(msg) - case msg: StopPoll => handleStopPoll(msg) - case msg: StartPoll => handleStartPoll(msg) - case msg: ClearPoll => handleClearPoll(msg) - case msg: GetPolls => handleGetPolls(msg) - case msg: RespondToPoll => handleRespondToPoll(msg) - case msg: HidePollResult => handleHidePollResult(msg) - case msg: ShowPollResult => handleShowPollResult(msg) - case msg: SendWhiteboardAnnotationRequest => handleSendWhiteboardAnnotationRequest(msg) - case msg: GetWhiteboardShapesRequest => handleGetWhiteboardShapesRequest(msg) - case msg: ClearWhiteboardRequest => handleClearWhiteboardRequest(msg) - case msg: UndoWhiteboardRequest => handleUndoWhiteboardRequest(msg) - case msg: EnableWhiteboardRequest => handleEnableWhiteboardRequest(msg) - case msg: IsWhiteboardEnabledRequest => handleIsWhiteboardEnabledRequest(msg) - case msg: SetRecordingStatus => handleSetRecordingStatus(msg) - case msg: GetRecordingStatus => handleGetRecordingStatus(msg) - case msg: VoiceRecording => handleVoiceRecording(msg) - - case msg: EndMeeting => handleEndMeeting(msg) - case StopMeetingActor => //exit - case _ => // do nothing - } - - def hasMeetingEnded():Boolean = { - meetingEnded - } - - private def handleStartTimer() { -// println("***************timer started******************") -// val timerActor = new TimerActor(2000, self, "Hello") -// timerActor.start - } - - private def handleHello() { -// println("***************hello received on [" + System.currentTimeMillis() + "]******************") - -// val timerActor = new TimerActor(2000, self, "Hello") -// timerActor.start - } - - def webUserJoined() { - if (users.numWebUsers > 0) { - lastWebUserLeftOn = 0 - } - } - - def startRecordingIfAutoStart() { - if (recorded && !recording && autoStartRecording && users.numWebUsers == 1) { - log.info("Auto start recording for meeting=[" + meetingID + "]") - recording = true - outGW.send(new RecordingStatusChanged(meetingID, recorded, "system", recording)) - } - } - - def stopAutoStartedRecording() { - if (recorded && recording && autoStartRecording - && users.numWebUsers == 0) { - log.info("Last web user left. Auto stopping recording for meeting=[{}", meetingID) - recording = false - outGW.send(new RecordingStatusChanged(meetingID, recorded, "system", recording)) - } - } - - def startCheckingIfWeNeedToEndVoiceConf() { - if (users.numWebUsers == 0) { - lastWebUserLeftOn = timeNowInMinutes - log.debug("MonitorNumberOfWebUsers started for meeting [" + meetingID + "]") - scheduleEndVoiceConference() - } - } - - def handleMonitorNumberOfWebUsers() { - if (users.numWebUsers == 0 && lastWebUserLeftOn > 0) { - if (timeNowInMinutes - lastWebUserLeftOn > 2) { - log.info("MonitorNumberOfWebUsers empty for meeting [" + meetingID + "]. Ejecting all users from voice.") - outGW.send(new EjectAllVoiceUsers(meetingID, recorded, voiceBridge)) - } else { - scheduleEndVoiceConference() - } - } - } - - private def scheduleEndVoiceConference() { - log.debug("MonitorNumberOfWebUsers continue for meeting [" + meetingID + "]") -// val timerActor = new TimerActor(TIMER_INTERVAL, self, "MonitorNumberOfWebUsers") -// timerActor.start - } - - def timeNowInMinutes():Long = { - TimeUnit.NANOSECONDS.toMinutes(System.nanoTime()) - } - - def sendMeetingHasEnded(userId: String) { - outGW.send(new MeetingHasEnded(meetingID, userId)) - outGW.send(new DisconnectUser(meetingID, userId)) - } - - private def handleEndMeeting(msg: EndMeeting) { - meetingEnded = true - outGW.send(new MeetingEnded(msg.meetingID, recorded, voiceBridge)) - outGW.send(new DisconnectAllUsers(msg.meetingID)) - } - - private def handleVoiceRecording(msg: VoiceRecording) { - if (msg.recording) { - outGW.send(new VoiceRecordingStarted(meetingID, - recorded, msg.recordingFile, - msg.timestamp, voiceBridge)) - } else { - outGW.send(new VoiceRecordingStopped(meetingID, recorded, - msg.recordingFile, msg.timestamp, voiceBridge)) - } - } - - private def handleSetRecordingStatus(msg: SetRecordingStatus) { - log.debug("Change recording status for meeting [" + meetingID + "], recording=[" + msg.recording + "]") - if (allowStartStopRecording && recording != msg.recording) { - recording = msg.recording - log.debug("Sending recording status for meeting [" + meetingID + "], recording=[" + msg.recording + "]") - outGW.send(new RecordingStatusChanged(meetingID, recorded, msg.userId, msg.recording)) - } - } - - private def handleGetRecordingStatus(msg: GetRecordingStatus) { - outGW.send(new GetRecordingStatusReply(meetingID, recorded, msg.userId, recording.booleanValue())) - } - - def lockLayout(lock: Boolean) { - permissions = permissions.copy(lockedLayout=lock) - } - - def newPermissions(np: Permissions) { - permissions = np - } - - def permissionsEqual(other: Permissions):Boolean = { - permissions == other - } - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/RunningMeeting.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/RunningMeeting.scala deleted file mode 100755 index 8eaebd5f55..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/RunningMeeting.scala +++ /dev/null @@ -1,37 +0,0 @@ -package org.bigbluebutton.core - -import akka.actor.ActorRef -import akka.actor.ActorContext -import org.bigbluebutton.core.api.MessageOutGateway - -object RunningMeeting { - def apply(meetingID: String, externalMeetingID: String, meetingName: String, recorded: Boolean, - voiceBridge: String, duration: Long, - autoStartRecording: Boolean, allowStartStopRecording: Boolean, - moderatorPass: String, viewerPass: String, - createTime: Long, createDate: String, - outGW: MessageOutGateway) - (implicit context: ActorContext) = - new RunningMeeting(meetingID, externalMeetingID, meetingName, recorded, - voiceBridge, duration, - autoStartRecording, allowStartStopRecording, - moderatorPass, viewerPass, - createTime, createDate, - outGW)(context) -} - -class RunningMeeting (val meetingID: String, val externalMeetingID: String, val meetingName: String, val recorded: Boolean, - val voiceBridge: String, val duration: Long, - val autoStartRecording: Boolean, val allowStartStopRecording: Boolean, - val moderatorPass: String, val viewerPass: String, - val createTime: Long, val createDate: String, - val outGW: MessageOutGateway) - (implicit val context: ActorContext) { - - val actorRef = context.actorOf(MeetingActor.props(meetingID, externalMeetingID, meetingName, recorded, - voiceBridge, duration, - autoStartRecording, allowStartStopRecording, - moderatorPass, viewerPass, - createTime, createDate, - outGW), meetingID) -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/SystemConfiguration.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/SystemConfiguration.scala deleted file mode 100755 index 11e4373cfe..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/SystemConfiguration.scala +++ /dev/null @@ -1,20 +0,0 @@ -package org.bigbluebutton.core - -import com.typesafe.config.ConfigFactory -import scala.util.Try - -trait SystemConfiguration { - - val config = ConfigFactory.load() - - lazy val serviceHost = Try(config.getString("service.host")).getOrElse("127.0.0.1") - - lazy val servicePort = Try(config.getInt("service.port")).getOrElse(8080) - - lazy val redisHost = Try(config.getString("redis.host")).getOrElse("127.0.0.1") - - lazy val redisPort = Try(config.getInt("redis.port")).getOrElse(6379) - - lazy val apiSourceName = Try(config.getString("api.source")).getOrElse("bigbluebutton-apps") - lazy val apiChannel = Try(config.getString("api.channel")).getOrElse("bbb-apps-channel") -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/User.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/User.scala deleted file mode 100755 index 56ce8df5fb..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/User.scala +++ /dev/null @@ -1,29 +0,0 @@ -package org.bigbluebutton.core - -import org.bigbluebutton.core.api.UserVO -import org.bigbluebutton.core.api.Role._ - -class User(val intUserID: String, val extUserID: String, val name: String, val role: Role) { - - private var presenter = false - private var handRaised = false - private var hasStream = false - private var voiceId:String = _ - private var muted = false - private var talking = false - private var locked = false - - def isPresenter():Boolean = { - return presenter; - } - - def becomePresenter() { - presenter = true - } - - def unbecomePresenter() { - presenter = false - } -} - -case class VoiceUser(userId: String, muted: Boolean=false, talking: Boolean=false, locked: Boolean=false) diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/ConsoleDispatcher.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/ConsoleDispatcher.scala deleted file mode 100755 index df46b038da..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/ConsoleDispatcher.scala +++ /dev/null @@ -1,8 +0,0 @@ -package org.bigbluebutton.core.api - -class ConsoleDispatcher extends IDispatcher { - - def dispatch(jsonMessage: String) { - println(jsonMessage) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/Constants.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/Constants.scala deleted file mode 100755 index 0771a44d70..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/Constants.scala +++ /dev/null @@ -1,97 +0,0 @@ -package org.bigbluebutton.core.api - -object Constants { - val NAME = "name" - val HEADER = "header" - val PAYLOAD = "payload" - val MEETING_ID = "meeting_id" - val EXTERNAL_MEETING_ID = "external_meeting_id" - val TIMESTAMP = "timestamp" - val CURRENT_TIME = "current_time" - val USER_ID = "userid" - val RECORDED = "recorded" - val MEETING_NAME = "meeting_name" - val MEETING_MUTED = "meetingMuted" - val VOICE_CONF = "voice_conf" - val DURATION = "duration" - val AUTH_TOKEN = "auth_token" - val ROLE = "role" - val EXT_USER_ID = "external_user_id" - val REQUESTER_ID = "requester_id" - val REPLY_TO = "reply_to" - val LOWERED_BY = "lowered_by" - val STREAM = "stream" - val LOCKED = "locked" - val SETTINGS = "settings" - val LOCK = "lock" - val EXCEPT_USERS = "except_users" - val STATUS = "status" - val VALUE = "value" - val NEW_PRESENTER_ID = "new_presenter_id" - val NEW_PRESENTER_NAME = "new_presenter_name" - val ASSIGNED_BY = "assigned_by" - val RECORDING = "recording" - val LAYOUT_ID = "layout_id" - val LAYOUT = "layout" - val POLL = "poll" - val POLL_ID = "poll_id" - val FORCE = "force" - val RESPONSE = "response" - val PRESENTATION_ID = "presentation_id" - val X_OFFSET = "x_offset" - val Y_OFFSET = "y_offset" - val WIDTH_RATIO = "width_ratio" - val HEIGHT_RATIO = "height_ratio" - val PAGE = "page" - val SHARE = "share" - val PRESENTATIONS = "presentations" - val MESSAGE_KEY = "message_key" - val CODE = "code" - val PRESENTATION_NAME = "presentation_name" - val NUM_PAGES = "num_pages" - val MAX_NUM_PAGES = "max_num_pages" - val PAGES_COMPLETED = "pages_completed" - val MUTE = "mute" - val CALLER_ID_NUM = "caller_id_num" - val CALLER_ID_NAME = "caller_id_name" - val TALKING = "talking" - val USER = "user" - val MUTED = "muted" - val VOICE_USER = "voice_user" - val RECORDING_FILE = "recording_file" - val ANNOTATION = "annotation" - val WHITEBOARD_ID = "whiteboard_id" - val ENABLE = "enable" - val PRESENTER = "presenter" - val USERS = "users" - val RAISE_HAND = "raise_hand" - val HAS_STREAM = "has_stream" - val WEBCAM_STREAM = "webcam_stream" - val PHONE_USER = "phone_user" - val PERMISSIONS = "permissions" - val VALID = "valid" - val CHAT_HISTORY = "chat_history" - val MESSAGE = "message" - val SET_BY_USER_ID = "set_by_user_id" - val POLLS = "polls" - val REASON = "reason" - val RESPONDER = "responder" - val PRESENTATION_INFO = "presentation_info" - val SHAPES = "shapes" - val SHAPE = "shape" - val SHAPE_ID = "shape_id" - val PRESENTATION = "presentation" - val ID = "id" - val CURRENT = "current" - val PAGES = "pages" - val WEB_USER_ID = "web_user_id" - val JOINED = "joined" - val X_PERCENT = "x_percent" - val Y_PERCENT = "y_percent" - val KEEP_ALIVE_ID = "keep_alive_id" - val LISTEN_ONLY = "listen_only" - val MODERATOR_PASS = "moderator_pass" - val VIEWER_PASS = "viewer_pass" - val CREATE_TIME = "create_time" - val CREATE_DATE = "create_date" -} diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/InMessages.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/InMessages.scala deleted file mode 100755 index 207787fb9f..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/InMessages.scala +++ /dev/null @@ -1,514 +0,0 @@ -package org.bigbluebutton.core.api - -import org.bigbluebutton.core.api.Role._ -import org.bigbluebutton.core.apps.poll._ -import org.bigbluebutton.core.apps.whiteboard.vo.AnnotationVO -import org.bigbluebutton.core.apps.presentation.Presentation - -trait InMessage {val meetingID: String} - -case class IsMeetingActorAliveMessage ( - meetingId:String -) - -case class KeepAliveMessage -( - aliveID:String -) - -case class CreateMeeting -( - meetingID: String, - externalMeetingID: String, - meetingName: String, - recorded: Boolean, - voiceBridge: String, - duration: Long, - autoStartRecording: Boolean, - allowStartStopRecording: Boolean, - moderatorPass: String, - viewerPass: String, - createTime: Long, - createDate: String -) extends InMessage - -case class InitializeMeeting( - meetingID: String, - recorded: Boolean) extends InMessage - -case class DestroyMeeting( - meetingID: String) extends InMessage - -case class StartMeeting( - meetingID: String) extends InMessage - -case class EndMeeting( - meetingID: String) extends InMessage - -case class LockSetting( - meetingID: String, - locked: Boolean, - settings: Map[String, Boolean]) extends InMessage - -// Lock -case class LockUser( - meetingID: String, - userId: String, - lock: Boolean) extends InMessage - -case class InitLockSettings( - meetingID: String, - settings: Permissions) extends InMessage - -case class SetLockSettings( - meetingID: String, - setByUser: String, - settings: Permissions -) extends InMessage - -case class GetLockSettings( - meetingID: String, - userId: String -) extends InMessage - -// Users -case class ValidateAuthToken( - meetingID: String, - userId: String, - token: String, - correlationId: String, - sessionId: String) extends InMessage - -case class RegisterUser( - meetingID: String, - userID: String, - name: String, - role: Role, - extUserID: String, - authToken: String -) extends InMessage - -case class UserJoining( - meetingID: String, - userID: String, - authToken: String -) extends InMessage - -case class UserLeaving( - meetingID: String, - userID: String, - sessionId: String -) extends InMessage - -case class GetUsers( - meetingID: String, - requesterID: String -) extends InMessage - -case class UserRaiseHand( - meetingID: String, - userId: String -) extends InMessage - -case class UserLowerHand( - meetingID: String, - userId: String, - loweredBy: String -) extends InMessage - -case class EjectUserFromMeeting(meetingID: String, userId: String, ejectedBy: String) extends InMessage - -case class UserShareWebcam( - meetingID: String, - userId: String, - stream: String -) extends InMessage - -case class UserUnshareWebcam( - meetingID: String, - userId: String, - stream: String -) extends InMessage - -case class ChangeUserStatus( - meetingID: String, - userID: String, - status: String, - value: Object -) extends InMessage - -case class AssignPresenter( - meetingID: String, - newPresenterID: String, - newPresenterName: String, - assignedBy: String -) extends InMessage - -case class SetRecordingStatus( - meetingID: String, - userId: String, - recording: Boolean -) extends InMessage - -case class GetRecordingStatus( - meetingID: String, - userId: String -) extends InMessage - -// Chat -case class GetChatHistoryRequest( - meetingID: String, - requesterID: String, - replyTo: String -) extends InMessage - -case class SendPublicMessageRequest( - meetingID: String, - requesterID: String, - message: Map[String, String] -) extends InMessage - -case class SendPrivateMessageRequest( - meetingID: String, - requesterID: String, - message: Map[String, String] -) extends InMessage - -case class UserConnectedToGlobalAudio( - meetingID: String, /** Not used. Just to satisfy trait **/ - voiceConf: String, - userid: String, - name: String -) extends InMessage - -case class UserDisconnectedFromGlobalAudio( - meetingID: String, /** Not used. Just to satisfy trait **/ - voiceConf: String, - userid: String, - name: String -) extends InMessage - -// Layout -case class GetCurrentLayoutRequest( - meetingID: String, - requesterID: String -) extends InMessage - -case class SetLayoutRequest( - meetingID: String, - requesterID: String, - layoutID: String -) extends InMessage - -case class LockLayoutRequest( - meetingID: String, - setById: String, - lock: Boolean, - viewersOnly: Boolean, - layout: Option[String] -) extends InMessage - -case class BroadcastLayoutRequest( - meetingID: String, - requesterID: String, - layout: String -) extends InMessage - -// Poll -case class PreCreatedPoll( - meetingID: String, - poll: PollVO -) extends InMessage - -case class CreatePoll( - meetingID: String, - requesterID: String, - poll: PollVO -) extends InMessage - -case class UpdatePoll( - meetingID: String, - requesterID: String, - poll: PollVO -) extends InMessage - -case class GetPolls( - meetingID: String, - requesterID: String -) extends InMessage - -case class DestroyPoll( - meetingID: String, - requesterID: String, - pollID: String -) extends InMessage - -case class RemovePoll( - meetingID: String, - requesterID: String, - pollID: String -) extends InMessage - -case class SharePoll( - meetingID: String, - requesterID: String, - pollID: String -) extends InMessage - -case class ShowPollResult( - meetingID: String, - requesterID: String, - pollID: String -) extends InMessage - -case class HidePollResult( - meetingID: String, - requesterID: String, - pollID: String -) extends InMessage - -case class StopPoll( - meetingID:String, - requesterID: String, - pollID: String -) extends InMessage - -case class StartPoll( - meetingID:String, - requesterID: String, - pollID: String -) extends InMessage - -case class ClearPoll( - meetingID: String, - requesterID: String, - pollID: String, - force: Boolean=false -) extends InMessage - -case class GetPollResult( - meetingID:String, - requesterID: String, - pollID: String -) extends InMessage - -case class RespondToPoll( - meetingID: String, - requesterID: String, - response: PollResponseVO -) extends InMessage - -// Presentation -case class ClearPresentation( - meetingID: String -) extends InMessage - -case class RemovePresentation( - meetingID: String, - presentationID: String -) extends InMessage - -case class GetPresentationInfo( - meetingID: String, - requesterID: String, - replyTo:String -) extends InMessage - -case class SendCursorUpdate( - meetingID: String, - xPercent: Double, - yPercent: Double -) extends InMessage - -case class ResizeAndMoveSlide( - meetingID: String, - xOffset: Double, - yOffset: Double, - widthRatio: Double, - heightRatio: Double -) extends InMessage - -case class GotoSlide( - meetingID: String, - page: String -) extends InMessage - -case class SharePresentation( - meetingID: String, - presentationID: String, - share: Boolean -) extends InMessage - -case class GetSlideInfo( - meetingID: String, - requesterID: String, - replyTo: String -) extends InMessage - -case class PreuploadedPresentations( - meetingID: String, - presentations: Seq[Presentation] -) extends InMessage - -case class PresentationConversionUpdate( - meetingID: String, - messageKey: String, - code: String, - presentationId: String, - presName: String -) extends InMessage - -case class PresentationPageCountError( - meetingID: String, - messageKey: String, - code: String, - presentationId: String, - numberOfPages: Int, - maxNumberPages: Int, - presName: String -) extends InMessage - -case class PresentationSlideGenerated( - meetingID: String, - messageKey: String, - code: String, - presentationId: String, - numberOfPages: Int, - pagesCompleted: Int, - presName: String -) extends InMessage - -case class PresentationConversionCompleted( - meetingID: String, - messageKey: String, - code: String, - presentation: Presentation -) extends InMessage - -// Voice -case class InitAudioSettings( - meetingID: String, - requesterID: String, - muted: Boolean) extends InMessage - -case class SendVoiceUsersRequest( - meetingID: String, - requesterID: String) extends InMessage - -case class MuteAllExceptPresenterRequest( - meetingID: String, - requesterID: String, - mute: Boolean) extends InMessage - -case class MuteMeetingRequest( - meetingID: String, - requesterID: String, - mute: Boolean) extends InMessage - -case class IsMeetingMutedRequest( - meetingID: String, - requesterID: String) extends InMessage - -case class MuteUserRequest( - meetingID: String, - requesterID: String, - userID: String, - mute: Boolean) extends InMessage - -case class LockUserRequest( - meetingID: String, - requesterID: String, - userID: String, - lock: Boolean) extends InMessage - -case class EjectUserFromVoiceRequest( - meetingID: String, - userId: String, - ejectedBy: String) extends InMessage - -case class VoiceUserJoinedMessage( - meetingID: String, - user: String, - voiceConfId: String, - callerIdNum: String, - callerIdName: String, - muted: Boolean, - talking: Boolean) extends InMessage - - -case class VoiceUserJoined( - meetingID: String, - voiceUser: VoiceUser -) extends InMessage - -case class VoiceUserLeft( - meetingID: String, - userId: String -) extends InMessage - -case class VoiceUserLocked( - meetingID: String, - userId: String, - locked: Boolean -) extends InMessage - -case class VoiceUserMuted( - meetingID: String, - userId: String, - muted: Boolean -) extends InMessage - -case class VoiceUserTalking( - meetingID: String, - userId: String, - talking: Boolean -) extends InMessage - -case class VoiceRecording( - meetingID: String, - recordingFile: String, - timestamp: String, - recording: Boolean -) extends InMessage - -// Whiteboard -case class SendWhiteboardAnnotationRequest( - meetingID: String, - requesterID: String, - annotation: AnnotationVO -) extends InMessage - -case class GetWhiteboardShapesRequest( - meetingID: String, - requesterID: String, - whiteboardId: String, - replyTo: String -) extends InMessage - -case class ClearWhiteboardRequest( - meetingID: String, - requesterID: String, - whiteboardId: String -) extends InMessage - -case class UndoWhiteboardRequest( - meetingID: String, - requesterID: String, - whiteboardId: String -) extends InMessage - -case class EnableWhiteboardRequest( - meetingID: String, - requesterID: String, - enable: Boolean -) extends InMessage - -case class IsWhiteboardEnabledRequest( - meetingID: String, - requesterID: String, - replyTo: String -) extends InMessage - -case class GetAllMeetingsRequest( - meetingID: String /** Not used. Just to satisfy trait **/ - ) extends InMessage diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/MessageNames.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/MessageNames.scala deleted file mode 100755 index 5029888370..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/MessageNames.scala +++ /dev/null @@ -1,167 +0,0 @@ -package org.bigbluebutton.core.api - -object MessageNames { - val CREATE_MEETING = "create_meeting_request" - val INITIALIZE_MEETING = "initialize_meeting_request" - val DESTROY_MEETING = "destroy_meeting_request" - val START_MEETING = "start_meeting_request" - val END_MEETING = "end_meeting_request" - val LOCK_SETTING = "lock_setting_request" - val LOCK_USER = "lock_user_request" - val INIT_LOCK_SETTINGS = "init_lock_settings" - val INIT_AUDIO_SETTINGS = "init_audio_settings" - val SET_LOCK_SETTINGS = "set_lock_settings" - val GET_LOCK_SETTINGS = "get_lock_settings" - val IS_MEETING_LOCKED = "is_meeting_locked" - val VALIDATE_AUTH_TOKEN = "validate_auth_token_request" - val VALIDATE_AUTH_TOKEN_REPLY = "validate_auth_token_reply" - val VALIDATE_AUTH_TOKEN_TIMEOUT = "validate_auth_token_timeout" - val REGISTER_USER = "register_user_request" - val USER_JOINING = "user_joining_request" - val USER_LEAVING = "user_leaving_request" - val GET_USERS = "get_users_request" - val RAISE_HAND = "user_raise_hand_request" - val LOWER_HAND = "user_lower_hand_request" - val USER_SHARE_WEBCAM = "user_share_webcam_request" - val USER_UNSHARE_WEBCAM = "user_unshare_webcam_request" - val CHANGE_USER_STATUS = "change_user_status_request" - val ASSIGN_PRESENTER = "assign_presenter_request" - val SET_RECORDING_STATUS = "set_recording_status_request" - val GET_CHAT_HISTORY = "get_chat_history_request" - val SEND_PUBLIC_MESSAGE = "send_public_chat_message_request" - val SEND_PRIVATE_MESSAGE = "send_private_chat_message_request" - val GET_CURRENT_LAYOUT = "get_current_layout_request" - val SET_LAYOUT = "set_layout_request" - val BROADCAST_LAYOUT = "broadcast_layout_request" - val UNLOCK_LAYOUT = "unlock_layout_request" - val PRECREATED_POLL = "precreated_poll_request" - val CREATE_POLL = "create_poll_request" - val UPDATE_POLL = "update_poll_request" - val GET_POLLS = "get_polls_request" - val DESTROY_POLL = "destroy_poll_request" - val REMOVE_POLL = "remove_poll_request" - val SHARE_POLL = "share_poll_request" - val SHOW_POLL_RESULT = "show_poll_result_request" - val HIDE_POLL_RESULT = "hide_poll_result_request" - val START_POLL = "start_poll_request" - val STOP_POLL = "stop_poll_request" - val CLEAR_POLL = "clear_poll_request" - val GET_POLL_RESULT = "get_poll_result_request" - val RESPONT_TO_POLL = "respond_to_poll_request" - val CLEAR_PRESENTATION = "clear_presentation_request" - val REMOVE_PRESENTATION = "remove_presentation_request" - val GET_PRESENTATION_INFO = "get_presentation_info_request" - val RESIZE_AND_MOVE_SLIDE = "resize_and_move_slide_request" - val GO_TO_SLIDE = "go_to_slide_request" - val SHARE_PRESENTATION = "share_presentation_request" - val GET_SLIDE_INFO = "get_slide_info_request" - val GET_SLIDE_INFO_REPLY = "get_slide_info_reply" - val PREUPLOADED_PRESENTATIONS = "preuploaded_presentation_request" - val PRESENTATION_CONVERSION_UPDATE = "presentation_conversion_update_message" - val PRESENTATION_PAGE_COUNT_ERROR = "presentation_page_count_error_message" - val PRESENTATION_SLIDE_GENERATED = "presentation_slide_generated_message" - val PRESENTATION_CONVERSION_COMPLETED = "presentation_conversion_completed_message" - val PRESENTATION_CURSOR_UPDATED = "presentation_cursor_updated_message" - val SEND_VOICE_USERS_REQUEST = "send_voice_users_request" - val MUTE_MEETING_REQUEST = "mute_meeting_request" - val IS_MEETING_MUTED = "is_meeting_muted_request" - val MUTE_USER = "mute_user_request" - val EJECT_USER = "eject_user_request" - val VOICE_USER_JOINED_MESSAGE = "voice_user_joined_message" - val VOICE_USER_JOINED = "voice_user_joined" - val VOICE_USER_LEFT = "voice_user_left_message" - val VOICE_USER_LOCKED = "voice_user_locked_message" - val VOICE_USER_MUTED = "voice_user_muted_message" - val VOICE_USER_TALKING = "voice_user_talking_message" - val VOICE_RECORDING = "voice_recording_message" - val SEND_WHITEBOARD_ANNOTATION = "send_whiteboard_annotation_request" - val GET_WHITEBOARD_SHAPES = "get_whiteboard_shapes_request" - val CLEAR_WHITEBOARD = "clear_whiteboard_request" - val UNDO_WHITEBOARD = "undo_whiteboard_request" - val ENABLE_WHITEBOARD = "enable_whiteboard_request" - val IS_WHITEBOARD_ENABLED = "is_whiteboard_enabled_request" - val GET_ALL_MEETINGS_REQUEST = "get_all_meetings_request" - - // OUT MESSAGES - val MEETING_CREATED = "meeting_created_message" - val VOICE_RECORDING_STARTED = "voice_recording_started_message" - val VOICE_RECORDING_STOPPED = "voice_recording_stopped_message" - val RECORDING_STATUS_CHANGED = "recording_status_changed_message" - val GET_RECORDING_STATUS_REPLY = "get_recording_status_reply" - val MEETING_ENDED = "meeting_ended_message" - val MEETING_HAS_ENDED = "meeting_has_ended_message" - val MEETING_STATE = "meeting_state_message" - val MEETING_MUTED = "meeting_muted_message" - val MEETING_DESTROYED = "meeting_destroyed_message" - val DISCONNECT_ALL_USERS = "disconnect_all_users_message" - val DISCONNECT_USER = "disconnect_user_message" - val PERMISSION_SETTING_INITIALIZED = "permisssion_setting_initialized_message" - val NEW_PERMISSION_SETTINGS = "new_permission_settings" - val USER_LOCKED = "user_locked_message" - val USERS_LOCKED = "users_locked_message" - val GET_PERMISSION_SETTINGS_REPLY = "get_permissions_setting_reply" - val IS_MEETING_LOCKED_REPLY = "is_meeting_locked_reply" - val USER_REGISTERED = "user_registered_message" - val USER_LEFT = "user_left_message" - val PRESENTER_ASSIGNED = "presenter_assigned_message" - val END_AND_KICK_ALL = "end_and_kick_all_message" - val GET_USERS_REPLY = "get_users_reply" - val USER_JOINED = "user_joined_message" - val USER_RAISED_HAND = "user_raised_hand_message" - val USER_LOWERED_HAND = "user_lowered_hand_message" - val USER_SHARED_WEBCAM = "user_shared_webcam_message" - val USER_UNSHARED_WEBCAM = "user_unshared_webcam_message" - val USER_STATUS_CHANGED = "user_status_changed_message" - val MUTE_VOICE_USER = "mute_voice_user_request" - val USER_VOICE_MUTED = "user_voice_muted_message" - val USER_VOICE_TALKING = "user_voice_talking_message" - val EJECT_VOICE_USER = "eject_voice_user_message" - val USER_JOINED_VOICE = "user_joined_voice_message" - val USER_LEFT_VOICE = "user_left_voice_message" - val IS_MEETING_MUTED_REPLY = "is_meeting_muted_reply" - val START_RECORDING = "start_recording_message" - val STOP_RECORDING = "stop_recording_message" - val GET_CHAT_HISTORY_REPLY = "get_chat_history_reply" - val SEND_PUBLIC_CHAT_MESSAGE = "send_public_chat_message" - val SEND_PRIVATE_CHAT_MESSAGE = "send_private_chat_message" - val GET_CURRENT_LAYOUT_REPLY = "get_current_layout_reply" - val SET_LAYOUT_REPLY = "set_layout_reply" - val BROADCAST_LAYOUT_REPLY = "broadcast_layout_reply" - val UNLOCK_LAYOUT_REPLY = "unlock_layout_reply" - val GET_POLL_RESULT_REPLY = "get_poll_result_reply" - val POLL_CLEARED = "poll_cleared_message" - val GET_POLLS_REPLY = "get_polls_reply" - val CLEAR_POLL_FAILED = "clear_poll_failed" - val POLL_STARTED = "poll_started_message" - val POLL_STOPPED = "poll_stopped_message" - val POLL_REMOVED = "poll_removed" - val POLL_UPDATED = "poll_updated_message" - val POLL_CREATED = "poll_created_message" - val POLL_RESPONSE = "poll_response_message" - val POLL_HIDE_RESULT = "poll_hide_result_message" - val POLL_SHOW_RESULT = "poll_show_result_message" - val PRESENTATION_CLEARED = "presentation_cleared_message" - val PRESENTATION_REMOVED = "presentation_removed_message" - val GET_PRESENTATION_INFO_REPLY = "get_presentation_info_reply" - val PRESENTATION_PAGE_RESIZED = "presentation_page_resized_message" - val PRESENTATION_PAGE_CHANGED = "presentation_page_changed_message" - val PRESENTATION_SHARED = "presentation_shared_message" - val GET_PREUPLOADED_PRESENTATIONS = "get_preuploaded_presentations_message" - val PRESENTATION_CONVERSION_PROGRESS = "presentation_conversion_progress_message" - val PRESENTATION_CONVERSION_ERROR = "presentation_conversion_error_message" - val PRESENTATION_CONVERSION_DONE = "presentation_conversion_done_message" - val PRESENTATION_CHANGED = "presentation_changed_message" - val GET_PRESENTATION_STATUS_REPLY = "get_presentation_status_reply" - val PRESENTATION_REMOVED_MESSAGE = "presentation_removed_message" - val PRESENTATION_PAGE_GENERATED = "presentation_page_generated_message" - val GET_WHITEBOARD_SHAPES_REPLY = "get_whiteboard_shapes_reply" - val SEND_WHITEBOARD_SHAPE = "send_whiteboard_shape_message" - val UNDO_WHITEBOARD_MESSAGE = "undo_whiteboard_message" - val WHITEBOARD_ENABLED = "whiteboard_enabled_message" - val WHITEBOARD_CLEARED = "whiteboard_cleared_message" - val IS_WHITEBOARD_ENABLED_REPLY = "is_whiteboard_enabled_reply" - val MEETING_DESTROYED_EVENT = "meeting_destroyed_event" - val KEEP_ALIVE_REPLY = "keep_alive_reply" - val USER_LISTEN_ONLY = "user_listening_only" - val GET_ALL_MEETINGS_REPLY = "get_all_meetings_reply" -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/OutMessages.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/OutMessages.scala deleted file mode 100755 index 8339531959..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/OutMessages.scala +++ /dev/null @@ -1,665 +0,0 @@ -package org.bigbluebutton.core.api - -import org.bigbluebutton.core.apps.poll._ -import org.bigbluebutton.core.apps.whiteboard.vo.AnnotationVO -import org.bigbluebutton.core.apps.presentation.CurrentPresentationInfo -import org.bigbluebutton.core.apps.presentation.Presentation -import org.bigbluebutton.core.apps.presentation.Page - -abstract class OutMessage - -case class VoiceRecordingStarted( - meetingID: String, - recorded: Boolean, - recordingFile: String, - timestamp: String, - confNum: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class VoiceRecordingStopped( - meetingID: String, - recorded: Boolean, - recordingFile: String, - timestamp: String, - confNum: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class RecordingStatusChanged( - meetingID: String, - recorded: Boolean, - userId: String, - recording: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class GetRecordingStatusReply( - meetingID: String, - recorded: Boolean, - userId: String, - recording: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class MeetingCreated( - meetingID: String, - externalMeetingID: String, - recorded: Boolean, - name: String, - voiceBridge: String, - duration: Long, - moderatorPass: String, - viewerPass: String, - createTime: Long, - createDate: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class MeetingMuted( - meetingID: String, - recorded: Boolean, - meetingMuted: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class MeetingEnded( - meetingID: String, - recorded: Boolean, - voiceBridge: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class MeetingState( - meetingID: String, - recorded: Boolean, - userId: String, - permissions: Permissions, - meetingMuted: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class MeetingHasEnded( - meetingID: String, - userId: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class MeetingDestroyed( - meetingID: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class DisconnectAllUsers( - meetingID: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class DisconnectUser( - meetingID: String, - userId: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class KeepAliveMessageReply( - aliveID:String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case object IsAliveMessage extends IOutMessage - -// Permissions -case class PermissionsSettingInitialized( - meetingID: String, - permissions: Permissions, - applyTo: Array[UserVO], - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class NewPermissionsSetting( - meetingID: String, - setByUser: String, - permissions: Permissions, - applyTo: Array[UserVO], - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserLocked( - meetingID: String, - userId: String, - lock: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class GetPermissionsSettingReply( - meetingID: String, - userId: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - - -// Users -case class UserRegistered( - meetingID: String, - recorded: Boolean, - user: RegisteredUser, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserLeft( - meetingID: String, - recorded: Boolean, - user:UserVO, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserEjectedFromMeeting(meetingID: String, recorded: Boolean, userId: String, ejectedBy: String, version:String = Versions.V_0_0_1) extends IOutMessage - -case class PresenterAssigned( - meetingID: String, - recorded: Boolean, - presenter: Presenter, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class EjectAllVoiceUsers( - meetingID: String, - recorded: Boolean, - voiceBridge:String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class EndAndKickAll( - meetingID: String, - recorded: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class GetUsersReply( - meetingID: String, - requesterID: String, - users: Array[UserVO], - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class ValidateAuthTokenTimedOut( - meetingID: String, - requesterId: String, - token: String, - valid: Boolean, - correlationId: String, - version:String = Versions.V_0_0_1 - ) extends IOutMessage - -case class ValidateAuthTokenReply( - meetingID: String, - requesterId: String, - token: String, - valid: Boolean, - correlationId: String, - version:String = Versions.V_0_0_1 - ) extends IOutMessage - -case class UserJoined( - meetingID: String, - recorded: Boolean, - user:UserVO, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserRaisedHand( - meetingID: String, - recorded: Boolean, - raisedHand: Boolean, - userID: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserLoweredHand( - meetingID: String, - recorded: Boolean, - raisedHand: Boolean, - userID: String, - loweredBy: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserListeningOnly( - meetingID: String, - recorded: Boolean, - userID: String, - listenOnly: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserSharedWebcam( - meetingID: String, - recorded: Boolean, - userID: String, - stream: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserUnsharedWebcam( - meetingID: String, - recorded: Boolean, - userID: String, - stream: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserStatusChange( - meetingID: String, - recorded: Boolean, - userID: String, - status: String, - value: Object, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class MuteVoiceUser( - meetingID: String, - recorded: Boolean, - requesterID: String, - userId: String, - mute: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserVoiceMuted( - meetingID: String, - recorded: Boolean, - confNum: String, - user:UserVO, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserVoiceTalking( - meetingID: String, - recorded: Boolean, - confNum: String, - user:UserVO, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class EjectVoiceUser( - meetingID: String, - recorded: Boolean, - requesterID: String, - userId: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserJoinedVoice( - meetingID: String, - recorded: Boolean, - confNum: String, - user:UserVO, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UserLeftVoice( - meetingID: String, - recorded: Boolean, - confNum: String, - user:UserVO, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -// Voice -case class IsMeetingMutedReply( - meetingID: String, - recorded: Boolean, - requesterID: String, - meetingMuted: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class StartRecording( - meetingID: String, - recorded: Boolean, - requesterID: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class StopRecording( - meetingID: String, - recorded: Boolean, - requesterID: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -// Chat -case class GetChatHistoryReply( - meetingID: String, - recorded: Boolean, - requesterID: String, - replyTo: String, - history: Array[Map[String, String]], - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class SendPublicMessageEvent( - meetingID: String, - recorded: Boolean, - requesterID: String, - message: Map[String, String], - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class SendPrivateMessageEvent( - meetingID: String, - recorded: Boolean, - requesterID: String, - message: Map[String, String], - version:String = Versions.V_0_0_1 -) extends IOutMessage - -// Layout -case class GetCurrentLayoutReply( - meetingID: String, - recorded: Boolean, - requesterID: String, - layoutID: String, - locked: Boolean, - setByUserID: String -) extends IOutMessage - -case class BroadcastLayoutEvent( - meetingID: String, - recorded: Boolean, - requesterID: String, - layoutID: String, - locked: Boolean, - setByUserID: String, - applyTo: Array[UserVO], - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class LockLayoutEvent( - meetingID: String, - recorded: Boolean, - setById: String, - locked: Boolean, - applyTo: Array[UserVO] -) extends IOutMessage - -// Poll -case class GetPollResultReply( - meetingID: String, - recorded: Boolean, - requesterID: String, - pollVO: PollVO -) extends IOutMessage - -case class GetPollsReplyOutMsg( - meetingID: String, - recorded: Boolean, - requesterID: String, - polls: Array[PollVO] -) extends IOutMessage - -case class ClearPollFailed( - meetingID: String, - pollID: String, - requesterID: String, - reason: String -) extends IOutMessage - -case class PollClearedOutMsg( - meetingID: String, - recorded: Boolean, - pollID: String -) extends IOutMessage - -case class PollStartedOutMsg( - meetingID: String, - recorded: Boolean, - pollID: String -) extends IOutMessage - -case class PollStoppedOutMsg( - meetingID: String, - recorded: Boolean, - pollID: String -) extends IOutMessage - -case class PollRemovedOutMsg( - meetingID: String, - recorded: Boolean, - pollID: String -) extends IOutMessage - -case class PollUpdatedOutMsg( - meetingID: String, - recorded: Boolean, - pollID: String, - pollVO: PollVO -) extends IOutMessage - -case class PollCreatedOutMsg( - meetingID: String, - recorded: Boolean, - pollID: String, - pollVO: PollVO -) extends IOutMessage - -case class PollResponseOutMsg( - meetingID: String, - recorded: Boolean, - responder: Responder, - response: PollResponseVO -) extends IOutMessage - -case class PollHideResultOutMsg( - meetingID: String, - recorded: Boolean, - pollID: String -) extends IOutMessage - -case class PollShowResultOutMsg( - meetingID: String, - recorded: Boolean, - pollID: String -) extends IOutMessage - -// Presentation -case class ClearPresentationOutMsg( - meetingID: String, - recorded: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class RemovePresentationOutMsg( - meetingID: String, - recorded: Boolean, - presentationID: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class GetPresentationInfoOutMsg( - meetingID: String, - recorded: Boolean, - requesterID: String, - info: CurrentPresentationInfo, - replyTo:String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class SendCursorUpdateOutMsg( - meetingID: String, - recorded: Boolean, - xPercent: Double, - yPercent: Double, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class ResizeAndMoveSlideOutMsg( - meetingID: String, - recorded: Boolean, - page: Page, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class GotoSlideOutMsg( - meetingID: String, - recorded: Boolean, - page: Page, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class SharePresentationOutMsg( - meetingID: String, - recorded: Boolean, - presentation: Presentation, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class GetSlideInfoOutMsg( - meetingID: String, - recorded: Boolean, - requesterID: String, - page: Page, - replyTo: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class GetPreuploadedPresentationsOutMsg( - meetingID:String, - recorded: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class PresentationConversionProgress( - meetingID: String, - messageKey: String, - code: String, - presentationId: String, - presentationName: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class PresentationConversionError( - meetingID: String, - messageKey: String, - code: String, - presentationId: String, - numberOfPages: Int, - maxNumberPages: Int, - presentationName: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class PresentationPageGenerated( - meetingID: String, - messageKey: String, - code: String, - presentationId: String, - numberOfPages: Int, - pagesCompleted: Int, - presentationName: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class PresentationConversionDone( - meetingID: String, - recorded: Boolean, - messageKey: String, - code: String, - presentation: Presentation, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class PresentationChanged( - meetingID: String, - presentation: Presentation, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class GetPresentationStatusReply( - meetingID: String, - presentations: Seq[Presentation], - current: Presentation, - replyTo: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class PresentationRemoved( - meetingID: String, - presentationId: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class PageChanged( - meetingID: String, - page: Page, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -// Whiteboard -case class GetWhiteboardShapesReply( - meetingID: String, - recorded: Boolean, - requesterID: String, - whiteboardId: String, - shapes: Array[AnnotationVO], - replyTo: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class SendWhiteboardAnnotationEvent( - meetingID: String, - recorded: Boolean, - requesterID: String, - whiteboardId: String, - shape: AnnotationVO, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class ClearWhiteboardEvent( - meetingID: String, - recorded: Boolean, - requesterID: String, - whiteboardId: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class UndoWhiteboardEvent( - meetingID: String, - recorded: Boolean, - requesterID: String, - whiteboardId: String, - shapeId: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - - -case class WhiteboardEnabledEvent( - meetingID: String, - recorded: Boolean, - requesterID: String, - enable: Boolean, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class IsWhiteboardEnabledReply( - meetingID: String, - recorded: Boolean, - requesterID: String, - enabled: Boolean, - replyTo: String, - version:String = Versions.V_0_0_1 -) extends IOutMessage - -case class GetAllMeetingsReply( - meetings: Array[MeetingInfo], - version:String = Versions.V_0_0_1 -) extends IOutMessage - -// Value Objects -case class MeetingVO( - id: String, - recorded: Boolean -) - - diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/TimestampGenerator.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/TimestampGenerator.scala deleted file mode 100644 index 4e71fc086d..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/TimestampGenerator.scala +++ /dev/null @@ -1,14 +0,0 @@ -package org.bigbluebutton.core.api - -import java.util.concurrent.TimeUnit - -object TimestampGenerator { - - def generateTimestamp():Long = { - TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - } - - def getCurrentTime():Long = { - System.currentTimeMillis(); - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/ValueObjects.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/ValueObjects.scala deleted file mode 100755 index c97c490647..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/ValueObjects.scala +++ /dev/null @@ -1,110 +0,0 @@ -package org.bigbluebutton.core.api - -import java.lang.Boolean - -object Role extends Enumeration { - type Role = Value - val MODERATOR = Value("MODERATOR") - val VIEWER = Value("VIEWER") -} - -case class Presenter( - presenterID: String, - presenterName: String, - assignedBy: String) - -case class User( - id: String, - externId: String, - name: String, - moderator: Boolean, - avatarUrl: String, - logoutUrl: String, - presenter: Boolean, - callerId: CallerId, - phoneCaller: Boolean, - handRaised: Boolean, - muted: Boolean, - talking: Boolean -) - -case class CallerId( - name: String, - number: String -) - -case class Permissions( - disableCam: Boolean = false, - disableMic: Boolean = false, - disablePrivChat: Boolean = false, - disablePubChat: Boolean = false, - lockedLayout:Boolean = false, - lockOnJoin:Boolean = false, - lockOnJoinConfigurable:Boolean = false -) - -case class RegisteredUser ( - id: String, - externId: String, - name: String, - role: Role.Role, - authToken: String -) - -case class Voice( - id: String, - webId: String, - callId: CallerId, - phoningIn: Boolean, - joined: Boolean, - locked: Boolean, - muted: Boolean, - talking: Boolean -) - -case class UserVO( - userID: String, - externUserID: String, - name: String, - role: Role.Role, - raiseHand: Boolean, - presenter: Boolean, - hasStream: Boolean, - locked: Boolean, - webcamStreams: Set[String], - phoneUser: Boolean, - voiceUser: VoiceUser, - listenOnly: Boolean) - -case class VoiceUser(userId: String, - webUserId: String, - callerName: String, - callerNum: String, - joined: Boolean, - locked: Boolean, - muted: Boolean, - talking: Boolean) - -case class MeetingConfig(name: String, - id: MeetingID, - passwords: MeetingPasswords, - welcomeMsg: String, - logoutUrl: String, - maxUsers: Int, - record: Boolean=false, - duration: MeetingDuration, - defaultAvatarURL: String, - defaultConfigToken: String) - -case class MeetingName(name: String) - -case class MeetingID(internal:String, external: String) - -case class VoiceConfig(telVoice: String, webVoice: String, dialNumber: String) - -case class MeetingPasswords(moderatorPass: String, viewerPass: String) - -case class MeetingDuration(duration: Int = 0, createdTime: Long = 0, - startTime: Long = 0, endTime: Long = 0) - -case class MeetingInfo(meetingID: String, meetingName: String, recorded: Boolean, voiceBridge: String, duration: Long) diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/Versions.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/Versions.scala deleted file mode 100755 index 6fe5b194e8..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/Versions.scala +++ /dev/null @@ -1,5 +0,0 @@ -package org.bigbluebutton.core.api - -object Versions { - val V_0_0_1 = "0.0.1" -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/ChatApp.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/ChatApp.scala deleted file mode 100755 index 5bcb0223b7..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/ChatApp.scala +++ /dev/null @@ -1,31 +0,0 @@ -package org.bigbluebutton.core.apps.chat - -import org.bigbluebutton.core.api._ -import scala.collection.mutable.ArrayBuffer -import org.bigbluebutton.core.MeetingActor - -trait ChatApp { - this : MeetingActor => - - val outGW: MessageOutGateway - - val messages = new ArrayBuffer[Map[String, String]]() - - def handleGetChatHistoryRequest(msg: GetChatHistoryRequest) { - val history = new Array[Map[String, String]](messages.size) - messages.copyToArray(history) - outGW.send(new GetChatHistoryReply(meetingID, recorded, msg.requesterID, msg.replyTo, history)) - } - - def handleSendPublicMessageRequest(msg: SendPublicMessageRequest) { - messages append msg.message.toMap - val pubMsg = msg.message.toMap - - outGW.send(new SendPublicMessageEvent(meetingID, recorded, msg.requesterID, pubMsg)) - } - - def handleSendPrivateMessageRequest(msg: SendPrivateMessageRequest) { - val pubMsg = msg.message.toMap - outGW.send(new SendPrivateMessageEvent(meetingID, recorded, msg.requesterID, pubMsg)) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/ChatInGateway.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/ChatInGateway.scala deleted file mode 100755 index db21b72009..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/ChatInGateway.scala +++ /dev/null @@ -1,19 +0,0 @@ -package org.bigbluebutton.core.apps.chat - -import org.bigbluebutton.core.BigBlueButtonGateway -import org.bigbluebutton.core.api._ - -class ChatInGateway(bbbGW: BigBlueButtonGateway) { - - def getChatHistory(meetingID: String, requesterID: String, replyTo: String) { - bbbGW.accept(new GetChatHistoryRequest(meetingID, requesterID, replyTo)) - } - - def sendPrivateMessage(meetingID: String, requesterID: String, msg: Map[String, String]) { - bbbGW.accept(new SendPrivateMessageRequest(meetingID, requesterID, msg)) - } - - def sendPublicMessage(meetingID: String, requesterID: String, msg: Map[String, String]) { - bbbGW.accept(new SendPublicMessageRequest(meetingID, requesterID, msg)) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatEventRedisPublisher.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatEventRedisPublisher.scala deleted file mode 100755 index d99cb2491a..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatEventRedisPublisher.scala +++ /dev/null @@ -1,38 +0,0 @@ -package org.bigbluebutton.core.apps.chat.redis - -import org.bigbluebutton.core.api.OutMessageListener2 -import org.bigbluebutton.conference.service.messaging.redis.MessageSender -import org.bigbluebutton.core.api._ -import com.google.gson.Gson -import scala.collection.mutable.HashMap -import collection.JavaConverters._ -import scala.collection.JavaConversions._ -import java.util.ArrayList -import org.bigbluebutton.common.messages.MessagingConstants -import org.bigbluebutton.core.messaging.Util - -class ChatEventRedisPublisher(service: MessageSender) extends OutMessageListener2 { - def handleMessage(msg: IOutMessage) { - msg match { - case msg: GetChatHistoryReply => handleGetChatHistoryReply(msg) - case msg: SendPublicMessageEvent => handleSendPublicMessageEvent(msg) - case msg: SendPrivateMessageEvent => handleSendPrivateMessageEvent(msg) - case _ => // do nothing - } - } - - private def handleGetChatHistoryReply(msg: GetChatHistoryReply) { - val json = ChatMessageToJsonConverter.getChatHistoryReplyToJson(msg) - service.send(MessagingConstants.FROM_CHAT_CHANNEL, json) - } - - private def handleSendPublicMessageEvent(msg: SendPublicMessageEvent) { - val json = ChatMessageToJsonConverter.sendPublicMessageEventToJson(msg) - service.send(MessagingConstants.FROM_CHAT_CHANNEL, json) - } - - private def handleSendPrivateMessageEvent(msg: SendPrivateMessageEvent) { - val json = ChatMessageToJsonConverter.sendPrivateMessageEventToJson(msg) - service.send(MessagingConstants.FROM_CHAT_CHANNEL, json) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatEventRedisRecorder.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatEventRedisRecorder.scala deleted file mode 100755 index 4d971adda3..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatEventRedisRecorder.scala +++ /dev/null @@ -1,29 +0,0 @@ -package org.bigbluebutton.core.apps.chat.redis - -import org.bigbluebutton.conference.service.recorder.RecorderApplication -import org.bigbluebutton.core.api._ -import org.bigbluebutton.conference.service.recorder.chat.PublicChatRecordEvent -import scala.collection.JavaConversions._ - -class ChatEventRedisRecorder(recorder: RecorderApplication) extends OutMessageListener2 { - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: SendPublicMessageEvent => handleSendPublicMessageEvent(msg) - case _ => // do nothing - } - } - - private def handleSendPublicMessageEvent(msg: SendPublicMessageEvent) { - if (msg.recorded) { - val message = mapAsJavaMap(msg.message) - val ev = new PublicChatRecordEvent(); - ev.setTimestamp(TimestampGenerator.generateTimestamp); - ev.setMeetingId(msg.meetingID); - ev.setSender(message.get("fromUsername")); - ev.setMessage(message.get("message")); - ev.setColor(message.get("fromColor")); - recorder.record(msg.meetingID, ev); - } - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatMessageToJsonConverter.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatMessageToJsonConverter.scala deleted file mode 100755 index 044b3bc8bc..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/chat/redis/ChatMessageToJsonConverter.scala +++ /dev/null @@ -1,67 +0,0 @@ -package org.bigbluebutton.core.apps.chat.redis - -import scala.collection.mutable.HashMap -import org.bigbluebutton.conference.service.chat.ChatKeyUtil -import org.bigbluebutton.core.api._ -import com.google.gson.Gson -import scala.collection.mutable.HashMap -import collection.JavaConverters._ -import scala.collection.JavaConversions._ -import java.util.ArrayList -import org.bigbluebutton.common.messages.MessagingConstants -import org.bigbluebutton.core.messaging.Util - -object ChatMessageToJsonConverter { - - val UNKNOWN = "unknown" - - private def chatMessageToMap(msg: Map[String, String]):HashMap[String, String] = { - val res = new HashMap[String, String] - res += "chat_type" -> msg.get(ChatKeyUtil.CHAT_TYPE).getOrElse(UNKNOWN) - res += "from_userid" -> msg.get(ChatKeyUtil.FROM_USERID).getOrElse(UNKNOWN) - res += "from_username" -> msg.get(ChatKeyUtil.FROM_USERNAME).getOrElse(UNKNOWN) - res += "from_color" -> msg.get(ChatKeyUtil.FROM_COLOR).getOrElse(UNKNOWN) - res += "from_time" -> msg.get(ChatKeyUtil.FROM_TIME).getOrElse(UNKNOWN) - res += "from_tz_offset" -> msg.get(ChatKeyUtil.FROM_TZ_OFFSET).getOrElse(UNKNOWN) - res += "to_userid" -> msg.get(ChatKeyUtil.TO_USERID).getOrElse(UNKNOWN) - res += "to_username" -> msg.get(ChatKeyUtil.TO_USERNAME).getOrElse(UNKNOWN) - res += "message" -> msg.get(ChatKeyUtil.MESSAGE).getOrElse(UNKNOWN) - - res - } - - def getChatHistoryReplyToJson(msg: GetChatHistoryReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val collection = new ArrayList[java.util.Map[String, String]](); - - msg.history.foreach(p => { - collection.add(mapAsJavaMap(ChatMessageToJsonConverter.chatMessageToMap(p))) - }) - - payload.put(Constants.CHAT_HISTORY, collection) - - val header = Util.buildHeader(MessageNames.GET_CHAT_HISTORY_REPLY, msg.version, Some(msg.replyTo)) - Util.buildJson(header, payload) - } - - def sendPublicMessageEventToJson(msg: SendPublicMessageEvent):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MESSAGE, mapAsJavaMap(ChatMessageToJsonConverter.chatMessageToMap(msg.message))) - - val header = Util.buildHeader(MessageNames.SEND_PUBLIC_CHAT_MESSAGE, msg.version, None) - Util.buildJson(header, payload) - } - - def sendPrivateMessageEventToJson(msg: SendPrivateMessageEvent):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MESSAGE, mapAsJavaMap(ChatMessageToJsonConverter.chatMessageToMap(msg.message))) - - val header = Util.buildHeader(MessageNames.SEND_PRIVATE_CHAT_MESSAGE, msg.version, None) - Util.buildJson(header, payload) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/layout/LayoutApp.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/layout/LayoutApp.scala deleted file mode 100755 index 9fbc137593..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/layout/LayoutApp.scala +++ /dev/null @@ -1,66 +0,0 @@ -package org.bigbluebutton.core.apps.layout - -import org.bigbluebutton.core.api._ -import org.bigbluebutton.core.MeetingActor -import scala.collection.mutable.ArrayBuffer - -trait LayoutApp { - this : MeetingActor => - - val outGW: MessageOutGateway - - private var setByUser:String = "system"; - private var currentLayout = ""; - private var layoutLocked = false - private var viewersOnly = true - - def handleGetCurrentLayoutRequest(msg: GetCurrentLayoutRequest) { - outGW.send(new GetCurrentLayoutReply(msg.meetingID, recorded, msg.requesterID, - currentLayout, permissions.lockedLayout, setByUser)) - } - - def handleLockLayoutRequest(msg: LockLayoutRequest) { - viewersOnly = msg.viewersOnly - lockLayout(msg.lock) - - outGW.send(new LockLayoutEvent(msg.meetingID, recorded, - msg.setById, msg.lock, affectedUsers)) - - msg.layout foreach {l => - currentLayout = l - broadcastSyncLayout(msg.meetingID, msg.setById) - } - } - - private def broadcastSyncLayout(meetingId: String, setById: String) { - outGW.send(new BroadcastLayoutEvent(meetingId, recorded, setById, - currentLayout, permissions.lockedLayout, setByUser, affectedUsers)) - } - - def handleBroadcastLayoutRequest(msg: BroadcastLayoutRequest) { - currentLayout = msg.layout - broadcastSyncLayout(msg.meetingID, msg.requesterID) - } - - def handleLockLayout(lock: Boolean, setById: String) { - outGW.send(new LockLayoutEvent(meetingID, recorded, setById, lock, affectedUsers)) - - broadcastSyncLayout(meetingID, setById) - } - - def affectedUsers():Array[UserVO] = { - if (viewersOnly) { - val au = ArrayBuffer[UserVO]() - users.getUsers foreach {u => - if (! u.presenter && u.role != Role.MODERATOR) { - au += u - } - } - au.toArray - } else { - users.getUsers - } - - } - -} diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/layout/LayoutInGateway.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/layout/LayoutInGateway.scala deleted file mode 100755 index bab884793b..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/layout/LayoutInGateway.scala +++ /dev/null @@ -1,26 +0,0 @@ -package org.bigbluebutton.core.apps.layout - -import org.bigbluebutton.core.BigBlueButtonGateway -import org.bigbluebutton.core.api._ - -class LayoutInGateway(bbbGW: BigBlueButtonGateway) { - - def getCurrentLayout(meetingID: String, requesterID: String) { - bbbGW.accept(new GetCurrentLayoutRequest(meetingID, requesterID)) - } - - def broadcastLayout(meetingID: String, requesterID: String, layout: String) { - bbbGW.accept(new BroadcastLayoutRequest(meetingID, requesterID, layout)) - } - - def lockLayout(meetingID: String, setById: String, - lock: Boolean, viewersOnly: Boolean, - layout: String) { - if (layout != null) { - bbbGW.accept(new LockLayoutRequest(meetingID, setById, lock, viewersOnly, Some(layout))) - } else { - bbbGW.accept(new LockLayoutRequest(meetingID, setById, lock, viewersOnly, None)) - } - - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/Poll.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/Poll.scala deleted file mode 100755 index 893a9d0aff..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/Poll.scala +++ /dev/null @@ -1,141 +0,0 @@ -package org.bigbluebutton.core.apps.poll - -import scala.collection.mutable.HashMap -import scala.collection.mutable.ArrayBuffer - -case class QuestionResponsesVO(val questionID:String, val responseIDs:Array[String]) -case class PollResponseVO(val pollID: String, val responses: Array[QuestionResponsesVO]) -case class ResponderVO(responseID: String, user: Responder) - -case class ResponseVO(id: String, text: String, responders: Array[Responder] = Array[Responder]()) -case class QuestionVO(id: String, multiResponse: Boolean, question: String, responses: Array[ResponseVO]) -case class PollVO(id: String, title: String, questions: Array[QuestionVO], started: Boolean = false, stopped: Boolean = false) - -case class Responder(val userID: String, name: String) - -case class ResponseOutVO(id: String, text: String, responders: Array[Responder] = Array[Responder]()) -case class QuestionOutVO(id: String, multiResponse: Boolean, question: String, responses: Array[ResponseOutVO]) -case class PollOutVO(id: String, title: String, started: Boolean, stopped: Boolean, questions: Array[QuestionOutVO]) - - -class Poll(val id: String, val title: String, val questions: Array[Question]) { - private var _started: Boolean = false - private var _stopped: Boolean = false - - private var _showResult: Boolean = false - - def showResult() { - _showResult = true - } - - def hideResult() { - _showResult = false - } - - def resultShown(): Boolean = { - _showResult - } - - def start() { - _started = true; - } - - def stop() { - _stopped = true; - } - - def isStarted():Boolean = { - return _started - } - - def isStopped():Boolean = { - return _stopped - } - - def clear() { - questions.foreach(q => { - q.clear - }) - - _started = false - _stopped = false - } - - def hasResponses():Boolean = { - questions.foreach(q => { - if (q.hasResponders) return true - }) - - return false - } - - def respondToQuestion(questionID: String, responseID: String, responder: Responder) { - questions.foreach(q => { - if (q.id.equals(questionID)) { - q.respondToQuestion(responseID, responder) - } - }) - } - - def toPollVO():PollVO = { - val qvos = new ArrayBuffer[QuestionVO] - questions.foreach(q => { - qvos += q.toQuestionVO - }) - - new PollVO(id, title, qvos.toArray, _started, _stopped) - } -} - -class Question(val id: String, val multiResponse: Boolean, val question: String, val responses: Array[Response]) { - - def clear() { - responses.foreach(r => r.clear) - } - - def hasResponders():Boolean = { - responses.foreach(r => { - if (r.numResponders > 0) return true - }) - - return false - } - - def respondToQuestion(id: String, responder: Responder) { - responses.foreach(r => { - if (r.id == id) r.addResponder(responder) - }) - } - - def toQuestionVO():QuestionVO = { - val rvos = new ArrayBuffer[ResponseVO] - responses.foreach(response => { - val r = new ResponseVO(response.id, response.response, response.getResponders) - rvos += r - }) - - new QuestionVO(id, multiResponse, question, rvos.toArray) - } -} - -class Response(val id: String, val response: String) { - - val responders = new ArrayBuffer[Responder]() - - def clear() { - responders.clear - } - def addResponder(responder: Responder) { - responders += responder - } - - def numResponders():Int = { - responders.length; - } - - def getResponders():Array[Responder] = { - var r = new Array[Responder](responders.length) - responders.copyToArray(r) - return r - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollApp.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollApp.scala deleted file mode 100755 index 1b66d21659..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollApp.scala +++ /dev/null @@ -1,123 +0,0 @@ -package org.bigbluebutton.core.apps.poll - -import scala.collection.mutable.HashMap -import org.bigbluebutton.core.api._ -import scala.collection.mutable.ArrayBuffer -import org.bigbluebutton.core.MeetingActor - -trait PollApp { - this : MeetingActor => - - val outGW: MessageOutGateway - - private val pollModel = new PollModel - - def handleHidePollResult(msg: HidePollResult) { - val pollID = msg.pollID - - if (pollModel.hasPoll(pollID)) { - pollModel.hidePollResult(pollID) - outGW.send(new PollHideResultOutMsg(meetingID, recorded, pollID)) - } - } - - def handleShowPollResult(msg: ShowPollResult) { - val pollID = msg.pollID - - if (pollModel.hasPoll(pollID)) { - pollModel.showPollResult(pollID) - outGW.send(new PollShowResultOutMsg(meetingID, recorded, pollID)) - } - } - - def handleRespondToPoll(msg: RespondToPoll) { - val pollID = msg.response.pollID - - if (pollModel.hasPoll(pollID)) { - if (hasUser(msg.requesterID)) { - getUser(msg.requesterID) match { - case Some(user) => { - val responder = new Responder(user.userID, user.name) - msg.response.responses.foreach(question => { - question.responseIDs.foreach(response => { - pollModel.respondToQuestion(pollID, question.questionID, response, responder) - }) - }) - - pollModel.getPoll(msg.response.pollID) match { - case Some(poll) => outGW.send(new PollResponseOutMsg(meetingID, recorded, responder, msg.response)) - case None => // do nothing - } - } - case None => //do nothing - } - } - } - } - - def handleGetPolls(msg: GetPolls) { - var polls = pollModel.getPolls - outGW.send(new GetPollsReplyOutMsg(meetingID, recorded, msg.requesterID, polls)) - } - - def handleClearPoll(msg: ClearPoll) { - if (pollModel.clearPoll(msg.pollID)) { - outGW.send(new PollClearedOutMsg(meetingID, recorded, msg.pollID)) - } else { - print("PollApp:: handleClearPoll - " + msg.pollID + " not found" ) - } - } - - def handleStartPoll(msg: StartPoll) { - if (pollModel.hasPoll(msg.pollID)) { - pollModel.startPoll(msg.pollID) - outGW.send(new PollStartedOutMsg(meetingID, recorded, msg.pollID)) - } else { - print("PollApp:: handleStartPoll - " + msg.pollID + " not found" ) - } - } - - def handleStopPoll(msg: StopPoll) { - if (pollModel.hasPoll(msg.pollID)) { - pollModel.stopPoll(msg.pollID) - outGW.send(new PollStoppedOutMsg(meetingID, recorded, msg.pollID)) - } else { - print("PollApp:: handleStopPoll - " + msg.pollID + " not found" ) - } - } - - def handleSharePoll(msg: SharePoll) { - - } - - def handleRemovePoll(msg: RemovePoll) { - if (pollModel.hasPoll(msg.pollID)) { - pollModel.removePoll(msg.pollID) - outGW.send(new PollRemovedOutMsg(meetingID, recorded, msg.pollID)) - } else { - print("PollApp:: handleRemovePoll - " + msg.pollID + " not found" ) - } - } - - def handleDestroyPoll(msg: DestroyPoll) { - - } - - def handleUpdatePoll(msg: UpdatePoll) { - if (pollModel.updatePoll(msg.poll)) { - outGW.send(new PollUpdatedOutMsg(meetingID, recorded, msg.poll.id, msg.poll)) - } else { - print("PollApp:: handleUpdatePoll - " + msg.poll.id + " not found" ) - } - } - - def handlePreCreatedPoll(msg: PreCreatedPoll) { - pollModel.createPoll(msg.poll) - outGW.send(new PollCreatedOutMsg(meetingID, recorded, msg.poll.id, msg.poll)) - } - - def handleCreatePoll(msg: CreatePoll) { - pollModel.createPoll(msg.poll) - outGW.send(new PollCreatedOutMsg(meetingID, recorded, msg.poll.id, msg.poll)) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollInGateway.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollInGateway.scala deleted file mode 100755 index 6a31c26d6f..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollInGateway.scala +++ /dev/null @@ -1,56 +0,0 @@ -package org.bigbluebutton.core.apps.poll - -import org.bigbluebutton.core.BigBlueButtonGateway -import org.bigbluebutton.core.api._ - -class PollInGateway(bbbGW: BigBlueButtonGateway) { - - val msgConverter = new PollMessageConverter - - def getPolls(meetingID: String, requesterID: String) { - bbbGW.accept(new GetPolls(meetingID, requesterID)) - } - - def preCreatedPoll(meetingID: String, msg: String) { - val pvo = msgConverter.convertPreCreatedPollMessage(msg) - bbbGW.accept(new PreCreatedPoll(meetingID, pvo)) - } - - def createPoll(meetingID: String, requesterID: String, msg: String) { - val pvo = msgConverter.convertCreatePollMessage(msg) - bbbGW.accept(new CreatePoll(meetingID, requesterID, pvo)) - } - - def updatePoll(meetingID: String, requesterID: String, msg: String) { - val pvo = msgConverter.convertUpdatePollMessage(msg) - bbbGW.accept(new UpdatePoll(meetingID, requesterID, pvo)) - } - - def startPoll(meetingID: String, requesterID: String, msg: String) { - val pollID = msgConverter.convertStartPollMessage(msg) - bbbGW.accept(new StartPoll(meetingID, requesterID, pollID)) - } - - def stopPoll(meetingID: String, requesterID: String, msg: String) { - val pollID = msgConverter.convertStopPollMessage(msg) - bbbGW.accept(new StopPoll(meetingID, requesterID, pollID)) - } - - def removePoll(meetingID: String, requesterID: String, msg: String) { - val pollID = msgConverter.convertRemovePollMessage(msg) - bbbGW.accept(new RemovePoll(meetingID, requesterID, pollID)) - } - - def respondPoll(meetingID: String, requesterID: String, msg: String) { - val pollResponse = msgConverter.convertTakePollMessage(msg) - bbbGW.accept(new RespondToPoll(meetingID, requesterID, pollResponse)) - } - - def showPollResult(meetingID: String, requesterID: String, pollID: String) { - bbbGW.accept(new ShowPollResult(meetingID, requesterID, pollID)) - } - - def hidePollResult(meetingID: String, requesterID: String, pollID: String) { - bbbGW.accept(new HidePollResult(meetingID, requesterID, pollID)) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollMessageConverter.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollMessageConverter.scala deleted file mode 100755 index e3763ef85c..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollMessageConverter.scala +++ /dev/null @@ -1,190 +0,0 @@ -package org.bigbluebutton.core.apps.poll - -import com.google.gson.Gson -import com.google.gson.JsonParser -import org.bigbluebutton.core.util.RandomStringGenerator._ -import scala.collection.mutable.ArrayBuffer - -class PollMessageConverter { - - def convertPreCreatedPollMessage(msg:String):PollVO = { - val gson = new Gson(); - val parser = new JsonParser(); - val obj = parser.parse(msg).getAsJsonObject(); - val title = gson.fromJson(obj.get("title"), classOf[String]); - - val question = gson.fromJson(obj.get("question"), classOf[String]); - val qType = gson.fromJson(obj.get("questionType"), classOf[String]) - - val cvoArray = ArrayBuffer[QuestionVO]() - - val responses = obj.get("answers").getAsJsonArray(); - - val rvoArray = ArrayBuffer[ResponseVO]() - - var j = 0 - val respIter = responses.iterator() - while(respIter.hasNext()) { - val response = gson.fromJson(respIter.next(), classOf[String]); - - rvoArray += new ResponseVO(j.toString, response) - - j += 1 - } - - val questionType = if (qType.equalsIgnoreCase(QuestionType.MULTI_CHOICE.toString())) true else false - - cvoArray += new QuestionVO(0.toString, questionType, question, rvoArray.toArray) - - new PollVO(randomAlphanumericString(12), title, cvoArray.toArray) - - } - - def convertCreatePollMessage(msg:String):PollVO = { - val gson = new Gson(); - val parser = new JsonParser(); - val obj = parser.parse(msg).getAsJsonObject(); - val title = gson.fromJson(obj.get("title"), classOf[String]); - - val questions = obj.get("questions").getAsJsonArray(); - val cvoArray = ArrayBuffer[QuestionVO]() - - val iter = questions.iterator() - var i = 0 - while(iter.hasNext()) { - val aquestion = iter.next().getAsJsonObject(); - val questionText = gson.fromJson(aquestion.get("question"), classOf[String]) - - val qType = gson.fromJson(aquestion.get("questionType"), classOf[String]) - - val responses = aquestion.get("responses").getAsJsonArray(); - - val rvoArray = ArrayBuffer[ResponseVO]() - - var j = 0 - val respIter = responses.iterator() - while(respIter.hasNext()) { - val response = gson.fromJson(respIter.next(), classOf[String]); - - rvoArray += new ResponseVO(j.toString, response) - - j += 1 - } - - val questionType = if (! qType.equalsIgnoreCase(QuestionType.MULTI_CHOICE.toString())) true else false - - cvoArray += new QuestionVO(i.toString, questionType, questionText, rvoArray.toArray) - - i += 1 - } - - new PollVO(randomAlphanumericString(12), title, cvoArray.toArray) - - } - - def convertUpdatePollMessage(msg:String):PollVO = { - val gson = new Gson(); - val parser = new JsonParser(); - val obj = parser.parse(msg).getAsJsonObject(); - val title = gson.fromJson(obj.get("title"), classOf[String]); - val pollID = gson.fromJson(obj.get("id"), classOf[String]); - - val questions = obj.get("questions").getAsJsonArray(); - - val cvoArray = ArrayBuffer[QuestionVO]() - - val iter = questions.iterator() - var i = 0 - while(iter.hasNext()) { - val aquestion = iter.next().getAsJsonObject(); - val questionText = gson.fromJson(aquestion.get("question"), classOf[String]) - - val responses = aquestion.get("responses").getAsJsonArray(); - - val rvoArray = ArrayBuffer[ResponseVO]() - - var j = 0 - val respIter = responses.iterator() - while(respIter.hasNext()) { - val response = respIter.next().getAsJsonObject() - - // Get the old response id - val oldRespID = gson.fromJson(response.get("id"), classOf[String]) - // if the old response id is empty, then this is a new answer, create a new id - val respID = if (oldRespID == "") j.toString() else oldRespID - val respText = gson.fromJson(response.get("response"), classOf[String]) - - rvoArray += new ResponseVO(respID, respText) - - j += 1 - } - - val qType = gson.fromJson(aquestion.get("questionType"), classOf[String]) - val qID = gson.fromJson(aquestion.get("id"), classOf[String]) - val questionType = if (qType.equalsIgnoreCase(QuestionType.MULTI_CHOICE.toString())) true else false - - cvoArray += new QuestionVO(qID, questionType, questionText, rvoArray.toArray) - - i += 1 - } - - new PollVO(pollID, title, cvoArray.toArray) - } - - def convertStartPollMessage(msg: String):String = { - val gson = new Gson(); - val parser = new JsonParser(); - val obj = parser.parse(msg).getAsJsonObject(); - val pollID = gson.fromJson(obj.get("pollID"), classOf[String]); - - pollID - } - - def convertStopPollMessage(msg: String):String = { - val gson = new Gson(); - val parser = new JsonParser(); - val obj = parser.parse(msg).getAsJsonObject(); - val pollID = gson.fromJson(obj.get("pollID"), classOf[String]); - - pollID - } - - def convertRemovePollMessage(msg: String):String = { - val gson = new Gson(); - val parser = new JsonParser(); - val obj = parser.parse(msg).getAsJsonObject(); - val pollID = gson.fromJson(obj.get("pollID"), classOf[String]); - - pollID - } - - def convertTakePollMessage(msg: String):PollResponseVO = { - val gson = new Gson(); - val parser = new JsonParser(); - val obj = parser.parse(msg).getAsJsonObject(); - val pollID = gson.fromJson(obj.get("pollID"), classOf[String]); - val questions = obj.get("questions").getAsJsonArray(); - - val qVO = ArrayBuffer[QuestionResponsesVO](); - - val iter = questions.iterator() - while(iter.hasNext()) { - val aquestion = iter.next().getAsJsonObject(); - val questionID = gson.fromJson(aquestion.get("questionID"), classOf[String]) - - val responses = aquestion.get("responseIDs").getAsJsonArray(); - - val rvoArray = ArrayBuffer[String]() - - val respIter = responses.iterator() - while(respIter.hasNext()) { - val response = gson.fromJson(respIter.next(), classOf[String]); - rvoArray += response - } - - qVO += new QuestionResponsesVO(questionID, rvoArray.toArray) - } - - new PollResponseVO(pollID, qVO.toArray) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollModel.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollModel.scala deleted file mode 100755 index 1b1efcb26d..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/PollModel.scala +++ /dev/null @@ -1,235 +0,0 @@ -package org.bigbluebutton.core.apps.poll - -import scala.collection.mutable.ArrayBuffer -import scala.collection.mutable.HashMap - -class PollModel { - - private val polls = new HashMap[String, Poll]() - - /*** - * Uncomment to create sample polls for manual testing purposes - */ - //createSamplePoll - - def numPolls():Int = { - polls.size - } - - def createPoll(pollVO: PollVO) { - val questions = new ArrayBuffer[Question] - pollVO.questions.foreach(qv => { - val responses = new ArrayBuffer[Response] - qv.responses.foreach(rv => { - val response = new Response(rv.id, rv.text) - responses += response - }) - questions += new Question(qv.id, qv.multiResponse, qv.question, responses.toArray) - }) - - val poll = new Poll(pollVO.id, pollVO.title, questions.toArray) - polls += poll.id -> poll - } - - def updatePoll(pollVO: PollVO):Boolean = { - var success = false - - polls.get(pollVO.id) match { - case Some(p) => { - val questions = new ArrayBuffer[Question] - pollVO.questions.foreach(qv => { - val responses = new ArrayBuffer[Response] - qv.responses.foreach(rv => { - val response = new Response(rv.id, rv.text) - responses += response - }) - questions += new Question(qv.id, qv.multiResponse, qv.question, responses.toArray) - }) - - val poll = new Poll(pollVO.id, pollVO.title, questions.toArray) - polls += poll.id -> poll - success = true - } - case None => success = false - } - - success - } - - def getPolls():Array[PollVO] = { - val poll = new ArrayBuffer[PollVO] - polls.values.foreach(p => { - poll += p.toPollVO - }) - - poll.toArray - } - - def clearPoll(pollID: String):Boolean = { - var success = false - polls.get(pollID) match { - case Some(p) => { - p.clear - success = true - } - case None => success = false - } - - success - } - - def startPoll(pollID: String):Boolean = { - var success = false - polls.get(pollID) match { - case Some(p) => { - p.start - success = true - } - case None => success = false - } - - success - } - - def removePoll(pollID: String):Boolean = { - var success = false - polls.get(pollID) match { - case Some(p) => { - polls -= p.id - success = true - } - case None => success = false - } - - success - } - - def stopPoll(pollID: String):Boolean = { - var success = false - polls.get(pollID) match { - case Some(p) => { - p.stop - success = true - } - case None => success = false - } - - success - } - - def hasPoll(pollID: String):Boolean = { - var present = false - polls.get(pollID) match { - case Some(p) => { - present = true - } - case None => present = false - } - - present - } - - def getPoll(pollID: String):Option[PollVO] = { - var poll:Option[PollVO] = None - - polls.get(pollID) match { - case Some(p) => { - val questions = new ArrayBuffer[QuestionVO] - p.questions.foreach(q => { - val responses = new ArrayBuffer[ResponseVO] - q.responses.foreach(response => { - val r = new ResponseVO(response.id, response.response, response.getResponders) - responses += r - }) - - val quest = new QuestionVO(q.id, q.multiResponse, q.question, responses.toArray) - questions += quest - }) - poll = Some(new PollVO(p.id, p.title, questions.toArray)) - } - case None => poll = None - } - - poll - } - - def hidePollResult(pollID: String) { - polls.get(pollID) match { - case Some(p) => p.hideResult - case None => // do nothing - } - } - - def showPollResult(pollID: String) { - polls.get(pollID) match { - case Some(p) => p.showResult - case None => // do nothing - } - } - - def respondToQuestion(pollID: String, questionID: String, responseID: String, responder: Responder) { - polls.get(pollID) match { - case Some(p) => { - p.respondToQuestion(questionID, responseID, responder) - } - case None => - } - } - - /******************************************************** - * Some pre-created polls for testing and simulation so we don't have - * to manually generate polls when testing the UI. - */ - def createSamplePoll() { - addSamplePoll1() - addSamplePoll2() - addSamplePoll3() - } - - def addSamplePoll1() { - val r1 = new ResponseVO("0", "Visa") - val r2 = new ResponseVO("1", "MasterCard") - val r3 = new ResponseVO("2", "AmEx") - val r4 = new ResponseVO("3", "Diners Club") - - var q = new QuestionVO("q1", false, "What type of credit card do you prefer?", Array(r1, r2, r3, r4)) - val pvo = new PollVO("pollID-101", "Preferred Credit Card", Array(q)) - - createPoll(pvo) - - respondToQuestion("pollID-101", "q1", "1", new Responder("user1", "Juan Tamad")) - respondToQuestion("pollID-101", "q1", "0", new Responder("user2", "Asyong Aksaya")) - } - - def addSamplePoll2() { - val r1 = new ResponseVO("0", "Visa") - val r2 = new ResponseVO("1", "MasterCard") - val r3 = new ResponseVO("2", "AmEx") - val r4 = new ResponseVO("3", "Diners Club") - - var q = new QuestionVO("q1", true, "Which credit cards do you own?", Array(r1, r2, r3, r4)) - val pvo = new PollVO("pollID-102", "Owned Credit Cards", Array(q)) - - createPoll(pvo) - - respondToQuestion("pollID-102", "q1", "1", new Responder("user1", "Juan Tamad")) - respondToQuestion("pollID-102", "q1", "0", new Responder("user2", "Asyong Aksaya")) - } - - def addSamplePoll3() { - val r1 = new ResponseVO("0", "Dumaguete") - val r2 = new ResponseVO("1", "Cebu") - val r3 = new ResponseVO("2", "Zamboanga") - val r4 = new ResponseVO("3", "None of the above") - - var q = new QuestionVO("q1", true, "What is the capital of the Philippines?", Array(r1, r2, r3, r4)) - val pvo = new PollVO("pollID-103", "Philippine Capital", Array(q)) - - createPoll(pvo) - - respondToQuestion("pollID-103", "q1", "1", new Responder("user1", "Juan Tamad")) - respondToQuestion("pollID-103", "q1", "0", new Responder("user2", "Asyong")) - respondToQuestion("pollID-103", "q1", "2", new Responder("user3", "Pedro")) - respondToQuestion("pollID-103", "q1", "3", new Responder("user4", "Aksaya")) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/QuestionType.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/QuestionType.scala deleted file mode 100755 index fdfc60122e..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/QuestionType.scala +++ /dev/null @@ -1,7 +0,0 @@ -package org.bigbluebutton.core.apps.poll - -object QuestionType extends Enumeration { - type QuestionType = Value - val MULTI_CHOICE = Value("MULTI_CHOICE") - val MULTI_REPONSE = Value("MULTI_REPONSE") -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/red5/PollClientMessageSender.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/red5/PollClientMessageSender.scala deleted file mode 100755 index 4505561d7d..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/red5/PollClientMessageSender.scala +++ /dev/null @@ -1,125 +0,0 @@ -package org.bigbluebutton.core.apps.poll.red5 - -import com.google.gson.Gson -import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService -import org.bigbluebutton.core.api._ -import org.bigbluebutton.conference.meeting.messaging.red5.DirectClientMessage -import org.bigbluebutton.conference.meeting.messaging.red5.BroadcastClientMessage -import java.util.ArrayList -import org.bigbluebutton.core.apps.poll.PollVO - -class PollClientMessageSender(service: ConnectionInvokerService) extends OutMessageListener2 { - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: GetPollsReplyOutMsg => handleGetPollsReplyOutMsg(msg) - case msg: PollClearedOutMsg => handlePollClearedOutMsg(msg) - case msg: PollStartedOutMsg => handlePollStartedOutMsg(msg) - case msg: PollStoppedOutMsg => handlePollStoppedOutMsg(msg) - case msg: PollRemovedOutMsg => handlePollRemovedOutMsg(msg) - case msg: PollUpdatedOutMsg => handlePollUpdatedOutMsg(msg) - case msg: PollCreatedOutMsg => handlePollCreatedOutMsg(msg) - case msg: PollResponseOutMsg => handlePollResponseOutMsg(msg) - case _ => // do nothing - } - } - - private def handlePollResponseOutMsg(msg: PollResponseOutMsg) { - val gson = new Gson(); - val map = new java.util.HashMap[String, Object]() - map.put("responder", msg.responder) - map.put("response", msg.response) - - val message = new java.util.HashMap[String, Object]() - message.put("msg", gson.toJson(map)) - -// println("PollClientMessageSender - Handling PollResponseOutMsg \n" + message.get("msg") + "\n") - - var m = new BroadcastClientMessage(msg.meetingID, "pollResultUpdatedMessage", message); - service.sendMessage(m); - } - - private def handleGetPollsReplyOutMsg(msg: GetPollsReplyOutMsg) { - val gson = new Gson(); - val message = new java.util.HashMap[String, Object]() - - val collection = new ArrayList[PollVO](); - - msg.polls.foreach(p => { - collection.add(p) - }) - - message.put("msg", gson.toJson(collection)) - -// println("PollClientMessageSender - Handling GetPollsReplyOutMsg \n" + message.get("msg") + "\n") - - var m = new DirectClientMessage(msg.meetingID, msg.requesterID, "pollGetPollsReply", message); - service.sendMessage(m); - } - - private def handlePollClearedOutMsg(msg: PollClearedOutMsg) { -// println("PollClientMessageSender - Handling PollClearedOutMsg") - } - - private def handlePollStartedOutMsg(msg: PollStartedOutMsg) { -// println("PollClientMessageSender - Handling PollStartedOutMsg") - - val map = new java.util.HashMap[String, Object]() - map.put("pollID", msg.pollID) - - val gson = new Gson(); - val message = new java.util.HashMap[String, Object]() - message.put("msg", gson.toJson(map)) - - var m = new BroadcastClientMessage(msg.meetingID, "pollStartedMessage", message); - service.sendMessage(m); - } - - private def handlePollStoppedOutMsg(msg: PollStoppedOutMsg) { -// println("PollClientMessageSender - Handling PollStoppedOutMsg") - - val map = new java.util.HashMap[String, Object]() - map.put("pollID", msg.pollID) - - val gson = new Gson(); - val message = new java.util.HashMap[String, Object]() - message.put("msg", gson.toJson(map)) - - var m = new BroadcastClientMessage(msg.meetingID, "pollStoppedMessage", message); - service.sendMessage(m); - } - - private def handlePollRemovedOutMsg(msg: PollRemovedOutMsg) { -// println("PollClientMessageSender - Handling PollRemovedOutMsg") - val map = new java.util.HashMap[String, Object]() - map.put("pollID", msg.pollID) - - val gson = new Gson(); - val message = new java.util.HashMap[String, Object]() - message.put("msg", gson.toJson(map)) - - var m = new BroadcastClientMessage(msg.meetingID, "pollDestroyedMessage", message); - service.sendMessage(m); - } - - private def handlePollUpdatedOutMsg(msg: PollUpdatedOutMsg) { -// println("PollClientMessageSender - Handling PollUpdatedOutMsg") - val gson= new Gson(); - val message = new java.util.HashMap[String, Object]() - message.put("msg", gson.toJson(msg.pollVO)) - - var m = new BroadcastClientMessage(msg.meetingID, "pollUpdatedMessage", message); - service.sendMessage(m); - } - - private def handlePollCreatedOutMsg(msg: PollCreatedOutMsg) { -// println("PollClientMessageSender - Handling PollCreatedOutMsg") - val gson= new Gson(); - - val message = new java.util.HashMap[String, Object]() - message.put("msg", gson.toJson(msg.pollVO)) - - var m = new BroadcastClientMessage(msg.meetingID, "pollCreatedMessage", message); - service.sendMessage(m); - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/redis/PollEventRedisPublisher.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/redis/PollEventRedisPublisher.scala deleted file mode 100755 index 830bf3cd59..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/redis/PollEventRedisPublisher.scala +++ /dev/null @@ -1,114 +0,0 @@ -package org.bigbluebutton.core.apps.poll.redis - -import org.bigbluebutton.core.api._ -import org.bigbluebutton.conference.service.messaging.redis.MessageSender -import com.google.gson.Gson -import org.bigbluebutton.common.messages.MessagingConstants -import java.util.ArrayList -import org.bigbluebutton.core.apps.poll.PollVO - -class PollEventRedisPublisher(service: MessageSender) extends OutMessageListener2 { - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: GetPollsReplyOutMsg => handleGetPollsReplyOutMsg(msg) - case msg: PollClearedOutMsg => handlePollClearedOutMsg(msg) - case msg: PollStartedOutMsg => handlePollStartedOutMsg(msg) - case msg: PollStoppedOutMsg => handlePollStoppedOutMsg(msg) - case msg: PollRemovedOutMsg => handlePollRemovedOutMsg(msg) - case msg: PollUpdatedOutMsg => handlePollUpdatedOutMsg(msg) - case msg: PollCreatedOutMsg => handlePollCreatedOutMsg(msg) - case msg: PollResponseOutMsg => handlePollResponseOutMsg(msg) - case _ => // do nothing - } - } - - private def handlePollResponseOutMsg(msg: PollResponseOutMsg) { - val gson = new Gson(); - val map = new java.util.HashMap[String, Object]() - - map.put("meetingID", msg.meetingID) - map.put("event", "PollResponseEvent") - map.put("responder", msg.responder) - map.put("response", msg.response) - - service.send(MessagingConstants.FROM_POLLING_CHANNEL, gson.toJson(map)); - } - - private def handleGetPollsReplyOutMsg(msg: GetPollsReplyOutMsg) { - val gson = new Gson(); - val message = new java.util.HashMap[String, Object]() - - val collection = new ArrayList[PollVO](); - - msg.polls.foreach(p => { - collection.add(p) - }) - - message.put("msg", gson.toJson(collection)) - -// println("PollClientMessageSender - Handling GetPollsReplyOutMsg \n" + message.get("msg") + "\n") - - } - - private def handlePollClearedOutMsg(msg: PollClearedOutMsg) { -// println("PollClientMessageSender - Handling PollClearedOutMsg") - } - - private def handlePollStartedOutMsg(msg: PollStartedOutMsg) { -// println("PollClientMessageSender - Handling PollStartedOutMsg") - - val gson = new Gson(); - val map = new java.util.HashMap[String, Object]() - map.put("meetingID", msg.meetingID) - map.put("event", "PollStartedEvent") - map.put("pollID", msg.pollID) - service.send(MessagingConstants.FROM_POLLING_CHANNEL, gson.toJson(map)); - - } - - private def handlePollStoppedOutMsg(msg: PollStoppedOutMsg) { -// println("PollClientMessageSender - Handling PollStoppedOutMsg") - - val gson = new Gson(); - val map = new java.util.HashMap[String, Object]() - map.put("meetingID", msg.meetingID) - map.put("event", "PollStoppedEvent") - map.put("pollID", msg.pollID) - service.send(MessagingConstants.FROM_POLLING_CHANNEL, gson.toJson(map)); - } - - private def handlePollRemovedOutMsg(msg: PollRemovedOutMsg) { -// println("PollClientMessageSender - Handling PollRemovedOutMsg") - - val gson = new Gson(); - val map = new java.util.HashMap[String, Object]() - map.put("meetingID", msg.meetingID) - map.put("event", "PollRemovedEvent") - map.put("pollID", msg.pollID) - service.send(MessagingConstants.FROM_POLLING_CHANNEL, gson.toJson(map)); - } - - private def handlePollUpdatedOutMsg(msg: PollUpdatedOutMsg) { -// println("PollClientMessageSender - Handling PollUpdatedOutMsg") - val gson = new Gson(); - val map = new java.util.HashMap[String, Object]() - map.put("meetingID", msg.meetingID) - map.put("event", "PollUpdatedEvent") - map.put("msg", gson.toJson(msg.pollVO)) - - service.send(MessagingConstants.FROM_POLLING_CHANNEL, gson.toJson(map)); - } - - private def handlePollCreatedOutMsg(msg: PollCreatedOutMsg) { -// println("PollClientMessageSender - Handling PollCreatedOutMsg") - val gson = new Gson(); - - val map = new java.util.HashMap[String, Object]() - map.put("meetingID", msg.meetingID) - map.put("event", "PollCreatedEvent") - map.put("msg", gson.toJson(msg.pollVO)) - - service.send(MessagingConstants.FROM_POLLING_CHANNEL, gson.toJson(map)); - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/redis/PollEventRedisRecorder.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/redis/PollEventRedisRecorder.scala deleted file mode 100755 index c0ffd80d25..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/poll/redis/PollEventRedisRecorder.scala +++ /dev/null @@ -1,115 +0,0 @@ -package org.bigbluebutton.core.apps.poll.redis - -import org.bigbluebutton.conference.service.recorder.RecorderApplication -import org.bigbluebutton.core.api._ -import org.bigbluebutton.conference.service.recorder.polling.PollCreatedRecordEvent -import org.bigbluebutton.conference.service.recorder.polling.PollUpdatedRecordEvent -import org.bigbluebutton.conference.service.recorder.polling.PollRemovedRecordEvent -import org.bigbluebutton.conference.service.recorder.polling.PollStoppedRecordEvent -import org.bigbluebutton.conference.service.recorder.polling.PollStartedRecordEvent -import org.bigbluebutton.conference.service.recorder.polling.PollClearedRecordEvent - -class PollEventRedisRecorder(recorder: RecorderApplication) extends OutMessageListener2 { - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: GetPollsReplyOutMsg => // do nothing? - case msg: PollClearedOutMsg => handlePollClearedOutMsg(msg) - case msg: PollStartedOutMsg => handlePollStartedOutMsg(msg) - case msg: PollStoppedOutMsg => handlePollStoppedOutMsg(msg) - case msg: PollRemovedOutMsg => handlePollRemovedOutMsg(msg) - case msg: PollUpdatedOutMsg => handlePollUpdatedOutMsg(msg) - case msg: PollCreatedOutMsg => handlePollCreatedOutMsg(msg) - case _ => // do nothing - } - } - - def handlePollCreatedOutMsg(msg: PollCreatedOutMsg):Unit = { - if (msg.recorded) { - val ev = new PollCreatedRecordEvent(); - ev.setPollID(msg.pollVO.id) - ev.setTitle(msg.pollVO.title) - - for ( q <- msg.pollVO.questions ) { - ev.addQuestion(q.id, q.question, q.multiResponse) - for( resp <- q.responses ){ - ev.addResponse(q.id, resp.id, resp.text) - - /*for( responder <- resp.responders ){ - ev.addResponder(q.id, resp.id, responder.id, ) - }*/ - } - } - - ev.setTimestamp(TimestampGenerator.generateTimestamp) - ev.setMeetingId(msg.meetingID) - recorder.record(msg.meetingID, ev) - } - - } - - def handlePollUpdatedOutMsg(msg:PollUpdatedOutMsg):Unit = { - if (msg.recorded) { - val ev = new PollUpdatedRecordEvent(); - ev.setPollID(msg.pollVO.id) - ev.setTitle(msg.pollVO.title) - - for ( q <- msg.pollVO.questions ) { - ev.addQuestion(q.id, q.question, q.multiResponse) - for( resp <- q.responses ){ - ev.addResponse(q.id, resp.id, resp.text) - - /*for( responder <- resp.responders ){ - ev.addResponder(q.id, resp.id, responder.id, ) - }*/ - } - } - - ev.setTimestamp(TimestampGenerator.generateTimestamp) - ev.setMeetingId(msg.meetingID) - recorder.record(msg.meetingID, ev) - } - } - - def handlePollRemovedOutMsg(msg:PollRemovedOutMsg):Unit = { - if (msg.recorded) { - val ev = new PollRemovedRecordEvent() - ev.setPollID(msg.pollID) - ev.setTimestamp(TimestampGenerator.generateTimestamp) - ev.setMeetingId(msg.meetingID) - recorder.record(msg.meetingID, ev) - } - } - - def handlePollStoppedOutMsg(msg:PollStoppedOutMsg):Unit = { - if (msg.recorded) { - val ev = new PollStoppedRecordEvent() - ev.setPollID(msg.pollID) - ev.setTimestamp(TimestampGenerator.generateTimestamp) - ev.setMeetingId(msg.meetingID) - recorder.record(msg.meetingID, ev) - } - } - - def handlePollStartedOutMsg(msg:PollStartedOutMsg):Unit = { - if(msg.recorded) { - val ev = new PollStartedRecordEvent() - ev.setPollID(msg.pollID) - ev.setTimestamp(System.currentTimeMillis()) - ev.setMeetingId(msg.meetingID) - recorder.record(msg.meetingID, ev) - } - } - - def handlePollClearedOutMsg(msg:PollClearedOutMsg):Unit = { - if (msg.recorded) { - val ev = new PollClearedRecordEvent() - ev.setPollID(msg.pollID) - ev.setTimestamp(TimestampGenerator.generateTimestamp) - ev.setMeetingId(msg.meetingID) - recorder.record(msg.meetingID, ev) - } - } - - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp.scala deleted file mode 100755 index 0329e21704..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp.scala +++ /dev/null @@ -1,157 +0,0 @@ -package org.bigbluebutton.core.apps.presentation - -import org.bigbluebutton.core.api._ -import org.bigbluebutton.core.MeetingActor -import com.google.gson.Gson - -case class CurrentPresenter(userId: String, name: String, assignedBy: String) - -case class CurrentPresentationInfo(presenter: CurrentPresenter, - presentations: Seq[Presentation]) -case class CursorLocation(xPercent: Double = 0D, yPercent: Double = 0D) - - - -trait PresentationApp { - this : MeetingActor => - - val outGW: MessageOutGateway - - private var cursorLocation = new CursorLocation - private val presModel = new PresentationModel - - - def handlePreuploadedPresentations(msg: PreuploadedPresentations) { - val pres = msg.presentations - - msg.presentations.foreach(presentation => { - presModel.addPresentation(presentation) - - sharePresentation(presentation.id, true) - }) - } - - def handleInitializeMeeting(msg: InitializeMeeting) { - - } - - def handleClearPresentation(msg: ClearPresentation) { - outGW.send(new ClearPresentationOutMsg(meetingID, recorded)) - } - - def handlePresentationConversionUpdate(msg: PresentationConversionUpdate) { - outGW.send(new PresentationConversionProgress(meetingID, msg.messageKey, - msg.code, msg.presentationId, msg.presName)) - } - - def handlePresentationPageCountError(msg: PresentationPageCountError) { - outGW.send(new PresentationConversionError(meetingID, msg.messageKey, - msg.code, msg.presentationId, - msg.numberOfPages, - msg.maxNumberPages, msg.presName)) - } - - def handlePresentationSlideGenerated(msg: PresentationSlideGenerated) { - outGW.send(new PresentationPageGenerated(meetingID, msg.messageKey, - msg.code, msg.presentationId, - msg.numberOfPages, - msg.pagesCompleted, msg.presName)) - } - - def handlePresentationConversionCompleted(msg: PresentationConversionCompleted) { - - presModel.addPresentation(msg.presentation) - - outGW.send(new PresentationConversionDone(meetingID, recorded, msg.messageKey, - msg.code, msg.presentation)) - - sharePresentation(msg.presentation.id, true) - } - - def handleRemovePresentation(msg: RemovePresentation) { - val curPres = presModel.getCurrentPresentation - - val removedPresentation = presModel.remove(msg.presentationID) - - curPres foreach (cp => { - if (cp.id == msg.presentationID) { - sharePresentation(msg.presentationID, false); - } - }) - - outGW.send(new RemovePresentationOutMsg(msg.meetingID, recorded, msg.presentationID)) - - } - - def handleGetPresentationInfo(msg: GetPresentationInfo) { -// println("PresentationApp : handleGetPresentationInfo GetPresentationInfo for meeting [" + msg.meetingID + "] [" + msg.requesterID + "]" ) - - val curPresenter = getCurrentPresenter; - val presenter = new CurrentPresenter(curPresenter.presenterID, - curPresenter.presenterName, - curPresenter.assignedBy) - val presentations = presModel.getPresentations - val presentationInfo = new CurrentPresentationInfo(presenter, presentations) - outGW.send(new GetPresentationInfoOutMsg(meetingID, recorded, msg.requesterID, presentationInfo, msg.replyTo)) - } - - def handleSendCursorUpdate(msg: SendCursorUpdate) { - cursorLocation = new CursorLocation(msg.xPercent, msg.yPercent) - outGW.send(new SendCursorUpdateOutMsg(meetingID, recorded, msg.xPercent, msg.yPercent)) - } - - def handleResizeAndMoveSlide(msg: ResizeAndMoveSlide) { - val page = presModel.resizePage(msg.xOffset, msg.yOffset, - msg.widthRatio, msg.heightRatio); - page foreach (p => outGW.send(new ResizeAndMoveSlideOutMsg(meetingID, recorded, p))) - } - - def handleGotoSlide(msg: GotoSlide) { -// println("Received GotoSlide for meeting=[" + msg.meetingID + "] page=[" + msg.page + "]") -// println("*** Before change page ****") -// printPresentations - presModel.changePage(msg.page) foreach {page => -// println("Switching page for meeting=[" + msg.meetingID + "] page=[" + page.id + "]") - outGW.send(new GotoSlideOutMsg(meetingID, recorded, page)) - } -// println("*** After change page ****") -// printPresentations - } - - def handleSharePresentation(msg: SharePresentation) { - sharePresentation(msg.presentationID, msg.share) - } - - def sharePresentation(presentationID: String, share: Boolean) { - val pres = presModel.sharePresentation(presentationID) - - pres foreach { p => - outGW.send(new SharePresentationOutMsg(meetingID, recorded, p)) - - presModel.getCurrentPage(p) foreach {page => - outGW.send(new GotoSlideOutMsg(meetingID, recorded, page)) - } - } - - } - - def handleGetSlideInfo(msg: GetSlideInfo) { - presModel.getCurrentPresentation foreach {pres => - presModel.getCurrentPage(pres) foreach {page => - outGW.send(new GetSlideInfoOutMsg(meetingID, recorded, msg.requesterID, page, msg.replyTo)) - } - } - - } - - def printPresentations() { - presModel.getPresentations foreach {pres => - println("presentation id=[" + pres.id + "] current=[" + pres.current + "]") - pres.pages.values foreach {page => - println("page id=[" + page.id + "] current=[" + page.current + "]") - } - } - - } - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationModel.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationModel.scala deleted file mode 100755 index 7f96eb4a09..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationModel.scala +++ /dev/null @@ -1,128 +0,0 @@ -package org.bigbluebutton.core.apps.presentation - -case class Presentation(id: String, name: String, current: Boolean = false, - pages: scala.collection.immutable.HashMap[String, Page]) - -case class Page(id: String, num: Int, - thumbUri: String = "", - swfUri: String, - txtUri: String, - pngUri: String, - current: Boolean = false, - xOffset: Double = 0, yOffset: Double = 0, - widthRatio: Double = 100D, heightRatio: Double = 100D) - -class PresentationModel { - private var presentations = new scala.collection.immutable.HashMap[String, Presentation] - - def addPresentation(pres: Presentation) { - savePresentation(pres) - } - - def getPresentations():Seq[Presentation] = { - presentations.values.toSeq - } - - def getCurrentPresentation():Option[Presentation] = { - presentations.values find (p => p.current) - } - - def getCurrentPage(pres: Presentation):Option[Page] = { - pres.pages.values find (p => p.current) - } - - def remove(presId: String):Option[Presentation] = { - val pres = presentations.get(presId) - pres foreach (p => presentations -= p.id) - pres - } - - def sharePresentation(presId: String):Option[Presentation] = { - getCurrentPresentation foreach (curPres => { - if (curPres.id != presId) { - val newPres = curPres.copy(current = false) - savePresentation(newPres) - } - }) - - presentations.get(presId) match { - case Some(pres) => { - val cp = pres.copy(current = true) - savePresentation(cp) - Some(cp) - } - case None => None - } - } - - private def savePresentation(pres: Presentation) { - presentations += pres.id -> pres - } - - private def resizeCurrentPage(pres: Presentation, - xOffset: Double, yOffset: Double, - widthRatio: Double, - heightRatio: Double):Option[Page] = { - getCurrentPage(pres) match { - case Some(cp) => { - val page = cp.copy(xOffset = xOffset, yOffset = yOffset, - widthRatio= widthRatio, heightRatio = heightRatio) - val nPages = pres.pages + (page.id -> page) - val newPres = pres.copy(pages= nPages) - savePresentation(newPres) - Some(page) - } - case None => None - } - } - - def resizePage(xOffset: Double, yOffset: Double, - widthRatio: Double, heightRatio: Double):Option[Page] = { - for { - curPres <- getCurrentPresentation - page <- resizeCurrentPage(curPres, xOffset, yOffset, widthRatio, heightRatio) - } yield page - } - - private def deactivateCurrentPage(pres: Presentation) { - getCurrentPage(pres) foreach {cp => - val page = cp.copy(current = false) - val nPages = pres.pages + (page.id -> page) - val newPres = pres.copy(pages= nPages) - savePresentation(newPres) -// println("Making page[" + page.id + "] not current[" + page.current + "]") -// println("After deact page. presentation id=[" + newPres.id + "] current=[" + newPres.current + "]") -// newPres.pages.values foreach {page => -// println("page id=[" + page.id + "] current=[" + page.current + "]") -// } - } - } - - - private def makePageCurrent(pres: Presentation, page: String):Option[Page] = { - pres.pages.values find (p => p.id == page) match { - case Some(newCurPage) => { - val page = newCurPage.copy(current=true) - val newPages = pres.pages + (page.id -> page) - val newPres = pres.copy(pages= newPages) - savePresentation(newPres) -// println("Making page[" + page.id + "] current[" + page.current + "]") - Some(page) - } - case None => { -// println("Could not find page[" + page + "] in presentation [" + pres.id + "]") - None - } - } - } - - def changePage(pageId: String):Option[Page] = { - getCurrentPresentation foreach {pres => deactivateCurrentPage(pres)} - - for { - pres <- getCurrentPresentation - page <- makePageCurrent(pres, pageId) - } yield page - } - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/red5/PresentationClientMessageSender.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/red5/PresentationClientMessageSender.scala deleted file mode 100755 index 7c9da8897a..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/red5/PresentationClientMessageSender.scala +++ /dev/null @@ -1,295 +0,0 @@ -package org.bigbluebutton.core.apps.presentation.red5 - -import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService -import org.bigbluebutton.core.api._ -import org.bigbluebutton.conference.meeting.messaging.red5.BroadcastClientMessage -import org.bigbluebutton.conference.meeting.messaging.red5.DirectClientMessage -import collection.JavaConversions._ -import com.google.gson.Gson -import java.util.ArrayList -import org.bigbluebutton.core.apps.presentation.Page -import org.bigbluebutton.core.apps.presentation.Presentation - - -class PresentationClientMessageSender(service: ConnectionInvokerService) extends OutMessageListener2 { - - private val OFFICE_DOC_CONVERSION_SUCCESS_KEY = "OFFICE_DOC_CONVERSION_SUCCESS"; - private val OFFICE_DOC_CONVERSION_FAILED_KEY = "OFFICE_DOC_CONVERSION_FAILED"; - private val SUPPORTED_DOCUMENT_KEY = "SUPPORTED_DOCUMENT"; - private val UNSUPPORTED_DOCUMENT_KEY = "UNSUPPORTED_DOCUMENT"; - private val PAGE_COUNT_FAILED_KEY = "PAGE_COUNT_FAILED"; - private val PAGE_COUNT_EXCEEDED_KEY = "PAGE_COUNT_EXCEEDED"; - private val GENERATED_SLIDE_KEY = "GENERATED_SLIDE"; - private val GENERATING_THUMBNAIL_KEY = "GENERATING_THUMBNAIL"; - private val GENERATED_THUMBNAIL_KEY = "GENERATED_THUMBNAIL"; - private val CONVERSION_COMPLETED_KEY = "CONVERSION_COMPLETED"; - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: ClearPresentationOutMsg => handleClearPresentationOutMsg(msg) -// case msg: RemovePresentationOutMsg => handleRemovePresentationOutMsg(msg) - case msg: GetPresentationInfoOutMsg => handleGetPresentationInfoOutMsg(msg) - case msg: SendCursorUpdateOutMsg => handleSendCursorUpdateOutMsg(msg) - case msg: ResizeAndMoveSlideOutMsg => handleResizeAndMoveSlideOutMsg(msg) - case msg: GotoSlideOutMsg => handleGotoSlideOutMsg(msg) - case msg: SharePresentationOutMsg => handleSharePresentationOutMsg(msg) - case msg: GetSlideInfoOutMsg => handleGetSlideInfoOutMsg(msg) - case msg: PresentationConversionProgress => handlePresentationConversionProgress(msg) - case msg: PresentationConversionError => handlePresentationConversionError(msg) - case msg: PresentationPageGenerated => handlePresentationPageGenerated(msg) - case msg: PresentationConversionDone => handlePresentationConversionDone(msg) - case _ => // do nothing - } - } - - private def handleClearPresentationOutMsg(msg: ClearPresentationOutMsg) { - - } - - private def handlePresentationConversionProgress(msg: PresentationConversionProgress) { - val args = new java.util.HashMap[String, String](); - args.put("meetingID", msg.meetingID); - args.put("code", msg.code); - args.put("presentationID", msg.presentationId); - args.put("presentationName", msg.presentationName); - args.put("messageKey", msg.messageKey); - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - -// println("PresentationClientMessageSender - handlePresentationConversionProgress \n" + message.get("msg") + "\n") - - val m = new BroadcastClientMessage(msg.meetingID, "conversionUpdateMessageCallback", message); - service.sendMessage(m); - } - - private def handlePresentationConversionError(msg: PresentationConversionError) { - val args = new java.util.HashMap[String, String](); - args.put("meetingID", msg.meetingID); - args.put("code", msg.code); - args.put("presentationID", msg.presentationId); - args.put("presentationName", msg.presentationName); - args.put("messageKey", msg.messageKey); - args.put("numberOfPages", msg.numberOfPages.toString); - args.put("maxNumberPages", msg.maxNumberPages.toString); - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - -// println("PresentationClientMessageSender - handlePresentationConversionError \n" + message.get("msg") + "\n") - - val m = new BroadcastClientMessage(msg.meetingID, "pageCountExceededUpdateMessageCallback", message); - service.sendMessage(m); - } - - private def handlePresentationPageGenerated(msg: PresentationPageGenerated) { - val args = new java.util.HashMap[String, String](); - args.put("meetingID", msg.meetingID); - args.put("code", msg.code); - args.put("presentationID", msg.presentationId); - args.put("presentationName", msg.presentationName); - args.put("messageKey", msg.messageKey); - args.put("numberOfPages", msg.numberOfPages.toString); - args.put("pagesCompleted", msg.pagesCompleted.toString); - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - -// println("PresentationClientMessageSender - handlePresentationPageGenerated \n" + message.get("msg") + "\n") - - val m = new BroadcastClientMessage(msg.meetingID, "generatedSlideUpdateMessageCallback", message); - service.sendMessage(m); - } - - private def handlePresentationConversionDone(msg: PresentationConversionDone) { - val args = new java.util.HashMap[String, Object]() - args.put("meetingID", msg.meetingID); - args.put("code", msg.code); - - val presentation = new java.util.HashMap[String, Object](); - presentation.put("id", msg.presentation.id) - presentation.put("name", msg.presentation.name) - presentation.put("current", msg.presentation.current:java.lang.Boolean) - - val pages = new ArrayList[Page]() - - msg.presentation.pages.values foreach {p => -// println("PresentationClientMessageSender **** Page [" + p.id + "," + p.num + "]") - pages.add(p) - } - - presentation.put("pages", pages) - - args.put("presentation", presentation); - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - -// println("PresentationClientMessageSender - handlePresentationConversionDone \n" + message.get("msg") + "\n") - - val m = new BroadcastClientMessage(msg.meetingID, "conversionCompletedUpdateMessageCallback", message); - service.sendMessage(m); - } - - private def handleRemovePresentationOutMsg(msg: RemovePresentationOutMsg) { - val args = new java.util.HashMap[String, Object](); - args.put("presentationID", msg.presentationID); - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - - val m = new BroadcastClientMessage(msg.meetingID, "removePresentationCallback", message); - service.sendMessage(m); - } - - private def handleGetPresentationInfoOutMsg(msg: GetPresentationInfoOutMsg) { - val info = msg.info - - // Build JSON - val args = new java.util.HashMap[String, Object]() - args.put("meetingID", msg.meetingID); - - // Create a map for our current presenter - val presenter = new java.util.HashMap[String, String]() - presenter.put("userId", info.presenter.userId) - presenter.put("name", info.presenter.name) - presenter.put("assignedBy", info.presenter.assignedBy) - - args.put("presenter", presenter) - - // Create an array for our presentations - val presentations = new ArrayList[java.util.HashMap[String, Object]] - info.presentations.foreach { pres => - val presentation = new java.util.HashMap[String, Object](); - presentation.put("id", pres.id) - presentation.put("name", pres.name) - presentation.put("current", pres.current:java.lang.Boolean) - - // Get the pages for a presentation - val pages = new ArrayList[Page]() - pres.pages.values foreach {p => - pages.add(p) - } - // store the pages in the presentation - presentation.put("pages", pages) - - // add this presentation into our presentations list - presentations.add(presentation); - } - - // add the presentation to our map to complete our json - args.put("presentations", presentations) - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - - println("***** PresentationClientMessageSender - handleGetPresentationInfoOutMsg to user[" +msg.requesterID + "] message[" + message.get("msg") + "]") - - val m = new DirectClientMessage(msg.meetingID, msg.requesterID, "getPresentationInfoReply", message); -// service.sendMessage(m); - } - - private def handleSendCursorUpdateOutMsg(msg: SendCursorUpdateOutMsg) { - val args = new java.util.HashMap[String, Object](); - args.put("xPercent", msg.xPercent:java.lang.Double); - args.put("yPercent", msg.yPercent:java.lang.Double); - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - - val m = new BroadcastClientMessage(msg.meetingID, "PresentationCursorUpdateCommand", message); - service.sendMessage(m); - } - - private def handleResizeAndMoveSlideOutMsg(msg: ResizeAndMoveSlideOutMsg) { - val args = new java.util.HashMap[String, Object](); - args.put("id", msg.page.id) - args.put("num", msg.page.num:java.lang.Integer) - args.put("current", msg.page.current:java.lang.Boolean) - args.put("swfUri", msg.page.swfUri) - args.put("txtUri", msg.page.txtUri) - args.put("pngUri", msg.page.pngUri) - args.put("thumbUri", msg.page.thumbUri) - args.put("xOffset", msg.page.xOffset:java.lang.Double); - args.put("yOffset", msg.page.yOffset:java.lang.Double); - args.put("widthRatio", msg.page.widthRatio:java.lang.Double); - args.put("heightRatio", msg.page.heightRatio:java.lang.Double); - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - - val m = new BroadcastClientMessage(msg.meetingID, "moveCallback", message); - service.sendMessage(m); - } - - private def handleGotoSlideOutMsg(msg: GotoSlideOutMsg) { - val args = new java.util.HashMap[String, Object](); - args.put("id", msg.page.id) - args.put("num", msg.page.num:java.lang.Integer) - args.put("current", msg.page.current:java.lang.Boolean) - args.put("swfUri", msg.page.swfUri) - args.put("txtUri", msg.page.txtUri) - args.put("pngUri", msg.page.pngUri) - args.put("thumbUri", msg.page.thumbUri) - args.put("xOffset", msg.page.xOffset:java.lang.Double); - args.put("yOffset", msg.page.yOffset:java.lang.Double); - args.put("widthRatio", msg.page.widthRatio:java.lang.Double); - args.put("heightRatio", msg.page.heightRatio:java.lang.Double); - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - - val m = new BroadcastClientMessage(msg.meetingID, "goToSlideCallback", message); - service.sendMessage(m); - } - - private def handleSharePresentationOutMsg(msg: SharePresentationOutMsg) { - val args = new java.util.HashMap[String, Object](); - - val presentation = new java.util.HashMap[String, Object](); - presentation.put("id", msg.presentation.id) - presentation.put("name", msg.presentation.name) - presentation.put("current", msg.presentation.current:java.lang.Boolean) - - // Get the pages for a presentation - val pages = new ArrayList[Page]() - msg.presentation.pages.values foreach {p => - pages.add(p) - } - // store the pages in the presentation - presentation.put("pages", pages) - - args.put("presentation", presentation); - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - - val m = new BroadcastClientMessage(msg.meetingID, "sharePresentationCallback", message); - service.sendMessage(m); - } - - private def handleGetSlideInfoOutMsg(msg: GetSlideInfoOutMsg) { - val args = new java.util.HashMap[String, Object](); - args.put("xOffset", msg.page.xOffset:java.lang.Double); - args.put("yOffest", msg.page.yOffset:java.lang.Double); - args.put("widthRatio", msg.page.widthRatio:java.lang.Double); - args.put("heightRatio", msg.page.heightRatio:java.lang.Double); - - val message = new java.util.HashMap[String, Object]() - val gson = new Gson(); - message.put("msg", gson.toJson(args)) - - val m = new DirectClientMessage(msg.meetingID, msg.requesterID, "getPresentationInfoReply", message); - service.sendMessage(m); - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PesentationMessageToJsonConverter.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PesentationMessageToJsonConverter.scala deleted file mode 100755 index e6833b11a0..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PesentationMessageToJsonConverter.scala +++ /dev/null @@ -1,281 +0,0 @@ -package org.bigbluebutton.core.apps.presentation.redis - -import org.bigbluebutton.core.api._ -import org.bigbluebutton.core.messaging.Util -import org.bigbluebutton.core.apps.presentation.Page -import collection.JavaConverters._ -import scala.collection.JavaConversions._ - -object PesentationMessageToJsonConverter { - private def pageToMap(page: Page):java.util.Map[String, Any] = { - val res = new scala.collection.mutable.HashMap[String, Any] - res += "id" -> page.id - res += "num" -> page.num - res += "thumb_uri" -> page.thumbUri - res += "swf_uri" -> page.swfUri - res += "txt_uri" -> page.txtUri - res += "png_uri" -> page.pngUri - res += "current" -> page.current - res += "x_offset" -> page.xOffset - res += "y_offset" -> page.yOffset - res += "width_ratio" -> page.widthRatio - res += "height_ratio" -> page.heightRatio - - mapAsJavaMap(res) - } - - def clearPresentationOutMsgToJson(msg: ClearPresentationOutMsg):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = Util.buildHeader(MessageNames.PRESENTATION_CLEARED, msg.version, None) - Util.buildJson(header, payload) - } - - def removePresentationOutMsgToJson(msg: RemovePresentationOutMsg):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PRESENTATION_ID, msg.presentationID) - - val header = Util.buildHeader(MessageNames.PRESENTATION_REMOVED, msg.version, None) - Util.buildJson(header, payload) - } - - def getPresentationInfoOutMsgToJson(msg: GetPresentationInfoOutMsg): String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PRESENTATION_INFO, msg.info) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val info = msg.info - - // Create a map for our current presenter - val presenter = new java.util.HashMap[String, String]() - presenter.put(Constants.USER_ID, info.presenter.userId) - presenter.put(Constants.NAME, info.presenter.name) - presenter.put(Constants.ASSIGNED_BY, info.presenter.assignedBy) - - payload.put(Constants.PRESENTER, presenter) - - // Create an array for our presentations - val presentations = new java.util.ArrayList[java.util.HashMap[String, Object]] - info.presentations.foreach { pres => - val presentation = new java.util.HashMap[String, Object]() - presentation.put(Constants.ID, pres.id) - presentation.put(Constants.NAME, pres.name) - presentation.put(Constants.CURRENT, pres.current:java.lang.Boolean) - - // Get the pages for a presentation - val pages = new java.util.ArrayList[java.util.Map[String, Any]]() - pres.pages.values foreach {p => - pages.add(pageToMap(p)) - } - // store the pages in the presentation - presentation.put(Constants.PAGES, pages) - - // add this presentation into our presentations list - presentations.add(presentation); - } - - // add the presentation to our map to complete our json - payload.put(Constants.PRESENTATIONS, presentations) - - val header = Util.buildHeader(MessageNames.GET_PRESENTATION_INFO_REPLY, msg.version, Some(msg.replyTo)) - Util.buildJson(header, payload) - } - - def sendCursorUpdateOutMsgToJson(msg: SendCursorUpdateOutMsg):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.X_PERCENT, msg.xPercent) - payload.put(Constants.Y_PERCENT, msg.yPercent) - - val header = Util.buildHeader(MessageNames.PRESENTATION_CURSOR_UPDATED, msg.version, None) - Util.buildJson(header, payload) - } - - def resizeAndMoveSlideOutMsgToJson(msg: ResizeAndMoveSlideOutMsg):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PAGE, pageToMap(msg.page)) - - val header = Util.buildHeader(MessageNames.PRESENTATION_PAGE_RESIZED, msg.version, None) - Util.buildJson(header, payload) - } - - def gotoSlideOutMsgToJson(msg: GotoSlideOutMsg):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PAGE, pageToMap(msg.page)) - - val header = Util.buildHeader(MessageNames.PRESENTATION_PAGE_CHANGED, msg.version, None) - Util.buildJson(header, payload) - } - - def sharePresentationOutMsgToJson(msg: SharePresentationOutMsg):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val presentation = new java.util.HashMap[String, Object](); - presentation.put(Constants.ID, msg.presentation.id) - presentation.put(Constants.NAME, msg.presentation.name) - presentation.put(Constants.CURRENT, msg.presentation.current:java.lang.Boolean) - - // Get the pages for a presentation - val pages = new java.util.ArrayList[java.util.Map[String, Any]]() - msg.presentation.pages.values foreach {p => - pages.add(pageToMap(p)) - } - - // store the pages in the presentation - presentation.put(Constants.PAGES, pages) - - payload.put(Constants.PRESENTATION, presentation); - - val header = Util.buildHeader(MessageNames.PRESENTATION_SHARED, msg.version, None) - Util.buildJson(header, payload) - } - - def getSlideInfoOutMsgToJson(msg: GetSlideInfoOutMsg):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.PAGE, pageToMap(msg.page)) - - val header = Util.buildHeader(MessageNames.GET_SLIDE_INFO_REPLY, msg.version, None) - Util.buildJson(header, payload) - } - - def getPreuploadedPresentationsOutMsgToJson(msg: GetPreuploadedPresentationsOutMsg):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = Util.buildHeader(MessageNames.GET_PREUPLOADED_PRESENTATIONS, msg.version, None) - Util.buildJson(header, payload) - } - - def presentationConversionProgressToJson(msg: PresentationConversionProgress):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MESSAGE_KEY, msg.messageKey) - payload.put(Constants.CODE, msg.code) - payload.put(Constants.PRESENTATION_ID, msg.presentationId) - payload.put(Constants.PRESENTATION_NAME, msg.presentationName) - - val header = Util.buildHeader(MessageNames.PRESENTATION_CONVERSION_PROGRESS, msg.version, None) - Util.buildJson(header, payload) - } - - def presentationConversionErrorToJson(msg: PresentationConversionError):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MESSAGE_KEY, msg.messageKey) - payload.put(Constants.CODE, msg.code) - payload.put(Constants.PRESENTATION_ID, msg.presentationId) - payload.put(Constants.PRESENTATION_NAME, msg.presentationName) - payload.put(Constants.NUM_PAGES, msg.numberOfPages) - payload.put(Constants.MAX_NUM_PAGES, msg.maxNumberPages) - - val header = Util.buildHeader(MessageNames.PRESENTATION_CONVERSION_ERROR, msg.version, None) - Util.buildJson(header, payload) - } - - def presentationPageGenerated(msg: PresentationPageGenerated):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MESSAGE_KEY, msg.messageKey) - payload.put(Constants.CODE, msg.code) - payload.put(Constants.PRESENTATION_ID, msg.presentationId) - payload.put(Constants.PRESENTATION_NAME, msg.presentationName) - payload.put(Constants.NUM_PAGES, msg.numberOfPages) - payload.put(Constants.PAGES_COMPLETED, msg.pagesCompleted) - - val header = Util.buildHeader(MessageNames.PRESENTATION_PAGE_GENERATED, msg.version, None) - Util.buildJson(header, payload) - } - - def presentationConversionDoneToJson(msg: PresentationConversionDone):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MESSAGE_KEY, msg.messageKey) - payload.put(Constants.CODE, msg.code) - - val presentation = new java.util.HashMap[String, Object](); - presentation.put(Constants.ID, msg.presentation.id) - presentation.put(Constants.NAME, msg.presentation.name) - presentation.put(Constants.CURRENT, msg.presentation.current:java.lang.Boolean) - - val pages = new java.util.ArrayList[java.util.Map[String, Any]]() - msg.presentation.pages.values foreach {p => - pages.add(pageToMap(p)) - } - - presentation.put(Constants.PAGES, pages) - - payload.put(Constants.PRESENTATION, presentation); - - val header = Util.buildHeader(MessageNames.PRESENTATION_CONVERSION_DONE, msg.version, None) - Util.buildJson(header, payload) - } - - def presentationChangedToJson(msg: PresentationChanged):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - val presentation = new java.util.HashMap[String, Object](); - presentation.put(Constants.ID, msg.presentation.id) - presentation.put(Constants.NAME, msg.presentation.name) - presentation.put(Constants.CURRENT, msg.presentation.current:java.lang.Boolean) - - val pages = new java.util.ArrayList[java.util.Map[String, Any]]() - msg.presentation.pages.values foreach {p => - pages.add(pageToMap(p)) - } - - presentation.put(Constants.PAGES, pages) - payload.put(Constants.PRESENTATION, presentation); - - val header = Util.buildHeader(MessageNames.PRESENTATION_CHANGED, msg.version, None) - Util.buildJson(header, payload) - } - - def getPresentationStatusReplyToJson(msg: GetPresentationStatusReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - val presentation = new java.util.HashMap[String, Object](); - - presentation.put(Constants.ID, msg.current.id) - presentation.put(Constants.NAME, msg.current.name) - presentation.put(Constants.CURRENT, msg.current.current:java.lang.Boolean) - - val pages = new java.util.ArrayList[java.util.Map[String, Any]]() - - msg.current.pages.values foreach {p => - pages.add(pageToMap(p)) - } - - presentation.put(Constants.PAGES, pages) - - payload.put(Constants.PRESENTATION, presentation); - - val header = Util.buildHeader(MessageNames.GET_PRESENTATION_STATUS_REPLY, msg.version, Some(msg.replyTo)) - Util.buildJson(header, payload) - } - - def presentationRemovedToJson(msg: PresentationRemoved):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PRESENTATION_ID, msg.presentationId) - - val header = Util.buildHeader(MessageNames.PRESENTATION_REMOVED, msg.version, None) - Util.buildJson(header, payload) - } - - def pageChangedToJson(msg: PageChanged):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PAGE, pageToMap(msg.page)) - - val header = Util.buildHeader(MessageNames.PRESENTATION_PAGE_CHANGED, msg.version, None) - Util.buildJson(header, payload) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PresentationEventRedisPublisher.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PresentationEventRedisPublisher.scala deleted file mode 100755 index 0daad8e933..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PresentationEventRedisPublisher.scala +++ /dev/null @@ -1,161 +0,0 @@ -package org.bigbluebutton.core.apps.presentation.redis - -import org.bigbluebutton.core.api.OutMessageListener2 -import org.bigbluebutton.core.apps.presentation.Page -import org.bigbluebutton.conference.service.messaging.redis.MessageSender -import org.bigbluebutton.core.api._ -import org.bigbluebutton.common.messages.MessagingConstants -import org.bigbluebutton.common.messages.PresentationRemovedMessage -import collection.JavaConverters._ -import scala.collection.JavaConversions._ -import org.bigbluebutton.common.messages.GetPresentationInfoReplyMessage - -class PresentationEventRedisPublisher(service: MessageSender) extends OutMessageListener2 { - def handleMessage(msg: IOutMessage) { - msg match { - case msg: ClearPresentationOutMsg => handleClearPresentationOutMsg(msg) - case msg: RemovePresentationOutMsg => handleRemovePresentationOutMsg(msg) - case msg: GetPresentationInfoOutMsg => handleGetPresentationInfoOutMsg(msg) - case msg: SendCursorUpdateOutMsg => handleSendCursorUpdateOutMsg(msg) - case msg: ResizeAndMoveSlideOutMsg => handleResizeAndMoveSlideOutMsg(msg) - case msg: GotoSlideOutMsg => handleGotoSlideOutMsg(msg) - case msg: SharePresentationOutMsg => handleSharePresentationOutMsg(msg) - case msg: GetSlideInfoOutMsg => handleGetSlideInfoOutMsg(msg) - case msg: PresentationConversionProgress => handlePresentationConversionProgress(msg) - case msg: PresentationConversionError => handlePresentationConversionError(msg) - case msg: PresentationPageGenerated => handlePresentationPageGenerated(msg) - case msg: PresentationConversionDone => handlePresentationConversionDone(msg) - case _ => // do nothing - } - } - - private def pageToMap(page: Page):java.util.Map[String, Any] = { - val res = new scala.collection.mutable.HashMap[String, Any] - res += "id" -> page.id - res += "num" -> page.num - res += "thumb_uri" -> page.thumbUri - res += "swf_uri" -> page.swfUri - res += "txt_uri" -> page.txtUri - res += "png_uri" -> page.pngUri - res += "current" -> page.current - res += "x_offset" -> page.xOffset - res += "y_offset" -> page.yOffset - res += "width_ratio" -> page.widthRatio - res += "height_ratio" -> page.heightRatio - - mapAsJavaMap(res) - } - - private def handleClearPresentationOutMsg(msg: ClearPresentationOutMsg) { - val json = PesentationMessageToJsonConverter.clearPresentationOutMsgToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handleRemovePresentationOutMsg(msg: RemovePresentationOutMsg) { - val m = new PresentationRemovedMessage(msg.meetingID, msg.presentationID) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, m.toJson()) - } - - private def handleGetPresentationInfoOutMsg(msg: GetPresentationInfoOutMsg) { - // Create a map for our current presenter - val presenter = new java.util.HashMap[String, Object]() - presenter.put(Constants.USER_ID, msg.info.presenter.userId) - presenter.put(Constants.NAME, msg.info.presenter.name) - presenter.put(Constants.ASSIGNED_BY, msg.info.presenter.assignedBy) - - // Create an array for our presentations - val presentations = new java.util.ArrayList[java.util.Map[String, Object]] - msg.info.presentations.foreach { pres => - val presentation = new java.util.HashMap[String, Object]() - presentation.put(Constants.ID, pres.id) - presentation.put(Constants.NAME, pres.name) - presentation.put(Constants.CURRENT, pres.current:java.lang.Boolean) - - // Get the pages for a presentation - val pages = new java.util.ArrayList[java.util.Map[String, Any]]() - pres.pages.values foreach {p => - pages.add(pageToMap(p)) - } - // store the pages in the presentation - presentation.put(Constants.PAGES, pages) - - // add this presentation into our presentations list - presentations.add(presentation); - } - - val reply = new GetPresentationInfoReplyMessage(msg.meetingID, msg.requesterID, presenter, presentations) - - val json = PesentationMessageToJsonConverter.getPresentationInfoOutMsgToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handleSendCursorUpdateOutMsg(msg: SendCursorUpdateOutMsg) { - val json = PesentationMessageToJsonConverter.sendCursorUpdateOutMsgToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handleResizeAndMoveSlideOutMsg(msg: ResizeAndMoveSlideOutMsg) { - val json = PesentationMessageToJsonConverter.resizeAndMoveSlideOutMsgToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handleGotoSlideOutMsg(msg: GotoSlideOutMsg) { - val json = PesentationMessageToJsonConverter.gotoSlideOutMsgToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handleSharePresentationOutMsg(msg: SharePresentationOutMsg) { - val json = PesentationMessageToJsonConverter.sharePresentationOutMsgToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handleGetSlideInfoOutMsg(msg: GetSlideInfoOutMsg) { - val json = PesentationMessageToJsonConverter.getSlideInfoOutMsgToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handleGetPreuploadedPresentationsOutMsg(msg: GetPreuploadedPresentationsOutMsg) { - val json = PesentationMessageToJsonConverter.getPreuploadedPresentationsOutMsgToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handlePresentationConversionProgress(msg: PresentationConversionProgress) { - val json = PesentationMessageToJsonConverter.presentationConversionProgressToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handlePresentationConversionError(msg: PresentationConversionError) { - val json = PesentationMessageToJsonConverter.presentationConversionErrorToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handlePresentationPageGenerated(msg: PresentationPageGenerated) { - val json = PesentationMessageToJsonConverter.presentationPageGenerated(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handlePresentationConversionDone(msg: PresentationConversionDone) { - val json = PesentationMessageToJsonConverter.presentationConversionDoneToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handlePresentationChanged(msg: PresentationChanged) { - val json = PesentationMessageToJsonConverter.presentationChangedToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handleGetPresentationStatusReply(msg: GetPresentationStatusReply) { - val json = PesentationMessageToJsonConverter.getPresentationStatusReplyToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handlePresentationRemoved(msg: PresentationRemoved) { - val json = PesentationMessageToJsonConverter.presentationRemovedToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } - - private def handlePageChanged(msg: PageChanged) { - val json = PesentationMessageToJsonConverter.pageChangedToJson(msg) - service.send(MessagingConstants.FROM_PRESENTATION_CHANNEL, json) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PresentationEventRedisRecorder.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PresentationEventRedisRecorder.scala deleted file mode 100644 index c47cf19039..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/redis/PresentationEventRedisRecorder.scala +++ /dev/null @@ -1,128 +0,0 @@ -package org.bigbluebutton.core.apps.presentation.redis - -import org.bigbluebutton.conference.service.recorder.RecorderApplication -import org.bigbluebutton.core.api.OutMessageListener2 -import org.bigbluebutton.core.api.IOutMessage -import org.bigbluebutton.conference.service.recorder.presentation.GenerateSlidePresentationRecordEvent -import org.bigbluebutton.conference.service.recorder.presentation.ConversionCompletedPresentationRecordEvent -import org.bigbluebutton.core.api.GotoSlideOutMsg -import org.bigbluebutton.conference.service.recorder.presentation.GotoSlidePresentationRecordEvent -import org.bigbluebutton.core.api.ResizeAndMoveSlideOutMsg -import org.bigbluebutton.conference.service.recorder.presentation.ResizeAndMoveSlidePresentationRecordEvent -import org.bigbluebutton.core.api.RemovePresentationOutMsg -import org.bigbluebutton.conference.service.recorder.presentation.RemovePresentationPresentationRecordEvent -import org.bigbluebutton.core.api.SharePresentationOutMsg -import org.bigbluebutton.conference.service.recorder.presentation.SharePresentationPresentationRecordEvent -import org.bigbluebutton.core.api.SendCursorUpdateOutMsg -import org.bigbluebutton.conference.service.recorder.presentation.CursorUpdateRecordEvent -import org.bigbluebutton.core.api.ClearPresentationOutMsg -import org.bigbluebutton.core.api.PresentationConversionDone -import org.bigbluebutton.core.api.TimestampGenerator - -class PresentationEventRedisRecorder(recorder: RecorderApplication) extends OutMessageListener2 { - private val GENERATED_SLIDE_KEY = "GENERATED_SLIDE"; - private val CONVERSION_COMPLETED_KEY = "CONVERSION_COMPLETED"; - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: ClearPresentationOutMsg => handleClearPresentationOutMsg(msg) - case msg: RemovePresentationOutMsg => handleRemovePresentationOutMsg(msg) - case msg: SendCursorUpdateOutMsg => handleSendCursorUpdateOutMsg(msg) - case msg: ResizeAndMoveSlideOutMsg => handleResizeAndMoveSlideOutMsg(msg) - case msg: GotoSlideOutMsg => handleGotoSlideOutMsg(msg) - case msg: SharePresentationOutMsg => handleSharePresentationOutMsg(msg) - case _ => // do nothing - } - } - - private def handleClearPresentationOutMsg(msg: ClearPresentationOutMsg) { - - } - - - private def handlePresentationConversionDone(msg: PresentationConversionDone) { - if (msg.recorded) { - val event = new ConversionCompletedPresentationRecordEvent(); - event.setMeetingId(msg.meetingID); - event.setTimestamp(TimestampGenerator.generateTimestamp); - event.setPresentationName(msg.presentation.id); - event.setOriginalFilename(msg.presentation.name); - recorder.record(msg.meetingID, event); - } - - } - - private def handleGotoSlideOutMsg(msg: GotoSlideOutMsg) { - if (msg.recorded) { - val event = new GotoSlidePresentationRecordEvent(); - event.setMeetingId(msg.meetingID); - event.setTimestamp(TimestampGenerator.generateTimestamp); - event.setSlide(msg.page.num); - event.setId(msg.page.id); - event.setNum(msg.page.num); - event.setThumbUri(msg.page.thumbUri); - event.setSwfUri(msg.page.swfUri); - event.setTxtUri(msg.page.txtUri); - event.setPngUri(msg.page.pngUri); - event.setXOffset(msg.page.xOffset); - event.setYOffset(msg.page.yOffset); - event.setWidthRatio(msg.page.widthRatio); - event.setHeightRatio(msg.page.heightRatio); - recorder.record(msg.meetingID, event); - } - } - - private def handleResizeAndMoveSlideOutMsg(msg: ResizeAndMoveSlideOutMsg) { - if (msg.recorded) { - val event = new ResizeAndMoveSlidePresentationRecordEvent(); - event.setMeetingId(msg.meetingID); - event.setTimestamp(TimestampGenerator.generateTimestamp); - event.setId(msg.page.id); - event.setNum(msg.page.num); - event.setThumbUri(msg.page.thumbUri); - event.setSwfUri(msg.page.swfUri); - event.setTxtUri(msg.page.txtUri); - event.setPngUri(msg.page.pngUri); - event.setXOffset(msg.page.xOffset); - event.setYOffset(msg.page.yOffset); - event.setWidthRatio(msg.page.widthRatio); - event.setHeightRatio(msg.page.heightRatio); - - recorder.record(msg.meetingID, event); - } - } - - private def handleRemovePresentationOutMsg(msg: RemovePresentationOutMsg) { - if (msg.recorded) { - val event = new RemovePresentationPresentationRecordEvent(); - event.setMeetingId(msg.meetingID); - event.setTimestamp(TimestampGenerator.generateTimestamp); - event.setPresentationName(msg.presentationID); - recorder.record(msg.meetingID, event); - } - } - - private def handleSharePresentationOutMsg(msg: SharePresentationOutMsg) { - if (msg.recorded) { - val event = new SharePresentationPresentationRecordEvent(); - event.setMeetingId(msg.meetingID); - event.setTimestamp(TimestampGenerator.generateTimestamp); - event.setPresentationName(msg.presentation.id); - event.setOriginalFilename(msg.presentation.name); - event.setShare(true); - recorder.record(msg.meetingID, event); - } - } - - private def handleSendCursorUpdateOutMsg(msg: SendCursorUpdateOutMsg) { - if (msg.recorded) { - val event = new CursorUpdateRecordEvent(); - event.setMeetingId(msg.meetingID); - event.setTimestamp(TimestampGenerator.generateTimestamp); - event.setXPercent(msg.xPercent); - event.setYPercent(msg.yPercent); - - recorder.record(msg.meetingID, event); - } - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/Users.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/Users.scala deleted file mode 100755 index 4148bbfe65..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/Users.scala +++ /dev/null @@ -1,133 +0,0 @@ -package org.bigbluebutton.core.apps.users - -import org.bigbluebutton.core.models.{UserV, Voice} -import scala.collection.mutable.ArrayBuffer -import org.bigbluebutton.core.api.Role._ - -class Users { - - private val users = collection.mutable.HashMap[String, UserV]() - - /** - * Add a new user. - */ - def add(user: UserV) = users += user.id -> user - - /** - * Returns the number of users. - */ - def count = users.size - - /** - * Removes a user. - */ - def remove(id: String) = users -= id - - /** - * Gets a user. - */ - def get(id: String):Option[UserV] = users.values.find(u => u.id == id) - - /** - * Get all users. - */ - def all():Array[UserV] = users.values.toArray - - def getPresenter():Option[UserV] = users.values.find(u => u.status.isPresenter) - - def makeEveryoneNotPresenter():Unit = { - users.values map (u => { - val p = u.copy(status = u.status.copy(isPresenter=false)) - users += p.id -> p - }) - } - - def makePresenter(id:String):Option[UserV] = { - var newPresenter: Option[UserV] = None - get(id) match { - case Some(u) => { - val p = u.copy(status = u.status.copy(isPresenter=true)) - newPresenter = Some(p) - users += p.id -> p - } - case None => - } - newPresenter - } - - def moderatorCount:Int = users.values.filter(u => u.role == MODERATOR).size - - def getVoiceUser(id:String):Option[UserV] = users.values.find(u => u.voice.id == id) - - def mute(id:String):Option[UserV] = { - var user:Option[UserV] = None - getVoiceUser(id) match { - case Some(u) => { - val mutedUser = u.copy(voice=u.voice.copy(muted=true)) - users += mutedUser.id -> mutedUser - user = Some(mutedUser) - } - case None => - } - - user - } - - def unmute(id:String):Option[UserV] = { - var user:Option[UserV] = None - getVoiceUser(id) match { - case Some(u) => { - val unmutedUser = u.copy(voice=u.voice.copy(muted=false)) - users += unmutedUser.id -> unmutedUser - user = Some(unmutedUser) - } - case None => - } - - user - } - - def lockVoice(id:String, lock: Boolean):Option[UserV] = { - var user:Option[UserV] = None - get(id) match { - case Some(u) => { - val lockedUser = u.copy(voice=u.voice.copy(locked=lock)) - users += lockedUser.id -> lockedUser - user = Some(lockedUser) - } - case None => - } - - user - } - - def joinedVoice(id:String, voice: Voice):Option[UserV] = { - var user:Option[UserV] = None - get(id) match { - case Some(u) => { - val voiceUser = u.copy(voice=voice) - users += voiceUser.id -> voiceUser - user = Some(voiceUser) - } - case None => - } - - user - } - - def leftVoice(id:String):Option[UserV] = { - var user:Option[UserV] = None - getVoiceUser(id) match { - case Some(u) => { - val voiceUser = u.copy(voice=Voice()) - users += voiceUser.id -> voiceUser - user = Some(voiceUser) - } - case None => - } - - user - } - - def unlockedUsers():Array[UserV] = users.values filter (u => !u.voice.locked) toArray -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala deleted file mode 100755 index abca3c07c1..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala +++ /dev/null @@ -1,448 +0,0 @@ -package org.bigbluebutton.core.apps.users - -import org.bigbluebutton.core.api._ -import scala.collection.mutable.HashMap -import org.bigbluebutton.core.User -import java.util.ArrayList -import org.bigbluebutton.core.MeetingActor -import scala.collection.mutable.ArrayBuffer -import scala.collection.immutable.ListSet - -trait UsersApp { - this : MeetingActor => - - val outGW: MessageOutGateway - - val users = new UsersModel - private var regUsers = new collection.immutable.HashMap[String, RegisteredUser] - - private var locked = false - private var meetingMuted = false - - private var currentPresenter = new Presenter("system", "system", "system") - - def hasUser(userID: String):Boolean = { - users.hasUser(userID) - } - - def getUser(userID:String):Option[UserVO] = { - users.getUser(userID) - } - - def getCurrentPresenter:Presenter = { - currentPresenter - } - - def handleUserConnectedToGlobalAudio(msg: UserConnectedToGlobalAudio) { - val user = users.getUserWithExternalId(msg.userid) - user foreach {u => - val vu = u.voiceUser.copy(talking=false) - val uvo = u.copy(listenOnly=true, voiceUser=vu) - users.addUser(uvo) - log.info("UserConnectedToGlobalAudio: mid=[" + meetingID + "] uid=[" + uvo.userID + "]") - outGW.send(new UserListeningOnly(meetingID, recorded, uvo.userID, uvo.listenOnly)) - } - } - - def handleUserDisconnectedFromGlobalAudio(msg: UserDisconnectedFromGlobalAudio) { - val user = users.getUserWithExternalId(msg.userid) - user foreach {u => - val uvo = u.copy(listenOnly=false) - users.addUser(uvo) - log.info("UserDisconnectedToGlobalAudio: mid=[" + meetingID + "] uid=[" + uvo.userID + "]") - outGW.send(new UserListeningOnly(meetingID, recorded, uvo.userID, uvo.listenOnly)) - } - } - - - def handleMuteAllExceptPresenterRequest(msg: MuteAllExceptPresenterRequest) { - meetingMuted = msg.mute - outGW.send(new MeetingMuted(meetingID, recorded, meetingMuted)) - - usersWhoAreNotPresenter foreach {u => - outGW.send(new MuteVoiceUser(meetingID, recorded, msg.requesterID, u.userID, msg.mute)) - } - } - - def handleMuteMeetingRequest(msg: MuteMeetingRequest) { - meetingMuted = msg.mute - outGW.send(new MeetingMuted(meetingID, recorded, meetingMuted)) - users.getUsers foreach {u => - outGW.send(new MuteVoiceUser(meetingID, recorded, msg.requesterID, u.userID, msg.mute)) - } - } - - def handleValidateAuthToken(msg: ValidateAuthToken) { -// println("*************** Got ValidateAuthToken message ********************" ) - regUsers.get (msg.token) match { - case Some(u) => - { - val replyTo = meetingID + '/' + msg.userId - - //send the reply - outGW.send(new ValidateAuthTokenReply(meetingID, msg.userId, msg.token, true, msg.correlationId, msg.sessionId)) - - //join the user - handleUserJoin(new UserJoining(meetingID, msg.userId, msg.token)) - - //send the presentation - log.info("ValidateToken success: mid=[" + meetingID + "] uid=[" + msg.userId + "]") - } - case None => { - log.info("ValidateToken failed: mid=[" + meetingID + "] uid=[" + msg.userId + "]") - outGW.send(new ValidateAuthTokenReply(meetingID, msg.userId, msg.token, false, msg.correlationId)) - } - } - - /** - * Send a reply to BigBlueButtonActor to let it know this MeetingActor hasn't hung! - * Sometimes, the actor seems to hang and doesn't anymore accept messages. This is a simple - * audit to check whether the actor is still alive. (ralam feb 25, 2015) - */ - sender ! new ValidateAuthTokenReply(meetingID, msg.userId, msg.token, false, msg.correlationId) - } - - def handleRegisterUser(msg: RegisterUser) { - if (hasMeetingEnded) { - // Check first if the meeting has ended and the user refreshed the client to re-connect. - log.info("Register user failed: reason=[meeting has ended] mid=[" + meetingID + "] uid=[" + msg.userID + "]") - sendMeetingHasEnded(msg.userID) - } else { - val regUser = new RegisteredUser(msg.userID, msg.extUserID, msg.name, msg.role, msg.authToken) - regUsers += msg.authToken -> regUser - log.info("Register user success: mid=[" + meetingID + "] uid=[" + msg.userID + "]") - outGW.send(new UserRegistered(meetingID, recorded, regUser)) - } - - } - - def handleIsMeetingMutedRequest(msg: IsMeetingMutedRequest) { - outGW.send(new IsMeetingMutedReply(meetingID, recorded, msg.requesterID, meetingMuted)) - } - - def handleMuteUserRequest(msg: MuteUserRequest) { -// println("Received mute user request uid=[" + msg.userID + "] mute=[" + msg.mute + "]") - users.getUser(msg.userID) match { - case Some(u) => { -// println("Sending mute user request uid=[" + msg.userID + "] mute=[" + msg.mute + "]") - log.info("Muting user: mid=[" + meetingID + "] uid=[" + u.userID + "]") - outGW.send(new MuteVoiceUser(meetingID, recorded, msg.requesterID, u.userID, msg.mute)) - } - case None => { - log.info("Could not find user to mute: mid=[" + meetingID + "] uid=[" + msg.userID + "]") -// println("Could not find user to mute. uid=[" + msg.userID + "] mute=[" + msg.mute + "]") - } - } - } - - def handleEjectUserRequest(msg: EjectUserFromVoiceRequest) { -// println("Received eject user request uid=[" + msg.userID + "]") - users.getUser(msg.userId) match { - case Some(u) => { - if (u.voiceUser.joined) { - log.info("Ejecting user from voice: mid=[" + meetingID + "] uid=[" + u.userID + "]") - outGW.send(new EjectVoiceUser(meetingID, recorded, msg.ejectedBy, u.userID)) - } - } - case None => // do nothing - } - } - - def handleGetLockSettings(msg: GetLockSettings) { - //println("*************** Reply with current lock settings ********************") - - //reusing the existing handle for NewPermissionsSettings to reply to the GetLockSettings request - outGW.send(new NewPermissionsSetting(meetingID, msg.userId, permissions, users.getUsers)) - } - - def handleSetLockSettings(msg: SetLockSettings) { -// println("*************** Received new lock settings ********************") - if (!permissionsEqual(msg.settings)) { - newPermissions(msg.settings) - outGW.send(new NewPermissionsSetting(meetingID, msg.setByUser, permissions, users.getUsers)) - - handleLockLayout(msg.settings.lockedLayout, msg.setByUser) - } - } - - def handleLockUserRequest(msg: LockUserRequest) { - users.getUser(msg.userID) match { - case Some(u) => { - val uvo = u.copy(locked=msg.lock) - users.addUser(uvo) - - log.info("Lock user: mid=[" + meetingID + "] uid=[" + u.userID + "] lock=[" + msg.lock + "]") - outGW.send(new UserLocked(meetingID, u.userID, msg.lock)) - } - case None => { - log.info("Could not find user to lock: mid=[" + meetingID + "] uid=[" + msg.userID + "] lock=[" + msg.lock + "]") - } - } - } - - def handleInitLockSettings(msg: InitLockSettings) { - if (! permissionsInited) { - permissionsInited = true - newPermissions(msg.settings) - outGW.send(new PermissionsSettingInitialized(msg.meetingID, msg.settings, users.getUsers)) - } - } - - def handleInitAudioSettings(msg: InitAudioSettings) { - if (! audioSettingsInited) { - audioSettingsInited = true - if(meetingMuted != msg.muted) { - handleMuteAllExceptPresenterRequest(new MuteAllExceptPresenterRequest(meetingID, msg.requesterID, msg.muted)); - } - } - } - - def usersWhoAreNotPresenter():Array[UserVO] = { - val au = ArrayBuffer[UserVO]() - - users.getUsers foreach {u => - if (! u.presenter) { - au += u - } - } - au.toArray - } - - def handleUserRaiseHand(msg: UserRaiseHand) { - users.getUser(msg.userId) foreach {user => - val uvo = user.copy(raiseHand=true) - users.addUser(uvo) - outGW.send(new UserRaisedHand(meetingID, recorded, uvo.raiseHand, uvo.userID)) - } - } - - def handleUserLowerHand(msg: UserLowerHand) { - users.getUser(msg.userId) foreach {user => - val uvo = user.copy(raiseHand=false) - users.addUser(uvo) - outGW.send(new UserLoweredHand(meetingID, recorded, uvo.raiseHand, uvo.userID, msg.loweredBy)) - } - } - - def handleEjectUserFromMeeting(msg: EjectUserFromMeeting) { - users.getUser(msg.userId) foreach {user => - if (user.voiceUser.joined) { - outGW.send(new EjectVoiceUser(meetingID, recorded, msg.ejectedBy, msg.userId)) - } - - users.removeUser(msg.userId) - - log.info("Ejecting user from meeting: mid=[" + meetingID + "]uid=[" + msg.userId + "]") - outGW.send(new UserEjectedFromMeeting(meetingID, recorded, msg.userId, msg.ejectedBy)) - outGW.send(new DisconnectUser(meetingID, msg.userId)) - - outGW.send(new UserLeft(msg.meetingID, recorded, user)) - } - } - - def handleUserShareWebcam(msg: UserShareWebcam) { - users.getUser(msg.userId) foreach {user => - val streams = user.webcamStreams + msg.stream - val uvo = user.copy(hasStream=true, webcamStreams=streams) - users.addUser(uvo) - log.info("User shared webcam: mid=[" + meetingID + "] uid=[" + uvo.userID + "] sharedStream=[" + msg.stream + "] streams=[" + streams + "]") - outGW.send(new UserSharedWebcam(meetingID, recorded, uvo.userID, msg.stream)) - } - } - - def handleUserunshareWebcam(msg: UserUnshareWebcam) { - users.getUser(msg.userId) foreach {user => - val streams = user.webcamStreams - msg.stream - val uvo = user.copy(hasStream=(!streams.isEmpty), webcamStreams=streams) - users.addUser(uvo) - log.info("User unshared webcam: mid=[" + meetingID + "] uid=[" + uvo.userID + "] unsharedStream=[" + msg.stream + "] streams=[" + streams + "]") - outGW.send(new UserUnsharedWebcam(meetingID, recorded, uvo.userID, msg.stream)) - } - } - - def handleChangeUserStatus(msg: ChangeUserStatus):Unit = { - if (users.hasUser(msg.userID)) { - outGW.send(new UserStatusChange(meetingID, recorded, msg.userID, msg.status, msg.value)) - } - } - - def handleGetUsers(msg: GetUsers):Unit = { - outGW.send(new GetUsersReply(msg.meetingID, msg.requesterID, users.getUsers)) - } - - def handleUserJoin(msg: UserJoining):Unit = { - val regUser = regUsers.get(msg.authToken) - regUser foreach { ru => - val vu = new VoiceUser(msg.userID, msg.userID, ru.name, ru.name, - false, false, false, false) - val uvo = new UserVO(msg.userID, ru.externId, ru.name, - ru.role, raiseHand=false, presenter=false, - hasStream=false, locked=getInitialLockStatus(ru.role), - webcamStreams=new ListSet[String](), phoneUser=false, vu, listenOnly=false) - - users.addUser(uvo) - - log.info("User joined meeting: mid=[" + meetingID + "] uid=[" + uvo.userID + "] role=[" + uvo.role + "] locked=[" + uvo.locked + "] permissions.lockOnJoin=[" + permissions.lockOnJoin + "] permissions.lockOnJoinConfigurable=[" + permissions.lockOnJoinConfigurable + "]") - outGW.send(new UserJoined(meetingID, recorded, uvo)) - - outGW.send(new MeetingState(meetingID, recorded, uvo.userID, permissions, meetingMuted)) - - // Become presenter if the only moderator - if (users.numModerators == 1) { - if (ru.role == Role.MODERATOR) { - assignNewPresenter(msg.userID, ru.name, msg.userID) - } - } - webUserJoined - startRecordingIfAutoStart() - } - } - - def handleUserLeft(msg: UserLeaving):Unit = { - if (users.hasUser(msg.userID)) { - val user = users.removeUser(msg.userID) - user foreach { u => - log.info("User left meeting: mid=[" + meetingID + "] uid=[" + u.userID + "]") - outGW.send(new UserLeft(msg.meetingID, recorded, u)) - - if (u.presenter) { - /* The current presenter has left the meeting. Find a moderator and make - * him presenter. This way, if there is a moderator in the meeting, there - * will always be a presenter. - */ - val moderator = users.findAModerator() - moderator.foreach { mod => - log.info("Presenter left meeting: mid=[" + meetingID + "] uid=[" + u.userID + "]. Making user=[" + mod.userID + "] presenter.") - assignNewPresenter(mod.userID, mod.name, mod.userID) - } - } - } - - startCheckingIfWeNeedToEndVoiceConf() - stopAutoStartedRecording() - } - } - - def getInitialLockStatus(role: Role.Role):Boolean = { - permissions.lockOnJoin && !role.equals(Role.MODERATOR) - } - - def handleUserJoinedVoiceFromPhone(msg: VoiceUserJoined) = { - val user = users.getUserWithVoiceUserId(msg.voiceUser.userId) match { - case Some(user) => { - log.info("Voice user=[" + msg.voiceUser.userId + "] is already in conf=[" + voiceBridge + "]. Must be duplicate message.") - } - case None => { - // No current web user. This means that the user called in through - // the phone. We need to generate a new user as we are not able - // to match with a web user. - val webUserId = users.generateWebUserId - val vu = new VoiceUser(msg.voiceUser.userId, webUserId, - msg.voiceUser.callerName, msg.voiceUser.callerNum, - true, false, false, false) - - val sessionId = "PHONE-" + webUserId; - - val uvo = new UserVO(webUserId, webUserId, msg.voiceUser.callerName, - Role.VIEWER, raiseHand=false, presenter=false, - hasStream=false, locked=getInitialLockStatus(Role.VIEWER), webcamStreams=new ListSet[String](), - phoneUser=true, vu, listenOnly=false) - - users.addUser(uvo) - log.info("New user joined voice for user [" + uvo.name + "] userid=[" + msg.voiceUser.webUserId + "]") - outGW.send(new UserJoined(meetingID, recorded, uvo, sessionId)) - - outGW.send(new UserJoinedVoice(meetingID, recorded, voiceBridge, uvo)) - if (meetingMuted) - outGW.send(new MuteVoiceUser(meetingID, recorded, uvo.userID, uvo.userID, meetingMuted)) - - } - } - } - - def handleVoiceUserJoined(msg: VoiceUserJoined) = { - val user = users.getUser(msg.voiceUser.webUserId) match { - case Some(user) => { - val nu = user.copy(voiceUser=msg.voiceUser) - users.addUser(nu) - log.info("Received user joined voice for user [" + nu.name + "] userid=[" + msg.voiceUser.webUserId + "]" ) - outGW.send(new UserJoinedVoice(meetingID, recorded, voiceBridge, nu)) - - if (meetingMuted) - outGW.send(new MuteVoiceUser(meetingID, recorded, nu.userID, nu.userID, meetingMuted)) - } - case None => { - handleUserJoinedVoiceFromPhone(msg) - } - } - } - - def handleVoiceUserLeft(msg: VoiceUserLeft) { - users.getUser(msg.userId) foreach {user => - val vu = new VoiceUser(user.userID, user.userID, user.name, user.name, - false, false, false, false) - val nu = user.copy(voiceUser=vu) - users.addUser(nu) - -// println("Received voice user left =[" + user.name + "] wid=[" + msg.userId + "]" ) - log.info("Received user left voice for user [" + nu.name + "] userid=[" + msg.userId + "]" ) - outGW.send(new UserLeftVoice(meetingID, recorded, voiceBridge, nu)) - - if (user.phoneUser) { - if (users.hasUser(user.userID)) { - val userLeaving = users.removeUser(user.userID) - userLeaving foreach (u => outGW.send(new UserLeft(msg.meetingID, recorded, u))) - } - } - } - } - - def handleVoiceUserMuted(msg: VoiceUserMuted) { - users.getUser(msg.userId) foreach {user => - val talking:Boolean = if (msg.muted) false else user.voiceUser.talking - val nv = user.voiceUser.copy(muted=msg.muted, talking=talking) - val nu = user.copy(voiceUser=nv) - users.addUser(nu) -// println("Received voice muted=[" + msg.muted + "] wid=[" + msg.userId + "]" ) - outGW.send(new UserVoiceMuted(meetingID, recorded, voiceBridge, nu)) - } - } - - def handleVoiceUserTalking(msg: VoiceUserTalking) { - users.getUser(msg.userId) foreach {user => - val nv = user.voiceUser.copy(talking=msg.talking) - val nu = user.copy(voiceUser=nv) - users.addUser(nu) -// println("Received voice talking=[" + msg.talking + "] wid=[" + msg.userId + "]" ) - outGW.send(new UserVoiceTalking(meetingID, recorded, voiceBridge, nu)) - } - } - - def handleAssignPresenter(msg: AssignPresenter):Unit = { - assignNewPresenter(msg.newPresenterID, msg.newPresenterName, msg.assignedBy) - } - - def assignNewPresenter(newPresenterID:String, newPresenterName: String, assignedBy: String) { - if (users.hasUser(newPresenterID)) { - - users.getCurrentPresenter match { - case Some(curPres) => { - users.unbecomePresenter(curPres.userID) - outGW.send(new UserStatusChange(meetingID, recorded, curPres.userID, "presenter", false:java.lang.Boolean)) - } - case None => // do nothing - } - - users.getUser(newPresenterID) match { - case Some(newPres) => { - users.becomePresenter(newPres.userID) - currentPresenter = new Presenter(newPresenterID, newPresenterName, assignedBy) - outGW.send(new PresenterAssigned(meetingID, recorded, new Presenter(newPresenterID, newPresenterName, assignedBy))) - outGW.send(new UserStatusChange(meetingID, recorded, newPresenterID, "presenter", true:java.lang.Boolean)) - } - case None => // do nothing - } - - } - } -} diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersModel.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersModel.scala deleted file mode 100755 index 5642ecf785..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersModel.scala +++ /dev/null @@ -1,101 +0,0 @@ -package org.bigbluebutton.core.apps.users - -import org.bigbluebutton.core.User -import scala.collection.mutable.HashMap -import org.bigbluebutton.core.api.UserVO -import org.bigbluebutton.core.api.Role._ -import scala.collection.mutable.ArrayBuffer -import org.bigbluebutton.core.api.VoiceUser -import org.bigbluebutton.core.util.RandomStringGenerator - -class UsersModel { - private var uservos = new collection.immutable.HashMap[String, UserVO] - - def generateWebUserId:String = { - val webUserId = RandomStringGenerator.randomAlphanumericString(6) - if (! hasUser(webUserId)) webUserId else generateWebUserId - } - - def addUser(uvo: UserVO) { - uservos += uvo.userID -> uvo - } - - def removeUser(userId: String):Option[UserVO] = { - val user = uservos get (userId) - user foreach (u => uservos -= userId) - - user - } - - def hasSessionId(sessionId: String):Boolean = { - uservos.contains(sessionId) - } - - def hasUser(userID: String):Boolean = { - uservos.contains(userID) - } - - def numUsers():Int = { - uservos.size - } - - def numWebUsers():Int = { - uservos.values filter (u => u.phoneUser == false) size - } - - def getUserWithExternalId(userID:String):Option[UserVO] = { - uservos.values find (u => u.externUserID == userID) - } - - def getUserWithVoiceUserId(voiceUserId: String):Option[UserVO] = { - uservos.values find (u => u.voiceUser.userId == voiceUserId) - } - - def getUser(userID:String):Option[UserVO] = { - uservos.values find (u => u.userID == userID) - } - - def getUsers():Array[UserVO] = { - uservos.values toArray - } - - def numModerators():Int = { - getModerators.length - } - - def findAModerator():Option[UserVO] = { - uservos.values find (u => u.role == MODERATOR) - } - - def getCurrentPresenter():Option[UserVO] = { - uservos.values find (u => u.presenter == true) - } - - def unbecomePresenter(userID: String) = { - uservos.get(userID) match { - case Some(u) => { - val nu = u.copy(presenter = false) - uservos += nu.userID -> nu - } - case None => // do nothing - } - } - - def becomePresenter(userID: String) = { - uservos.get(userID) match { - case Some(u) => { - val nu = u.copy(presenter = true) - uservos += nu.userID -> nu - } - case None => // do nothing - } - } - - def getModerators():Array[UserVO] = { - uservos.values filter (u => u.role == MODERATOR ) toArray - } - - def getViewers():Array[UserVO] = { - uservos.values filter (u => u.role == VIEWER ) toArray - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersEventRedisPublisher.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersEventRedisPublisher.scala deleted file mode 100755 index cd5f43a01b..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersEventRedisPublisher.scala +++ /dev/null @@ -1,252 +0,0 @@ -package org.bigbluebutton.core.apps.users.redis - -import org.bigbluebutton.conference.service.messaging.redis.MessageSender -import org.bigbluebutton.core.api._ -import org.bigbluebutton.common.messages.MessagingConstants -import com.google.gson.Gson -import org.bigbluebutton.common.messages.GetCurrentLayoutReplyMessage -import org.bigbluebutton.common.messages.BroadcastLayoutMessage -import org.bigbluebutton.common.messages.LockLayoutMessage - -class UsersEventRedisPublisher(service: MessageSender) extends OutMessageListener2 { - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: RecordingStatusChanged => handleRecordingStatusChanged(msg) - case msg: GetRecordingStatusReply => handleGetRecordingStatusReply(msg) - case msg: MeetingMuted => handleMeetingMuted(msg) - case msg: MeetingState => handleMeetingState(msg) - case msg: MeetingEnded => handleMeetingEnded(msg) - case msg: MeetingHasEnded => handleMeetingHasEnded(msg) - case msg: DisconnectAllUsers => handleDisconnectAllUsers(msg) - case msg: DisconnectUser => handleDisconnectUser(msg) - case msg: PermissionsSettingInitialized => handlePermissionsSettingInitialized(msg) - case msg: NewPermissionsSetting => handleNewPermissionsSetting(msg) - case msg: UserLocked => handleUserLocked(msg) - case msg: GetPermissionsSettingReply => handleGetPermissionsSettingReply(msg) - case msg: UserRegistered => handleUserRegistered(msg) - case msg: UserLeft => handleUserLeft(msg) - case msg: PresenterAssigned => handlePresenterAssigned(msg) - case msg: EndAndKickAll => handleEndAndKickAll(msg) - case msg: GetUsersReply => handleGetUsersReply(msg) - case msg: ValidateAuthTokenReply => handleValidateAuthTokenReply(msg) - case msg: ValidateAuthTokenTimedOut => handleValidateAuthTokenTimedOut(msg) - case msg: UserJoined => handleUserJoined(msg) - case msg: UserRaisedHand => handleUserRaisedHand(msg) - case msg: UserLoweredHand => handleUserLoweredHand(msg) - case msg: UserSharedWebcam => handleUserSharedWebcam(msg) - case msg: UserUnsharedWebcam => handleUserUnsharedWebcam(msg) - case msg: UserStatusChange => handleUserStatusChange(msg) - case msg: UserVoiceMuted => handleUserVoiceMuted(msg) - case msg: UserVoiceTalking => handleUserVoiceTalking(msg) - case msg: MuteVoiceUser => handleMuteVoiceUser(msg) - case msg: EjectVoiceUser => handleEjectVoiceUser(msg) - case msg: UserJoinedVoice => handleUserJoinedVoice(msg) - case msg: UserLeftVoice => handleUserLeftVoice(msg) - case msg: IsMeetingMutedReply => handleIsMeetingMutedReply(msg) - case msg: UserListeningOnly => handleUserListeningOnly(msg) - case msg: GetCurrentLayoutReply => handleGetCurrentLayoutReply(msg) - case msg: BroadcastLayoutEvent => handleBroadcastLayoutEvent(msg) - case msg: LockLayoutEvent => handleLockLayoutEvent(msg) - case _ => //println("Unhandled message in UsersClientMessageSender") - } - } - - private def handleLockLayoutEvent(msg: LockLayoutEvent) { - val users = new java.util.ArrayList[String]; - msg.applyTo.foreach(uvo => { - users.add(uvo.userID) - }) - - val evt = new LockLayoutMessage(msg.meetingID, msg.setById, msg.locked, users) - service.send(MessagingConstants.FROM_USERS_CHANNEL, evt.toJson()) - } - - private def handleBroadcastLayoutEvent(msg: BroadcastLayoutEvent) { - val users = new java.util.ArrayList[String]; - msg.applyTo.foreach(uvo => { - users.add(uvo.userID) - }) - - val evt = new BroadcastLayoutMessage(msg.meetingID, msg.setByUserID, msg.layoutID, msg.locked, users) - service.send(MessagingConstants.FROM_USERS_CHANNEL, evt.toJson()) - } - - private def handleGetCurrentLayoutReply(msg: GetCurrentLayoutReply) { - val reply = new GetCurrentLayoutReplyMessage(msg.meetingID, msg.requesterID, msg.setByUserID, msg.layoutID, msg.locked) - service.send(MessagingConstants.FROM_USERS_CHANNEL, reply.toJson()) - } - - private def handleMeetingState(msg: MeetingState) { - val json = UsersMessageToJsonConverter.meetingState(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleMeetingMuted(msg: MeetingMuted) { - val json = UsersMessageToJsonConverter.meetingMuted(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleMeetingHasEnded(msg: MeetingHasEnded):Unit = { - val json = UsersMessageToJsonConverter.meetingHasEnded(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleMeetingEnded(msg: MeetingEnded):Unit = { - val json = UsersMessageToJsonConverter.meetingEnded(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleDisconnectAllUsers(msg: DisconnectAllUsers) { - val json = UsersMessageToJsonConverter.disconnectAllUsersToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleDisconnectUser(msg: DisconnectUser) { - val json = UsersMessageToJsonConverter.disconnectUserToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - - private def handlePermissionsSettingInitialized(msg: PermissionsSettingInitialized) { - val json = UsersMessageToJsonConverter.permissionsSettingInitializedToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleNewPermissionsSetting(msg: NewPermissionsSetting) { - val json = UsersMessageToJsonConverter.newPermissionsSettingToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleUserLocked(msg: UserLocked) { - val json = UsersMessageToJsonConverter.userLockedToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleGetPermissionsSettingReply(msg: GetPermissionsSettingReply) { - val json = UsersMessageToJsonConverter.getPermissionsSettingReplyToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleUserRegistered(msg: UserRegistered) { - val json = UsersMessageToJsonConverter.userRegisteredToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleUserStatusChange(msg: UserStatusChange) { - val json = UsersMessageToJsonConverter.userStatusChangeToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserRaisedHand(msg: UserRaisedHand) { - val json = UsersMessageToJsonConverter.userRaisedHandToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserLoweredHand(msg: UserLoweredHand) { - val json = UsersMessageToJsonConverter.userLoweredHandToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserSharedWebcam(msg: UserSharedWebcam) { - val json = UsersMessageToJsonConverter.userSharedWebcamToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserUnsharedWebcam(msg: UserUnsharedWebcam) { - val json = UsersMessageToJsonConverter.userUnsharedWebcamToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleGetUsersReply(msg: GetUsersReply) { - val json = UsersMessageToJsonConverter.getUsersReplyToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserJoinedVoice(msg: UserJoinedVoice) { - val json = UsersMessageToJsonConverter.userJoinedVoice(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserVoiceMuted(msg: UserVoiceMuted) { - val json = UsersMessageToJsonConverter.userVoiceMuted(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserVoiceTalking(msg: UserVoiceTalking) { - val json = UsersMessageToJsonConverter.userVoiceTalking(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleMuteVoiceUser(msg: MuteVoiceUser) { - val json = UsersMessageToJsonConverter.muteVoiceUserToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleEjectVoiceUser(msg: EjectVoiceUser) { - val json = UsersMessageToJsonConverter.ejectVoiceUserToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserLeftVoice(msg: UserLeftVoice) { - val json = UsersMessageToJsonConverter.userLeftVoiceToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleIsMeetingMutedReply(msg: IsMeetingMutedReply) { - val json = UsersMessageToJsonConverter.isMeetingMutedReplyToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleRecordingStatusChanged(msg: RecordingStatusChanged) { - val json = UsersMessageToJsonConverter.recordingStatusChangedToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleGetRecordingStatusReply(msg: GetRecordingStatusReply) { - val json = UsersMessageToJsonConverter.getRecordingStatusReplyToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleValidateAuthTokenReply(msg: ValidateAuthTokenReply) { - val json = UsersMessageToJsonConverter.validateAuthTokenReplyToJson(msg) - println("************** Publishing [" + json + "] *******************") - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleValidateAuthTokenTimedOut(msg: ValidateAuthTokenTimedOut) { - val json = UsersMessageToJsonConverter.validateAuthTokenTimeoutToJson(msg) - println("************** Publishing [" + json + "] *******************") - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserJoined(msg: UserJoined) { - val json = UsersMessageToJsonConverter.userJoinedToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleRegisteredUser(msg: UserRegistered) { - val json = UsersMessageToJsonConverter.userRegisteredToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserLeft(msg: UserLeft) { - val json = UsersMessageToJsonConverter.userLeftToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handlePresenterAssigned(msg: PresenterAssigned) { - val json = UsersMessageToJsonConverter.presenterAssignedToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleEndAndKickAll(msg: EndAndKickAll) { - val json = UsersMessageToJsonConverter.endAndKickAllToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } - - private def handleUserListeningOnly(msg: UserListeningOnly) { - val json = UsersMessageToJsonConverter.userListeningOnlyToJson(msg) - service.send(MessagingConstants.FROM_USERS_CHANNEL, json) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersEventRedisRecorder.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersEventRedisRecorder.scala deleted file mode 100755 index e203aaa81f..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersEventRedisRecorder.scala +++ /dev/null @@ -1,214 +0,0 @@ -package org.bigbluebutton.core.apps.users.redis - -import org.bigbluebutton.conference.service.recorder.RecorderApplication -import org.bigbluebutton.core.api._ -import org.bigbluebutton.conference.service.recorder.participants.ParticipantEndAndKickAllRecordEvent -import org.bigbluebutton.conference.service.recorder.participants.AssignPresenterRecordEvent -import org.bigbluebutton.conference.service.recorder.participants.ParticipantStatusChangeRecordEvent -import org.bigbluebutton.conference.service.recorder.participants.ParticipantLeftRecordEvent -import org.bigbluebutton.conference.service.recorder.participants.ParticipantJoinRecordEvent -import org.bigbluebutton.webconference.voice.ParticipantMutedVoiceRecordEvent -import org.bigbluebutton.webconference.voice.ParticipantTalkingVoiceRecordEvent -import org.bigbluebutton.webconference.voice.ParticipantJoinedVoiceRecordEvent -import org.bigbluebutton.webconference.voice.ParticipantLeftVoiceRecordEvent -import org.bigbluebutton.conference.service.recorder.participants.RecordStatusRecordEvent -import org.bigbluebutton.webconference.voice.StartRecordingVoiceRecordEvent - -class UsersEventRedisRecorder(recorder: RecorderApplication) extends OutMessageListener2 { - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: EndAndKickAll => handleEndAndKickAll(msg) - case msg: PresenterAssigned => handleAssignPresenter(msg) - case msg: UserJoined => handleUserJoined(msg) - case msg: UserLeft => handleUserLeft(msg) - case msg: UserStatusChange => handleUserStatusChange(msg) - case msg: UserVoiceMuted => handleUserVoiceMuted(msg) - case msg: UserVoiceTalking => handleUserVoiceTalking(msg) - case msg: UserJoinedVoice => handleUserJoinedVoice(msg) - case msg: UserLeftVoice => handleUserLeftVoice(msg) - case msg: RecordingStatusChanged => handleRecordingStatusChanged(msg) - case msg: UserRaisedHand => handleUserRaisedHand(msg) - case msg: UserLoweredHand => handleUserLoweredHand(msg) - case msg: UserSharedWebcam => handleUserSharedWebcam(msg) - case msg: UserUnsharedWebcam => handleUserUnsharedWebcam(msg) - case msg: VoiceRecordingStarted => handleVoiceRecordingStarted(msg) - case msg: VoiceRecordingStopped => handleVoiceRecordingStopped(msg) - case _ => //println("Unhandled message in UsersClientMessageSender") - } - } - - private def handleEndAndKickAll(msg: EndAndKickAll):Unit = { - if (msg.recorded) { - val ev = new ParticipantEndAndKickAllRecordEvent(); - ev.setTimestamp(TimestampGenerator.generateTimestamp); - ev.setMeetingId(msg.meetingID); - recorder.record(msg.meetingID, ev); - } - } - - private def handleUserJoined(msg: UserJoined):Unit = { - if (msg.recorded) { - val ev = new ParticipantJoinRecordEvent(); - ev.setTimestamp(TimestampGenerator.generateTimestamp); - ev.setUserId(msg.user.userID); - ev.setName(msg.user.name); - ev.setMeetingId(msg.meetingID); - ev.setRole(msg.user.role.toString()); - - recorder.record(msg.meetingID, ev); - } - } - - def handleVoiceRecordingStarted(msg: VoiceRecordingStarted) { - if (msg.recorded) { - val evt = new StartRecordingVoiceRecordEvent(true); - evt.setMeetingId(msg.meetingID); - evt.setTimestamp(TimestampGenerator.generateTimestamp); - evt.setBridge(msg.confNum); - evt.setRecordingTimestamp(msg.timestamp); - evt.setFilename(msg.recordingFile); - recorder.record(msg.meetingID, evt); - } - } - - def handleVoiceRecordingStopped(msg: VoiceRecordingStopped) { - if (msg.recorded) { - val evt = new StartRecordingVoiceRecordEvent(false); - evt.setMeetingId(msg.meetingID); - evt.setTimestamp(TimestampGenerator.generateTimestamp); - evt.setBridge(msg.confNum); - evt.setRecordingTimestamp(msg.timestamp); - evt.setFilename(msg.recordingFile); - recorder.record(msg.meetingID, evt); - } - } - - def handleUserVoiceMuted(msg: UserVoiceMuted) { - if (msg.recorded) { - val ev = new ParticipantMutedVoiceRecordEvent() - ev.setMeetingId(msg.meetingID); - ev.setTimestamp(TimestampGenerator.generateTimestamp); - ev.setBridge(msg.confNum); - ev.setParticipant(msg.user.voiceUser.userId); - ev.setMuted(msg.user.voiceUser.muted); - - recorder.record(msg.meetingID, ev); - } - } - - def handleUserVoiceTalking(msg: UserVoiceTalking) { - if (msg.recorded) { - val evt = new ParticipantTalkingVoiceRecordEvent(); - evt.setMeetingId(msg.meetingID); - evt.setTimestamp(TimestampGenerator.generateTimestamp); - evt.setBridge(msg.confNum); - evt.setParticipant(msg.user.userID); - evt.setTalking(msg.user.voiceUser.talking); - - recorder.record(msg.meetingID, evt); - } - } - - def handleUserJoinedVoice(msg: UserJoinedVoice) { - if (msg.recorded) { - val evt = new ParticipantJoinedVoiceRecordEvent(); - evt.setMeetingId(msg.meetingID); - evt.setTimestamp(TimestampGenerator.generateTimestamp); - evt.setBridge(msg.confNum); - evt.setParticipant(msg.user.voiceUser.userId); - evt.setCallerName(msg.user.voiceUser.callerName); - evt.setCallerNumber(msg.user.voiceUser.callerNum); - evt.setMuted(msg.user.voiceUser.muted); - evt.setTalking(msg.user.voiceUser.talking); - - recorder.record(msg.meetingID, evt) - } - } - - def handleUserLeftVoice(msg: UserLeftVoice) { - if (msg.recorded) { - val evt = new ParticipantLeftVoiceRecordEvent(); - evt.setMeetingId(msg.meetingID); - evt.setTimestamp(TimestampGenerator.generateTimestamp); - evt.setBridge(msg.confNum); - evt.setParticipant(msg.user.voiceUser.userId); - recorder.record(msg.meetingID, evt); - } - } - - def handleRecordingStatusChanged(msg: RecordingStatusChanged) { - if (msg.recorded) { - val evt = new RecordStatusRecordEvent(); - evt.setMeetingId(msg.meetingID); - evt.setTimestamp(TimestampGenerator.generateTimestamp); - evt.setUserId(msg.userId); - evt.setRecordingStatus(msg.recording.toString); - - recorder.record(msg.meetingID, evt); - } - } - - private def handleUserLeft(msg: UserLeft):Unit = { - if (msg.recorded) { - val ev = new ParticipantLeftRecordEvent(); - ev.setTimestamp(TimestampGenerator.generateTimestamp); - ev.setUserId(msg.user.userID); - ev.setMeetingId(msg.meetingID); - - recorder.record(msg.meetingID, ev); - } - - } - - private def handleUserRaisedHand(msg: UserRaisedHand) { - val status = UserStatusChange(msg.meetingID, msg.recorded, - msg.userID, "raiseHand", true:java.lang.Boolean) - handleUserStatusChange(status) - } - - private def handleUserLoweredHand(msg: UserLoweredHand) { - val status = UserStatusChange(msg.meetingID, msg.recorded, - msg.userID, "raiseHand", false:java.lang.Boolean) - handleUserStatusChange(status) - } - - private def handleUserSharedWebcam(msg: UserSharedWebcam) { - val status = UserStatusChange(msg.meetingID, msg.recorded, - msg.userID, "hasStream", "true,stream=" + msg.stream) - handleUserStatusChange(status) - } - - private def handleUserUnsharedWebcam(msg: UserUnsharedWebcam) { - val status = UserStatusChange(msg.meetingID, msg.recorded, - msg.userID, "hasStream", "false,stream=" + msg.stream) - handleUserStatusChange(status) - } - - private def handleUserStatusChange(msg: UserStatusChange):Unit = { - if (msg.recorded) { - val ev = new ParticipantStatusChangeRecordEvent(); - ev.setTimestamp(TimestampGenerator.generateTimestamp); - ev.setUserId(msg.userID); - ev.setMeetingId(msg.meetingID); - ev.setStatus(msg.status); - ev.setValue(msg.value.toString()); - - recorder.record(msg.meetingID, ev); - } - } - - private def handleAssignPresenter(msg:PresenterAssigned):Unit = { - if (msg.recorded) { - val event = new AssignPresenterRecordEvent(); - event.setMeetingId(msg.meetingID); - event.setTimestamp(TimestampGenerator.generateTimestamp); - event.setUserId(msg.presenter.presenterID); - event.setName(msg.presenter.presenterName); - event.setAssignedBy(msg.presenter.assignedBy); - - recorder.record(msg.meetingID, event); - } - - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersMessageToJsonConverter.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersMessageToJsonConverter.scala deleted file mode 100755 index 97d9defdcf..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersMessageToJsonConverter.scala +++ /dev/null @@ -1,431 +0,0 @@ -package org.bigbluebutton.core.apps.users.redis - -import org.bigbluebutton.core.api._ -import org.bigbluebutton.common.messages.MessagingConstants -import org.bigbluebutton.core.messaging.Util -import com.google.gson.Gson -import org.bigbluebutton.core.api.UserVO -import collection.JavaConverters._ -import scala.collection.JavaConversions._ - -object UsersMessageToJsonConverter { - private def userToMap(user: UserVO):java.util.Map[String, Any] = { - - val wuser = new scala.collection.mutable.HashMap[String, Any] - wuser += "userid" -> user.userID - wuser += "extern_userid" -> user.externUserID - wuser += "name" -> user.name - wuser += "role" -> user.role.toString() - wuser += "raise_hand" -> user.raiseHand - wuser += "presenter" -> user.presenter - wuser += "has_stream" -> user.hasStream - wuser += "locked" -> user.locked - wuser += "webcam_stream" -> user.webcamStreams - wuser += "phone_user" -> user.phoneUser - wuser += "listenOnly" -> user.listenOnly - - val vuser = new scala.collection.mutable.HashMap[String, Any] - vuser += "userid" -> user.voiceUser.userId - vuser += "web_userid" -> user.voiceUser.webUserId - vuser += "callername" -> user.voiceUser.callerName - vuser += "callernum" -> user.voiceUser.callerNum - vuser += "joined" -> user.voiceUser.joined - vuser += "locked" -> user.voiceUser.locked - vuser += "muted" -> user.voiceUser.muted - vuser += "talking" -> user.voiceUser.talking - - wuser.put("voiceUser", mapAsJavaMap(vuser)) - - mapAsJavaMap(wuser) - } - - private def registeredUserToMap(user: RegisteredUser):java.util.Map[String, Any] = { - val wuser = new scala.collection.mutable.HashMap[String, Any] - wuser += "userid" -> user.id - wuser += "extern_userid" -> user.externId - wuser += "name" -> user.name - wuser += "role" -> user.role.toString() - wuser += "authToken" -> user.authToken - - mapAsJavaMap(wuser) - } - - private def buildPermissionsHashMap(perms: Permissions):java.util.HashMap[String, java.lang.Boolean] = { - val args = new java.util.HashMap[String, java.lang.Boolean](); - args.put("disableCam", perms.disableCam:java.lang.Boolean); - args.put("disableMic", perms.disableMic:java.lang.Boolean); - args.put("disablePrivChat", perms.disablePrivChat:java.lang.Boolean); - args.put("disablePubChat", perms.disablePubChat:java.lang.Boolean); - args.put("lockedLayout", perms.lockedLayout:java.lang.Boolean); - args.put("lockOnJoin", perms.lockOnJoin:java.lang.Boolean); - args.put("lockOnJoinConfigurable", perms.lockOnJoinConfigurable:java.lang.Boolean); - args - } - - def meetingState(msg: MeetingState):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PERMISSIONS, buildPermissionsHashMap(msg.permissions)) - payload.put(Constants.MEETING_MUTED, msg.meetingMuted:java.lang.Boolean); - payload.put(Constants.USER_ID, msg.userId); - - val header = Util.buildHeader(MessageNames.MEETING_STATE, msg.version, None) - Util.buildJson(header, payload) - } - - def meetingMuted(msg: MeetingMuted):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MEETING_MUTED, msg.meetingMuted:java.lang.Boolean); - - val header = Util.buildHeader(MessageNames.MEETING_MUTED, msg.version, None) - Util.buildJson(header, payload) - } - - def meetingHasEnded(msg: MeetingHasEnded):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = Util.buildHeader(MessageNames.MEETING_HAS_ENDED, msg.version, None) - Util.buildJson(header, payload) - } - - def meetingEnded(msg: MeetingEnded):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = Util.buildHeader(MessageNames.MEETING_ENDED, msg.version, None) - Util.buildJson(header, payload) - } - - def disconnectAllUsersToJson(msg: DisconnectAllUsers):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = Util.buildHeader(MessageNames.DISCONNECT_ALL_USERS, msg.version, None) - Util.buildJson(header, payload) - } - - def disconnectUserToJson(msg: DisconnectUser):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - - val header = Util.buildHeader(MessageNames.DISCONNECT_USER, msg.version, None) - Util.buildJson(header, payload) - } - - def permissionsSettingInitializedToJson(msg: PermissionsSettingInitialized):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.SETTINGS, msg.permissions.toString()) //#todo not tested - - val header = Util.buildHeader(MessageNames.PERMISSION_SETTING_INITIALIZED, msg.version, None) - Util.buildJson(header, payload) - } - - def newPermissionsSettingToJson(msg: NewPermissionsSetting):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.PERMISSIONS, buildPermissionsHashMap(msg.permissions)) - - val users = new java.util.ArrayList[java.util.Map[String, Any]] - msg.applyTo.foreach(uvo => { - users.add(userToMap(uvo)) - }) - - payload.put("users", users) - - val header = Util.buildHeader(MessageNames.NEW_PERMISSION_SETTINGS, msg.version, None) - Util.buildJson(header, payload) - } - - def userLockedToJson(msg: UserLocked):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.LOCKED, msg.lock) - - val header = Util.buildHeader(MessageNames.USER_LOCKED, msg.version, None) - Util.buildJson(header, payload) - } - - def getPermissionsSettingReplyToJson(msg: GetPermissionsSettingReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - - val header = Util.buildHeader(MessageNames.GET_PERMISSION_SETTINGS_REPLY, msg.version, None) - Util.buildJson(header, payload) - } - - def userRegisteredToJson(msg: UserRegistered):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER, registeredUserToMap(msg.user)) - payload.put(Constants.RECORDED, msg.recorded) - - val header = Util.buildHeader(MessageNames.USER_REGISTERED, msg.version, None) - Util.buildJson(header, payload) - } - - - def userRaisedHandToJson(msg: UserRaisedHand):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RAISE_HAND, msg.raisedHand) - payload.put(Constants.USER_ID, msg.userID) - - val header = Util.buildHeader(MessageNames.USER_RAISED_HAND, msg.version, None) - Util.buildJson(header, payload) - } - - def userLoweredHandToJson(msg: UserLoweredHand):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RAISE_HAND, msg.raisedHand) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.LOWERED_BY, msg.loweredBy) - - val header = Util.buildHeader(MessageNames.USER_LOWERED_HAND, msg.version, None) - Util.buildJson(header, payload) - } - - def userStatusChangeToJson(msg: UserStatusChange):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.STATUS, msg.status) - payload.put(Constants.VALUE, msg.value.toString) - - val header = Util.buildHeader(MessageNames.USER_STATUS_CHANGED, msg.version, None) - Util.buildJson(header, payload) - } - - def userSharedWebcamToJson(msg: UserSharedWebcam):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.STREAM, msg.stream) - - val header = Util.buildHeader(MessageNames.USER_SHARED_WEBCAM, msg.version, None) - Util.buildJson(header, payload) - } - - def userUnsharedWebcamToJson(msg: UserUnsharedWebcam):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.STREAM, msg.stream) - - val header = Util.buildHeader(MessageNames.USER_UNSHARED_WEBCAM, msg.version, None) - Util.buildJson(header, payload) - } - - def broadcastLayout(msg: BroadcastLayoutEvent):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val users = new java.util.ArrayList[String]; - msg.applyTo.foreach(uvo => { - users.add(uvo.userID) - }) - - payload.put(Constants.USERS, users) - - val header = Util.buildHeader(MessageNames.GET_USERS_REPLY, msg.version, None) - Util.buildJson(header, payload) - } - - def getUsersReplyToJson(msg: GetUsersReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val users = new java.util.ArrayList[java.util.Map[String, Any]]; - msg.users.foreach(uvo => { - users.add(userToMap(uvo)) - }) - - payload.put(Constants.USERS, users) - - val header = Util.buildHeader(MessageNames.GET_USERS_REPLY, msg.version, None) - Util.buildJson(header, payload) - } - - def userJoinedVoice(msg: UserJoinedVoice):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER, userToMap(msg.user)) - payload.put(Constants.VOICE_CONF, msg.confNum) - - val header = Util.buildHeader(MessageNames.USER_JOINED_VOICE, msg.version, None) - Util.buildJson(header, payload) - } - - def userVoiceMuted(msg: UserVoiceMuted):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER, userToMap(msg.user)) - payload.put(Constants.VOICE_CONF, msg.confNum) - - val header = Util.buildHeader(MessageNames.USER_VOICE_MUTED, msg.version, None) - Util.buildJson(header, payload) - } - - def userVoiceTalking(msg: UserVoiceTalking):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER, userToMap(msg.user)) - payload.put(Constants.VOICE_CONF, msg.confNum) - - val header = Util.buildHeader(MessageNames.USER_VOICE_TALKING, msg.version, None) - Util.buildJson(header, payload) - } - - def muteVoiceUserToJson(msg: MuteVoiceUser):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.MUTE, msg.mute) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = Util.buildHeader(MessageNames.EJECT_VOICE_USER, msg.version, None) - Util.buildJson(header, payload) - } - - def ejectVoiceUserToJson(msg: EjectVoiceUser):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = Util.buildHeader(MessageNames.EJECT_VOICE_USER, msg.version, None) - Util.buildJson(header, payload) - } - - def userLeftVoiceToJson(msg: UserLeftVoice):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER, userToMap(msg.user)) - payload.put(Constants.VOICE_CONF, msg.confNum) - - val header = Util.buildHeader(MessageNames.USER_LEFT_VOICE, msg.version, None) - Util.buildJson(header, payload) - } - - def isMeetingMutedReplyToJson(msg: IsMeetingMutedReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.MUTED, msg.meetingMuted) - - val header = Util.buildHeader(MessageNames.IS_MEETING_MUTED_REPLY, msg.version, None) - Util.buildJson(header, payload) - } - - def recordingStatusChangedToJson(msg: RecordingStatusChanged):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.RECORDING, msg.recording) - - val header = Util.buildHeader(MessageNames.RECORDING_STATUS_CHANGED, msg.version, None) - Util.buildJson(header, payload) - } - - def getRecordingStatusReplyToJson(msg: GetRecordingStatusReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.RECORDING, msg.recording) - - val header = Util.buildHeader(MessageNames.GET_RECORDING_STATUS_REPLY, msg.version, None) - Util.buildJson(header, payload) - } - - def validateAuthTokenReplyToJson(msg: ValidateAuthTokenReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.REPLY_TO, msg.correlationId) - payload.put(Constants.VALID, msg.valid.toString) - payload.put(Constants.USER_ID, msg.requesterId) - payload.put(Constants.AUTH_TOKEN, msg.token) - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = Util.buildHeader(MessageNames.VALIDATE_AUTH_TOKEN_REPLY, msg.version, None) - Util.buildJson(header, payload) - } - - def validateAuthTokenTimeoutToJson(msg: ValidateAuthTokenTimedOut):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.REPLY_TO, msg.correlationId) - payload.put(Constants.VALID, msg.valid.toString) - payload.put(Constants.AUTH_TOKEN, msg.token) - payload.put(Constants.USER_ID, msg.requesterId) - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = Util.buildHeader(MessageNames.VALIDATE_AUTH_TOKEN_TIMEOUT, msg.version, None) - Util.buildJson(header, payload) - } - - def userJoinedToJson(msg: UserJoined):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put("user", userToMap(msg.user)) - - val header = Util.buildHeader(MessageNames.USER_JOINED, msg.version, None) - Util.buildJson(header, payload) - } - - - def userLeftToJson(msg: UserLeft):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put("user", userToMap(msg.user)) - - val header = Util.buildHeader(MessageNames.USER_LEFT, msg.version, None) - Util.buildJson(header, payload) - } - - def presenterAssignedToJson(msg: PresenterAssigned):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.NEW_PRESENTER_ID, msg.presenter.presenterID); - payload.put(Constants.NEW_PRESENTER_NAME, msg.presenter.presenterName); - payload.put(Constants.ASSIGNED_BY, msg.presenter.assignedBy); - payload.put(Constants.RECORDED, msg.recorded) - - val header = Util.buildHeader(MessageNames.PRESENTER_ASSIGNED, msg.version, None) - Util.buildJson(header, payload) - } - - def endAndKickAllToJson(msg: EndAndKickAll):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - - val header = Util.buildHeader(MessageNames.END_AND_KICK_ALL, msg.version, None) - Util.buildJson(header, payload) - } - - def userListeningOnlyToJson(msg: UserListeningOnly):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userID) - payload.put(Constants.LISTEN_ONLY, msg.listenOnly) - - val header = Util.buildHeader(MessageNames.USER_LISTEN_ONLY, msg.version, None) - Util.buildJson(header, payload) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp.scala deleted file mode 100644 index 89c6059bca..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp.scala +++ /dev/null @@ -1,34 +0,0 @@ -package org.bigbluebutton.core.apps.voice - -import org.bigbluebutton.core.api._ -import org.bigbluebutton.core.MeetingActor - -trait VoiceApp { - this : MeetingActor => - - val outGW: MessageOutGateway - - def handleMuteAllExceptPresenterRequest(msg: MuteAllExceptPresenterRequest) { - - } - - def handleMuteMeetingRequest(msg: MuteMeetingRequest) { - - } - - def handleIsMeetingMutedRequest(msg: IsMeetingMutedRequest) { - - } - - def handleMuteUserRequest(msg: MuteUserRequest) { - - } - - def handleLockUserRequest(msg: LockUserRequest) { - - } - - def handleEjectUserRequest(msg: EjectUserFromVoiceRequest) { - - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceInGateway.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceInGateway.scala deleted file mode 100644 index 3381ce549d..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceInGateway.scala +++ /dev/null @@ -1,65 +0,0 @@ -package org.bigbluebutton.core.apps.voice - -import org.bigbluebutton.core.BigBlueButtonGateway -import org.bigbluebutton.core.api._ - -class VoiceInGateway(bbbGW: BigBlueButtonGateway) { - - def muteAllExceptPresenter(meetingID: String, requesterID: String, mute: Boolean) { - bbbGW.accept(new MuteAllExceptPresenterRequest(meetingID, requesterID, mute)) - } - - def muteAllUsers(meetingID: String, requesterID: String, mute: Boolean) { - bbbGW.accept(new MuteMeetingRequest(meetingID, requesterID, mute)) - } - - def isMeetingMuted(meetingID: String, requesterID: String) { - bbbGW.accept(new IsMeetingMutedRequest(meetingID, requesterID)) - } - - def muteUser(meetingID: String, requesterID: String, userID: String, mute: Boolean) { - bbbGW.accept(new MuteUserRequest(meetingID, requesterID, userID, mute)) - } - - def lockUser(meetingID: String, requesterID: String, userID: String, lock: Boolean) { - bbbGW.accept(new LockUserRequest(meetingID, requesterID, userID, lock)) - } - - def ejectUserFromVoice(meetingID: String, userId: String, ejectedBy: String) { - bbbGW.accept(new EjectUserFromVoiceRequest(meetingID, userId, ejectedBy)) - } - - def voiceUserJoined(meetingId: String, userId: String, webUserId: String, - conference: String, callerIdNum: String, - callerIdName: String, - muted: Boolean, talking: Boolean) { -// println("VoiceInGateway: Got voiceUserJoined message for meeting [" + meetingId + "] user[" + callerIdName + "]") - val voiceUser = new VoiceUser(userId, webUserId, - callerIdName, callerIdNum, - true, false, muted, talking) - bbbGW.accept(new VoiceUserJoined(meetingId, voiceUser)) - } - - def voiceUserLeft(meetingId: String, userId: String) { -// println("VoiceInGateway: Got voiceUserLeft message for meeting [" + meetingId + "] user[" + userId + "]") - bbbGW.accept(new VoiceUserLeft(meetingId, userId)) - } - - def voiceUserLocked(meetingId: String, userId: String, locked: Boolean) { - bbbGW.accept(new VoiceUserLocked(meetingId, userId, locked)) - } - - def voiceUserMuted(meetingId: String, userId: String, muted: Boolean) { - bbbGW.accept(new VoiceUserMuted(meetingId, userId, muted)) - } - - def voiceUserTalking(meetingId: String, userId: String, talking: Boolean) { - bbbGW.accept(new VoiceUserTalking(meetingId, userId, talking)) - } - - def voiceRecording(meetingId: String, recordingFile: String, - timestamp: String, recording: java.lang.Boolean) { - bbbGW.accept(new VoiceRecording(meetingId, recordingFile, - timestamp, recording)) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardApp.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardApp.scala deleted file mode 100644 index d0d8a82027..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardApp.scala +++ /dev/null @@ -1,100 +0,0 @@ -package org.bigbluebutton.core.apps.whiteboard - -import org.bigbluebutton.core.api._ -import org.bigbluebutton.conference.service.whiteboard.WhiteboardKeyUtil -import org.bigbluebutton.core.MeetingActor -import org.bigbluebutton.core.apps.whiteboard.vo._ - -case class Whiteboard(id: String, shapes:Seq[AnnotationVO]) - -trait WhiteboardApp { - this : MeetingActor => - - val outGW: MessageOutGateway - - private val wbModel = new WhiteboardModel - - def handleSendWhiteboardAnnotationRequest(msg: SendWhiteboardAnnotationRequest) { - val status = msg.annotation.status - val shapeType = msg.annotation.shapeType - val wbId = msg.annotation.wbId - val shape = msg.annotation - - initWhiteboard(wbId) - -// println("Received whiteboard shape. status=[" + status + "], shapeType=[" + shapeType + "]") - - if (WhiteboardKeyUtil.TEXT_CREATED_STATUS == status) { -// println("Received textcreated status") - wbModel.addAnnotation(wbId, shape) - } else if ((WhiteboardKeyUtil.PENCIL_TYPE == shapeType) - && (WhiteboardKeyUtil.DRAW_START_STATUS == status)) { -// println("Received pencil draw start status") - wbModel.addAnnotation(wbId, shape) - } else if ((WhiteboardKeyUtil.DRAW_END_STATUS == status) - && ((WhiteboardKeyUtil.RECTANGLE_TYPE == shapeType) - || (WhiteboardKeyUtil.ELLIPSE_TYPE == shapeType) - || (WhiteboardKeyUtil.TRIANGLE_TYPE == shapeType) - || (WhiteboardKeyUtil.LINE_TYPE == shapeType))) { -// println("Received [" + shapeType +"] draw end status") - wbModel.addAnnotation(wbId, shape) - } else if (WhiteboardKeyUtil.TEXT_TYPE == shapeType) { -// println("Received [" + shapeType +"] modify text status") - wbModel.modifyText(wbId, shape) - } else { -// println("Received UNKNOWN whiteboard shape!!!!. status=[" + status + "], shapeType=[" + shapeType + "]") - } - wbModel.getWhiteboard(wbId) foreach {wb => -// println("WhiteboardApp::handleSendWhiteboardAnnotationRequest - num shapes [" + wb.shapes.length + "]") - outGW.send(new SendWhiteboardAnnotationEvent(meetingID, recorded, - msg.requesterID, wbId, msg.annotation)) - } - - } - - private def initWhiteboard(wbId: String) { - if (! wbModel.hasWhiteboard(wbId)) { - wbModel.createWhiteboard(wbId) - } - } - - def handleGetWhiteboardShapesRequest(msg: GetWhiteboardShapesRequest) { - //println("WB: Received page history [" + msg.whiteboardId + "]") - wbModel.history(msg.whiteboardId) foreach {wb => - outGW.send(new GetWhiteboardShapesReply(meetingID, recorded, - msg.requesterID, wb.id, wb.shapes.toArray, msg.replyTo)) - } - } - - def handleClearWhiteboardRequest(msg: ClearWhiteboardRequest) { - //println("WB: Received clear whiteboard") - wbModel.clearWhiteboard(msg.whiteboardId) - wbModel.getWhiteboard(msg.whiteboardId) foreach {wb => - outGW.send(new ClearWhiteboardEvent(meetingID, recorded, - msg.requesterID, wb.id)) - } - } - - def handleUndoWhiteboardRequest(msg: UndoWhiteboardRequest) { -// println("WB: Received undo whiteboard") - - wbModel.getWhiteboard(msg.whiteboardId) foreach {wb => - wbModel.undoWhiteboard(msg.whiteboardId) foreach {last => - outGW.send(new UndoWhiteboardEvent(meetingID, recorded, - msg.requesterID, wb.id, last.id)) - } - } - } - - def handleEnableWhiteboardRequest(msg: EnableWhiteboardRequest) { - wbModel.enableWhiteboard(msg.enable) - outGW.send(new WhiteboardEnabledEvent(meetingID, recorded, - msg.requesterID, msg.enable)) - } - - def handleIsWhiteboardEnabledRequest(msg: IsWhiteboardEnabledRequest) { - val enabled = wbModel.isWhiteboardEnabled() - outGW.send(new IsWhiteboardEnabledReply(meetingID, recorded, - msg.requesterID, enabled, msg.replyTo)) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardInGateway.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardInGateway.scala deleted file mode 100755 index c92ef2c0e1..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardInGateway.scala +++ /dev/null @@ -1,54 +0,0 @@ -package org.bigbluebutton.core.apps.whiteboard - -import org.bigbluebutton.core.BigBlueButtonGateway -import org.bigbluebutton.core.api._ -import org.bigbluebutton.core.apps.whiteboard.vo.AnnotationVO - -class WhiteboardInGateway(bbbGW: BigBlueButtonGateway) { - - private def buildAnnotation(annotation: Map[String, Object]):Option[AnnotationVO] = { - var shape:Option[AnnotationVO] = None - - val id = annotation.getOrElse("id", null).asInstanceOf[String] - val shapeType = annotation.getOrElse("type", null).asInstanceOf[String] - val status = annotation.getOrElse("status", null).asInstanceOf[String] - val wbId = annotation.getOrElse("whiteboardId", null).asInstanceOf[String] -// println("** GOT ANNOTATION status[" + status + "] shape=[" + shapeType + "]"); - - if (id != null && shapeType != null && status != null && wbId != null) { - shape = Some(new AnnotationVO(id, status, shapeType, annotation.toMap, wbId)) - } - - shape - } - - def sendWhiteboardAnnotation(meetingID: String, requesterID: String, annotation: Map[String, Object]) { - buildAnnotation(annotation) match { - case Some(shape) => { - bbbGW.accept(new SendWhiteboardAnnotationRequest(meetingID, requesterID, shape)) - } - case None => // do nothing - } - } - - def requestWhiteboardAnnotationHistory(meetingID: String, requesterID: String, whiteboardId: String, replyTo: String) { - bbbGW.accept(new GetWhiteboardShapesRequest(meetingID, requesterID, whiteboardId, replyTo)) - } - - def clearWhiteboard(meetingID: String, requesterID: String, whiteboardId: String) { - bbbGW.accept(new ClearWhiteboardRequest(meetingID, requesterID, whiteboardId)) - } - - def undoWhiteboard(meetingID: String, requesterID: String, whiteboardId: String) { - bbbGW.accept(new UndoWhiteboardRequest(meetingID, requesterID, whiteboardId)) - } - - def enableWhiteboard(meetingID: String, requesterID: String, enable: Boolean) { - bbbGW.accept(new EnableWhiteboardRequest(meetingID, requesterID, enable)) - } - - def isWhiteboardEnabled(meetingID: String, requesterID: String, replyTo: String) { - bbbGW.accept(new IsWhiteboardEnabledRequest(meetingID, requesterID, replyTo)) - } - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardModel.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardModel.scala deleted file mode 100644 index 7e19312cd1..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/WhiteboardModel.scala +++ /dev/null @@ -1,87 +0,0 @@ -package org.bigbluebutton.core.apps.whiteboard - -import org.bigbluebutton.core.apps.whiteboard.vo.AnnotationVO -import scala.collection.mutable.ArrayBuffer - -class WhiteboardModel { - private var _whiteboards = new scala.collection.immutable.HashMap[String, Whiteboard]() - - private var _enabled = true - - private def saveWhiteboard(wb: Whiteboard) { - _whiteboards += wb.id -> wb - } - - def getWhiteboard(id: String):Option[Whiteboard] = { - _whiteboards.values.find(wb => wb.id == id) - } - - def hasWhiteboard(id: String):Boolean = { - _whiteboards.contains(id) - } - - def createWhiteboard(wbId: String) { - val vec = scala.collection.immutable.Vector.empty - val wb = new Whiteboard(wbId, vec) - saveWhiteboard(wb) - } - - def addAnnotationToShape(wb: Whiteboard, shape: AnnotationVO) = { -// println("Adding shape to wb [" + wb.id + "]. Before numShapes=[" + wb.shapes.length + "].") - val newWb = wb.copy(shapes=(wb.shapes :+ shape)) -// println("Adding shape to page [" + wb.id + "]. After numShapes=[" + newWb.shapes.length + "].") - saveWhiteboard(newWb) - } - - def addAnnotation(wbId:String, shape: AnnotationVO) { - getWhiteboard(wbId) foreach { wb => - addAnnotationToShape(wb, shape) - } - } - - private def modifyTextInPage(wb: Whiteboard, shape: AnnotationVO) = { - val removedLastText = wb.shapes.dropRight(1) - val addedNewText = removedLastText :+ shape - val newWb = wb.copy(shapes=addedNewText) - saveWhiteboard(newWb) - } - - def modifyText(wbId:String, shape: AnnotationVO) { - getWhiteboard(wbId) foreach { wb => - modifyTextInPage(wb, shape) - } - } - - def history(wbId:String):Option[Whiteboard] = { - getWhiteboard(wbId) - } - - def clearWhiteboard(wbId:String) { - getWhiteboard(wbId) foreach { wb => - val clearedShapes = wb.shapes.drop(wb.shapes.length) - val newWb = wb.copy(shapes= clearedShapes) - saveWhiteboard(newWb) - } - } - - def undoWhiteboard(wbId:String):Option[AnnotationVO] = { - var last:Option[AnnotationVO] = None - getWhiteboard(wbId) foreach { wb => - if (!wb.shapes.isEmpty) { - last = Some(wb.shapes.last) - val remaining = wb.shapes.dropRight(1) - val newWb = wb.copy(shapes=remaining) - saveWhiteboard(newWb) - } - } - last - } - - def enableWhiteboard(enable: Boolean) { - _enabled = enable - } - - def isWhiteboardEnabled():Boolean = { - _enabled - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardEventRedisPublisher.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardEventRedisPublisher.scala deleted file mode 100755 index 39d110fc27..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardEventRedisPublisher.scala +++ /dev/null @@ -1,56 +0,0 @@ -package org.bigbluebutton.core.apps.whiteboard.redis - -import org.bigbluebutton.core.api._ -import scala.collection.JavaConversions._ -import org.bigbluebutton.conference.service.whiteboard.WhiteboardKeyUtil -import scala.collection.immutable.StringOps -import org.bigbluebutton.conference.service.messaging.redis.MessageSender -import org.bigbluebutton.common.messages.MessagingConstants - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; - -class WhiteboardEventRedisPublisher(service: MessageSender) extends OutMessageListener2 { - def handleMessage(msg: IOutMessage) { - msg match { - case msg: GetWhiteboardShapesReply => handleGetWhiteboardShapesReply(msg) - case msg: SendWhiteboardAnnotationEvent => handleSendWhiteboardAnnotationEvent(msg) - case msg: ClearWhiteboardEvent => handleClearWhiteboardEvent(msg) - case msg: UndoWhiteboardEvent => handleUndoWhiteboardEvent(msg) - case msg: WhiteboardEnabledEvent => handleWhiteboardEnabledEvent(msg) - case msg: IsWhiteboardEnabledReply => handleIsWhiteboardEnabledReply(msg) - case _ => //println("Unhandled message in UsersClientMessageSender") - } - } - - private def handleGetWhiteboardShapesReply(msg: GetWhiteboardShapesReply) { - val json = WhiteboardMessageToJsonConverter.getWhiteboardShapesReplyToJson(msg) - service.send(MessagingConstants.FROM_WHITEBOARD_CHANNEL, json) - } - - private def handleSendWhiteboardAnnotationEvent(msg: SendWhiteboardAnnotationEvent) { - val json = WhiteboardMessageToJsonConverter.sendWhiteboardAnnotationEventToJson(msg) - service.send(MessagingConstants.FROM_WHITEBOARD_CHANNEL, json) - } - - private def handleClearWhiteboardEvent(msg: ClearWhiteboardEvent) { - val json = WhiteboardMessageToJsonConverter.clearWhiteboardEventToJson(msg) - service.send(MessagingConstants.FROM_WHITEBOARD_CHANNEL, json) - } - - private def handleUndoWhiteboardEvent(msg: UndoWhiteboardEvent) { - val json = WhiteboardMessageToJsonConverter.undoWhiteboardEventToJson(msg) - service.send(MessagingConstants.FROM_WHITEBOARD_CHANNEL, json) - } - - private def handleWhiteboardEnabledEvent(msg: WhiteboardEnabledEvent) { - val json = WhiteboardMessageToJsonConverter.whiteboardEnabledEventToJson(msg) - service.send(MessagingConstants.FROM_WHITEBOARD_CHANNEL, json) - } - - private def handleIsWhiteboardEnabledReply(msg: IsWhiteboardEnabledReply) { - val json = WhiteboardMessageToJsonConverter.isWhiteboardEnabledReplyToJson(msg) - service.send(MessagingConstants.FROM_WHITEBOARD_CHANNEL, json) - } - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardEventRedisRecorder.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardEventRedisRecorder.scala deleted file mode 100644 index 4d5ba7cb5a..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardEventRedisRecorder.scala +++ /dev/null @@ -1,93 +0,0 @@ -package org.bigbluebutton.core.apps.whiteboard.redis - -import org.bigbluebutton.conference.service.recorder.RecorderApplication -import org.bigbluebutton.core.api._ -import org.bigbluebutton.conference.service.whiteboard.redis.AddShapeWhiteboardRecordEvent -import scala.collection.JavaConversions._ -import org.bigbluebutton.conference.service.whiteboard.WhiteboardKeyUtil -import org.bigbluebutton.conference.service.whiteboard.redis.AddTextWhiteboardRecordEvent -import org.bigbluebutton.conference.service.whiteboard.redis.ClearPageWhiteboardRecordEvent -import org.bigbluebutton.conference.service.whiteboard.redis.UndoShapeWhiteboardRecordEvent -import org.bigbluebutton.conference.service.whiteboard.redis.ModifyTextWhiteboardRecordEvent -import scala.collection.immutable.StringOps - - -class WhiteboardEventRedisRecorder(recorder: RecorderApplication) extends OutMessageListener2 { - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: SendWhiteboardAnnotationEvent => handleSendWhiteboardAnnotationEvent(msg) - case msg: ClearWhiteboardEvent => handleClearWhiteboardEvent(msg) - case msg: UndoWhiteboardEvent => handleUndoWhiteboardEvent(msg) - case _ => //println("Unhandled message in UsersClientMessageSender") - } - } - - private def getPresentationId(whiteboardId:String):String = { - // Need to split the whiteboard id into presenation id and page num as the old - // recording expects them - val strId = new StringOps(whiteboardId) - val ids = strId.split('/') - var presId:String = "" - if (ids.length == 2) { - presId = ids(0) - } - - presId - } - - private def getPageNum(whiteboardId:String):String = { - val strId = new StringOps(whiteboardId) - val ids = strId.split('/') - var pageNum = "0" - if (ids.length == 2) { - pageNum = ids(1) - } - pageNum - } - - private def handleSendWhiteboardAnnotationEvent(msg: SendWhiteboardAnnotationEvent) { - if ((msg.shape.shapeType == WhiteboardKeyUtil.TEXT_TYPE) && (msg.shape.status != WhiteboardKeyUtil.TEXT_CREATED_STATUS)) { - - val event = new ModifyTextWhiteboardRecordEvent() - event.setMeetingId(msg.meetingID) - event.setTimestamp(TimestampGenerator.generateTimestamp) - event.setPresentation(getPresentationId(msg.whiteboardId)) - event.setPageNumber(getPageNum(msg.whiteboardId)) - event.setWhiteboardId(msg.whiteboardId) - event.addAnnotation(mapAsJavaMap(msg.shape.shape)) - recorder.record(msg.meetingID, event) - } else { - val event = new AddShapeWhiteboardRecordEvent() - event.setMeetingId(msg.meetingID) - event.setTimestamp(TimestampGenerator.generateTimestamp) - event.setPresentation(getPresentationId(msg.whiteboardId)) - event.setPageNumber(getPageNum(msg.whiteboardId)) - event.setWhiteboardId(msg.whiteboardId); - event.addAnnotation(mapAsJavaMap(msg.shape.shape)) - recorder.record(msg.meetingID, event) - } - } - - private def handleClearWhiteboardEvent(msg: ClearWhiteboardEvent) { - val event = new ClearPageWhiteboardRecordEvent() - event.setMeetingId(msg.meetingID) - event.setTimestamp(TimestampGenerator.generateTimestamp) - event.setPresentation(getPresentationId(msg.whiteboardId)) - event.setPageNumber(getPageNum(msg.whiteboardId)) - event.setWhiteboardId(msg.whiteboardId) - recorder.record(msg.meetingID, event) - } - - private def handleUndoWhiteboardEvent(msg: UndoWhiteboardEvent) { - val event = new UndoShapeWhiteboardRecordEvent() - event.setMeetingId(msg.meetingID) - event.setTimestamp(TimestampGenerator.generateTimestamp) - event.setPresentation(getPresentationId(msg.whiteboardId)) - event.setPageNumber(getPageNum(msg.whiteboardId)) - event.setWhiteboardId(msg.whiteboardId) - event.setShapeId(msg.shapeId); - recorder.record(msg.meetingID, event) - } - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardMessageToJsonConverter.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardMessageToJsonConverter.scala deleted file mode 100755 index cbdd521e52..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/redis/WhiteboardMessageToJsonConverter.scala +++ /dev/null @@ -1,94 +0,0 @@ -package org.bigbluebutton.core.apps.whiteboard.redis - -import org.bigbluebutton.core.api._ -import org.bigbluebutton.core.messaging.Util -import org.bigbluebutton.core.apps.whiteboard.vo.AnnotationVO -import collection.JavaConverters._ -import scala.collection.JavaConversions._ - -object WhiteboardMessageToJsonConverter { - private def shapeToMap(shape: AnnotationVO):java.util.Map[String, Any] = { - val res = new scala.collection.mutable.HashMap[String, Any] - res += "id" -> shape.id - res += "status" -> shape.status - res += "shape_type" -> shape.shapeType - res += "wb_id" -> shape.wbId - - val shapeMap = new scala.collection.mutable.HashMap[String, Any]() - for ((key, value) <- shape.shape) { - shapeMap += key -> value - } - res += "shape" -> mapAsJavaMap(shapeMap) - - mapAsJavaMap(res) - } - - def getWhiteboardShapesReplyToJson(msg: GetWhiteboardShapesReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.WHITEBOARD_ID, msg.whiteboardId) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val shapes = new java.util.ArrayList[java.util.Map[String, Any]]() - msg.shapes.foreach {shape => - shapes.add(shapeToMap(shape)) - } - - payload.put(Constants.SHAPES, shapes) - - val header = Util.buildHeader(MessageNames.GET_WHITEBOARD_SHAPES_REPLY, msg.version, Some(msg.replyTo)) - Util.buildJson(header, payload) - } - - def sendWhiteboardAnnotationEventToJson(msg: SendWhiteboardAnnotationEvent):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.WHITEBOARD_ID, msg.whiteboardId) - payload.put(Constants.SHAPE, shapeToMap(msg.shape)) - - val header = Util.buildHeader(MessageNames.SEND_WHITEBOARD_SHAPE, msg.version, None) - Util.buildJson(header, payload) - } - - def clearWhiteboardEventToJson(msg: ClearWhiteboardEvent):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.WHITEBOARD_ID, msg.whiteboardId) - - val header = Util.buildHeader(MessageNames.WHITEBOARD_CLEARED, msg.version, None) - Util.buildJson(header, payload) - } - - def undoWhiteboardEventToJson(msg: UndoWhiteboardEvent):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.WHITEBOARD_ID, msg.whiteboardId) - payload.put(Constants.SHAPE_ID, msg.shapeId) - - val header = Util.buildHeader(MessageNames.UNDO_WHITEBOARD, msg.version, None) - Util.buildJson(header, payload) - } - - def whiteboardEnabledEventToJson(msg: WhiteboardEnabledEvent):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.ENABLE, msg.enable) - - val header = Util.buildHeader(MessageNames.WHITEBOARD_ENABLED, msg.version, None) - Util.buildJson(header, payload) - } - - def isWhiteboardEnabledReplyToJson(msg: IsWhiteboardEnabledReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - payload.put(Constants.ENABLE, msg.enabled) - - val header = Util.buildHeader(MessageNames.IS_WHITEBOARD_ENABLED_REPLY, msg.version, Some(msg.replyTo)) - Util.buildJson(header, payload) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/vo/ValueObjects.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/vo/ValueObjects.scala deleted file mode 100755 index 81711b8f5c..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/whiteboard/vo/ValueObjects.scala +++ /dev/null @@ -1,3 +0,0 @@ -package org.bigbluebutton.core.apps.whiteboard.vo - -case class AnnotationVO(id: String, status: String, shapeType: String, shape: scala.collection.immutable.Map[String, Object], wbId:String) \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/meeting/MeetingEventRedisPublisher.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/meeting/MeetingEventRedisPublisher.scala deleted file mode 100755 index 6d2c0be073..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/meeting/MeetingEventRedisPublisher.scala +++ /dev/null @@ -1,94 +0,0 @@ -package org.bigbluebutton.core.meeting - -import org.bigbluebutton.conference.service.messaging.redis.MessageSender -import org.bigbluebutton.core.api._ -import scala.collection.immutable.HashMap -import com.google.gson.Gson -import scala.collection.JavaConverters._ -import org.bigbluebutton.common.messages.MessagingConstants - -class MeetingEventRedisPublisher(service: MessageSender) extends OutMessageListener2 { - - private val KEEP_ALIVE_REPLY = "KEEP_ALIVE_REPLY" - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: MeetingCreated => handleMeetingCreated(msg) - case msg: VoiceRecordingStarted => handleVoiceRecordingStarted(msg) - case msg: VoiceRecordingStopped => handleVoiceRecordingStopped(msg) - case msg: RecordingStatusChanged => handleRecordingStatusChanged(msg) - case msg: GetRecordingStatusReply => handleGetRecordingStatusReply(msg) - case msg: MeetingEnded => handleMeetingEnded(msg) - case msg: MeetingHasEnded => handleMeetingHasEnded(msg) - case msg: MeetingDestroyed => handleMeetingDestroyed(msg) - case msg: KeepAliveMessageReply => handleKeepAliveMessageReply(msg) - case msg: StartRecording => handleStartRecording(msg) - case msg: StopRecording => handleStopRecording(msg) - case msg: GetAllMeetingsReply => handleGetAllMeetingsReply(msg) - case _ => //println("Unhandled message in MeetingEventRedisPublisher") - } - } - - private def handleMeetingDestroyed(msg: MeetingDestroyed) { - val json = MeetingMessageToJsonConverter.meetingDestroyedToJson(msg) -// System.out.println("****\n" + json) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleKeepAliveMessageReply(msg: KeepAliveMessageReply) { - val json = MeetingMessageToJsonConverter.keepAliveMessageReplyToJson(msg) - service.send(MessagingConstants.FROM_SYSTEM_CHANNEL, json) - } - - private def handleMeetingCreated(msg:MeetingCreated) { - val json = MeetingMessageToJsonConverter.meetingCreatedToJson(msg) -// System.out.println("****\n" + json) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleMeetingEnded(msg:MeetingEnded){ - val json = MeetingMessageToJsonConverter.meetingEndedToJson(msg) -// System.out.println("****\n" + json) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleStartRecording(msg: StartRecording) { - val json = MeetingMessageToJsonConverter.startRecordingToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleStopRecording(msg: StopRecording) { - val json = MeetingMessageToJsonConverter.stopRecordingToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleVoiceRecordingStarted(msg: VoiceRecordingStarted) { - val json = MeetingMessageToJsonConverter.voiceRecordingStartedToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleVoiceRecordingStopped(msg: VoiceRecordingStopped) { - val json = MeetingMessageToJsonConverter.voiceRecordingStoppedToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleRecordingStatusChanged(msg: RecordingStatusChanged) { - val json = MeetingMessageToJsonConverter.recordingStatusChangedToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleGetRecordingStatusReply(msg: GetRecordingStatusReply) { - val json = MeetingMessageToJsonConverter.getRecordingStatusReplyToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleMeetingHasEnded(msg: MeetingHasEnded) { - val json = MeetingMessageToJsonConverter.meetingHasEndedToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } - - private def handleGetAllMeetingsReply(msg: GetAllMeetingsReply) { - val json = MeetingMessageToJsonConverter.getAllMeetingsReplyToJson(msg) - service.send(MessagingConstants.FROM_MEETING_CHANNEL, json) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/meeting/MeetingMessageToJsonConverter.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/meeting/MeetingMessageToJsonConverter.scala deleted file mode 100644 index 72050524f2..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/meeting/MeetingMessageToJsonConverter.scala +++ /dev/null @@ -1,132 +0,0 @@ -package org.bigbluebutton.core.meeting - -import org.bigbluebutton.core.messaging.Util -import org.bigbluebutton.core.api._ -import com.google.gson.Gson -import scala.collection.JavaConverters._ - -object MeetingMessageToJsonConverter { - def meetingDestroyedToJson(msg: MeetingDestroyed):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = Util.buildHeader(MessageNames.MEETING_DESTROYED_EVENT, msg.version, None) - Util.buildJson(header, payload) - } - - def keepAliveMessageReplyToJson(msg: KeepAliveMessageReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.KEEP_ALIVE_ID, msg.aliveID) - - val header = Util.buildHeader(MessageNames.KEEP_ALIVE_REPLY, msg.version, None) - Util.buildJson(header, payload) - } - - def meetingCreatedToJson(msg:MeetingCreated):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.EXTERNAL_MEETING_ID, msg.externalMeetingID) - payload.put(Constants.NAME, msg.name) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.VOICE_CONF, msg.voiceBridge) - payload.put(Constants.DURATION, msg.duration) - payload.put(Constants.MODERATOR_PASS, msg.moderatorPass) - payload.put(Constants.VIEWER_PASS, msg.viewerPass) - payload.put(Constants.CREATE_TIME, msg.createTime) - payload.put(Constants.CREATE_DATE, msg.createDate) - - val header = Util.buildHeader(MessageNames.MEETING_CREATED, msg.version, None) - Util.buildJson(header, payload) - } - - def meetingEndedToJson(msg:MeetingEnded):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - - val header = Util.buildHeader(MessageNames.MEETING_ENDED, msg.version, None) - Util.buildJson(header, payload) - } - - def voiceRecordingStartedToJson(msg: VoiceRecordingStarted):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.RECORDING_FILE, msg.recordingFile) - payload.put(Constants.VOICE_CONF, msg.confNum) - payload.put(Constants.TIMESTAMP, msg.timestamp) - - val header = Util.buildHeader(MessageNames.VOICE_RECORDING_STARTED, msg.version, None) - Util.buildJson(header, payload) - } - - def voiceRecordingStoppedToJson(msg: VoiceRecordingStopped):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.RECORDING_FILE, msg.recordingFile) - payload.put(Constants.VOICE_CONF, msg.confNum) - payload.put(Constants.TIMESTAMP, msg.timestamp) - - val header = Util.buildHeader(MessageNames.VOICE_RECORDING_STOPPED, msg.version, None) - Util.buildJson(header, payload) - } - - def recordingStatusChangedToJson(msg: RecordingStatusChanged):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.RECORDING, msg.recording) - - val header = Util.buildHeader(MessageNames.RECORDING_STATUS_CHANGED, msg.version, None) - Util.buildJson(header, payload) - } - - def getRecordingStatusReplyToJson(msg: GetRecordingStatusReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.USER_ID, msg.userId) - payload.put(Constants.RECORDING, msg.recording) - - val header = Util.buildHeader(MessageNames.GET_RECORDING_STATUS_REPLY, msg.version, None) - Util.buildJson(header, payload) - } - - def meetingHasEndedToJson(msg: MeetingHasEnded):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.USER_ID, msg.userId) - - val header = Util.buildHeader(MessageNames.MEETING_ENDED, msg.version, None) - Util.buildJson(header, payload) - } - - def startRecordingToJson(msg: StartRecording):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = Util.buildHeader(MessageNames.START_RECORDING, msg.version, None) - Util.buildJson(header, payload) - } - - def stopRecordingToJson(msg: StopRecording):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put(Constants.MEETING_ID, msg.meetingID) - payload.put(Constants.RECORDED, msg.recorded) - payload.put(Constants.REQUESTER_ID, msg.requesterID) - - val header = Util.buildHeader(MessageNames.STOP_RECORDING, msg.version, None) - Util.buildJson(header, payload) - } - - def getAllMeetingsReplyToJson(msg: GetAllMeetingsReply):String = { - val payload = new java.util.HashMap[String, Any]() - payload.put("meetings", msg.meetings) - - val header = Util.buildHeader(MessageNames.GET_ALL_MEETINGS_REPLY, msg.version, None) - Util.buildJson(header, payload) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/messaging/Util.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/messaging/Util.scala deleted file mode 100644 index 868c08b81c..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/messaging/Util.scala +++ /dev/null @@ -1,33 +0,0 @@ -package org.bigbluebutton.core.messaging - -import org.bigbluebutton.core.api._ -import com.google.gson.Gson - -object Util { - - val VERSION = "version" - - def buildHeader(name: String, version: String, - replyTo:Option[String]):java.util.HashMap[String, Any] = { - val header = new java.util.HashMap[String, Any]() - header.put(Constants.NAME, name) - header.put(VERSION, version) - header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp) - header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime) - replyTo.foreach(rep => header.put(Constants.REPLY_TO, rep)) - - header - } - - - def buildJson(header: java.util.HashMap[String, Any], - payload: java.util.HashMap[String, Any]): String = { - - val message = new java.util.HashMap[String, java.util.HashMap[String, Any]]() - message.put(Constants.HEADER, header) - message.put(Constants.PAYLOAD, payload) - - val gson = new Gson() - gson.toJson(message) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/models/Values.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/models/Values.scala deleted file mode 100755 index 02a3fa94a1..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/models/Values.scala +++ /dev/null @@ -1,23 +0,0 @@ -package org.bigbluebutton.core.models - -import org.bigbluebutton.core.api.Role._ - -case class Status(isPresenter: Boolean = false, handRaised: Boolean = false) - -case class CallerId(num: String="", name: String="") - -case class Voice( - hasJoined: Boolean = false, - id: String = "", - callerId: CallerId = CallerId(), - muted: Boolean = false, - talking: Boolean = false, - locked: Boolean = false) - -case class UserV( - id: String, - extId: String, - name: String, - role: Role = VIEWER, - status: Status = Status(), - voice: Voice = Voice()) \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/util/LogHelper.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/util/LogHelper.scala deleted file mode 100644 index f4646b81b4..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/util/LogHelper.scala +++ /dev/null @@ -1,13 +0,0 @@ -package org.bigbluebutton.core.util - -import org.slf4j.Logger -import org.red5.logging.Red5LoggerFactory; - -/** - * LogHelper is a trait you can mix in to provide easy log4j logging - * for your scala classes. - **/ -trait LogHelper { - val loggerName = this.getClass.getName - lazy val logger = Red5LoggerFactory.getLogger(this.getClass, "bigbluebutton") -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/util/RandomStringGenerator.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/util/RandomStringGenerator.scala deleted file mode 100755 index 08fede1efa..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/util/RandomStringGenerator.scala +++ /dev/null @@ -1,17 +0,0 @@ -package org.bigbluebutton.core.util - -object RandomStringGenerator { -// From: http://www.bindschaedler.com/2012/04/07/elegant-random-string-generation-in-scala/ - - // Random generator - val random = new scala.util.Random - - // Generate a random string of length n from the given alphabet - def randomString(alphabet: String)(n: Int): String = - Stream.continually(random.nextInt(alphabet.size)).map(alphabet).take(n).mkString - - // Generate a random alphabnumeric string of length n - def randomAlphanumericString(n: Int) = - randomString("abcdefghijklmnopqrstuvwxyz0123456789")(n) -} - diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/voice/VoiceConferenceActor.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/voice/VoiceConferenceActor.scala deleted file mode 100755 index 2b34a0f239..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/voice/VoiceConferenceActor.scala +++ /dev/null @@ -1,16 +0,0 @@ -package org.bigbluebutton.core.voice - -import akka.actor._ -import akka.actor.ActorLogging - -case class MuteAllUsers(meetingId: String, except: Option[Seq[String]]) -case class MuteUser(meetingId: String, userId: String) -case class UnmuteUser(meetingId: String, userId: String) -case class EjectVoiceUser(meetingId: String, userId: String) - - -class VoiceConferenceActor(val meetingId: String, - val voiceConf: String) { //extends Actor { - - -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/voice/VoiceConferenceService.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/voice/VoiceConferenceService.scala deleted file mode 100755 index 51c4c3100d..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/voice/VoiceConferenceService.scala +++ /dev/null @@ -1,19 +0,0 @@ -package org.bigbluebutton.core.voice - -import org.bigbluebutton.core.api._ -import org.bigbluebutton.freeswitch.FreeswitchManagerProxy - -class VoiceConferenceService(fsproxy: FreeswitchManagerProxy, - bbbInGW: IBigBlueButtonInGW) - extends OutMessageListener2 { - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: MeetingCreated => handleMeetingCreated(msg) - } - } - - private def handleMeetingCreated(msg: MeetingCreated) { - - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConference.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConference.scala deleted file mode 100644 index bb657183ff..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConference.scala +++ /dev/null @@ -1,54 +0,0 @@ -package org.bigbluebutton.freeswitch - -import org.bigbluebutton.core.api.UserVO -import org.bigbluebutton.core.util._ - -class FreeswitchConference(val conferenceNum: String, - val meetingId: String, - val recorded: Boolean) extends LogHelper { - - private var users = new scala.collection.immutable.HashMap[String, UserVO] - - private var recording:Boolean = false - - def addUser(user: UserVO) { - users += user.userID -> user - } - - def removeUser(user: UserVO) { - users -= user.userID - } - - def getWebUserUsingExtId(webUserId: String):Option[UserVO] = { - users.values find {u => - (u.externUserID == webUserId) - } - } - - def getWebUser(webUserId: String):Option[UserVO] = { - users.values find (u => (u.userID == webUserId)) - } - - def getVoiceUser(voiceUserId: String):Option[UserVO] = { - users.values find (u => u.voiceUser.userId == voiceUserId) - } - - def numUsersInVoiceConference:Int = { - val joinedUsers = users.values filter (u => u.voiceUser.joined) - joinedUsers.size - } - - def numUsers = users.size - - def recordingStarted() { - recording = true; - } - - def recordingStopped() { - recording = false - } - - def isRecording():Boolean = { - recording - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConferenceActor.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConferenceActor.scala deleted file mode 100755 index 669b79e771..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConferenceActor.scala +++ /dev/null @@ -1,250 +0,0 @@ -package org.bigbluebutton.freeswitch - -import akka.actor._ -import akka.actor.ActorLogging -import org.bigbluebutton.core.api._ -import org.bigbluebutton.core.util._ - -case class FsVoiceUserJoined(userId: String, webUserId: String, - conference: String, callerIdNum: String, - callerIdName: String, muted: Boolean, - speaking: Boolean) - -case class FsVoiceUserLeft(userId: String, conference: String) -case class FsVoiceUserLocked(userId: String, conference: String, locked: Boolean) -case class FsVoiceUserMuted(userId: String, conference: String, muted: Boolean) -case class FsVoiceUserTalking(userId: String, conference: String, talking: Boolean) -case class FsRecording(conference: String, recordingFile: String, - timestamp: String, recording: Boolean) - -object FreeswitchConferenceActor { - def props(system: ActorSystem, fsproxy: FreeswitchManagerProxy, bbbInGW: IBigBlueButtonInGW): Props = - Props(classOf[FreeswitchConferenceActor], system, fsproxy, bbbInGW) -} - -class FreeswitchConferenceActor(val system: ActorSystem, fsproxy: FreeswitchManagerProxy, bbbInGW: IBigBlueButtonInGW) extends Actor with ActorLogging { - - private var confs = new scala.collection.immutable.HashMap[String, FreeswitchConference] - - def receive = { - case msg: MeetingCreated => handleMeetingCreated(msg) - case msg: MeetingEnded => handleMeetingEnded(msg) - case msg: MeetingDestroyed => handleMeetingDestroyed(msg) - case msg: UserJoined => handleUserJoined(msg) - case msg: UserLeft => handleUserLeft(msg) - case msg: MuteVoiceUser => handleMuteVoiceUser(msg) - case msg: EjectVoiceUser => handleEjectVoiceUser(msg) - case msg: StartRecording => handleStartRecording(msg) - case msg: StopRecording => handleStopRecording(msg) - case msg: FsRecording => handleFsRecording(msg) - case msg: FsVoiceUserJoined => handleFsVoiceUserJoined(msg) - case msg: FsVoiceUserLeft => handleFsVoiceUserLeft(msg) - case msg: FsVoiceUserLocked => handleFsVoiceUserLocked(msg) - case msg: FsVoiceUserMuted => handleFsVoiceUserMuted(msg) - case msg: FsVoiceUserTalking => handleFsVoiceUserTalking(msg) - case msg: UserJoinedVoice => handleUserJoinedVoice(msg) - case msg: UserLeftVoice => handleUserLeftVoice(msg) - case msg: EjectAllVoiceUsers => handleEjectAllVoiceUsers(msg) - case _ => // do nothing - } - - private def handleEjectAllVoiceUsers(msg: EjectAllVoiceUsers) { - val fsconf = confs.values find (c => c.meetingId == msg.meetingID) - - fsconf foreach (fc => { - fsproxy.ejectUsers(fc.conferenceNum) - }) - } - - private def handleMeetingCreated(msg: MeetingCreated) { - if (! confs.contains(msg.meetingID)) { - log.info("Meeting created [" + msg.meetingID + "] with voice conf [" + msg.voiceBridge + "]") - val fsconf = new FreeswitchConference(msg.voiceBridge, - msg.meetingID, - msg.recorded) - confs += fsconf.meetingId -> fsconf - } - - fsproxy.getUsers(msg.voiceBridge) - } - - private def handleMeetingEnded(msg: MeetingEnded) { - val fsconf = confs.values find (c => c.meetingId == msg.meetingID) - - fsconf foreach (fc => { - log.info("Meeting ended [" + msg.meetingID + "]") - fsproxy.ejectUsers(fc.conferenceNum) - confs -= fc.meetingId - }) - } - - private def handleMeetingDestroyed(msg: MeetingDestroyed) { - val fsconf = confs.values find (c => c.meetingId == msg.meetingID) - - fsconf foreach (fc => { - log.info("Meeting destroyed [" + msg.meetingID + "]") - fsproxy.ejectUsers(fc.conferenceNum) - confs -= fc.meetingId - }) - } - - - - private def handleUserJoinedVoice(msg: UserJoinedVoice) { - val fsconf = confs.values find (c => c.meetingId == msg.meetingID) - - fsconf foreach {fc => - log.info("Web user has joined voice. mid[" + fc.meetingId + "] wid=[" + msg.user.userID + "], vid=[" + msg.user.voiceUser.userId + "]") - fc.addUser(msg.user) - if (fc.numUsersInVoiceConference == 1 && fc.recorded) { - log.info("Meeting is recorded. Tell FreeSWITCH to start recording. mid[" + fc.meetingId + "]") - fsproxy.startRecording(fc.conferenceNum, fc.meetingId) - } - } - } - - private def handleUserLeftVoice(msg: UserLeftVoice) { - val fsconf = confs.values find (c => c.meetingId == msg.meetingID) - -// println("FreeswitchConferenceActor - handleUserLeftVoice mid=[" + msg.meetingID + "]") - - fsconf foreach {fc => - fc.addUser(msg.user) - log.info("Web user has left voice. mid[" + fc.meetingId + "] wid=[" + msg.user.userID + "], vid=[" + msg.user.voiceUser.userId + "]") - if (fc.numUsersInVoiceConference == 0 && fc.recorded) { - log.info("Meeting is recorded. No more users in voice conference. Tell FreeSWITCH to stop recording. mid[" + fc.meetingId + "]") - fsproxy.stopRecording(fc.conferenceNum) - } - } - } - - private def handleUserJoined(msg: UserJoined) { - val fsconf = confs.values find (c => c.meetingId == msg.meetingID) - - fsconf foreach (fc => { - log.info("Web user id joining meeting id[" + fc.meetingId + "] wid=[" + msg.user.userID + "], extId=[" + msg.user.externUserID + "]") - fc.addUser(msg.user) - }) - } - - private def handleUserLeft(msg: UserLeft) { - val fsconf = confs.values find (c => c.meetingId == msg.meetingID) - - fsconf foreach (fc => { - fc.removeUser(msg.user) - }) - } - - private def handleMuteVoiceUser(msg: MuteVoiceUser) { - val fsconf = confs.values find (c => c.meetingId == msg.meetingID) - log.debug("Mute user request for wid[" + msg.userId + "] mute=[" + msg.mute + "]") - fsconf foreach (fc => { - val user = fc.getWebUser(msg.userId) - user foreach (u => { - log.debug("Muting user wid[" + msg.userId + "] mute=[" + msg.mute + "]") - fsproxy.muteUser(fc.conferenceNum, u.voiceUser.userId, msg.mute) - }) - }) - } - - private def handleEjectVoiceUser(msg: EjectVoiceUser) { - val fsconf = confs.values find (c => c.meetingId == msg.meetingID) - - fsconf foreach (fc => { - val user = fc.getWebUser(msg.userId) - user foreach (u => { - fsproxy.ejectUser(fc.conferenceNum, u.voiceUser.userId) - }) - }) - } - - private def handleStartRecording(msg: StartRecording) { - - } - - private def handleStopRecording(msg: StopRecording) { - - } - - private def handleFsRecording(msg: FsRecording) { - val fsconf = confs.values find (c => c.conferenceNum == msg.conference) - fsconf foreach {fc => - // Need to filter recording events here to not have duplicate events - if (! fc.isRecording && msg.recording) { - // - fc.recordingStarted - bbbInGW.voiceRecording(fc.meetingId, msg.recordingFile, msg.timestamp, msg.recording) - } else if (fc.isRecording && ! msg.recording) { - fc.recordingStopped - bbbInGW.voiceRecording(fc.meetingId, msg.recordingFile, msg.timestamp, msg.recording) - } - } - } - - private def sendNonWebUserJoined(meetingId: String, webUserId: String, msg: FsVoiceUserJoined) { - bbbInGW.voiceUserJoined(meetingId, msg.userId, - webUserId, msg.conference, msg.callerIdNum, msg.callerIdName, - msg.muted, msg.speaking) - } - - private def handleFsVoiceUserJoined(msg: FsVoiceUserJoined) { - log.info("A user has joined the voice conference [" + - msg.conference + "] user=[" + msg.callerIdName + "] wid=[" + msg.webUserId + "]") - val fsconf = confs.values find (c => c.conferenceNum == msg.conference) - - fsconf foreach (fc => { - log.debug("Meeting [" + fc.meetingId + "] has [" + fc.numUsers + "]") - fc.getWebUserUsingExtId(msg.webUserId) match { - case Some(user) => { - log.info("The user is also in the web client. [" + - msg.conference + "] user=[" + msg.callerIdName + "] wid=[" + msg.webUserId + "]") - sendNonWebUserJoined(fc.meetingId, user.userID, msg) - } - case None => { - log.info("User is not a web user. Must be a phone caller. [" + - msg.conference + "] user=[" + msg.callerIdName + "] wid=[" + msg.webUserId + "]") - sendNonWebUserJoined(fc.meetingId, msg.userId, msg) - } - } - }) - } - - private def handleFsVoiceUserLeft(msg: FsVoiceUserLeft) { - val fsconf = confs.values find (c => c.conferenceNum == msg.conference) - - fsconf foreach (fc => { - val user = fc.getVoiceUser(msg.userId) - user foreach (u => bbbInGW.voiceUserLeft(fc.meetingId, u.userID)) - }) - } - - private def handleFsVoiceUserLocked(msg: FsVoiceUserLocked) { - val fsconf = confs.values find (c => c.conferenceNum == msg.conference) - - fsconf foreach (fc => { - val user = fc.getVoiceUser(msg.userId) - user foreach (u => bbbInGW.voiceUserLocked(fc.meetingId, u.userID, msg.locked)) - }) - } - - private def handleFsVoiceUserMuted(msg: FsVoiceUserMuted) { - val fsconf = confs.values find (c => c.conferenceNum == msg.conference) - -// println("Rx voice user muted for cnum=[" + msg.conference + "] vid[" + msg.userId + "] mute=[" + msg.muted + "]") - fsconf foreach (fc => { - val user = fc.getVoiceUser(msg.userId) -// println("Rx voice user muted for mid=[" + fc.meetingId + "] vid[" + msg.userId + "] mute=[" + msg.muted + "]") - user foreach (u => bbbInGW.voiceUserMuted(fc.meetingId, u.userID, msg.muted)) - }) - } - - private def handleFsVoiceUserTalking(msg: FsVoiceUserTalking) { - val fsconf = confs.values find (c => c.conferenceNum == msg.conference) - - fsconf foreach (fc => { - val user = fc.getVoiceUser(msg.userId) -// println("Rx voice user talking for vid[" + msg.userId + "] mute=[" + msg.talking + "]") - user foreach (u => bbbInGW.voiceUserTalking(fc.meetingId, u.userID, msg.talking)) - }) - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConferenceService.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConferenceService.scala deleted file mode 100755 index f320f3e272..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchConferenceService.scala +++ /dev/null @@ -1,126 +0,0 @@ -package org.bigbluebutton.freeswitch - -import akka.actor.{ ActorSystem, Props } -import org.bigbluebutton.webconference.voice.IVoiceConferenceService -import org.bigbluebutton.core.api._ -import org.bigbluebutton.webconference.voice.FreeswitchConferenceEventListener -import akka.actor.ActorRef - -class FreeswitchConferenceService(fsproxy: FreeswitchManagerProxy, - fsListener: FreeswitchConferenceEventListener) - extends IVoiceConferenceService - with OutMessageListener2 { - - fsListener.setVoiceConferenceService(this) - - implicit val system = ActorSystem("bigbluebutton-apps-fsesl") - - - - var bbbInGW: IBigBlueButtonInGW = _ - var fsActor: ActorRef = _ - - def setIBigBlueButtonInGW(inGW: IBigBlueButtonInGW) { - bbbInGW = inGW - fsActor = system.actorOf( - FreeswitchConferenceActor.props(system, fsproxy, bbbInGW), - "bigbluebutton-fs-actor") - } - - def handleMessage(msg: IOutMessage) { - msg match { - case msg: MeetingCreated => handleMeetingCreated(msg) - case msg: MeetingEnded => handleMeetingEnded(msg) - case msg: MeetingDestroyed => handleMeetingDestroyed(msg) - case msg: UserJoined => handleUserJoined(msg) - case msg: UserLeft => handleUserLeft(msg) - case msg: MuteVoiceUser => handleMuteVoiceUser(msg) - case msg: EjectVoiceUser => handleEjectVoiceUser(msg) - case msg: UserJoinedVoice => handleUserJoinedVoice(msg) - case msg: UserLeftVoice => handleUserLeftVoice(msg) - case msg: EjectAllVoiceUsers => handleEjectAllVoiceUsers(msg) - case _ => // do nothing - } - } - - private def handleUserLeftVoice(msg: UserLeftVoice) { - fsActor ! msg - } - - private def handleUserJoinedVoice(msg: UserJoinedVoice) { - fsActor ! msg - } - - private def handleMuteVoiceUser(msg: MuteVoiceUser) { - fsActor ! msg - } - - private def handleEjectVoiceUser(msg: EjectVoiceUser) { - fsActor ! msg - } - - private def handleUserLeft(msg: UserLeft) { - fsActor ! msg - } - - private def handleUserJoined(msg: UserJoined) { - fsActor ! msg - } - - private def handleMeetingCreated(msg: MeetingCreated) { - fsActor ! msg - } - - private def handleMeetingEnded(msg: MeetingEnded) { - fsActor ! msg - } - - private def handleMeetingDestroyed(msg: MeetingDestroyed) { - fsActor ! msg - } - - - private def handleEjectAllVoiceUsers(msg: EjectAllVoiceUsers) { - fsActor ! msg - } - - def voiceStartedRecording(conference: String, recordingFile: String, - timestamp: String, recording: java.lang.Boolean) { - val fsRec = new FsRecording(conference, recordingFile, timestamp, recording) - fsActor ! fsRec - } - - def voiceUserJoined(userId: String, webUserId: String, conference: String, - callerIdNum: String, callerIdName: String, - muted: java.lang.Boolean, talking: java.lang.Boolean) { -// println("******** FreeswitchConferenceService received voiceUserJoined vui=[" + userId + "] wui=[" + webUserId + "]") - val vuj = new FsVoiceUserJoined(userId, webUserId, - conference, callerIdNum, - callerIdName, muted, - talking) - fsActor ! vuj - } - - def voiceUserLeft(userId: String, conference: String) { -// println("******** FreeswitchConferenceService received voiceUserLeft vui=[" + userId + "] conference=[" + conference + "]") - val vul = new FsVoiceUserLeft(userId, conference) - fsActor ! vul - } - - def voiceUserLocked(userId: String, conference: String, locked: java.lang.Boolean) { - val vul = new FsVoiceUserLocked(userId, conference, locked) - fsActor ! vul - } - - def voiceUserMuted(userId: String, conference: String, muted: java.lang.Boolean) { - println("******** FreeswitchConferenceService received voiceUserMuted vui=[" + userId + "] muted=[" + muted + "]") - val vum = new FsVoiceUserMuted(userId, conference, muted) - fsActor ! vum - } - - def voiceUserTalking(userId: String, conference: String, talking: java.lang.Boolean) { - println("******** FreeswitchConferenceService received voiceUserTalking vui=[" + userId + "] talking=[" + talking + "]") - val vut = new FsVoiceUserTalking(userId, conference, talking) - fsActor ! vut - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchManagerProxy.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchManagerProxy.scala deleted file mode 100755 index a5d5434b30..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FreeswitchManagerProxy.scala +++ /dev/null @@ -1,32 +0,0 @@ -package org.bigbluebutton.freeswitch - -import org.bigbluebutton.webconference.voice.freeswitch.FreeswitchApplication - -class FreeswitchManagerProxy(fsApp: FreeswitchApplication) { - - def getUsers(conference: String) { - fsApp.populateRoom(conference) - } - - def ejectUsers(conference: String) { - fsApp.ejectAll(conference) - } - - def muteUser(conference: String, userId: String, mute: Boolean) { - println("Forwarding mute request to fsApp") - fsApp.mute(conference, userId, mute) - } - - def ejectUser(conference: String, userId: String ) { - println("Forwarding eject user request to fsApp") - fsApp.eject(conference, userId) - } - - def startRecording(conference: String, meetingId: String) { - fsApp.record(conference, meetingId) - } - - def stopRecording(conference: String) { - - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FsInGwWrapper.scala b/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FsInGwWrapper.scala deleted file mode 100755 index 011be11c57..0000000000 --- a/bigbluebutton-apps/src/main/scala/org/bigbluebutton/freeswitch/FsInGwWrapper.scala +++ /dev/null @@ -1,12 +0,0 @@ -package org.bigbluebutton.freeswitch - -import org.bigbluebutton.core.api.IBigBlueButtonInGW - -/** - * Workaround to get away from circular dependency injection. - */ -class FsInGwWrapper(inGW: IBigBlueButtonInGW, - fsConfService: FreeswitchConferenceService) { - - fsConfService.setIBigBlueButtonInGW(inGW) -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-chat.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-chat.xml deleted file mode 100755 index 5bad0a61a3..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-chat.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-layout.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-layout.xml deleted file mode 100755 index 5c7a8fa45b..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-layout.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-lock.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-lock.xml deleted file mode 100644 index 058168210c..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-lock.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-poll.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-poll.xml deleted file mode 100755 index d0c7905e28..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-poll.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-presentation.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-presentation.xml deleted file mode 100755 index e5d21e2a9f..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-presentation.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-users.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-users.xml deleted file mode 100755 index 8bb992a5ac..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-users.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-whiteboard.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-whiteboard.xml deleted file mode 100755 index 47ba0c9bb7..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-app-whiteboard.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-messaging.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-messaging.xml deleted file mode 100755 index fa92bcfa6a..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-messaging.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-pool.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-pool.xml index 4c20c42638..ba2ae3e2a0 100755 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-pool.xml +++ b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-pool.xml @@ -35,7 +35,7 @@ with BigBlueButton; if not, see . - + diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-recorder.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-recorder.xml deleted file mode 100755 index 013b01ae58..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-redis-recorder.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml deleted file mode 100755 index ef6a1a7173..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-app.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-freeswitch.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-freeswitch.xml deleted file mode 100755 index 4f471fc51b..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-voice-freeswitch.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/configgy-logger.conf b/bigbluebutton-apps/src/main/webapp/WEB-INF/configgy-logger.conf deleted file mode 100755 index 53fcebf01d..0000000000 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/configgy-logger.conf +++ /dev/null @@ -1,21 +0,0 @@ -log { - filename = "/usr/share/red5/log/bigbluebutton-scala.log" - roll = "daily" - level = "info" - use_full_package_names = on - - silence_net_sf_cache { - node = "net.sf.ehcache" - level = "error" - } - - silence_sun_rmi { - node = "sun.rmi" - level = "error" - } - - silence_org_apache { - node = "org.apache" - level = "error" - } -} \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/red5-web.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/red5-web.xml index 1ce5ec0d27..f27408d0fe 100755 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/red5-web.xml +++ b/bigbluebutton-apps/src/main/webapp/WEB-INF/red5-web.xml @@ -48,135 +48,55 @@ with BigBlueButton; if not, see . - + - - - - - - - - - - - - - + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -184,16 +104,5 @@ with BigBlueButton; if not, see . - - - - - - - - - - -