You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by se...@apache.org on 2012/12/01 09:13:09 UTC

svn commit: r1415944 - in /incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings: conference/room/ClientListHashMapStore.java conference/room/IClientList.java remote/ConferenceService.java remote/FLVRecorderService.java

Author: sebawagner
Date: Sat Dec  1 08:13:09 2012
New Revision: 1415944

URL: http://svn.apache.org/viewvc?rev=1415944&view=rev
Log:
OPENMEETINGS-460 Fixes lists to be updated only once, fixes lists to be cleaned up correctly, extend JUnit Test case

Modified:
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/conference/room/ClientListHashMapStore.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/conference/room/IClientList.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConferenceService.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/FLVRecorderService.java

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/conference/room/ClientListHashMapStore.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/conference/room/ClientListHashMapStore.java?rev=1415944&r1=1415943&r2=1415944&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/conference/room/ClientListHashMapStore.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/conference/room/ClientListHashMapStore.java Sat Dec  1 08:13:09 2012
@@ -233,11 +233,11 @@ public class ClientListHashMapStore impl
 		return null;
 	}
 
-	public synchronized ArrayList<RoomClient> getClientListByRoom(Long roomId) {
+	public synchronized ArrayList<RoomClient> getClientListByRoom(Long roomId, Server server) {
 		ArrayList<RoomClient> roomClientList = new ArrayList<RoomClient>();
 		try {
 
-			for (RoomClient rcl : cache.getClientsByRoomId(roomId).values()) {
+			for (RoomClient rcl : cache.getClientsByRoomId(server, roomId).values()) {
 
 				if (rcl.getIsScreenClient() == null || rcl.getIsScreenClient()) {
 					continue;
@@ -258,9 +258,9 @@ public class ClientListHashMapStore impl
 		return roomClientList;
 	}
 
-	public synchronized Collection<RoomClient> getClientListByRoomAll(Long roomId) {
+	public synchronized Collection<RoomClient> getClientListByRoomAll(Long roomId, Server server) {
 		try {
-			return cache.getClientsByRoomId(roomId).values();
+			return cache.getClientsByRoomId(server, roomId).values();
 		} catch (Exception err) {
 			log.error("[getClientListByRoomAll]", err);
 		}
@@ -269,7 +269,7 @@ public class ClientListHashMapStore impl
 
 	public synchronized List<RoomClient> getCurrentModeratorByRoom(Long room_id) {
 		List<RoomClient> rclList = new LinkedList<RoomClient>();
-		List<RoomClient> currentClients = this.getClientListByRoom(room_id);
+		List<RoomClient> currentClients = this.getClientListByRoom(room_id, null);
 		for (RoomClient rcl : currentClients) {
 			if (rcl.getIsMod()) {
 				rclList.add(rcl);
@@ -299,7 +299,7 @@ public class ClientListHashMapStore impl
 	}
 
 	public long getRecordingCount(long roomId) {
-		List<RoomClient> currentClients = this.getClientListByRoom(roomId);
+		List<RoomClient> currentClients = this.getClientListByRoom(roomId, null);
 		int numberOfRecordingUsers = 0;
 		for (RoomClient rcl : currentClients) {
 			if (rcl.isStartRecording()) {
@@ -310,7 +310,7 @@ public class ClientListHashMapStore impl
 	}
 
 	public long getPublishingCount(long roomId) {
-		List<RoomClient> currentClients = this.getClientListByRoom(roomId);
+		List<RoomClient> currentClients = this.getClientListByRoom(roomId, null);
 		int numberOfPublishingUsers = 0;
 		for (RoomClient rcl : currentClients) {
 			if (rcl.isStreamPublishStarted()) {

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/conference/room/IClientList.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/conference/room/IClientList.java?rev=1415944&r1=1415943&r2=1415944&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/conference/room/IClientList.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/conference/room/IClientList.java Sat Dec  1 08:13:09 2012
@@ -117,11 +117,12 @@ public interface IClientList {
 	 * needed cause it is invoked internally AFTER the current user has been
 	 * already removed from the ClientList to see if the Room is empty again and
 	 * the PollList can be removed
+	 * @param server TODO
 	 * @return
 	 */
-	public abstract List<RoomClient> getClientListByRoom(Long room_id);
+	public abstract List<RoomClient> getClientListByRoom(Long room_id, Server server);
 
-	public abstract Collection<RoomClient> getClientListByRoomAll(Long room_id);
+	public abstract Collection<RoomClient> getClientListByRoomAll(Long room_id, Server server);
 
 	/**
 	 * get the current Moderator in this room

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConferenceService.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConferenceService.java?rev=1415944&r1=1415943&r2=1415944&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConferenceService.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConferenceService.java Sat Dec  1 08:13:09 2012
@@ -145,7 +145,7 @@ public class ConferenceService {
 							organisation_id);
 			
 			for (Rooms_Organisation roomOrg : roomOrgsList) {
-				roomOrg.getRoom().setCurrentusers(clientListManager.getClientListByRoom(roomOrg.getRoom().getRooms_id()));
+				roomOrg.getRoom().setCurrentusers(clientListManager.getClientListByRoom(roomOrg.getRoom().getRooms_id(), null));
 			}
 
 			return roomOrgsList;
@@ -225,7 +225,7 @@ public class ConferenceService {
 			List<Rooms> roomList = roomDao.getPublicRooms();
 			
 			for (Rooms room : roomList) {
-				room.setCurrentusers(clientListManager.getClientListByRoom(room.getRooms_id()));
+				room.setCurrentusers(clientListManager.getClientListByRoom(room.getRooms_id(), null));
 			}
 
 			return roomList;
@@ -434,7 +434,7 @@ public class ConferenceService {
 		Long users_id = sessionManagement.checkSession(SID);
 		Long user_level = userManagement.getUserLevelByID(users_id);
 		Rooms room = roommanagement.getRoomById(user_level, rooms_id);
-		room.setCurrentusers(clientListManager.getClientListByRoom(room.getRooms_id()));
+		room.setCurrentusers(clientListManager.getClientListByRoom(room.getRooms_id(), null));
 		return room;
 	}
 
@@ -682,7 +682,7 @@ public class ConferenceService {
 			Rooms room = roomDao.get(room_id);
 			
 			if (room.getNumberOfPartizipants() <= this.clientListManager
-					.getClientListByRoom(room_id).size()) {
+					.getClientListByRoom(room_id, null).size()) {
 				return true;
 			}
 			
@@ -700,7 +700,7 @@ public class ConferenceService {
 	 * @return
 	 */
 	public List<RoomClient> getRoomClientsListByRoomId(Long room_id) {
-		return clientListManager.getClientListByRoom(room_id);
+		return clientListManager.getClientListByRoom(room_id, null);
 	}
 
 	/**

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/FLVRecorderService.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/FLVRecorderService.java?rev=1415944&r1=1415943&r2=1415944&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/FLVRecorderService.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/FLVRecorderService.java Sat Dec  1 08:13:09 2012
@@ -124,7 +124,7 @@ public class FLVRecorderService implemen
 			RoomClient currentClient = this.clientListManager
 					.getClientByStreamId(streamid, null);
 
-			for (RoomClient rcl : clientListManager.getClientListByRoom(currentClient.getRoom_id())) {
+			for (RoomClient rcl : clientListManager.getClientListByRoom(currentClient.getRoom_id(), null)) {
 				if (rcl.getIsRecording()) {
 					return rcl;
 				}
@@ -551,7 +551,7 @@ public class FLVRecorderService implemen
 			log.debug("getCurrentRoomClient -#########################- "
 					+ currentClient.getRoom_id());
 
-			for (RoomClient rcl : clientListManager.getClientListByRoomAll(currentClient.getRoom_id())) {
+			for (RoomClient rcl : clientListManager.getClientListByRoomAll(currentClient.getRoom_id(), null)) {
 				if (rcl.getIsRecording()) {
 					return rcl;
 				}