Implemented EndAllBreakoutRooms in akka-bbb-apps

This commit is contained in:
Ghazi Triki 2016-01-12 20:45:35 +01:00
parent 48844648ee
commit 6ad3b315ee
5 changed files with 19 additions and 2 deletions

View File

@ -63,6 +63,9 @@ object JsonMessageDecoder {
case RequestBreakoutJoinURL.NAME => {
msg.payload.convertTo[RequestBreakoutJoinURLInMessage]
}
case EndAllBreakoutRoomsRequest.NAME => {
msg.payload.convertTo[EndAllBreakoutRooms]
}
case _ => throw MessageProcessException("Cannot parse JSON message: [" + msg + "]")
}
}

View File

@ -163,6 +163,7 @@ class MeetingActor(val mProps: MeetingProperties,
case msg: RequestBreakoutJoinURLInMessage => liveMeeting.handleRequestBreakoutJoinURL(msg)
case msg: BreakoutRoomUsersUpdate => liveMeeting.handleBreakoutRoomUsersUpdate(msg)
case msg: SendBreakoutUsersUpdate => liveMeeting.handleSendBreakoutUsersUpdate(msg)
case msg: EndAllBreakoutRooms => liveMeeting.handleEndAllBreakoutRooms(msg)
case msg: ExtendMeetingDuration => liveMeeting.handleExtendMeetingDuration(msg)
case msg: SendTimeRemainingUpdate => liveMeeting.handleSendTimeRemainingUpdate(msg)

View File

@ -5,6 +5,7 @@ import org.bigbluebutton.core.api.BreakoutRoomInPayload
import org.bigbluebutton.core.api.CreateBreakoutRooms
import org.bigbluebutton.core.api.InMessageHeader
import org.bigbluebutton.core.api.RequestBreakoutJoinURLInMessage
import org.bigbluebutton.core.api.EndAllBreakoutRooms
object UserMessagesProtocol extends DefaultJsonProtocol {
/*
@ -30,6 +31,7 @@ object UserMessagesProtocol extends DefaultJsonProtocol {
implicit val breakoutRoomInPayloadFormat = jsonFormat2(BreakoutRoomInPayload)
implicit val createBreakoutRoomsFormat = jsonFormat3(CreateBreakoutRooms)
implicit val requestBreakoutJoinURLInMessageFormat = jsonFormat3(RequestBreakoutJoinURLInMessage)
implicit val endBreakoutRoomsFormat = jsonFormat1(EndAllBreakoutRooms)
implicit val inMsgHeaderFormat = jsonFormat1(InMessageHeader)
implicit val outMsgHeaderFormat = jsonFormat1(OutMsgHeader)
implicit val outMsgEnvelopeHeaderFormat = jsonFormat2(OutMsgEnvelopeHeader)

View File

@ -54,6 +54,8 @@ case class BreakoutRoomUsersUpdate(meetingId: String, breakoutId: String,
users: Vector[BreakoutUser]) extends InMessage
// Send by internal actor to tell the breakout actor to send it's list of users to the main meeting actor.
case class SendBreakoutUsersUpdate(meetingId: String) extends InMessage
// Sent by user to request ending all the breakout rooms
case class EndAllBreakoutRooms(meetingId: String) extends InMessage
////////////////////////////////////////////////////////////////////////////////////
// Lock

View File

@ -56,6 +56,7 @@ trait BreakoutRoomApp extends SystemConfiguration {
}
def handleRequestBreakoutJoinURL(msg: RequestBreakoutJoinURLInMessage) {
log.debug("$$ Received RequestBreakoutJoinURLInMessage: {}", msg.userId)
sendJoinURL(msg.userId, msg.breakoutId)
}
@ -67,7 +68,7 @@ trait BreakoutRoomApp extends SystemConfiguration {
breakoutModel.getAssignedUsers(msg.breakoutRoomId) foreach { users =>
users.foreach { u =>
log.debug("## Sending Join URL for users: {}", u);
log.debug("## Sending Join URL for users: {} for breakout room {}", u, msg.breakoutRoomId);
sendJoinURL(u, msg.breakoutRoomId)
}
}
@ -89,6 +90,14 @@ trait BreakoutRoomApp extends SystemConfiguration {
eventBus.publish(BigBlueButtonEvent(mProps.externalMeetingID,
new BreakoutRoomUsersUpdate(mProps.externalMeetingID, mProps.meetingID, breakoutUsers)))
}
def handleEndAllBreakoutRooms(msg: EndAllBreakoutRooms) {
breakoutModel.getRooms().foreach { room =>
eventBus.publish(BigBlueButtonEvent(room.id,
new EndMeeting(room.id)))
}
}
}
object BreakoutRoomsUtil {