-
Notifications
You must be signed in to change notification settings - Fork 5.9k
/
RedisRecorderActor.scala
executable file
·533 lines (432 loc) · 19.5 KB
/
RedisRecorderActor.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
package org.bigbluebutton.endpoint.redis
import scala.collection.immutable.StringOps
import scala.collection.JavaConverters._
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.common2.redis.{ RedisConfig, RedisStorageProvider }
import org.bigbluebutton.core.apps.groupchats.GroupChatApp
import org.bigbluebutton.core.record.events._
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.actor.ActorSystem
import akka.actor.Props
object RedisRecorderActor {
def props(
system: ActorSystem,
redisConfig: RedisConfig
): Props =
Props(
classOf[RedisRecorderActor],
system,
redisConfig
)
}
class RedisRecorderActor(
system: ActorSystem,
redisConfig: RedisConfig
)
extends RedisStorageProvider(
system,
"BbbAppsAkkaRecorder",
redisConfig
) with Actor with ActorLogging {
private def record(session: String, message: java.util.Map[java.lang.String, java.lang.String]): Unit = {
redis.recordAndExpire(session, message)
}
def receive = {
//=============================
// 2x messages
case msg: BbbCommonEnvCoreMsg => handleBbbCommonEnvCoreMsg(msg)
case _ => // do nothing
}
private def handleBbbCommonEnvCoreMsg(msg: BbbCommonEnvCoreMsg): Unit = {
msg.core match {
// Chat
case m: GroupChatMessageBroadcastEvtMsg => handleGroupChatMessageBroadcastEvtMsg(m)
case m: ClearPublicChatHistoryEvtMsg => handleClearPublicChatHistoryEvtMsg(m)
// Presentation
case m: PresentationConversionCompletedEvtMsg => handlePresentationConversionCompletedEvtMsg(m)
case m: SetCurrentPageEvtMsg => handleSetCurrentPageEvtMsg(m)
case m: ResizeAndMovePageEvtMsg => handleResizeAndMovePageEvtMsg(m)
case m: RemovePresentationEvtMsg => handleRemovePresentationEvtMsg(m)
case m: SetPresentationDownloadableEvtMsg => handleSetPresentationDownloadableEvtMsg(m)
case m: SetCurrentPresentationEvtMsg => handleSetCurrentPresentationEvtMsg(m)
case m: CreateNewPresentationPodEvtMsg => handleCreateNewPresentationPodEvtMsg(m)
case m: RemovePresentationPodEvtMsg => handleRemovePresentationPodEvtMsg(m)
case m: SetPresenterInPodRespMsg => handleSetPresenterInPodRespMsg(m)
// Whiteboard
case m: SendWhiteboardAnnotationEvtMsg => handleSendWhiteboardAnnotationEvtMsg(m)
case m: SendCursorPositionEvtMsg => handleSendCursorPositionEvtMsg(m)
case m: ClearWhiteboardEvtMsg => handleClearWhiteboardEvtMsg(m)
case m: UndoWhiteboardEvtMsg => handleUndoWhiteboardEvtMsg(m)
// User
case m: UserJoinedMeetingEvtMsg => handleUserJoinedMeetingEvtMsg(m)
case m: UserLeftMeetingEvtMsg => handleUserLeftMeetingEvtMsg(m)
case m: PresenterAssignedEvtMsg => handlePresenterAssignedEvtMsg(m)
case m: UserEmojiChangedEvtMsg => handleUserEmojiChangedEvtMsg(m)
case m: UserBroadcastCamStartedEvtMsg => handleUserBroadcastCamStartedEvtMsg(m)
case m: UserBroadcastCamStoppedEvtMsg => handleUserBroadcastCamStoppedEvtMsg(m)
// Voice
case m: UserJoinedVoiceConfToClientEvtMsg => handleUserJoinedVoiceConfToClientEvtMsg(m)
case m: UserLeftVoiceConfToClientEvtMsg => handleUserLeftVoiceConfToClientEvtMsg(m)
case m: UserMutedVoiceEvtMsg => handleUserMutedVoiceEvtMsg(m)
case m: UserTalkingVoiceEvtMsg => handleUserTalkingVoiceEvtMsg(m)
case m: VoiceRecordingStartedEvtMsg => handleVoiceRecordingStartedEvtMsg(m)
case m: VoiceRecordingStoppedEvtMsg => handleVoiceRecordingStoppedEvtMsg(m)
// Caption
case m: EditCaptionHistoryEvtMsg => handleEditCaptionHistoryEvtMsg(m)
// Screenshare
case m: ScreenshareRtmpBroadcastStartedEvtMsg => handleScreenshareRtmpBroadcastStartedEvtMsg(m)
case m: ScreenshareRtmpBroadcastStoppedEvtMsg => handleScreenshareRtmpBroadcastStoppedEvtMsg(m)
//case m: DeskShareNotifyViewersRTMP => handleDeskShareNotifyViewersRTMP(m)
// Meeting
case m: RecordingStatusChangedEvtMsg => handleRecordingStatusChangedEvtMsg(m)
case m: RecordStatusResetSysMsg => handleRecordStatusResetSysMsg(m)
case m: WebcamsOnlyForModeratorChangedEvtMsg => handleWebcamsOnlyForModeratorChangedEvtMsg(m)
case m: EndAndKickAllSysMsg => handleEndAndKickAllSysMsg(m)
// Recording
case m: RecordingChapterBreakSysMsg => handleRecordingChapterBreakSysMsg(m)
// Poll
case m: PollStartedEvtMsg => handlePollStartedEvtMsg(m)
case m: UserRespondedToPollRecordMsg => handleUserRespondedToPollRecordMsg(m)
case m: PollStoppedEvtMsg => handlePollStoppedEvtMsg(m)
case m: PollShowResultEvtMsg => handlePollShowResultEvtMsg(m)
case _ => // message not to be recorded.
}
}
private def handleGroupChatMessageBroadcastEvtMsg(msg: GroupChatMessageBroadcastEvtMsg) {
if (msg.body.chatId == GroupChatApp.MAIN_PUBLIC_CHAT) {
val ev = new PublicChatRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setSender(msg.body.msg.sender.name)
ev.setSenderId(msg.body.msg.sender.id)
ev.setMessage(msg.body.msg.message)
ev.setColor(msg.body.msg.color)
record(msg.header.meetingId, ev.toMap.asJava)
}
}
private def handleClearPublicChatHistoryEvtMsg(msg: ClearPublicChatHistoryEvtMsg) {
val ev = new ClearPublicChatRecordEvent()
ev.setMeetingId(msg.header.meetingId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handlePresentationConversionCompletedEvtMsg(msg: PresentationConversionCompletedEvtMsg) {
val ev = new ConversionCompletedPresentationRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPodId(msg.body.podId)
ev.setPresentationName(msg.body.presentation.id)
ev.setOriginalFilename(msg.body.presentation.name)
record(msg.header.meetingId, ev.toMap.asJava)
if (msg.body.presentation.current) {
recordSharePresentationEvent(msg.header.meetingId, msg.body.podId, msg.body.presentation.id)
}
}
private def handleSetCurrentPageEvtMsg(msg: SetCurrentPageEvtMsg) {
val ev = new GotoSlideRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPodId(msg.body.podId)
ev.setPresentationName(msg.body.presentationId)
ev.setSlide(getPageNum(msg.body.pageId))
ev.setId(msg.body.pageId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleResizeAndMovePageEvtMsg(msg: ResizeAndMovePageEvtMsg) {
val ev = new ResizeAndMoveSlideRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPodId(msg.body.podId)
ev.setPresentationName(msg.body.presentationId)
ev.setId(msg.body.pageId)
ev.setXOffset(msg.body.xOffset)
ev.setYOffset(msg.body.yOffset)
ev.setWidthRatio(msg.body.widthRatio)
ev.setHeightRatio(msg.body.heightRatio)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleRemovePresentationEvtMsg(msg: RemovePresentationEvtMsg) {
val ev = new RemovePresentationRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPodId(msg.body.podId)
ev.setPresentationName(msg.body.presentationId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleSetPresentationDownloadableEvtMsg(msg: SetPresentationDownloadableEvtMsg) {
val ev = new SetPresentationDownloadable()
ev.setMeetingId(msg.header.meetingId)
ev.setPodId(msg.body.podId)
ev.setPresentationName(msg.body.presentationId)
ev.setDownloadable(msg.body.downloadable)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleSetCurrentPresentationEvtMsg(msg: SetCurrentPresentationEvtMsg) {
recordSharePresentationEvent(msg.header.meetingId, msg.body.podId, msg.body.presentationId)
}
private def handleCreateNewPresentationPodEvtMsg(msg: CreateNewPresentationPodEvtMsg) {
val ev = new CreatePresentationPodRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPodId(msg.body.podId)
ev.setCurrentPresenter(msg.body.currentPresenterId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleRemovePresentationPodEvtMsg(msg: RemovePresentationPodEvtMsg) {
val ev = new RemovePresentationPodRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPodId(msg.body.podId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleSetPresenterInPodRespMsg(msg: SetPresenterInPodRespMsg) {
val ev = new SetPresenterInPodRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPodId(msg.body.podId)
ev.setNextPresenterId(msg.body.nextPresenterId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def recordSharePresentationEvent(meetingId: String, podId: String, presentationId: String) {
val ev = new SharePresentationRecordEvent()
ev.setMeetingId(meetingId)
ev.setPodId(podId)
ev.setPresentationName(presentationId)
ev.setShare(true)
record(meetingId, ev.toMap.asJava)
}
private def getPageNum(id: String): Integer = {
val strId = new StringOps(id)
val ids = strId.split('/')
var pageNum = 0
if (ids.length == 2) {
pageNum = ids(1).toInt
}
pageNum
}
private def getPresentationId(whiteboardId: String): String = {
// Need to split the whiteboard id into presenation id and page num as the old
// recording expects them
val strId = new StringOps(whiteboardId)
val ids = strId.split('/')
var presId: String = ""
if (ids.length == 2) {
presId = ids(0)
}
presId
}
private def handleSendWhiteboardAnnotationEvtMsg(msg: SendWhiteboardAnnotationEvtMsg) {
val annotation = msg.body.annotation
val ev = new AddShapeWhiteboardRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPresentation(getPresentationId(annotation.wbId))
ev.setPageNumber(getPageNum(annotation.wbId))
ev.setWhiteboardId(annotation.wbId)
ev.setUserId(annotation.userId)
ev.setAnnotationId(annotation.id)
ev.setPosition(annotation.position)
ev.addAnnotation(annotation.annotationInfo)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleSendCursorPositionEvtMsg(msg: SendCursorPositionEvtMsg) {
val ev = new WhiteboardCursorMoveRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPresentation(getPresentationId(msg.body.whiteboardId))
ev.setPageNumber(getPageNum(msg.body.whiteboardId))
ev.setWhiteboardId(msg.body.whiteboardId)
ev.setUserId(msg.header.userId)
ev.setXPercent(msg.body.xPercent)
ev.setYPercent(msg.body.yPercent)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleClearWhiteboardEvtMsg(msg: ClearWhiteboardEvtMsg) {
val ev = new ClearWhiteboardRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPresentation(getPresentationId(msg.body.whiteboardId))
ev.setPageNumber(getPageNum(msg.body.whiteboardId))
ev.setWhiteboardId(msg.body.whiteboardId)
ev.setUserId(msg.body.userId)
ev.setFullClear(msg.body.fullClear)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleUndoWhiteboardEvtMsg(msg: UndoWhiteboardEvtMsg) {
val ev = new UndoAnnotationRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setPresentation(getPresentationId(msg.body.whiteboardId))
ev.setPageNumber(getPageNum(msg.body.whiteboardId))
ev.setWhiteboardId(msg.body.whiteboardId)
ev.setUserId(msg.body.userId)
ev.setShapeId(msg.body.annotationId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleUserJoinedMeetingEvtMsg(msg: UserJoinedMeetingEvtMsg): Unit = {
val ev = new ParticipantJoinRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setUserId(msg.body.intId)
ev.setExternalUserId(msg.body.extId)
ev.setName(msg.body.name)
ev.setRole(msg.body.role)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleUserLeftMeetingEvtMsg(msg: UserLeftMeetingEvtMsg): Unit = {
val ev = new ParticipantLeftRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setUserId(msg.body.intId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handlePresenterAssignedEvtMsg(msg: PresenterAssignedEvtMsg): Unit = {
val ev = new AssignPresenterRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setUserId(msg.body.presenterId)
ev.setName(msg.body.presenterName)
ev.setAssignedBy(msg.body.assignedBy)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleUserEmojiChangedEvtMsg(msg: UserEmojiChangedEvtMsg) {
handleUserStatusChange(msg.header.meetingId, msg.body.userId, "emojiStatus", msg.body.emoji)
}
private def handleUserBroadcastCamStartedEvtMsg(msg: UserBroadcastCamStartedEvtMsg) {
handleUserStatusChange(msg.header.meetingId, msg.body.userId, "hasStream", "true,stream=" + msg.body.stream)
}
private def handleUserBroadcastCamStoppedEvtMsg(msg: UserBroadcastCamStoppedEvtMsg) {
handleUserStatusChange(msg.header.meetingId, msg.body.userId, "hasStream", "false,stream=" + msg.body.stream)
}
private def handleUserStatusChange(meetingId: String, userId: String, statusName: String, statusValue: String): Unit = {
val ev = new ParticipantStatusChangeRecordEvent()
ev.setMeetingId(meetingId)
ev.setUserId(userId)
ev.setStatus(statusName)
ev.setValue(statusValue)
record(meetingId, ev.toMap.asJava)
}
private def handleUserJoinedVoiceConfToClientEvtMsg(msg: UserJoinedVoiceConfToClientEvtMsg) {
val ev = new ParticipantJoinedVoiceRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setBridge(msg.body.voiceConf)
ev.setParticipant(msg.body.intId)
ev.setCallerName(msg.body.callerName)
ev.setCallerNumber(msg.body.callerNum)
ev.setMuted(msg.body.muted)
ev.setTalking(msg.body.talking)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleUserLeftVoiceConfToClientEvtMsg(msg: UserLeftVoiceConfToClientEvtMsg) {
val ev = new ParticipantLeftVoiceRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setBridge(msg.body.voiceConf)
ev.setParticipant(msg.body.intId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleUserMutedVoiceEvtMsg(msg: UserMutedVoiceEvtMsg) {
val ev = new ParticipantMutedVoiceRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setBridge(msg.body.voiceConf)
ev.setParticipant(msg.body.intId)
ev.setMuted(msg.body.muted)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleUserTalkingVoiceEvtMsg(msg: UserTalkingVoiceEvtMsg) {
val ev = new ParticipantTalkingVoiceRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setBridge(msg.body.voiceConf)
ev.setParticipant(msg.body.intId)
ev.setTalking(msg.body.talking)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleVoiceRecordingStartedEvtMsg(msg: VoiceRecordingStartedEvtMsg) {
val ev = new StartRecordingVoiceRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setBridge(msg.body.voiceConf)
ev.setRecordingTimestamp(msg.body.timestamp)
ev.setFilename(msg.body.stream)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleVoiceRecordingStoppedEvtMsg(msg: VoiceRecordingStoppedEvtMsg) {
val ev = new StopRecordingVoiceRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setBridge(msg.body.voiceConf)
ev.setRecordingTimestamp(msg.body.timestamp)
ev.setFilename(msg.body.stream)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleEditCaptionHistoryEvtMsg(msg: EditCaptionHistoryEvtMsg) {
val ev = new EditCaptionHistoryRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setStartIndex(msg.body.startIndex)
ev.setEndIndex(msg.body.endIndex)
ev.setLocale(msg.body.locale)
ev.setLocaleCode(msg.body.localeCode)
ev.setText(msg.body.text)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleScreenshareRtmpBroadcastStartedEvtMsg(msg: ScreenshareRtmpBroadcastStartedEvtMsg) {
val ev = new DeskshareStartRtmpRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setStreamPath(msg.body.stream)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleScreenshareRtmpBroadcastStoppedEvtMsg(msg: ScreenshareRtmpBroadcastStoppedEvtMsg) {
val ev = new DeskshareStopRtmpRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setStreamPath(msg.body.stream)
record(msg.header.meetingId, ev.toMap.asJava)
}
/*
private def handleDeskShareNotifyViewersRTMP(msg: DeskShareNotifyViewersRTMP) {
val ev = new DeskShareNotifyViewersRTMPRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setStreamPath(msg.streamPath)
ev.setBroadcasting(msg.broadcasting)
record(msg.header.meetingId, JavaConverters.mapAsScalaMap(ev.toMap).toMap)
}
*/
private def handleRecordingStatusChangedEvtMsg(msg: RecordingStatusChangedEvtMsg) {
val ev = new RecordStatusRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setUserId(msg.body.setBy)
ev.setRecordingStatus(msg.body.recording)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleRecordStatusResetSysMsg(msg: RecordStatusResetSysMsg) {
val ev = new RecordStatusResetEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setUserId(msg.body.setBy)
ev.setRecordingStatus(msg.body.recording)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleWebcamsOnlyForModeratorChangedEvtMsg(msg: WebcamsOnlyForModeratorChangedEvtMsg) {
val ev = new WebcamsOnlyForModeratorRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setUserId(msg.body.setBy)
ev.setWebcamsOnlyForModerator(msg.body.webcamsOnlyForModerator)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleEndAndKickAllSysMsg(msg: EndAndKickAllSysMsg): Unit = {
val ev = new EndAndKickAllRecordEvent()
ev.setMeetingId(msg.header.meetingId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleRecordingChapterBreakSysMsg(msg: RecordingChapterBreakSysMsg): Unit = {
val ev = new RecordChapterBreakRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setChapterBreakTimestamp(msg.body.timestamp)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handlePollStartedEvtMsg(msg: PollStartedEvtMsg): Unit = {
val ev = new PollStartedRecordEvent()
ev.setPollId(msg.body.pollId)
ev.setAnswers(msg.body.poll.answers)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleUserRespondedToPollRecordMsg(msg: UserRespondedToPollRecordMsg): Unit = {
val ev = new UserRespondedToPollRecordEvent()
ev.setPollId(msg.body.pollId)
ev.setUserId(msg.header.userId)
ev.setAnswerId(msg.body.answerId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handlePollStoppedEvtMsg(msg: PollStoppedEvtMsg): Unit = {
pollStoppedRecordHelper(msg.header.meetingId, msg.body.pollId)
}
private def handlePollShowResultEvtMsg(msg: PollShowResultEvtMsg): Unit = {
pollStoppedRecordHelper(msg.header.meetingId, msg.body.pollId)
}
private def pollStoppedRecordHelper(meetingId: String, pollId: String): Unit = {
val ev = new PollStoppedRecordEvent()
ev.setPollId(pollId)
record(meetingId, ev.toMap.asJava)
}
}