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 2013/02/04 01:22:35 UTC
svn commit: r1441994 - in
/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings: remote/
remote/red5/ session/
Author: sebawagner
Date: Mon Feb 4 00:22:35 2013
New Revision: 1441994
URL: http://svn.apache.org/viewvc?rev=1441994&view=rev
Log:
OPENMEETINGS-460 Fixing server "null" no more hard-coded anywhere, every serverId is now loaded through the ServerUtil
Modified:
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/FLVRecorderService.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/WhiteBoardService.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/ISessionManager.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/session/SessionManager.java
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/FLVRecorderService.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/FLVRecorderService.java?rev=1441994&r1=1441993&r2=1441994&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/FLVRecorderService.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/FLVRecorderService.java Mon Feb 4 00:22:35 2013
@@ -172,7 +172,7 @@ public class FLVRecorderService implemen
currentClient.setIsRecording(true);
currentClient.setFlvRecordingId(flvRecordingId);
this.sessionManager.updateClientByStreamId(current.getClient()
- .getId(), currentClient, false);
+ .getId(), currentClient, false, null);
// get all stream and start recording them
Collection<Set<IConnection>> conCollection = current.getScope()
@@ -225,7 +225,7 @@ public class FLVRecorderService implemen
this.sessionManager
.updateClientByStreamId(
- rcl.getStreamid(), rcl, false);
+ rcl.getStreamid(), rcl, false, null);
}
@@ -266,7 +266,7 @@ public class FLVRecorderService implemen
rcl.setFlvRecordingMetaDataId(flvRecordingMetaDataId);
this.sessionManager.updateClientByStreamId(
- rcl.getStreamid(), rcl, false);
+ rcl.getStreamid(), rcl, false, null);
// Start FLV recording
recordShow(conn,
@@ -508,7 +508,7 @@ public class FLVRecorderService implemen
currentClient.setIsRecording(false);
this.sessionManager.updateClientByStreamId(
- currentClient.getStreamid(), currentClient, false);
+ currentClient.getStreamid(), currentClient, false, null);
log.debug("this.flvRecorderConverterTask ",
this.flvRecorderConverterTask);
@@ -649,7 +649,7 @@ public class FLVRecorderService implemen
rcl.setFlvRecordingMetaDataId(flvRecordingMetaDataId);
this.sessionManager.updateClientByStreamId(
- rcl.getStreamid(), rcl, false);
+ rcl.getStreamid(), rcl, false, null);
}
@@ -688,7 +688,7 @@ public class FLVRecorderService implemen
rcl.setFlvRecordingMetaDataId(flvRecordingMetaDataId);
this.sessionManager.updateClientByStreamId(
- rcl.getStreamid(), rcl, false);
+ rcl.getStreamid(), rcl, false, null);
}
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java?rev=1441994&r1=1441993&r2=1441994&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java Mon Feb 4 00:22:35 2013
@@ -462,7 +462,7 @@ public class MainService implements IPen
currentClient.setAllowRecording(soapLogin.getAllowRecording());
this.sessionManager.updateClientByStreamId(streamId,
- currentClient, false);
+ currentClient, false, null);
if (loginReturn == null) {
@@ -544,7 +544,7 @@ public class MainService implements IPen
currentClient.getLastname());
this.sessionManager.updateClientByStreamId(streamId,
- currentClient, false);
+ currentClient, false, null);
return 1L;
@@ -657,7 +657,7 @@ public class MainService implements IPen
}
this.sessionManager.updateClientByStreamId(streamId,
- currentClient, false);
+ currentClient, false, null);
return new Long(1);
}
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/WhiteBoardService.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/WhiteBoardService.java?rev=1441994&r1=1441993&r2=1441994&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/WhiteBoardService.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/WhiteBoardService.java Mon Feb 4 00:22:35 2013
@@ -232,7 +232,7 @@ public class WhiteBoardService implement
if (rcl != null) {
rcl.setCanDraw(canDraw);
this.sessionManager.updateClientByStreamId(
- rcl.getStreamid(), rcl, false);
+ rcl.getStreamid(), rcl, false, null);
HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>();
newMessage.put(0, "updateDrawStatus");
@@ -274,7 +274,7 @@ public class WhiteBoardService implement
if (rcl != null) {
rcl.setCanShare(canShare);
this.sessionManager.updateClientByStreamId(
- rcl.getStreamid(), rcl, false);
+ rcl.getStreamid(), rcl, false, null);
HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>();
newMessage.put(0, "updateDrawStatus");
@@ -316,7 +316,7 @@ public class WhiteBoardService implement
if (rcl != null) {
rcl.setCanRemote(canRemote);
this.sessionManager.updateClientByStreamId(
- rcl.getStreamid(), rcl, false);
+ rcl.getStreamid(), rcl, false, null);
HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>();
newMessage.put(0, "updateDrawStatus");
@@ -357,7 +357,7 @@ public class WhiteBoardService implement
if (rcl != null) {
rcl.setCanGiveAudio(canGiveAudio);
this.sessionManager.updateClientByStreamId(
- rcl.getStreamid(), rcl, false);
+ rcl.getStreamid(), rcl, false, null);
HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>();
newMessage.put(0, "updateGiveAudioStatus");
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java?rev=1441994&r1=1441993&r2=1441994&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java Mon Feb 4 00:22:35 2013
@@ -241,7 +241,7 @@ public class ScopeApplicationAdapter ext
}
if (changed) {
- sessionManager.updateClientByStreamId(rc.getStreamid(), rc, false);
+ sessionManager.updateClientByStreamId(rc.getStreamid(), rc, false, null);
if (!rc.isStartStreaming() && !rc.isStartRecording() && !rc.isStreamPublishStarted()) {
returnMap.put("result", "stopAll");
@@ -330,7 +330,7 @@ public class ScopeApplicationAdapter ext
"organization_id").toString()));
this.sessionManager.updateClientByStreamId(current
- .getClient().getId(), currentClient, false);
+ .getClient().getId(), currentClient, false, null);
Map returnMap = new HashMap();
returnMap.put("alreadyPublished", false);
@@ -370,7 +370,7 @@ public class ScopeApplicationAdapter ext
// This is duplicated, but its not sure that in the meantime
// somebody requests this Client Object Info
this.sessionManager.updateClientByStreamId(current
- .getClient().getId(), currentClient, false);
+ .getClient().getId(), currentClient, false, null);
if (startStreaming) {
returnMap.put("modus", "startStreaming");
@@ -450,7 +450,7 @@ public class ScopeApplicationAdapter ext
Client currentClient = this.sessionManager
.getClientByStreamId(current.getClient().getId(), null);
sessionManager.updateClientByStreamId(current.getClient().getId(),
- currentClient, false);
+ currentClient, false, null);
return currentClient.getPublicSID();
}
@@ -469,7 +469,7 @@ public class ScopeApplicationAdapter ext
}
SessionVariablesUtil.initClient(c, SessionVariablesUtil.isAVClient(c), newPublicSID);
currentClient.setPublicSID(newPublicSID);
- sessionManager.updateClientByStreamId(c.getId(), currentClient, false);
+ sessionManager.updateClientByStreamId(c.getId(), currentClient, false, null);
return true;
} catch (Exception err) {
log.error("[overwritePublicSID]", err);
@@ -661,7 +661,7 @@ public class ScopeApplicationAdapter ext
}
if (removeUserFromSessionList) {
- this.sessionManager.removeClient(currentClient.getStreamid());
+ this.sessionManager.removeClient(currentClient.getStreamid(), null);
}
} catch (Exception err) {
log.error("[roomLeaveByScope]", err);
@@ -698,7 +698,7 @@ public class ScopeApplicationAdapter ext
currentClient.setScreenPublishStarted(true);
this.sessionManager.updateClientByStreamId(current
- .getClient().getId(), currentClient, false);
+ .getClient().getId(), currentClient, false, null);
}
//If its an audio/video client then send the session object with the full
//data to everybody
@@ -928,7 +928,7 @@ public class ScopeApplicationAdapter ext
currentClient.setIsMod(true);
// Put the mod-flag to true for this client
this.sessionManager.updateClientByStreamId(
- currentClient.getStreamid(), currentClient, false);
+ currentClient.getStreamid(), currentClient, false, null);
List<Client> currentMods = this.sessionManager
.getCurrentModeratorByRoom(room_id);
@@ -1007,7 +1007,7 @@ public class ScopeApplicationAdapter ext
currentClient.setIsMod(false);
// Put the mod-flag to true for this client
this.sessionManager.updateClientByStreamId(
- currentClient.getStreamid(), currentClient, false);
+ currentClient.getStreamid(), currentClient, false, null);
List<Client> currentMods = this.sessionManager
.getCurrentModeratorByRoom(room_id);
@@ -1062,7 +1062,7 @@ public class ScopeApplicationAdapter ext
// Put the mod-flag to true for this client
this.sessionManager.updateClientByStreamId(
- currentClient.getStreamid(), currentClient, false);
+ currentClient.getStreamid(), currentClient, false, null);
// Notify all clients of the same scope (room)
Collection<Set<IConnection>> conCollection = current.getScope()
@@ -1112,7 +1112,7 @@ public class ScopeApplicationAdapter ext
// Put the mod-flag to true for this client
currentClient.setMicMuted(false);
this.sessionManager.updateClientByStreamId(
- currentClient.getStreamid(), currentClient, false);
+ currentClient.getStreamid(), currentClient, false, null);
// Notify all clients of the same scope (room)
Collection<Set<IConnection>> conCollection = current.getScope()
@@ -1131,7 +1131,7 @@ public class ScopeApplicationAdapter ext
if (rcl != currentClient) {
rcl.setMicMuted(true);
this.sessionManager.updateClientByStreamId(
- rcl.getStreamid(), rcl, false);
+ rcl.getStreamid(), rcl, false, null);
}
log.debug("Send Flag to Client: "
+ rcl.getUsername());
@@ -1165,7 +1165,7 @@ public class ScopeApplicationAdapter ext
currentClient.setMicMuted(mute);
this.sessionManager.updateClientByStreamId(
- currentClient.getStreamid(), currentClient, false);
+ currentClient.getStreamid(), currentClient, false, null);
HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>();
newMessage.put(0, "updateMuteStatus");
@@ -1249,7 +1249,7 @@ public class ScopeApplicationAdapter ext
.getClientByStreamId(streamid, null);
currentClient.setBroadCastID(broadCastCounter++);
this.sessionManager.updateClientByStreamId(streamid,
- currentClient, false);
+ currentClient, false, null);
return currentClient.getBroadCastID();
} catch (Exception err) {
log.error("[getBroadCastId]", err);
@@ -1291,7 +1291,7 @@ public class ScopeApplicationAdapter ext
currentClient.setInterviewPodId(interviewPodId);
// Long room_id = currentClient.getRoom_id();
this.sessionManager.updateAVClientByStreamId(streamid,
- currentClient);
+ currentClient, null);
SessionVariablesUtil.initClient(c, false, publicSID);
HashMap<String, Object> hsm = new HashMap<String, Object>();
@@ -1440,7 +1440,7 @@ public class ScopeApplicationAdapter ext
currentClient.setIsSuperModerator(isSuperModerator);
this.sessionManager.updateClientByStreamId(streamid,
- currentClient, true);
+ currentClient, true, null);
Rooms room = roomDao.get(room_id);
if (room.getShowMicrophoneStatus()) {
@@ -1491,7 +1491,7 @@ public class ScopeApplicationAdapter ext
// Update the Client List
this.sessionManager.updateClientByStreamId(streamid,
- currentClient, false);
+ currentClient, false, null);
List<Client> modRoomList = this.sessionManager
.getCurrentModeratorByRoom(currentClient.getRoom_id());
@@ -1524,7 +1524,7 @@ public class ScopeApplicationAdapter ext
// Update the Client List
this.sessionManager.updateClientByStreamId(
- streamid, currentClient, false);
+ streamid, currentClient, false, null);
List<Client> modRoomList = this.sessionManager
.getCurrentModeratorByRoom(currentClient
@@ -1549,7 +1549,7 @@ public class ScopeApplicationAdapter ext
// Update the Client List
this.sessionManager.updateClientByStreamId(streamid,
- currentClient, false);
+ currentClient, false, null);
} else {
@@ -1591,7 +1591,7 @@ public class ScopeApplicationAdapter ext
// Update the Client List
this.sessionManager.updateClientByStreamId(
- streamid, currentClient, false);
+ streamid, currentClient, false, null);
List<Client> modRoomList = this.sessionManager
.getCurrentModeratorByRoom(currentClient
@@ -1605,7 +1605,7 @@ public class ScopeApplicationAdapter ext
moderator_set = true;
this.sessionManager.updateClientByStreamId(
- streamid, currentClient, false);
+ streamid, currentClient, false, null);
break;
} else {
log.debug("User "
@@ -1613,7 +1613,7 @@ public class ScopeApplicationAdapter ext
+ " is NOT moderator due to flag in MeetingMember record");
currentClient.setIsMod(false);
this.sessionManager.updateClientByStreamId(
- streamid, currentClient, false);
+ streamid, currentClient, false, null);
break;
}
} else {
@@ -1633,7 +1633,7 @@ public class ScopeApplicationAdapter ext
+ " could not be found as MeetingMember -> definitely no moderator");
currentClient.setIsMod(false);
this.sessionManager.updateClientByStreamId(streamid,
- currentClient, false);
+ currentClient, false, null);
} else {
// if current user is part of the member list, but moderator
// couldn't be retrieved : first come, first draw!
@@ -1643,7 +1643,7 @@ public class ScopeApplicationAdapter ext
// Update the Client List
this.sessionManager.updateClientByStreamId(streamid,
- currentClient, false);
+ currentClient, false, null);
List<Client> modRoomList = this.sessionManager
.getCurrentModeratorByRoom(currentClient
@@ -1657,7 +1657,7 @@ public class ScopeApplicationAdapter ext
syncMessageToCurrentScope("setNewModeratorByList", modRoomList, false);
this.sessionManager.updateClientByStreamId(streamid,
- currentClient, false);
+ currentClient, false, null);
}
}
@@ -1733,7 +1733,7 @@ public class ScopeApplicationAdapter ext
}
}
this.sessionManager.updateClientByStreamId(streamid,
- currentClient, false);
+ currentClient, false, null);
return currentClient;
} catch (Exception err) {
log.error("[setUsername]", err);
@@ -1784,7 +1784,7 @@ public class ScopeApplicationAdapter ext
currentClient.setPicture_uri(us.getPictureuri());
}
this.sessionManager.updateClientByStreamId(streamid,
- currentClient, false);
+ currentClient, false, null);
return currentClient;
} catch (Exception err) {
log.error("[setUsername]", err);
@@ -2614,7 +2614,7 @@ public class ScopeApplicationAdapter ext
// later
current_rcl.setIsRecording(true);
this.sessionManager.updateClientByStreamId(current.getClient()
- .getId(), current_rcl, false);
+ .getId(), current_rcl, false, null);
Map<String, String> interviewStatus = new HashMap<String, String>();
interviewStatus.put("action", "start");
@@ -2718,7 +2718,7 @@ public class ScopeApplicationAdapter ext
// Reset the Recording Flag to Record all
// Participants that enter later
this.sessionManager.updateClientByStreamId(conn
- .getClient().getId(), rcl, false);
+ .getClient().getId(), rcl, false, null);
found = true;
}
@@ -2872,7 +2872,7 @@ public class ScopeApplicationAdapter ext
String newNumber = "("+Integer.toString(roommanagement.getSipConferenceMembersNumber(currentClient.getRoom_id())-1)+")";
if(!newNumber.equals(currentClient.getLastname())) {
currentClient.setLastname(newNumber);
- this.sessionManager.updateClientByStreamId(streamid, currentClient, false);
+ this.sessionManager.updateClientByStreamId(streamid, currentClient, false, null);
log.debug("updateSipTransport: {}, {}, {}, {}", new Object[]{currentClient.getPublicSID(),
currentClient.getRoom_id(), currentClient.getFirstname(), currentClient.getLastname()});
sendMessageWithClient(new String[]{"personal",currentClient.getFirstname(),currentClient.getLastname()});
@@ -2922,7 +2922,7 @@ public class ScopeApplicationAdapter ext
currentClient.setVWidth(120);
currentClient.setVHeight(90);
currentClient.setSipTransport(true);
- this.sessionManager.updateClientByStreamId(streamid, currentClient, false);
+ this.sessionManager.updateClientByStreamId(streamid, currentClient, false, null);
SessionVariablesUtil.initClient(c, false, publicSID); //TODO not sure if this should be marked as AVClient or not
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=1441994&r1=1441993&r2=1441994&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 00:22:35 2013
@@ -125,7 +125,7 @@ public interface ISessionManager {
* @return
*/
public abstract Boolean updateAVClientByStreamId(String streamId,
- Client rcm);
+ Client rcm, Server server);
/**
* Update the session object
@@ -141,7 +141,7 @@ public interface ISessionManager {
* @return
*/
public abstract Boolean updateClientByStreamId(String streamId,
- Client rcm, boolean updateRoomCount);
+ Client rcm, boolean updateRoomCount, Server server);
/**
* Remove a client from the session store
@@ -149,7 +149,7 @@ public interface ISessionManager {
* @param streamId
* @return
*/
- public abstract Boolean removeClient(String streamId);
+ public abstract Boolean removeClient(String streamId, Server server);
/**
* Get all ClientList Objects of that room and domain This Function is
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=1441994&r1=1441993&r2=1441994&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 00:22:35 2013
@@ -202,12 +202,12 @@ public class SessionManager implements I
}
public synchronized Boolean updateAVClientByStreamId(String streamId,
- Client rcm) {
+ Client rcm, Server server) {
try {
// get the corresponding user session object and update the settings
Client rclUsual = getClientByPublicSID(rcm.getPublicSID(),
- false, null);
+ false, server);
if (rclUsual != null) {
rclUsual.setBroadCastID(rcm.getBroadCastID());
rclUsual.setAvsettings(rcm.getAvsettings());
@@ -215,7 +215,7 @@ public class SessionManager implements I
rclUsual.setVWidth(rcm.getVWidth());
rclUsual.setVX(rcm.getVX());
rclUsual.setVY(rcm.getVY());
- Client rclSaved = cache.get(null, rclUsual.getStreamid());
+ Client rclSaved = cache.get(server, rclUsual.getStreamid());
if (rclSaved != null) {
cache.put(rclUsual.getStreamid(),rclUsual);
} else {
@@ -224,7 +224,7 @@ public class SessionManager implements I
}
}
- updateClientByStreamId(streamId, rcm, false);
+ updateClientByStreamId(streamId, rcm, false, server);
} catch (Exception err) {
log.error("[updateAVClientByStreamId]", err);
}
@@ -232,10 +232,10 @@ public class SessionManager implements I
}
public synchronized Boolean updateClientByStreamId(String streamId,
- Client rcm, boolean updateRoomCount) {
+ Client rcm, boolean updateRoomCount, Server server) {
try {
- Client rclSaved = cache.get(null, streamId);
+ Client rclSaved = cache.get(server, streamId);
if (rclSaved != null) {
cache.put(streamId, rcm);
@@ -250,10 +250,10 @@ public class SessionManager implements I
return null;
}
- public synchronized Boolean removeClient(String streamId) {
+ public synchronized Boolean removeClient(String streamId, Server server) {
try {
- if (cache.containsKey(null,streamId)) {
- cache.remove(null,streamId);
+ if (cache.containsKey(server,streamId)) {
+ cache.remove(server,streamId);
return true;
} else {
log.debug("Tried to remove a non existing Client " + streamId);
@@ -403,18 +403,27 @@ public class SessionManager implements I
return sessionManager.getClientByUserId(userId);
}
- public Boolean updateAVClientByStreamId(String streamId, Client rcm) {
- return sessionManager.updateAVClientByStreamId(streamId, rcm);
+ public Boolean updateAVClientByStreamId(String streamId, Client rcm, Server server) {
+ if (server == null) {
+ server = serverUtil.getCurrentServer();
+ }
+ return sessionManager.updateAVClientByStreamId(streamId, rcm, server);
}
public Boolean updateClientByStreamId(String streamId, Client rcm,
- boolean updateRoomCount) {
+ boolean updateRoomCount, Server server) {
+ if (server == null) {
+ server = serverUtil.getCurrentServer();
+ }
return sessionManager.updateClientByStreamId(streamId, rcm,
- updateRoomCount);
+ updateRoomCount, server);
}
- public Boolean removeClient(String streamId) {
- return sessionManager.removeClient(streamId);
+ public Boolean removeClient(String streamId, Server server) {
+ if (server == null) {
+ server = serverUtil.getCurrentServer();
+ }
+ return sessionManager.removeClient(streamId, server);
}
public List<Client> getClientListByRoom(Long room_id) {