From 47f012f08f37439f6925ac907e409f9229739edc Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Fri, 21 Jul 2017 14:15:51 -0700 Subject: [PATCH] - start fixing breakout rooms --- .../bigbluebutton/core/api/InMessages.scala | 42 ++++++++++++++- .../core/apps/breakout/BreakoutApp2x.scala | 5 +- .../breakout/BreakoutRoomCreatedMsgHdlr.scala | 5 +- ...=> BreakoutRoomEndedInternalMsgHdlr.scala} | 43 ++++++++------- .../BreakoutRoomUsersUpdateMsgHdlr.scala | 13 ++--- .../breakout/EndAllBreakoutRoomsMsgHdlr.scala | 24 +++------ .../EndBreakoutRoomInternalMsgHdlr.scala | 19 +++++++ .../SendBreakoutUsersUpdateMsgHdlr.scala | 15 +++--- .../core/domain/MeetingState2x.scala | 1 + .../senders/ReceivedJsonMsgHandlerActor.scala | 54 ++----------------- .../core/running/MeetingActor.scala | 32 +++++------ .../core/running/MeetingActorAudit.scala | 19 ++++--- .../SendTimeRemainingUpdateHdlr.scala | 4 +- .../common2/msgs/BreakoutMsgs.scala | 32 ++--------- .../org/bigbluebutton/api/MeetingService.java | 2 - .../api2/bus/ReceivedJsonMsgHdlrActor.scala | 2 - .../api2/meeting/OldMeetingMsgHdlrActor.scala | 5 -- 17 files changed, 149 insertions(+), 168 deletions(-) rename akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/{BreakoutRoomEndedMsgHdlr.scala => BreakoutRoomEndedInternalMsgHdlr.scala} (57%) create mode 100755 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndBreakoutRoomInternalMsgHdlr.scala diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/api/InMessages.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/api/InMessages.scala index 6a95777e0c..6a9d7adb9d 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/api/InMessages.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/api/InMessages.scala @@ -22,11 +22,51 @@ case class KeepAliveMessage(aliveID: String) extends InMessage ///////////////////////////////////////////////////////////////////////////// case class MonitorNumberOfUsersInternalMsg(meetingID: String) extends InMessage -case class SendTimeRemainingUpdate(meetingId: String) extends InMessage + +/** + * Audit message sent to meeting to trigger updating clients of meeting time remaining. + * @param meetingId + */ +case class SendTimeRemainingAuditInternalMsg(meetingId: String) extends InMessage + case class ExtendMeetingDuration(meetingId: String, userId: String) extends InMessage case class DestroyMeetingInternalMsg(meetingId: String) extends InMessage + +/** + * Sent by breakout room to parent meeting the breakout had ended. + * @param meetingId + */ case class BreakoutRoomEndedInternalMsg(meetingId: String) extends InMessage +/** + * Sent by breakout room to parent meeting that breakout room has been created. + * @param parentId + * @param breakoutId + */ +case class BreakoutRoomCreatedInternalMsg(parentId: String, breakoutId: String) extends InMessage + +/** + * Audit message to trigger breakout room to update parent meeting of list of users. + * @param parentId + * @param breakoutId + */ +case class SendBreakoutUsersAuditInternalMsg(parentId: String, breakoutId: String) extends InMessage + +/** + * Send by breakout room to parent meeting with list of users in breakout room. + * @param parentId + * @param breakoutId + * @param users + */ +case class BreakoutRoomUsersUpdateInternalMsg(parentId: String, breakoutId: String, users: Vector[BreakoutUserVO]) extends InMessage + +/** + * Sent by parent meeting to breakout room to end breakout room. + * @param parentId + * @param breakoutId + */ +case class EndBreakoutRoomInternalMsg(parentId: String, breakoutId: String) extends InMessage + ////////////////////////////////////////////////////////////////////////////// // Meeting ///////////////////////////////////////////////////////////////////////////// diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutApp2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutApp2x.scala index 1462291de2..b91230ec39 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutApp2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutApp2x.scala @@ -8,14 +8,15 @@ import scala.collection.mutable import org.apache.commons.codec.digest.DigestUtils trait BreakoutApp2x extends BreakoutRoomCreatedMsgHdlr - with BreakoutRoomEndedMsgHdlr with BreakoutRoomsListMsgHdlr with BreakoutRoomUsersUpdateMsgHdlr with CreateBreakoutRoomsCmdMsgHdlr with EndAllBreakoutRoomsMsgHdlr with RequestBreakoutJoinURLReqMsgHdlr with SendBreakoutUsersUpdateMsgHdlr - with TransferUserToMeetingRequestHdlr { + with TransferUserToMeetingRequestHdlr + with EndBreakoutRoomInternalMsgHdlr + with BreakoutRoomEndedInternalMsgHdlr { this: MeetingActor => diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomCreatedMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomCreatedMsgHdlr.scala index 0929670cb6..b0ccd5d1d2 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomCreatedMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomCreatedMsgHdlr.scala @@ -3,6 +3,7 @@ package org.bigbluebutton.core.apps.breakout import org.bigbluebutton.SystemConfiguration import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.OutMessageGateway +import org.bigbluebutton.core.api.BreakoutRoomCreatedInternalMsg import org.bigbluebutton.core.models.{ BreakoutRooms, Users2x } import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting, MeetingActor } @@ -12,10 +13,10 @@ trait BreakoutRoomCreatedMsgHdlr extends SystemConfiguration { val liveMeeting: LiveMeeting val outGW: OutMessageGateway - def handleBreakoutRoomCreatedMsg(msg: BreakoutRoomCreatedMsg): Unit = { + def handleBreakoutRoomCreatedInternalMsg(msg: BreakoutRoomCreatedInternalMsg): Unit = { liveMeeting.breakoutRooms.pendingRoomsNumber -= 1 - val room = BreakoutRooms.getBreakoutRoom(liveMeeting.breakoutRooms, msg.body.breakoutRoomId) + val room = BreakoutRooms.getBreakoutRoom(liveMeeting.breakoutRooms, msg.breakoutId) room foreach { room => sendBreakoutRoomStarted(room.parentRoomId, room.name, room.externalMeetingId, room.id, room.sequence, room.voiceConfId) } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomEndedMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomEndedInternalMsgHdlr.scala similarity index 57% rename from akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomEndedMsgHdlr.scala rename to akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomEndedInternalMsgHdlr.scala index 5c30b26815..4dc99e1115 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomEndedMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomEndedInternalMsgHdlr.scala @@ -1,22 +1,21 @@ -package org.bigbluebutton.core.apps.breakout - -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.OutMessageGateway -import org.bigbluebutton.core.models.BreakoutRooms -import org.bigbluebutton.core.running.MeetingActor -import org.bigbluebutton.core2.message.senders.MsgBuilder - -trait BreakoutRoomEndedMsgHdlr { - this: MeetingActor => - - val outGW: OutMessageGateway - - def handleBreakoutRoomEndedMsg(msg: BreakoutRoomEndedMsg): Unit = { - - // send out BreakoutRoomEndedEvtMsg to inform clients the breakout has ended - outGW.send(MsgBuilder.buildBreakoutRoomEndedEvtMsg(liveMeeting.props.meetingProp.intId, msg.header.userId, - msg.body.breakoutRoomId)) - - BreakoutRooms.removeRoom(liveMeeting.breakoutRooms, msg.body.breakoutRoomId) - } -} +package org.bigbluebutton.core.apps.breakout + +import org.bigbluebutton.core.OutMessageGateway +import org.bigbluebutton.core.api.BreakoutRoomEndedInternalMsg +import org.bigbluebutton.core.models.BreakoutRooms +import org.bigbluebutton.core.running.MeetingActor +import org.bigbluebutton.core2.message.senders.MsgBuilder + +trait BreakoutRoomEndedInternalMsgHdlr { + this: MeetingActor => + + val outGW: OutMessageGateway + + def handleBreakoutRoomEndedInternalMsg(msg: BreakoutRoomEndedInternalMsg): Unit = { + // send out BreakoutRoomEndedEvtMsg to inform clients the breakout has ended + outGW.send(MsgBuilder.buildBreakoutRoomEndedEvtMsg(liveMeeting.props.meetingProp.intId, "not-used", + msg.meetingId)) + + BreakoutRooms.removeRoom(liveMeeting.breakoutRooms, msg.meetingId) + } +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomUsersUpdateMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomUsersUpdateMsgHdlr.scala index 7f143f2cc0..3ca4739907 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomUsersUpdateMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomUsersUpdateMsgHdlr.scala @@ -2,6 +2,7 @@ package org.bigbluebutton.core.apps.breakout import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.OutMessageGateway +import org.bigbluebutton.core.api.BreakoutRoomUsersUpdateInternalMsg import org.bigbluebutton.core.models.BreakoutRooms import org.bigbluebutton.core.running.MeetingActor @@ -10,16 +11,16 @@ trait BreakoutRoomUsersUpdateMsgHdlr { val outGW: OutMessageGateway - def handleBreakoutRoomUsersUpdateMsg(msg: BreakoutRoomUsersUpdateMsg): Unit = { + def handleBreakoutRoomUsersUpdateInternalMsg(msg: BreakoutRoomUsersUpdateInternalMsg): Unit = { - def broadcastEvent(msg: BreakoutRoomUsersUpdateMsg): Unit = { - BreakoutRooms.updateBreakoutUsers(liveMeeting.breakoutRooms, msg.body.breakoutMeetingId, msg.body.users) foreach { room => + def broadcastEvent(msg: BreakoutRoomUsersUpdateInternalMsg): Unit = { + BreakoutRooms.updateBreakoutUsers(liveMeeting.breakoutRooms, msg.breakoutId, msg.users) foreach { room => - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, props.meetingProp.intId, msg.header.userId) + val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, props.meetingProp.intId, "not-used") val envelope = BbbCoreEnvelope(UpdateBreakoutUsersEvtMsg.NAME, routing) - val header = BbbClientMsgHeader(UpdateBreakoutUsersEvtMsg.NAME, props.meetingProp.intId, msg.header.userId) + val header = BbbClientMsgHeader(UpdateBreakoutUsersEvtMsg.NAME, props.meetingProp.intId, "not-used") - val body = UpdateBreakoutUsersEvtMsgBody(props.meetingProp.intId, msg.body.breakoutMeetingId, room.users) + val body = UpdateBreakoutUsersEvtMsgBody(props.meetingProp.intId, msg.breakoutId, room.users) val event = UpdateBreakoutUsersEvtMsg(header, body) val msgEvent = BbbCommonEnvCoreMsg(envelope, event) outGW.send(msgEvent) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndAllBreakoutRoomsMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndAllBreakoutRoomsMsgHdlr.scala index 88251f247a..3a61e4adc6 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndAllBreakoutRoomsMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndAllBreakoutRoomsMsgHdlr.scala @@ -2,6 +2,8 @@ package org.bigbluebutton.core.apps.breakout import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.OutMessageGateway +import org.bigbluebutton.core.api.EndBreakoutRoomInternalMsg +import org.bigbluebutton.core.bus.BigBlueButtonEvent import org.bigbluebutton.core.models.BreakoutRooms import org.bigbluebutton.core.running.MeetingActor @@ -11,23 +13,11 @@ trait EndAllBreakoutRoomsMsgHdlr { val outGW: OutMessageGateway def handleEndAllBreakoutRoomsMsg(msg: EndAllBreakoutRoomsMsg): Unit = { - - def broadcastEvent(msg: EndAllBreakoutRoomsMsg): Unit = { - - log.info("EndAllBreakoutRooms event received for meetingId={}", props.meetingProp.intId) - - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, props.meetingProp.intId, msg.header.userId) - val envelope = BbbCoreEnvelope(EndBreakoutRoomEvtMsg.NAME, routing) - val header = BbbClientMsgHeader(EndBreakoutRoomEvtMsg.NAME, props.meetingProp.intId, msg.header.userId) - - BreakoutRooms.getRooms(liveMeeting.breakoutRooms).foreach { room => - val body = EndBreakoutRoomEvtMsgBody(room.id) - val event = EndBreakoutRoomEvtMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - outGW.send(msgEvent) - } + BreakoutRooms.getRooms(liveMeeting.breakoutRooms).foreach { room => + eventBus.publish(BigBlueButtonEvent( + room.id, + EndBreakoutRoomInternalMsg(props.breakoutProps.parentId, room.id) + )) } - - broadcastEvent(msg) } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndBreakoutRoomInternalMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndBreakoutRoomInternalMsgHdlr.scala new file mode 100755 index 0000000000..fa058a3264 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndBreakoutRoomInternalMsgHdlr.scala @@ -0,0 +1,19 @@ +package org.bigbluebutton.core.apps.breakout + +import org.bigbluebutton.core.OutMessageGateway +import org.bigbluebutton.core.api.EndBreakoutRoomInternalMsg +import org.bigbluebutton.core.bus.IncomingEventBus +import org.bigbluebutton.core.domain.MeetingEndReason +import org.bigbluebutton.core.running.{ BaseMeetingActor, HandlerHelpers, LiveMeeting } + +trait EndBreakoutRoomInternalMsgHdlr extends HandlerHelpers { + this: BaseMeetingActor => + + val liveMeeting: LiveMeeting + val outGW: OutMessageGateway + val eventBus: IncomingEventBus + + def handleEndBreakoutRoomInternalMsg(msg: EndBreakoutRoomInternalMsg): Unit = { + sendEndMeetingDueToExpiry(MeetingEndReason.ENDED_BY_PARENT, eventBus, outGW, liveMeeting) + } +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/SendBreakoutUsersUpdateMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/SendBreakoutUsersUpdateMsgHdlr.scala index c19f053cb6..e9c7b0f79c 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/SendBreakoutUsersUpdateMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/SendBreakoutUsersUpdateMsgHdlr.scala @@ -1,7 +1,9 @@ package org.bigbluebutton.core.apps.breakout -import org.bigbluebutton.common2.msgs.{ BreakoutUserVO, SendBreakoutUsersUpdateMsg } +import org.bigbluebutton.common2.msgs.BreakoutUserVO import org.bigbluebutton.core.OutMessageGateway +import org.bigbluebutton.core.api.{ BreakoutRoomUsersUpdateInternalMsg, SendBreakoutUsersAuditInternalMsg } +import org.bigbluebutton.core.bus.BigBlueButtonEvent import org.bigbluebutton.core.models.Users2x import org.bigbluebutton.core.running.MeetingActor @@ -10,13 +12,14 @@ trait SendBreakoutUsersUpdateMsgHdlr { val outGW: OutMessageGateway - def handleSendBreakoutUsersUpdateMsg(msg: SendBreakoutUsersUpdateMsg): Unit = { + def handleSendBreakoutUsersUpdateInternalMsg(msg: SendBreakoutUsersAuditInternalMsg): Unit = { val users = Users2x.findAll(liveMeeting.users2x) val breakoutUsers = users map { u => new BreakoutUserVO(u.extId, u.name) } - /** TODO Need to figure out how to do this in a 2.0 way */ - log.error("**** SendBreakoutUsersUpdateMsgHdlr isn't finished and needs a new part *****") - //eventBus.publish(BigBlueButtonEvent(props.breakoutProps.parentId, - // new BreakoutRoomUsersUpdate(props.breakoutProps.parentId, props.meetingProp.intId, breakoutUsers))) + + eventBus.publish(BigBlueButtonEvent( + props.breakoutProps.parentId, + new BreakoutRoomUsersUpdateInternalMsg(props.breakoutProps.parentId, props.meetingProp.intId, breakoutUsers) + )) } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala index bb880efc73..3d8e3c5eb8 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala @@ -16,4 +16,5 @@ object MeetingEndReason { val ENDED_WHEN_LAST_USER_LEFT = "ENDED_WHEN_LAST_USER_LEFT" val ENDED_AFTER_USER_LOGGED_OUT = "ENDED_AFTER_USER_LOGGED_OUT" val ENDED_AFTER_EXCEEDING_DURATION = "ENDED_AFTER_USER_LOGGED_OUT" + val ENDED_BY_PARENT = "ENDED_BY_PARENT" } \ No newline at end of file diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala index 2d7021cdff..2ef6d19c05 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala @@ -130,59 +130,15 @@ class ReceivedJsonMsgHandlerActor( // Breakout rooms case BreakoutRoomsListMsg.NAME => - for { - m <- deserialize[BreakoutRoomsListMsg](jsonNode) - } yield { - send(m.header.meetingId, envelope, m) - } + routeGenericMsg[BreakoutRoomsListMsg](envelope, jsonNode) case CreateBreakoutRoomsCmdMsg.NAME => - for { - m <- deserialize[CreateBreakoutRoomsCmdMsg](jsonNode) - } yield { - send(m.header.meetingId, envelope, m) - } + routeGenericMsg[CreateBreakoutRoomsCmdMsg](envelope, jsonNode) case RequestBreakoutJoinURLReqMsg.NAME => - for { - m <- deserialize[RequestBreakoutJoinURLReqMsg](jsonNode) - } yield { - send(m.header.meetingId, envelope, m) - } - case BreakoutRoomCreatedMsg.NAME => - for { - m <- deserialize[BreakoutRoomCreatedMsg](jsonNode) - } yield { - send(m.header.meetingId, envelope, m) - } - case BreakoutRoomUsersUpdateMsg.NAME => - for { - m <- deserialize[BreakoutRoomUsersUpdateMsg](jsonNode) - } yield { - send(m.header.meetingId, envelope, m) - } - case SendBreakoutUsersUpdateMsg.NAME => - for { - m <- deserialize[SendBreakoutUsersUpdateMsg](jsonNode) - } yield { - send(m.header.meetingId, envelope, m) - } + routeGenericMsg[RequestBreakoutJoinURLReqMsg](envelope, jsonNode) case EndAllBreakoutRoomsMsg.NAME => - for { - m <- deserialize[EndAllBreakoutRoomsMsg](jsonNode) - } yield { - send(m.header.meetingId, envelope, m) - } - case BreakoutRoomEndedMsg.NAME => - for { - m <- deserialize[BreakoutRoomEndedMsg](jsonNode) - } yield { - send(m.header.meetingId, envelope, m) - } + routeGenericMsg[EndAllBreakoutRoomsMsg](envelope, jsonNode) case TransferUserToMeetingRequestMsg.NAME => - for { - m <- deserialize[TransferUserToMeetingRequestMsg](jsonNode) - } yield { - send(m.header.meetingId, envelope, m) - } + routeGenericMsg[TransferUserToMeetingRequestMsg](envelope, jsonNode) // Layout case GetCurrentLayoutReqMsg.NAME => diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index 83b347f924..e8347faca2 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -133,30 +133,35 @@ class MeetingActor( def receive = { //============================= // 2x messages - case msg: BbbCommonEnvCoreMsg => handleBbbCommonEnvCoreMsg(msg) + case msg: BbbCommonEnvCoreMsg => handleBbbCommonEnvCoreMsg(msg) // Handling RegisterUserReqMsg as it is forwarded from BBBActor and // its type is not BbbCommonEnvCoreMsg - case m: RegisterUserReqMsg => usersApp.handleRegisterUserReqMsg(m) - case m: GetAllMeetingsReqMsg => handleGetAllMeetingsReqMsg(m) + case m: RegisterUserReqMsg => usersApp.handleRegisterUserReqMsg(m) + case m: GetAllMeetingsReqMsg => handleGetAllMeetingsReqMsg(m) // Meeting - case m: DestroyMeetingSysCmdMsg => handleDestroyMeetingSysCmdMsg(m) + case m: DestroyMeetingSysCmdMsg => handleDestroyMeetingSysCmdMsg(m) //====================================== //======================================= - // old messages - case msg: MonitorNumberOfUsersInternalMsg => handleMonitorNumberOfUsers(msg) + // internal messages + case msg: MonitorNumberOfUsersInternalMsg => handleMonitorNumberOfUsers(msg) - case msg: AllowUserToShareDesktop => handleAllowUserToShareDesktop(msg) - case msg: ExtendMeetingDuration => handleExtendMeetingDuration(msg) - case msg: SendTimeRemainingUpdate => state = handleSendTimeRemainingUpdate(msg, state) + case msg: AllowUserToShareDesktop => handleAllowUserToShareDesktop(msg) + case msg: ExtendMeetingDuration => handleExtendMeetingDuration(msg) + case msg: SendTimeRemainingAuditInternalMsg => state = handleSendTimeRemainingUpdate(msg, state) + case msg: BreakoutRoomCreatedInternalMsg => handleBreakoutRoomCreatedInternalMsg(msg) + case msg: SendBreakoutUsersAuditInternalMsg => handleSendBreakoutUsersUpdateInternalMsg(msg) + case msg: BreakoutRoomUsersUpdateInternalMsg => handleBreakoutRoomUsersUpdateInternalMsg(msg) + case msg: EndBreakoutRoomInternalMsg => handleEndBreakoutRoomInternalMsg(msg) + case msg: BreakoutRoomEndedInternalMsg => handleBreakoutRoomEndedInternalMsg(msg) // Screenshare - case msg: DeskShareGetDeskShareInfoRequest => handleDeskShareGetDeskShareInfoRequest(msg) + case msg: DeskShareGetDeskShareInfoRequest => handleDeskShareGetDeskShareInfoRequest(msg) - case _ => // do nothing + case _ => // do nothing } private def handleBbbCommonEnvCoreMsg(msg: BbbCommonEnvCoreMsg): Unit = { @@ -205,10 +210,7 @@ class MeetingActor( case m: CreateBreakoutRoomsCmdMsg => handleCreateBreakoutRoomsCmdMsg(m) case m: EndAllBreakoutRoomsMsg => handleEndAllBreakoutRoomsMsg(m) case m: RequestBreakoutJoinURLReqMsg => handleRequestBreakoutJoinURLReqMsg(m) - case m: BreakoutRoomCreatedMsg => handleBreakoutRoomCreatedMsg(m) - case m: BreakoutRoomEndedMsg => handleBreakoutRoomEndedMsg(m) - case m: BreakoutRoomUsersUpdateMsg => handleBreakoutRoomUsersUpdateMsg(m) - case m: SendBreakoutUsersUpdateMsg => handleSendBreakoutUsersUpdateMsg(m) + case m: TransferUserToMeetingRequestMsg => handleTransferUserToMeetingRequestMsg(m) // Voice diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActorAudit.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActorAudit.scala index 729aabe2aa..a82f6a07ce 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActorAudit.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActorAudit.scala @@ -55,12 +55,11 @@ class MeetingActorAudit( if (props.meetingProp.isBreakout) { // This is a breakout room. Inform our parent meeting that we have been successfully created. - /**TODO Need to add a 2.0 notification somehow */ - log.error("****** MeetingActorInternal still needs to be fixed with 2.0 breakout messages ******") - /*eventBus.publish(BigBlueButtonEvent( + eventBus.publish(BigBlueButtonEvent( props.breakoutProps.parentId, - BreakoutRoomCreated(props.breakoutProps.parentId, props.meetingProp.intId))) - */ + BreakoutRoomCreatedInternalMsg(props.breakoutProps.parentId, props.meetingProp.intId) + )) + } def receive = { @@ -75,15 +74,15 @@ class MeetingActorAudit( eventBus.publish(BigBlueButtonEvent(props.meetingProp.intId, MonitorNumberOfUsersInternalMsg(props.meetingProp.intId))) // Trigger updating users of time remaining on meeting. - eventBus.publish(BigBlueButtonEvent(props.meetingProp.intId, SendTimeRemainingUpdate(props.meetingProp.intId))) + eventBus.publish(BigBlueButtonEvent(props.meetingProp.intId, SendTimeRemainingAuditInternalMsg(props.meetingProp.intId))) if (props.meetingProp.isBreakout) { - /**TODO Need to add a 2.0 notification somehow */ - log.error("******* MeetingActorInternal still needs to be fixed with 2.0 breakout messages *******") // This is a breakout room. Update the main meeting with list of users in this breakout room. - //eventBus.publish(BigBlueButtonEvent(props.meetingProp.intId, SendBreakoutUsersUpdate(props.meetingProp.intId))) + eventBus.publish(BigBlueButtonEvent( + props.meetingProp.intId, + SendBreakoutUsersAuditInternalMsg(props.breakoutProps.parentId, props.meetingProp.intId) + )) } - } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/SendTimeRemainingUpdateHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/SendTimeRemainingUpdateHdlr.scala index ae5501e70f..53001057fa 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/SendTimeRemainingUpdateHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/SendTimeRemainingUpdateHdlr.scala @@ -2,7 +2,7 @@ package org.bigbluebutton.core2.message.handlers import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.OutMessageGateway -import org.bigbluebutton.core.api.SendTimeRemainingUpdate +import org.bigbluebutton.core.api.SendTimeRemainingAuditInternalMsg import org.bigbluebutton.core.domain.{ MeetingExpiryTracker, MeetingState2x } import org.bigbluebutton.core.models.BreakoutRooms import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting } @@ -14,7 +14,7 @@ trait SendTimeRemainingUpdateHdlr { val liveMeeting: LiveMeeting val outGW: OutMessageGateway - def handleSendTimeRemainingUpdate(msg: SendTimeRemainingUpdate, state: MeetingState2x): MeetingState2x = { + def handleSendTimeRemainingUpdate(msg: SendTimeRemainingAuditInternalMsg, state: MeetingState2x): MeetingState2x = { if (liveMeeting.props.durationProps.duration > 0) { val endMeetingTime = MeetingExpiryTracker.endMeetingTime(state) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/BreakoutMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/BreakoutMsgs.scala index 3f2d08695f..846488e077 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/BreakoutMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/BreakoutMsgs.scala @@ -1,18 +1,10 @@ package org.bigbluebutton.common2.msgs - object BreakoutRoomCreatedMsg { val NAME = "BreakoutRoomCreatedMsg" } - case class BreakoutRoomCreatedMsg(header: BbbClientMsgHeader, body: BreakoutRoomCreatedMsgBody) extends BbbCoreMsg - case class BreakoutRoomCreatedMsgBody(meetingId: String, breakoutRoomId: String) object BreakoutRoomEndedEvtMsg { val NAME = "BreakoutRoomEndedEvtMsg" } case class BreakoutRoomEndedEvtMsg(header: BbbClientMsgHeader, body: BreakoutRoomEndedEvtMsgBody) extends BbbCoreMsg case class BreakoutRoomEndedEvtMsgBody(parentMeetingId: String, meetingId: String) - // Sent by breakout actor to tell meeting actor that breakout room has been ended - object BreakoutRoomEndedMsg { val NAME = "BreakoutRoomEndedMsg" } - case class BreakoutRoomEndedMsg(header: BbbClientMsgHeader, body: BreakoutRoomEndedMsgBody) extends BbbCoreMsg - case class BreakoutRoomEndedMsgBody(meetingId: String, breakoutRoomId: String) - object BreakoutRoomJoinURLEvtMsg { val NAME = "BreakoutRoomJoinURLEvtMsg" } case class BreakoutRoomJoinURLEvtMsg(header: BbbClientMsgHeader, body: BreakoutRoomJoinURLEvtMsgBody) extends BbbCoreMsg case class BreakoutRoomJoinURLEvtMsgBody(parentMeetingId: String, breakoutMeetingId: String, @@ -25,7 +17,7 @@ package org.bigbluebutton.common2.msgs case class BreakoutRoomInfo(name: String, externalMeetingId: String, meetingId: String, sequence: Int) object BreakoutRoomsListMsg { val NAME = "BreakoutRoomsListMsg" } - case class BreakoutRoomsListMsg(header: BbbClientMsgHeader, body: BreakoutRoomsListMsgBody) extends BbbCoreMsg + case class BreakoutRoomsListMsg(header: BbbClientMsgHeader, body: BreakoutRoomsListMsgBody) extends StandardMsg case class BreakoutRoomsListMsgBody(meetingId: String) /** @@ -40,12 +32,6 @@ package org.bigbluebutton.common2.msgs body: BreakoutRoomsTimeRemainingUpdateEvtMsgBody) extends BbbCoreMsg case class BreakoutRoomsTimeRemainingUpdateEvtMsgBody(timeRemaining: Long) - - // Sent by breakout actor to tell meeting actor the list of users in the breakout room. - object BreakoutRoomUsersUpdateMsg { val NAME = "BreakoutRoomUsersUpdateMsg" } - case class BreakoutRoomUsersUpdateMsg(header: BbbClientMsgHeader, body: BreakoutRoomUsersUpdateMsgBody) extends BbbCoreMsg - case class BreakoutRoomUsersUpdateMsgBody(meetingId: String, breakoutMeetingId: String, users: Vector[BreakoutUserVO]) - /** * Sent to bbb-web to create breakout rooms. */ @@ -61,24 +47,20 @@ package org.bigbluebutton.common2.msgs * Sent by client to request to create breakout rooms. */ object CreateBreakoutRoomsCmdMsg { val NAME = "CreateBreakoutRoomsCmdMsg" } - case class CreateBreakoutRoomsCmdMsg(header: BbbClientMsgHeader, body: CreateBreakoutRoomsCmdMsgBody) extends BbbCoreMsg + case class CreateBreakoutRoomsCmdMsg(header: BbbClientMsgHeader, body: CreateBreakoutRoomsCmdMsgBody) extends StandardMsg case class CreateBreakoutRoomsCmdMsgBody(meetingId: String, durationInMinutes: Int, record: Boolean, rooms: Vector[BreakoutRoomMsgBody]) case class BreakoutRoomMsgBody(name: String, sequence: Int, users: Vector[String]) // Sent by user to request ending all the breakout rooms object EndAllBreakoutRoomsMsg { val NAME = "EndAllBreakoutRoomsMsg" } - case class EndAllBreakoutRoomsMsg(header: BbbClientMsgHeader, body: EndAllBreakoutRoomsMsgBody) extends BbbCoreMsg + case class EndAllBreakoutRoomsMsg(header: BbbClientMsgHeader, body: EndAllBreakoutRoomsMsgBody) extends StandardMsg case class EndAllBreakoutRoomsMsgBody(meetingId: String) - object EndBreakoutRoomEvtMsg { val NAME = "EndBreakoutRoomEvtMsg" } - case class EndBreakoutRoomEvtMsg(header: BbbClientMsgHeader, body: EndBreakoutRoomEvtMsgBody) extends BbbCoreMsg - case class EndBreakoutRoomEvtMsgBody(breakoutMeetingId: String) - /** * Sent by client to request a join URL for the breakout room. */ object RequestBreakoutJoinURLReqMsg { val NAME = "RequestBreakoutJoinURLReqMsg" } - case class RequestBreakoutJoinURLReqMsg(header: BbbClientMsgHeader, body: RequestBreakoutJoinURLReqMsgBody) extends BbbCoreMsg + case class RequestBreakoutJoinURLReqMsg(header: BbbClientMsgHeader, body: RequestBreakoutJoinURLReqMsgBody) extends StandardMsg case class RequestBreakoutJoinURLReqMsgBody(meetingId: String, breakoutMeetingId: String, userId: String) /** @@ -89,10 +71,6 @@ case class RequestBreakoutJoinURLRespMsg(header: BbbClientMsgHeader, body: Reque case class RequestBreakoutJoinURLRespMsgBody(parentMeetingId: String, breakoutMeetingId: String, userId: String, redirectJoinURL: String, noRedirectJoinURL: String) - // Send by internal actor to tell the breakout actor to send it's list of users to the main meeting actor. - object SendBreakoutUsersUpdateMsg { val NAME = "SendBreakoutUsersUpdateMsg" } - case class SendBreakoutUsersUpdateMsg(header: BbbClientMsgHeader, body: SendBreakoutUsersUpdateMsgBody) extends BbbCoreMsg - case class SendBreakoutUsersUpdateMsgBody(meetingId: String) object TransferUserToMeetingEvtMsg { val NAME = "TransferUserToMeetingEvtMsg" } case class TransferUserToMeetingEvtMsg(header: BbbClientMsgHeader, body: TransferUserToMeetingEvtMsgBody) extends BbbCoreMsg @@ -100,7 +78,7 @@ case class RequestBreakoutJoinURLRespMsgBody(parentMeetingId: String, breakoutMe // Sent by user actor to ask for voice conference transfer object TransferUserToMeetingRequestMsg { val NAME = "TransferUserToMeetingRequestMsg" } - case class TransferUserToMeetingRequestMsg(header: BbbClientMsgHeader, body: TransferUserToMeetingRequestMsgBody) extends BbbCoreMsg + case class TransferUserToMeetingRequestMsg(header: BbbClientMsgHeader, body: TransferUserToMeetingRequestMsgBody) extends StandardMsg case class TransferUserToMeetingRequestMsgBody(meetingId: String, targetMeetingId: String, userId: String) object UpdateBreakoutUsersEvtMsg { val NAME = "UpdateBreakoutUsersEvtMsg" } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java index b1c914279c..11e897b932 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java @@ -884,8 +884,6 @@ public class MeetingService implements MessageListener { processStunTurnInfoRequested((StunTurnInfoRequested) message); } else if (message instanceof CreateBreakoutRoom) { processCreateBreakoutRoom((CreateBreakoutRoom) message); - } else if (message instanceof EndBreakoutRoom) { - processEndBreakoutRoom((EndBreakoutRoom) message); } } }; diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/bus/ReceivedJsonMsgHdlrActor.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/bus/ReceivedJsonMsgHdlrActor.scala index a792a09044..0a265fc9c8 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/bus/ReceivedJsonMsgHdlrActor.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/bus/ReceivedJsonMsgHdlrActor.scala @@ -83,8 +83,6 @@ class ReceivedJsonMsgHdlrActor(val msgFromAkkaAppsEventBus: MsgFromAkkaAppsEvent route[UserBroadcastCamStoppedEvtMsg](envelope, jsonNode) case CreateBreakoutRoomSysCmdMsg.NAME => route[CreateBreakoutRoomSysCmdMsg](envelope, jsonNode) - case EndBreakoutRoomEvtMsg.NAME => - route[EndBreakoutRoomEvtMsg](envelope, jsonNode) case _ => diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/OldMeetingMsgHdlrActor.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/OldMeetingMsgHdlrActor.scala index 56d2e698c5..e51d8a4f9d 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/OldMeetingMsgHdlrActor.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/OldMeetingMsgHdlrActor.scala @@ -33,7 +33,6 @@ class OldMeetingMsgHdlrActor(val olgMsgGW: OldMessageReceivedGW) case m: UserBroadcastCamStartedEvtMsg => handleUserBroadcastCamStartedEvtMsg(m) case m: UserBroadcastCamStoppedEvtMsg => handleUserBroadcastCamStoppedEvtMsg(m) case m: CreateBreakoutRoomSysCmdMsg => handleCreateBreakoutRoomSysCmdMsg(m) - case m: EndBreakoutRoomEvtMsg => handleEndBreakoutRoomEvtMsg(m) case _ => log.error("***** Cannot handle " + msg.envelope.name) } } @@ -67,10 +66,6 @@ class OldMeetingMsgHdlrActor(val olgMsgGW: OldMessageReceivedGW) } - def handleEndBreakoutRoomEvtMsg(msg: EndBreakoutRoomEvtMsg): Unit = { - olgMsgGW.handle(new EndBreakoutRoom(msg.body.breakoutMeetingId)) - } - def handlePubSubPongSysRespMsg(msg: PubSubPongSysRespMsg): Unit = { olgMsgGW.handle(new org.bigbluebutton.api.messaging.messages.KeepAliveReply(msg.body.system, msg.body.timestamp)) }