feat(timer): add recording events

Adds recording events to each timer message(except CreateTimerPubMsg).
This commit is contained in:
Arthurk12 2023-05-31 10:45:03 -03:00
parent 1431e76bfe
commit ad8759ed1b
11 changed files with 398 additions and 0 deletions

View File

@ -0,0 +1,24 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
trait AbstractTimerRecordEvent extends RecordEvent {
setModule("TIMER")
}

View File

@ -0,0 +1,59 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class ActivateTimerRecordEvent extends AbstractTimerRecordEvent {
import ActivateTimerRecordEvent._
setEvent("ActivateTimerEvent")
def setStopwatch(value: Boolean) {
eventMap.put(STOPWATCH, value.toString)
}
def setRunning(value: Boolean) {
eventMap.put(RUNNING, value.toString)
}
def setTime(value: Int) {
eventMap.put(TIME, value.toString)
}
def setAccumulated(value: Int) {
eventMap.put(ACCUMULATED, value.toString)
}
def setTimestamp(value: Int) {
eventMap.put(TIMESTAMP, value.toString)
}
def setTrack(value: String) {
eventMap.put(TRACK, value)
}
}
object ActivateTimerRecordEvent {
protected final val STOPWATCH = "stopwatch"
protected final val RUNNING = "running"
protected final val TIME = "time"
protected final val ACCUMULATED = "accumulated"
protected final val TIMESTAMP = "timestamp"
protected final val TRACK = "track"
}

View File

@ -0,0 +1,24 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class DeactivateTimerRecordEvent extends AbstractTimerRecordEvent {
setEvent("DeactivateTimerEvent")
}

View File

@ -0,0 +1,24 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class ResetTimerRecordEvent extends AbstractTimerRecordEvent {
setEvent("ResetTimerEvent")
}

View File

@ -0,0 +1,34 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class SetTimerRecordEvent extends AbstractTimerRecordEvent {
import SetTimerRecordEvent._
setEvent("SetTimerEvent")
def setTime(value: Int) {
eventMap.put(TIME, value.toString)
}
}
object SetTimerRecordEvent {
protected final val TIME = "time"
}

View File

@ -0,0 +1,34 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class SetTimerTrackRecordEvent extends AbstractTimerRecordEvent {
import SetTimerTrackRecordEvent._
setEvent("SetTimerTrackEvent")
def setTrack(value: String) {
eventMap.put(TRACK, value)
}
}
object SetTimerTrackRecordEvent {
protected final val TRACK = "track"
}

View File

@ -0,0 +1,24 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class StartTimerRecordEvent extends AbstractTimerRecordEvent {
setEvent("StartTimerEvent")
}

View File

@ -0,0 +1,34 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class StopTimerRecordEvent extends AbstractTimerRecordEvent {
import StopTimerRecordEvent._
setEvent("StopTimerEvent")
def setAccumulated(value: Int) {
eventMap.put(ACCUMULATED, value.toString)
}
}
object StopTimerRecordEvent {
protected final val ACCUMULATED = "accumulated"
}

View File

@ -0,0 +1,34 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class SwitchTimerRecordEvent extends AbstractTimerRecordEvent {
import SwitchTimerRecordEvent._
setEvent("SwitchTimerEvent")
def setStopwatch(value: Boolean) {
eventMap.put(STOPWATCH, value.toString)
}
}
object SwitchTimerRecordEvent {
protected final val STOPWATCH = "stopwatch"
}

View File

@ -0,0 +1,24 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class TimerEndedRecordEvent extends AbstractTimerRecordEvent {
setEvent("TimerEndedEvent")
}

View File

@ -135,6 +135,17 @@ class RedisRecorderActor(
case m: UpdateExternalVideoEvtMsg => handleUpdateExternalVideoEvtMsg(m)
case m: StopExternalVideoEvtMsg => handleStopExternalVideoEvtMsg(m)
// Timer
case m: ActivateTimerRespMsg => handleActivateTimerRespMsg(m)
case m: DeactivateTimerRespMsg => handleDeactivateTimerRespMsg(m)
case m: StartTimerRespMsg => handleStartTimerRespMsg(m)
case m: StopTimerRespMsg => handleStopTimerRespMsg(m)
case m: SwitchTimerRespMsg => handleSwitchTimerRespMsg(m)
case m: SetTimerRespMsg => handleSetTimerRespMsg(m)
case m: ResetTimerRespMsg => handleResetTimerRespMsg(m)
case m: TimerEndedEvtMsg => handleTimerEndedEvtMsg(m)
case m: SetTrackRespMsg => handleSetTrackRespMsg(m)
case _ => // message not to be recorded.
}
}
@ -545,6 +556,78 @@ class RedisRecorderActor(
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleActivateTimerRespMsg(msg: ActivateTimerRespMsg) {
val ev = new ActivateTimerRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setStopwatch(msg.body.stopwatch)
ev.setRunning(msg.body.running)
ev.setTime(msg.body.time)
ev.setAccumulated(msg.body.accumulated)
ev.setTrack(msg.body.track)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleDeactivateTimerRespMsg(msg: DeactivateTimerRespMsg) {
val ev = new DeactivateTimerRecordEvent()
ev.setMeetingId(msg.header.meetingId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleStartTimerRespMsg(msg: StartTimerRespMsg) {
val ev = new StartTimerRecordEvent()
ev.setMeetingId(msg.header.meetingId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleStopTimerRespMsg(msg: StopTimerRespMsg) {
val ev = new StopTimerRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setAccumulated(msg.body.accumulated)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleSwitchTimerRespMsg(msg: SwitchTimerRespMsg) {
val ev = new SwitchTimerRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setStopwatch(msg.body.stopwatch)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleSetTimerRespMsg(msg: SetTimerRespMsg) {
val ev = new SetTimerRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setTime(msg.body.time)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleResetTimerRespMsg(msg: ResetTimerRespMsg) {
val ev = new ResetTimerRecordEvent()
ev.setMeetingId(msg.header.meetingId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleTimerEndedEvtMsg(msg: TimerEndedEvtMsg) {
val ev = new TimerEndedRecordEvent()
ev.setMeetingId(msg.header.meetingId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleSetTrackRespMsg(msg: SetTrackRespMsg) {
val ev = new SetTimerTrackRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setTrack(msg.body.track)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleRecordingStatusChangedEvtMsg(msg: RecordingStatusChangedEvtMsg) {
val ev = new RecordStatusRecordEvent()
ev.setMeetingId(msg.header.meetingId)