- start handling create meeting
This commit is contained in:
parent
63f26e901b
commit
d9647b8292
@ -1,13 +1,13 @@
|
||||
package org.bigbluebutton.api2.domain
|
||||
|
||||
|
||||
import org.bigbluebutton.api.domain.{Config}
|
||||
case class ConfigProps(defaultConfigToken: String, config: String)
|
||||
|
||||
case class ConfigProps(defaultConfigToken: String, configs: collection.immutable.Map[String, Config])
|
||||
case class DurationProps(duration: Int, createdTime: Long)
|
||||
|
||||
case class DurationProps(duration: Int, createdTime: Long, startTime: Long, endTime: Long)
|
||||
case class MeetingProp(name: String, extId: String, intId: String, isBreakout: Boolean)
|
||||
|
||||
case class MeetingProp(name: String, extId: String, intId: String, parentId: String, sequence: Int, isBreakout: Boolean)
|
||||
case class BreakoutProps(parentId: String, sequence: Int, breakoutRooms: Vector[String])
|
||||
|
||||
case class PasswordProp(moderatorPass: String, viewerPass: String)
|
||||
|
||||
@ -17,7 +17,18 @@ case class WelcomeProp(welcomeMsgTemplate: String, welcomeMsg: String, modOnlyMe
|
||||
|
||||
case class VoiceProp(telVoice: String, webVoice: String, dialNumber: String)
|
||||
|
||||
case class UsersProp(maxUsers: Int, webcamsOnlyForModerator: Boolean, guestPolicy: String, userHasJoined: Boolean)
|
||||
case class UsersProp(maxUsers: Int, webcamsOnlyForModerator: Boolean, guestPolicy: String)
|
||||
|
||||
case class DefaultProps(meetingProp: MeetingProp, durationProps: DurationProps, password: PasswordProp,
|
||||
recordProp: RecordProp, welcomeProp: WelcomeProp, voiceProp: VoiceProp, usersProp: UsersProp)
|
||||
|
||||
|
||||
case class StartEndTimeStatus(startTime: Long, endTime: Long)
|
||||
case class RecordingStatus(isRecording: Boolean)
|
||||
case class GuestPolicyStatus(currentGuestPolicy: String)
|
||||
case class RunningStatus(isRunning: Boolean, isForciblyEnded: Boolean, numUsers: Int)
|
||||
case class MeetingStatus(startEndTimeStatus: StartEndTimeStatus, recordingStatus: RecordingStatus,
|
||||
guestPolicyStatus: GuestPolicyStatus, userHasJoined: Boolean)
|
||||
|
||||
case class Meeting2x(defaultProps: DefaultProps, meetingStatus: MeetingStatus)
|
||||
|
||||
case class Meeting2x(meetingProp: MeetingProp, durationProps: DurationProps, password: PasswordProp,
|
||||
recordProp: RecordProp, welcomeProp: WelcomeProp, voiceProp: VoiceProp, usersProp: UsersProp)
|
||||
|
@ -5,7 +5,7 @@ case class VoiceUser(id: String, callerId: CallerId, status: String, vid: String
|
||||
|
||||
case class User2(intId: String, extId: String, name: String, role: String, avatarURL: String,
|
||||
guest: Boolean, waitingForAcceptance: Boolean, status: Vector[String],
|
||||
streams: Set[String], customData: UserCustomData)
|
||||
streams: Set[String], customData: UserCustomData, voiceUser: VoiceUser, webcamStreams: Vector[String])
|
||||
|
||||
object Users {
|
||||
def findWithId(users: Users, id: String): Option[User2] = {
|
||||
|
@ -2,10 +2,15 @@ package org.bigbluebutton.api2.meeting
|
||||
|
||||
|
||||
object MeetingsManager {
|
||||
|
||||
def findWithId(mgr: MeetingsManager, id: String): Option[RunningMeeting] = {
|
||||
mgr.toVector.find(m => m.meetingId == id)
|
||||
}
|
||||
|
||||
def findMeetingThatStartsWith(mgr: MeetingsManager, id: String): Option[RunningMeeting] = {
|
||||
mgr.toVector.find(m => m.meetingId.startsWith(id))
|
||||
}
|
||||
|
||||
def add(mgr: MeetingsManager, meeting: RunningMeeting): RunningMeeting = {
|
||||
mgr.save(meeting)
|
||||
}
|
||||
|
@ -1,8 +1,11 @@
|
||||
package org.bigbluebutton.api2.meeting
|
||||
|
||||
import akka.actor.{Actor, ActorLogging, Props}
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.bigbluebutton.api.domain.UserSession
|
||||
import org.bigbluebutton.api2.bus.MsgToAkkaAppsEventBus
|
||||
import org.bigbluebutton.api2.domain.DefaultProps
|
||||
import org.bigbluebutton.api2.util.Util2
|
||||
import org.bigbluebutton.common.messages.UserJoinedVoiceMessage
|
||||
|
||||
|
||||
@ -12,7 +15,6 @@ case class CreateBreakoutRoomMsg(meetingId: String, parentMeetingId: String,
|
||||
viewerPassword: String, moderatorPassword: String, duration: Int,
|
||||
sourcePresentationId: String, sourcePresentationSlide: Int,
|
||||
record: Boolean) extends ApiMsg
|
||||
case class CreateMeetingMsg() extends ApiMsg
|
||||
case class EndBreakoutRoomMsg() extends ApiMsg
|
||||
case class KeepAliveReply() extends ApiMsg
|
||||
case class MeetingDestoyedMsg() extends ApiMsg
|
||||
@ -26,7 +28,9 @@ case class RemoveUserSession(token: String)
|
||||
case object PurgeRegisteredUsers
|
||||
case class GetMeetings()
|
||||
case class GetSessions()
|
||||
case class CreateMeeting(m: Meeting)
|
||||
|
||||
case class CreateMeetingMsg(defaultProps: DefaultProps)
|
||||
|
||||
case class GetMeeting(meetingId: String)
|
||||
case class GetMeetingsWithId(meetingId: String)
|
||||
case class GetNotEndedMeetingWithId(meetingId: String)
|
||||
@ -47,11 +51,39 @@ object MeetingsManagerActor {
|
||||
|
||||
class MeetingsManagerActor(msgToAkkaAppsEventBus: MsgToAkkaAppsEventBus) extends Actor with ActorLogging {
|
||||
|
||||
private val manager = new MeetingsManager
|
||||
|
||||
def receive = {
|
||||
case msg: CreateMeetingMsg => handleCreateMeeting(msg)
|
||||
}
|
||||
|
||||
def handleCreateMeeting(msg: CreateMeetingMsg): Unit = {
|
||||
for {
|
||||
mid <- Util2.getFirstPartOfMeetingId(msg.defaultProps.meetingProp.intId)
|
||||
} yield {
|
||||
MeetingsManager.findMeetingThatStartsWith(manager, mid) match {
|
||||
case Some(m) => replyWithDuplicateMeeting()
|
||||
case None => createNewMeeting()
|
||||
sendCreateMeetingRequestToAkkaApps()
|
||||
replyWithCreatedMeeting()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def sendCreateMeetingRequestToAkkaApps(): Unit = {
|
||||
|
||||
}
|
||||
|
||||
def replyWithDuplicateMeeting(): Unit = {
|
||||
|
||||
}
|
||||
|
||||
def createNewMeeting(): Unit = {
|
||||
|
||||
}
|
||||
|
||||
def replyWithCreatedMeeting(): Unit = {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
15
bbb-common-web/src/main/scala/org/bigbluebutton/api2/util/Util2.scala
Executable file
15
bbb-common-web/src/main/scala/org/bigbluebutton/api2/util/Util2.scala
Executable file
@ -0,0 +1,15 @@
|
||||
package org.bigbluebutton.api2.util
|
||||
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
|
||||
|
||||
object Util2 {
|
||||
def getFirstPartOfMeetingId(meetingId: String): Option[String] = {
|
||||
val segments: Array[String] = StringUtils.split(meetingId, "-")
|
||||
if (segments.length == 2) {
|
||||
Some(segments(0))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
@ -23,7 +23,7 @@ class RecordingMetadataReaderHelperTest extends UnitSpec {
|
||||
|
||||
val playback: RecordingMetadataPlayback = mapper.readValue(reader, classOf[RecordingMetadataPlayback])
|
||||
|
||||
println("***** FOOO =" + mapper.writeValueAsString(playback))
|
||||
//println("***** FOOO =" + mapper.writeValueAsString(playback))
|
||||
|
||||
assert(playback.getDuration == 545949)
|
||||
|
||||
@ -44,7 +44,7 @@ class RecordingMetadataReaderHelperTest extends UnitSpec {
|
||||
|
||||
val recMeta: RecordingMetadata = mapper.readValue(reader, classOf[RecordingMetadata])
|
||||
|
||||
println("***** FOOO =" + mapper.writeValueAsString(recMeta))
|
||||
//println("***** FOOO =" + mapper.writeValueAsString(recMeta))
|
||||
|
||||
//assert(recMeta.getPlayback.getDuration == 126376)
|
||||
assert(true)
|
||||
|
@ -31,7 +31,7 @@ class RecordingServiceTest extends UnitSpec {
|
||||
val recordingDir = new File(destDir.getPath() + File.separatorChar + recordingId)
|
||||
|
||||
val publishedDir = new File("target/recording/published")
|
||||
RecordingService.publishRecording(publishedDir, recordingId, recordingDir)
|
||||
RecordingService.publishRecording(publishedDir, recordingId, recordingDir, "presentation")
|
||||
|
||||
assert(true)
|
||||
}
|
||||
@ -50,7 +50,7 @@ class RecordingServiceTest extends UnitSpec {
|
||||
val unpublishedDir = new File("target/recording/unpublished")
|
||||
if (unpublishedDir.exists()) FileUtils.deleteDirectory(unpublishedDir)
|
||||
|
||||
RecordingService.unpublishRecording(unpublishedDir, recordingId, recordingDir)
|
||||
RecordingService.unpublishRecording(unpublishedDir, recordingId, recordingDir, "presentation")
|
||||
|
||||
assert(unpublishedDir.exists())
|
||||
}
|
||||
@ -69,7 +69,7 @@ class RecordingServiceTest extends UnitSpec {
|
||||
val deletedDir = new File("target/recording/deleted")
|
||||
if (deletedDir.exists()) FileUtils.deleteDirectory(deletedDir)
|
||||
|
||||
RecordingService.deleteRecording(deletedDir, recordingId, recordingDir)
|
||||
RecordingService.deleteRecording(deletedDir, recordingId, recordingDir, "presentation")
|
||||
|
||||
assert(deletedDir.exists())
|
||||
}
|
||||
|
@ -37,13 +37,13 @@ class ResponseBuilderTest extends UnitSpec {
|
||||
meeting.addBreakoutRoom("breakout-room-id-2")
|
||||
meeting.addBreakoutRoom("breakout-room-id-3")
|
||||
|
||||
val user: User = new User("uid1", "extuid1", "Richard", "moderator", "/aygwapo")
|
||||
val user: User = new User("uid1", "extuid1", "Richard", "moderator", "/aygwapo", false, false)
|
||||
meeting.userJoined(user)
|
||||
|
||||
val user2: User = new User("uid2", "extuid2", "Richard 2", "moderator", "/aygwapo")
|
||||
val user2: User = new User("uid2", "extuid2", "Richard 2", "moderator", "/aygwapo", false, false)
|
||||
meeting.userJoined(user2)
|
||||
|
||||
val user3: User = new User("uid3", "extuid3", "Richard 3", "moderator", "/aygwapo")
|
||||
val user3: User = new User("uid3", "extuid3", "Richard 3", "moderator", "/aygwapo", false, false)
|
||||
meeting.userJoined(user2)
|
||||
|
||||
val custData = new util.HashMap[String, String]()
|
||||
@ -82,13 +82,13 @@ class ResponseBuilderTest extends UnitSpec {
|
||||
meeting1.addBreakoutRoom("breakout-room-id-2")
|
||||
meeting1.addBreakoutRoom("breakout-room-id-3")
|
||||
|
||||
val userm11: User = new User("uid1", "extuid1", "Richard", "moderator", "/aygwapo")
|
||||
val userm11: User = new User("uid1", "extuid1", "Richard", "moderator", "/aygwapo", false, false)
|
||||
meeting1.userJoined(userm11)
|
||||
|
||||
val userm12: User = new User("uid2", "extuid2", "Richard 2", "moderator", "/aygwapo")
|
||||
val userm12: User = new User("uid2", "extuid2", "Richard 2", "moderator", "/aygwapo", false, false)
|
||||
meeting1.userJoined(userm12)
|
||||
|
||||
val userm13: User = new User("uid3", "extuid3", "Richard 3", "moderator", "/aygwapo")
|
||||
val userm13: User = new User("uid3", "extuid3", "Richard 3", "moderator", "/aygwapo", false, false)
|
||||
meeting1.userJoined(userm13)
|
||||
|
||||
val custDatam1 = new util.HashMap[String, String]()
|
||||
@ -118,13 +118,13 @@ class ResponseBuilderTest extends UnitSpec {
|
||||
meeting2.addBreakoutRoom("breakout-room-id-2")
|
||||
meeting2.addBreakoutRoom("breakout-room-id-3")
|
||||
|
||||
val userm21: User = new User("uid1", "extuid1", "Richard", "moderator", "/aygwapo")
|
||||
val userm21: User = new User("uid1", "extuid1", "Richard", "moderator", "/aygwapo", false, false)
|
||||
meeting2.userJoined(userm21)
|
||||
|
||||
val userm22: User = new User("uid2", "extuid2", "Richard 2", "moderator", "/aygwapo")
|
||||
val userm22: User = new User("uid2", "extuid2", "Richard 2", "moderator", "/aygwapo", false, false)
|
||||
meeting2.userJoined(userm22)
|
||||
|
||||
val userm23: User = new User("uid3", "extuid3", "Richard 3", "moderator", "/aygwapo")
|
||||
val userm23: User = new User("uid3", "extuid3", "Richard 3", "moderator", "/aygwapo", false, false)
|
||||
meeting2.userJoined(userm23)
|
||||
|
||||
val custDatam2 = new util.HashMap[String, String]()
|
||||
@ -155,13 +155,13 @@ class ResponseBuilderTest extends UnitSpec {
|
||||
meeting3.addBreakoutRoom("breakout-room-id-2")
|
||||
meeting3.addBreakoutRoom("breakout-room-id-3")
|
||||
|
||||
val user: User = new User("uid1", "extuid1", "Richard", "moderator", "/aygwapo")
|
||||
val user: User = new User("uid1", "extuid1", "Richard", "moderator", "/aygwapo", false, false)
|
||||
meeting3.userJoined(user)
|
||||
|
||||
val user2: User = new User("uid2", "extuid2", "Richard 2", "moderator", "/aygwapo")
|
||||
val user2: User = new User("uid2", "extuid2", "Richard 2", "moderator", "/aygwapo", false, false)
|
||||
meeting3.userJoined(user2)
|
||||
|
||||
val user3: User = new User("uid3", "extuid3", "Richard 3", "moderator", "/aygwapo")
|
||||
val user3: User = new User("uid3", "extuid3", "Richard 3", "moderator", "/aygwapo", false, false)
|
||||
meeting3.userJoined(user2)
|
||||
|
||||
val custData = new util.HashMap[String, String]()
|
||||
|
Loading…
Reference in New Issue
Block a user