From 0bbe44e7858e582d8e993b2ed5c1fc8ee75fb24a Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Thu, 8 Dec 2011 21:43:16 +0000 Subject: [PATCH] move assign presenter logic to users/participants. This fixes a race condition where the first moderator doesn't become presenter by default. --- .../conference/IRoomListener.java | 4 +- .../ParticipantUpdatingRoomListener.java | 5 ++ .../org/bigbluebutton/conference/Room.java | 16 +++- .../conference/RoomListener.java | 4 + .../conference/RoomsManager.java | 22 +++++ .../participants/ParticipantsApplication.java | 19 ++++- .../participants/ParticipantsEventSender.java | 7 ++ .../participants/ParticipantsService.java | 28 ++++++- .../IPresentationRoomListener.java | 1 - .../presentation/PresentationApplication.java | 20 +---- .../presentation/PresentationEventSender.java | 7 -- .../presentation/PresentationRoom.java | 19 +---- .../PresentationRoomsManager.java | 22 +---- .../presentation/PresentationService.java | 32 ++------ .../AssignPresenterRecordEvent.java} | 10 +-- .../ParticipantsEventRecorder.java | 16 +++- .../PresentationEventRecorder.java | 14 ---- .../main/maps/ApplicationEventMap.mxml | 7 +- .../main/model/users/UserService.as | 18 ++-- .../main/model/users/UsersSOService.as | 82 ++++++++++++++++--- .../modules/present/business/PresentProxy.as | 15 +--- .../present/business/PresentSOService.as | 51 +----------- .../present/managers/PresentManager.as | 19 +---- .../modules/present/maps/PresentEventMap.mxml | 6 +- 24 files changed, 220 insertions(+), 224 deletions(-) rename bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/{presentation/AssignPresenterPresentationRecordEvent.java => participants/AssignPresenterRecordEvent.java} (53%) diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/IRoomListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/IRoomListener.java index ab912a62bf..0979860df2 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/IRoomListener.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/IRoomListener.java @@ -19,11 +19,13 @@ package org.bigbluebutton.conference; +import java.util.ArrayList; + public interface IRoomListener { public String getName(); public void participantStatusChange(Long userid, String status, Object value); public void participantJoined(Participant participant); public void participantLeft(Long userid); - + public void assignPresenter(ArrayList presenter); public void endAndKickAll(); } \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/ParticipantUpdatingRoomListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/ParticipantUpdatingRoomListener.java index 0e58ff8969..3ec3664291 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/ParticipantUpdatingRoomListener.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/ParticipantUpdatingRoomListener.java @@ -19,6 +19,7 @@ package org.bigbluebutton.conference; +import java.util.ArrayList; import java.util.HashMap; import org.bigbluebutton.conference.service.messaging.MessagingConstants; @@ -88,6 +89,10 @@ public class ParticipantUpdatingRoomListener implements IRoomListener{ } } + public void assignPresenter(ArrayList presenter) { + // Do nothing. + } + public void endAndKickAll() { // no-op } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/Room.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/Room.java index ca848e77db..e41c204c4e 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/Room.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/Room.java @@ -24,6 +24,7 @@ import org.red5.logging.Red5LoggerFactory; import net.jcip.annotations.ThreadSafe; import java.io.Serializable; import java.util.concurrent.ConcurrentHashMap; +import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.Map; @@ -34,7 +35,7 @@ import java.util.Map; @ThreadSafe public class Room implements Serializable { private static Logger log = Red5LoggerFactory.getLogger( Room.class, "bigbluebutton" ); - + ArrayList currentPresenter = null; private String name; private Map participants; @@ -151,4 +152,17 @@ public class Room implements Serializable { return sum; } + public ArrayList getCurrentPresenter() { + return currentPresenter; + } + + public void assignPresenter(ArrayList presenter){ + currentPresenter = presenter; + for (Iterator iter = listeners.values().iterator(); iter.hasNext();) { + log.debug("calling on listener"); + IRoomListener listener = (IRoomListener) iter.next(); + log.debug("calling sendUpdateMessage on listener " + listener.getName()); + listener.assignPresenter(presenter); + } + } } \ No newline at end of file diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/RoomListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/RoomListener.java index 3cfd862702..d9101c3f69 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/RoomListener.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/RoomListener.java @@ -58,6 +58,10 @@ public class RoomListener implements IRoomListener{ so.sendMessage("participantLeft", args); } + public void assignPresenter(ArrayList presenter) { + so.sendMessage("assignPresenterCallback", presenter); + } + public void endAndKickAll() { // no-op } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/RoomsManager.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/RoomsManager.java index a3bd994871..5fdd3b5a5a 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/RoomsManager.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/RoomsManager.java @@ -23,9 +23,12 @@ import org.bigbluebutton.conference.service.messaging.MessageListener; import org.bigbluebutton.conference.service.messaging.MessagingConstants; import org.bigbluebutton.conference.service.messaging.MessagingService; import org.bigbluebutton.conference.service.presentation.ConversionUpdatesMessageListener; +import org.bigbluebutton.conference.service.presentation.PresentationRoom; import org.red5.logging.Red5LoggerFactory; import com.google.gson.Gson; import net.jcip.annotations.ThreadSafe; + +import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -191,6 +194,25 @@ public class RoomsManager { this.messagingService.addListener(new RoomsManagerListener()); this.messagingService.start(); } + + public ArrayList getCurrentPresenter( String room){ + Room r = getRoom(room); + if (r != null) { + return r.getCurrentPresenter(); + } + log.warn("Getting presenter from a non-existing room " + room); + return null; + } + + public void assignPresenter(String room, ArrayList presenter){ + Room r = getRoom(room); + if (r != null) { + r.assignPresenter(presenter); + return; + } + log.warn("Assigning presenter to a non-existing room " + room); + } + public void setConversionUpdatesMessageListener(ConversionUpdatesMessageListener conversionUpdatesMessageListener) { this.conversionUpdatesMessageListener = conversionUpdatesMessageListener; } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsApplication.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsApplication.java index 855b95bbb0..53529c405f 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsApplication.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsApplication.java @@ -20,7 +20,8 @@ package org.bigbluebutton.conference.service.participants; import org.slf4j.Logger; import org.red5.logging.Red5LoggerFactory; - import java.util.Map; import org.bigbluebutton.conference.RoomsManager; + import java.util.ArrayList; +import java.util.Map; import org.bigbluebutton.conference.RoomsManager; import org.bigbluebutton.conference.Room; import org.bigbluebutton.conference.Participant; import org.bigbluebutton.conference.IRoomListener; public class ParticipantsApplication { @@ -104,6 +105,22 @@ public class ParticipantsApplication { return false; } + public ArrayList getCurrentPresenter(String room){ + if (roomsManager.hasRoom(room)){ + return roomsManager.getCurrentPresenter(room); + } + log.warn("Getting presenter on a non-existant room " + room); + return null; + } + + public void assignPresenter(String room, ArrayList presenter){ + if (roomsManager.hasRoom(room)){ + roomsManager.assignPresenter(room, presenter); + return; + } + log.warn("Assigning presenter on a non-existant room " + room); + } + public void setRoomsManager(RoomsManager r) { log.debug("Setting room manager"); roomsManager = r; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsEventSender.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsEventSender.java index 8fd1ff0ec6..9905070dbb 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsEventSender.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsEventSender.java @@ -53,6 +53,13 @@ public class ParticipantsEventSender implements IRoomListener { so.sendMessage("logout", new ArrayList()); } + @SuppressWarnings("unchecked") + @Override + public void assignPresenter(ArrayList presenter) { + log.debug("calling assignPresenterCallback " + presenter.get(0) + ", " + presenter.get(1) + " " + presenter.get(2)); + so.sendMessage("assignPresenterCallback", presenter); + } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void participantJoined(Participant p) { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsService.java index b09c66486c..3308497e93 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsService.java @@ -23,8 +23,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.red5.logging.Red5LoggerFactory; +import org.red5.server.api.IScope; import org.red5.server.api.Red5; +import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; @@ -35,12 +37,34 @@ public class ParticipantsService { private static Logger log = Red5LoggerFactory.getLogger( ParticipantsService.class, "bigbluebutton" ); private ParticipantsApplication application; + @SuppressWarnings("unchecked") + public void assignPresenter(Long userid, String name, Long assignedBy) { + log.info("Receive assignPresenter request from client [" + userid + "," + name + "," + assignedBy + "]"); + IScope scope = Red5.getConnectionLocal().getScope(); + ArrayList presenter = new ArrayList(); + presenter.add(userid.toString()); + presenter.add(name); + presenter.add(assignedBy.toString()); + ArrayList curPresenter = application.getCurrentPresenter(scope.getName()); + application.setParticipantStatus(scope.getName(), userid, "presenter", true); + + if (curPresenter != null){ + String curUserid = (String) curPresenter.get(0); + if (! curUserid.equals(userid.toString())){ + log.info("Changing the current presenter [" + curPresenter.get(0) + "] to viewer."); + application.setParticipantStatus(scope.getName(), new Long(curPresenter.get(0)), "presenter", false); + } + } else { + log.info("No current presenter. So do nothing."); + } + application.assignPresenter(scope.getName(), presenter); + } + @SuppressWarnings("unchecked") public Map getParticipants() { String roomName = Red5.getConnectionLocal().getScope().getName(); - log.debug("getting participants for " + roomName); + log.info("Client is requesting for list of participants in [" + roomName + "]."); Map p = application.getParticipants(roomName); - log.debug("getting participants for " + roomName); Map participants = new HashMap(); if (p == null) { participants.put("count", 0); diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/IPresentationRoomListener.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/IPresentationRoomListener.java index 4df9a0f97f..eed25573f5 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/IPresentationRoomListener.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/IPresentationRoomListener.java @@ -28,7 +28,6 @@ import java.util.Map; public interface IPresentationRoomListener { public String getName(); public void sendUpdateMessage(Map message); - public void assignPresenter(ArrayList presenter); public void gotoSlide(int curslide); public void resizeAndMoveSlide(Double xOffset, Double yOffset, Double widthRatio, Double heightRatio); public void removePresentation(String name); diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java index 796f9687b4..1311f7568c 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java @@ -69,15 +69,7 @@ public class PresentationApplication { } log.warn("Sending update message to a non-existant room " + room); } - - public ArrayList getCurrentPresenter(String room){ - if (roomsManager.hasRoom(room)){ - return roomsManager.getCurrentPresenter(room); - } - log.warn("Getting presenter on a non-existant room " + room); - return null; - } - + public ArrayList getPresentations(String room){ if (roomsManager.hasRoom(room)){ return roomsManager.getPresentations(room); @@ -134,15 +126,7 @@ public class PresentationApplication { } log.warn("resizeAndMoveSlide on a non-existant room " + room); } - - public void assignPresenter(String room, ArrayList presenter){ - if (roomsManager.hasRoom(room)){ - roomsManager.assignPresenter(room, presenter); - return; - } - log.warn("Assigning presenter on a non-existant room " + room); - } - + public void gotoSlide(String room, int slide){ if (roomsManager.hasRoom(room)){ log.debug("Request to go to slide " + slide + " for room " + room); diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationEventSender.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationEventSender.java index b4eb485506..2dc4176710 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationEventSender.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationEventSender.java @@ -140,13 +140,6 @@ public class PresentationEventSender implements IPresentationRoomListener { so.sendMessage("sharePresentationCallback", list); } - @SuppressWarnings("unchecked") - @Override - public void assignPresenter(ArrayList presenter) { - log.debug("calling assignPresenterCallback " + presenter.get(0) + ", " + presenter.get(1) + " " + presenter.get(2)); - so.sendMessage("assignPresenterCallback", presenter); - } - @SuppressWarnings("unchecked") @Override public void resizeAndMoveSlide(Double xOffset, Double yOffset, Double widthRatio, Double heightRatio) { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationRoom.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationRoom.java index 6eea157891..3aaf641a4a 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationRoom.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationRoom.java @@ -40,9 +40,6 @@ public class PresentationRoom { private final String name; private final Map listeners; - //TODO: check this type of attributes... - @SuppressWarnings("unchecked") - ArrayList currentPresenter = null; int currentSlide = 0; Boolean sharing = false; String currentPresentation = ""; @@ -109,17 +106,7 @@ public class PresentationRoom { listener.resizeAndMoveSlide(xOffset, yOffset, widthRatio, heightRatio); } } - - public void assignPresenter(ArrayList presenter){ - currentPresenter = presenter; - for (Iterator iter = listeners.values().iterator(); iter.hasNext();) { - log.debug("calling on listener"); - IPresentationRoomListener listener = (IPresentationRoomListener) iter.next(); - log.debug("calling sendUpdateMessage on listener " + listener.getName()); - listener.assignPresenter(presenter); - } - } - + @SuppressWarnings("unchecked") public void gotoSlide(int curslide){ log.debug("Request to go to slide " + curslide + "for room " + name); @@ -190,10 +177,6 @@ public class PresentationRoom { return presentationNames; } - public ArrayList getCurrentPresenter() { - return currentPresenter; - } - public Double getxOffset() { return xOffset; } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationRoomsManager.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationRoomsManager.java index 85d15ee314..cce0fa5b12 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationRoomsManager.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationRoomsManager.java @@ -96,16 +96,7 @@ public class PresentationRoomsManager { } log.warn("Sending update message to a non-existing room " + room); } - - public ArrayList getCurrentPresenter( String room){ - PresentationRoom r = getRoom(room); - if (r != null) { - return r.getCurrentPresenter(); - } - log.warn("Getting presenter from a non-existing room " + room); - return null; - } - + public Boolean getSharingPresentation(String room){ PresentationRoom r = getRoom(room); if (r != null) { @@ -114,16 +105,7 @@ public class PresentationRoomsManager { log.warn("Getting sharing from a non-existing room " + room); return null; } - - public void assignPresenter(String room, ArrayList presenter){ - PresentationRoom r = getRoom(room); - if (r != null) { - r.assignPresenter(presenter); - return; - } - log.warn("Assigning presenter to a non-existing room " + room); - } - + @SuppressWarnings("unchecked") public Map getPresenterSettings(String room){ PresentationRoom r = getRoom(room); diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationService.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationService.java index 3094e5ab59..28dabf576c 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationService.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationService.java @@ -29,34 +29,12 @@ import org.red5.logging.Red5LoggerFactory; import org.red5.server.api.Red5; import org.red5.server.api.IScope; import org.bigbluebutton.conference.service.participants.ParticipantsApplication; -public class PresentationService { - +public class PresentationService { private static Logger log = Red5LoggerFactory.getLogger( PresentationService.class, "bigbluebutton" ); private ParticipantsApplication participantsApplication; private PresentationApplication presentationApplication; - @SuppressWarnings("unchecked") - public void assignPresenter(Long userid, String name, Long assignedBy) { - log.debug("assignPresenter " + userid + " " + name + " " + assignedBy); - IScope scope = Red5.getConnectionLocal().getScope(); - ArrayList presenter = new ArrayList(); - presenter.add(userid); - presenter.add(name); - presenter.add(assignedBy); - ArrayList curPresenter = presentationApplication.getCurrentPresenter(scope.getName()); - participantsApplication.setParticipantStatus(scope.getName(), userid, "presenter", true); - - if (curPresenter != null){ - long curUserid=(Long) curPresenter.get(0); - if( curUserid!= userid){ - log.debug("Changing presenter from " + curPresenter.get(0) + " to " + userid); - participantsApplication.setParticipantStatus(scope.getName(), (Long)curPresenter.get(0), "presenter", false); - } - } - presentationApplication.assignPresenter(scope.getName(), presenter); - } - public void removePresentation(String name) { log.debug("removePresentation " + name); IScope scope = Red5.getConnectionLocal().getScope(); @@ -67,7 +45,7 @@ public class PresentationService { public Map getPresentationInfo() { log.debug("Getting presentation information."); IScope scope = Red5.getConnectionLocal().getScope(); - ArrayList curPresenter = presentationApplication.getCurrentPresenter(scope.getName()); + ArrayList curPresenter = participantsApplication.getCurrentPresenter(scope.getName()); int curSlide = presentationApplication.getCurrentSlide(scope.getName()); Boolean isSharing = presentationApplication.getSharingPresentation(scope.getName()); String currentPresentation = presentationApplication.getCurrentPresentation(scope.getName()); @@ -127,10 +105,10 @@ public class PresentationService { IScope scope = Red5.getConnectionLocal().getScope(); presentationApplication.resizeAndMoveSlide(scope.getName(), xOffset, yOffset, widthRatio, heightRatio); } - + public void setParticipantsApplication(ParticipantsApplication a) { - log.debug("Setting participants application"); - participantsApplication = a; + log.debug("Setting participants application"); + participantsApplication = a; } public void setPresentationApplication(PresentationApplication a) { diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/AssignPresenterPresentationRecordEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AssignPresenterRecordEvent.java similarity index 53% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/AssignPresenterPresentationRecordEvent.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AssignPresenterRecordEvent.java index b9d6896ba0..e3a2b8048e 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/AssignPresenterPresentationRecordEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/AssignPresenterRecordEvent.java @@ -1,14 +1,12 @@ -package org.bigbluebutton.conference.service.recorder.presentation; +package org.bigbluebutton.conference.service.recorder.participants; +public class AssignPresenterRecordEvent extends AbstractParticipantRecordEvent { -public class AssignPresenterPresentationRecordEvent extends - AbstractPresentationRecordEvent { - - public AssignPresenterPresentationRecordEvent() { + public AssignPresenterRecordEvent() { super(); setEvent("AssignPresenterEvent"); } - + public void setUserId(String userid) { eventMap.put("userid", userid); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantsEventRecorder.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantsEventRecorder.java index 3dd993c017..ab3a42bda3 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantsEventRecorder.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantsEventRecorder.java @@ -1,7 +1,6 @@ package org.bigbluebutton.conference.service.recorder.participants; -import java.util.HashMap; - +import java.util.ArrayList; import org.bigbluebutton.conference.IRoomListener; import org.bigbluebutton.conference.Participant; import org.bigbluebutton.conference.service.recorder.RecorderApplication; @@ -62,6 +61,19 @@ public class ParticipantsEventRecorder implements IRoomListener { recorder.record(session, ev); } + @Override + public void assignPresenter(ArrayList presenter) { + log.debug("RECORD module:presentation event:assign_presenter"); + AssignPresenterRecordEvent event = new AssignPresenterRecordEvent(); + event.setMeetingId(session); + event.setTimestamp(System.currentTimeMillis()); + event.setUserId(presenter.get(0).toString()); + event.setName(presenter.get(1).toString()); + event.setAssignedBy(presenter.get(2).toString()); + + recorder.record(session, event); + } + @Override public String getName() { return this.name; diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/PresentationEventRecorder.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/PresentationEventRecorder.java index a8b3dd12a6..e551991ad4 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/PresentationEventRecorder.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/presentation/PresentationEventRecorder.java @@ -66,20 +66,6 @@ public class PresentationEventRecorder implements IPresentationRoomListener { recorder.record(session, event); } - @SuppressWarnings("rawtypes") - @Override - public void assignPresenter(ArrayList presenter) { - log.debug("RECORD module:presentation event:assign_presenter"); - AssignPresenterPresentationRecordEvent event = new AssignPresenterPresentationRecordEvent(); - event.setMeetingId(session); - event.setTimestamp(System.currentTimeMillis()); - event.setUserId(presenter.get(0).toString()); - event.setName(presenter.get(1).toString()); - event.setAssignedBy(presenter.get(2).toString()); - - recorder.record(session, event); - } - @Override public void gotoSlide(int curslide) { log.debug("RECORD module:presentation event:update_slide"); diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/maps/ApplicationEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/maps/ApplicationEventMap.mxml index 96b5a9291d..54c7ddc114 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/maps/ApplicationEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/maps/ApplicationEventMap.mxml @@ -21,7 +21,6 @@ --> - @@ -94,12 +93,16 @@ + + + + - - - - - +