diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/AbstractTimerRecordEvent.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/AbstractTimerRecordEvent.scala new file mode 100644 index 0000000000..d92d3624c2 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/AbstractTimerRecordEvent.scala @@ -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 . + * + */ + +package org.bigbluebutton.core.record.events + +trait AbstractTimerRecordEvent extends RecordEvent { + setModule("TIMER") +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/ActivateTimerRecordEvent.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/ActivateTimerRecordEvent.scala new file mode 100644 index 0000000000..abc706e9ae --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/ActivateTimerRecordEvent.scala @@ -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 . + * + */ + +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" +} \ No newline at end of file diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/DeactivateTimerRecordEvent.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/DeactivateTimerRecordEvent.scala new file mode 100644 index 0000000000..87b5fbbc6e --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/DeactivateTimerRecordEvent.scala @@ -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 . + * + */ + +package org.bigbluebutton.core.record.events + +class DeactivateTimerRecordEvent extends AbstractTimerRecordEvent { + setEvent("DeactivateTimerEvent") +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/ResetTimerRecordEvent.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/ResetTimerRecordEvent.scala new file mode 100644 index 0000000000..f0dd570ead --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/ResetTimerRecordEvent.scala @@ -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 . + * + */ + +package org.bigbluebutton.core.record.events + +class ResetTimerRecordEvent extends AbstractTimerRecordEvent { + setEvent("ResetTimerEvent") +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/SetTimerRecordEvent.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/SetTimerRecordEvent.scala new file mode 100644 index 0000000000..1b406922fb --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/SetTimerRecordEvent.scala @@ -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 . + * + */ + +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" +} \ No newline at end of file diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/SetTimerTrackRecordEvent.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/SetTimerTrackRecordEvent.scala new file mode 100644 index 0000000000..047b592721 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/SetTimerTrackRecordEvent.scala @@ -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 . + * + */ + +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" +} \ No newline at end of file diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/StartTimerRecordEvent.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/StartTimerRecordEvent.scala new file mode 100644 index 0000000000..ee5f124eb9 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/StartTimerRecordEvent.scala @@ -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 . + * + */ + +package org.bigbluebutton.core.record.events + +class StartTimerRecordEvent extends AbstractTimerRecordEvent { + setEvent("StartTimerEvent") +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/StopTimerRecordEvent.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/StopTimerRecordEvent.scala new file mode 100644 index 0000000000..b6f65c4ef8 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/StopTimerRecordEvent.scala @@ -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 . + * + */ + +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" +} \ No newline at end of file diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/SwitchTimerRecordEvent.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/SwitchTimerRecordEvent.scala new file mode 100644 index 0000000000..0f269c0be4 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/SwitchTimerRecordEvent.scala @@ -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 . + * + */ + +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" +} \ No newline at end of file diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/TimerEndedRecordEvent.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/TimerEndedRecordEvent.scala new file mode 100644 index 0000000000..74c064b804 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/record/events/TimerEndedRecordEvent.scala @@ -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 . + * + */ + +package org.bigbluebutton.core.record.events + +class TimerEndedRecordEvent extends AbstractTimerRecordEvent { + setEvent("TimerEndedEvent") +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/RedisRecorderActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/RedisRecorderActor.scala index e634a89007..ae91ed9b5f 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/RedisRecorderActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/RedisRecorderActor.scala @@ -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)