openmeetings-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebawag...@apache.org
Subject svn commit: r1442001 - in /openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session: ISessionManager.java SessionManager.java store/DatabaseStore.java store/HashMapStore.java store/IClientPersistenceStore.java
Date Mon, 04 Feb 2013 01:32:42 GMT
Author: sebawagner
Date: Mon Feb  4 01:32:42 2013
New Revision: 1442001

URL: http://svn.apache.org/viewvc?rev=1442001&view=rev
Log:
OPENMEETINGS-460 Fixing server force "FETCH" of lazy loaded server attribute in Client object,
in case its a query for the admin-UI where there is a column "server" (and probably the info
needed to kick the user later) 

Modified:
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/ISessionManager.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/SessionManager.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/DatabaseStore.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/HashMapStore.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/IClientPersistenceStore.java

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/ISessionManager.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/ISessionManager.java?rev=1442001&r1=1442000&r2=1442001&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/ISessionManager.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/ISessionManager.java
Mon Feb  4 01:32:42 2013
@@ -42,40 +42,39 @@ public interface ISessionManager {
 	public abstract void sessionStart();
 
 	/**
-	 * Get current clients and extends the room client with its potential
-	 * audio/video client and settings
+	 * add a new client item
 	 * 
-	 * @param room_id
-	 * @param server TODO
+	 * @param streamId
+	 * @param scopeName
+	 * @param remotePort
+	 * @param remoteAddress
+	 * @param swfUrl
+	 * @param isAVClient
+	 * @param server
 	 * @return
 	 */
 	public abstract Client addClientListItem(String streamId,
 			String scopeName, Integer remotePort, String remoteAddress,
 			String swfUrl, boolean isAVClient, Server server);
 
-	public abstract Collection<Client> getAllClients();
-
+	public abstract Collection<Client> getClients();
+	
 	/**
-	 * Get a client by its streamId
+	 * loads the server into the client (only if database cache is used)
 	 * 
-	 * @param streamId
-	 * @param server
-	 *            TODO
 	 * @return
 	 */
-	public abstract Client getClientByStreamId(String streamId,
-			Server server);
+	public abstract Collection<Client> getClientsWithServer();
 
 	/**
-	 * Additionally checks if the client receives sync events
-	 * 
-	 * Sync events will no be broadcasted to: - Screensharing users -
-	 * Audio/Video connections only
+	 * Get a client by its streamId
 	 * 
 	 * @param streamId
+	 * @param server
 	 * @return
 	 */
-	public abstract Client getSyncClientByStreamId(String streamId);
+	public abstract Client getClientByStreamId(String streamId,
+			Server server);
 
 	/**
 	 * get a client by its publicSID and the server, 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/SessionManager.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/SessionManager.java?rev=1442001&r1=1442000&r2=1442001&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/SessionManager.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/SessionManager.java
Mon Feb  4 01:32:42 2013
@@ -88,7 +88,7 @@ public class SessionManager implements I
 				rcm.setPublicSID(manageCryptStyle.getInstanceOfCrypt()
 						.createPassPhrase(String.valueOf(random).toString()));
 
-				//rcm.setServer(server);
+				rcm.setServer(server);
 				rcm.setUserport(remotePort);
 				rcm.setUserip(remoteAddress);
 				rcm.setSwfurl(swfUrl);
@@ -110,14 +110,18 @@ public class SessionManager implements I
 			return null;
 		}
 
-		public synchronized Collection<Client> getAllClients() {
+		public synchronized Collection<Client> getClients() {
 			return cache.getClients();
 		}
+		
+		public synchronized Collection<Client> getClientsWithServer() {
+			return cache.getClientsWithServer();
+		}
 
 		public synchronized Client getClientByStreamId(String streamId, Server server) {
 			try {
 				if (!cache.containsKey(server, streamId)) {
-					log.debug("Tried to get a non existing Client " + streamId);
+					log.debug("Tried to get a non existing Client " + streamId + " server " + server);
 					return null;
 				}
 				return cache.get(server, streamId);
@@ -127,30 +131,6 @@ public class SessionManager implements I
 			return null;
 		}
 
-		public synchronized Client getSyncClientByStreamId(String streamId) {
-			try {
-				if (!cache.containsKey(null, streamId)) {
-					log.debug("Tried to get a non existing Client " + streamId);
-					return null;
-				}
-
-				Client rcl = cache.get(null, streamId);
-
-				if (rcl == null) {
-					return null;
-				}
-
-				if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
-					return null;
-				}
-
-				return cache.get(null, streamId);
-			} catch (Exception err) {
-				log.error("[getClientByStreamId]", err);
-			}
-			return null;
-		}
-
 		public Client getClientByPublicSID(String publicSID, boolean isAVClient, Server server)
{
 			try {
 				for (Client rcl : cache.getClientsByPublicSID(server, publicSID)) {
@@ -317,7 +297,7 @@ public class SessionManager implements I
 			SearchResult<Client> sResult = new SearchResult<Client>();
 			sResult.setObjectName(Client.class.getName());
 			sResult.setRecords(Long.valueOf(cache.size()).longValue());
-			sResult.setResult(cache.values());
+			sResult.setResult(cache.getClientsWithServer());
 			return sResult;
 		}
 
@@ -369,8 +349,12 @@ public class SessionManager implements I
 				remotePort, remoteAddress, swfUrl, isAVClient, server);
 	}
 
-	public Collection<Client> getAllClients() {
-		return sessionManager.getAllClients();
+	public Collection<Client> getClients() {
+		return sessionManager.getClients();
+	}
+	
+	public Collection<Client> getClientsWithServer() {
+		return sessionManager.getClientsWithServer();
 	}
 
 	public Client getClientByStreamId(String streamId, Server server) {
@@ -380,10 +364,6 @@ public class SessionManager implements I
 		return sessionManager.getClientByStreamId(streamId, server);
 	}
 
-	public Client getSyncClientByStreamId(String streamId) {
-		return sessionManager.getSyncClientByStreamId(streamId);
-	}
-
 	public Client getClientByPublicSID(String publicSID, boolean isAVClient,
 			Server server) {
 		if (server == null) {
@@ -465,5 +445,5 @@ public class SessionManager implements I
 	public void sessionStart() {
 		sessionManager.sessionStart();
 	}
-
+	
 }

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/DatabaseStore.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/DatabaseStore.java?rev=1442001&r1=1442000&r2=1442001&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/DatabaseStore.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/DatabaseStore.java
Mon Feb  4 01:32:42 2013
@@ -92,6 +92,10 @@ public class DatabaseStore implements IC
 	public Collection<Client> getClients() {
 		return clientDao.getClients();
 	}
+	
+	public Collection<Client> getClientsWithServer() {
+		return clientDao.getClientsWithServer();
+	}
 
 	public Collection<Client> getClientsByServer(Server server) {
 		return clientDao.getClientsByServer(server);

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/HashMapStore.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/HashMapStore.java?rev=1442001&r1=1442000&r2=1442001&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/HashMapStore.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/HashMapStore.java
Mon Feb  4 01:32:42 2013
@@ -96,6 +96,12 @@ public class HashMapStore implements ICl
 		return clientsByStreamId.values();
 	}
 	
+	public Collection<Client> getClientsWithServer() {
+		//there is no server object to be loaded, memory cache means
+		//there is no cluster enabled
+		return getClients();
+	}
+	
 	public Collection<Client> getClientsByServer(Server server) {
 		return clientsByStreamId.values();
 	}

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/IClientPersistenceStore.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/IClientPersistenceStore.java?rev=1442001&r1=1442000&r2=1442001&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/IClientPersistenceStore.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/store/IClientPersistenceStore.java
Mon Feb  4 01:32:42 2013
@@ -123,4 +123,12 @@ public interface IClientPersistenceStore
 
 	public abstract List<Long> getRoomsIdsByServer(Server server);
 
+	/**
+	 * if database cache + cluster is enabled, the server object will be loaded 
+	 * into the client
+	 * 
+	 * @return
+	 */
+	public abstract Collection<Client> getClientsWithServer();
+
 }
\ No newline at end of file



Mime
View raw message