Author: solomax
Date: Wed Dec 2 05:48:38 2015
New Revision: 1717570
URL: http://svn.apache.org/viewvc?rev=1717570&view=rev
Log:
[OPENMEETINGS-1286] screen sharing is fixed
Modified:
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceService.java
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/util/SessionVariablesUtil.java
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/room/Client.java
openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
openmeetings/trunk/singlewebapp/openmeetings-service/src/main/java/org/apache/openmeetings/service/user/UserManager.java
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/poll/TestClientListManager.java
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/session/TestHashMapSession.java
Modified:
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceService.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceService.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceService.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceService.java
Wed Dec 2 05:48:38 2015
@@ -355,4 +355,12 @@ public class ConferenceService {
}
return null;
}
+
+ public Room getRoomById(String SID, Long roomId) {
+ Long userId = sessiondataDao.checkSession(SID);
+ if (AuthLevelUtil.hasUserLevel(userDao.getRights(userId))) {
+ return roomDao.get(roomId);
+ }
+ return null;
+ }
}
Modified:
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java
Wed Dec 2 05:48:38 2015
@@ -204,10 +204,10 @@ public class MobileService {
Client c =
sessionManager.getClientByStreamId(streamId, null);
if (c == null) {
c =
sessionManager.addClientListItem(streamId, conn.getScope().getName(),
conn.getRemotePort(),
- conn.getRemoteAddress(), "",
false, null);
+ conn.getRemoteAddress(), "",
null);
}
-
SessionVariablesUtil.initClient(conn.getClient(), false, c.getPublicSID());
+
SessionVariablesUtil.initClient(conn.getClient(), c.getPublicSID());
c.setUserId(u.getId());
c.setFirstname(u.getFirstname());
c.setLastname(u.getLastname());
@@ -235,7 +235,7 @@ public class MobileService {
for (IConnection conn :
current.getScope().getClientConnections()) {
if (conn != null && conn instanceof
IServiceCapableConnection) {
Client c =
sessionManager.getClientByStreamId(conn.getClient().getId(), null);
- if ((c.isMobile() || c.isAvClient()) &&
!Strings.isEmpty(c.getAvsettings()) && !c.isScreenClient()) {
+ if (!Strings.isEmpty(c.getAvsettings()) &&
!c.isScreenClient()) {
Map<String, Object> map = new
Hashtable<String, Object>();
add(map, "streamId", c.getStreamid());
add(map, "broadCastId",
c.getBroadCastID());
Modified:
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java
Wed Dec 2 05:48:38 2015
@@ -138,9 +138,7 @@ public class RecordingService implements
Client rcl =
sessionManager.getClientByStreamId(conn.getClient().getId(), null);
// Send every user a
notification that the recording did start
- if (!rcl.isAvClient()) {
-
((IServiceCapableConnection) conn).invoke("startedRecording", new Object[] {
client }, this);
- }
+ ((IServiceCapableConnection)
conn).invoke("startedRecording", new Object[] { client }, this);
// If its the recording client
we need another type of Meta Data
if (rcl.isScreenClient()) {
@@ -159,8 +157,7 @@ public class RecordingService implements
sessionManager.updateClientByStreamId(rcl.getStreamid(), rcl, false, null);
}
- } else if ((rcl.isMobile() ||
rcl.isAvClient())
- &&
(rcl.getAvsettings().equals("av") || rcl.getAvsettings().equals("a") ||
rcl.getAvsettings().equals("v"))) {
+ } else if
(rcl.getAvsettings().equals("av") || rcl.getAvsettings().equals("a") ||
rcl.getAvsettings().equals("v")) {
// if the user does
publish av, a, v
// But we only record
av or a, video only is not interesting
String broadcastId = ""
+ rcl.getBroadCastID();
@@ -329,8 +326,7 @@ public class RecordingService implements
// Update Meta
Data
metaDataDao.updateEndDate(rcl.getRecordingMetaDataId(), new Date());
}
- } else if ((rcl.isMobile() ||
rcl.isAvClient())
- &&
(rcl.getAvsettings().equals("av") || rcl.getAvsettings().equals("a") ||
rcl.getAvsettings().equals("v"))) {
+ } else if
(rcl.getAvsettings().equals("av") || rcl.getAvsettings().equals("a") ||
rcl.getAvsettings().equals("v")) {
stopRecordingShow(conn,
String.valueOf(rcl.getBroadCastID()).toString(), rcl.getRecordingMetaDataId());
@@ -418,8 +414,7 @@ public class RecordingService implements
metaDataDao.updateEndDate(rcl.getRecordingMetaDataId(), new Date());
}
- } else if (rcl.isAvClient()
- && (rcl.getAvsettings().equals("a") ||
rcl.getAvsettings().equals("v") || rcl.getAvsettings().equals("av"))) {
+ } else if (rcl.getAvsettings().equals("a") ||
rcl.getAvsettings().equals("v") || rcl.getAvsettings().equals("av")) {
// FIXME: Is there really a need to stop it
manually if the user
// just stops the stream?
@@ -459,8 +454,7 @@ public class RecordingService implements
sessionManager.updateClientByStreamId(rcl.getStreamid(), rcl, false, null);
}
- } else if (rcl.isAvClient()
- && (rcl.getAvsettings().equals("av") ||
rcl.getAvsettings().equals("a") || rcl.getAvsettings().equals("v"))) {
+ } else if (rcl.getAvsettings().equals("av") ||
rcl.getAvsettings().equals("a") || rcl.getAvsettings().equals("v")) {
// if the user does publish av, a, v
// But we only record av or a, video only is
not interesting
Modified:
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java
Wed Dec 2 05:48:38 2015
@@ -281,7 +281,7 @@ public class UserService implements IUse
Long userId = sessiondataDao.checkSession(SID);
// users only
if
(AuthLevelUtil.hasUserLevel(userDao.getRights(userId))) {
- Client rcl =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client rcl =
sessionManager.getClientByPublicSID(publicSID, null);
if (rcl == null) {
return true;
Modified:
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java
Wed Dec 2 05:48:38 2015
@@ -160,7 +160,7 @@ public class WhiteBoardService implement
if
(AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
if (currentClient.getIsMod()) {
- Client rcl =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client rcl =
sessionManager.getClientByPublicSID(publicSID, null);
if (rcl != null) {
rcl.setCanDraw(canDraw);
@@ -193,7 +193,7 @@ public class WhiteBoardService implement
if
(AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
if (currentClient.getIsMod()) {
- Client rcl =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client rcl =
sessionManager.getClientByPublicSID(publicSID, null);
if (rcl != null) {
rcl.setCanShare(canShare);
@@ -226,7 +226,7 @@ public class WhiteBoardService implement
if
(AuthLevelUtil.hasUserLevel(userDao.getRights(userId))) {
if (currentClient.getIsMod()) {
- Client rcl =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client rcl =
sessionManager.getClientByPublicSID(publicSID, null);
if (rcl != null) {
rcl.setCanRemote(canRemote);
@@ -260,7 +260,7 @@ public class WhiteBoardService implement
if
(AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
if (currentClient.getIsMod()) {
- Client rcl =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client rcl =
sessionManager.getClientByPublicSID(publicSID, null);
if (rcl != null) {
rcl.setCanGiveAudio(canGiveAudio);
Modified:
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
Wed Dec 2 05:48:38 2015
@@ -144,10 +144,7 @@ public class ScopeApplicationAdapter ext
IServiceCapableConnection service = (IServiceCapableConnection)
conn;
String streamId = conn.getClient().getId();
- boolean isAVClient = params.length == 1 ? Boolean.valueOf("" +
params[0]) : false;
-
- log.debug("### Client connected to OpenMeetings, register
Client StreamId: " + streamId + " scope "
- + conn.getScope().getName() + " isAVClient " +
isAVClient);
+ log.debug("### Client connected to OpenMeetings, register
Client StreamId: " + streamId + " scope " + conn.getScope().getName());
// Set StreamId in Client
service.invoke("setId", new Object[] { streamId }, this);
@@ -158,16 +155,16 @@ public class ScopeApplicationAdapter ext
//TODO add similar code for other connections
if (map.containsKey("screenClient")) {
String parentSid = (String)map.get("parentSid");
- Client parentClient =
sessionManager.getClientByPublicSID(parentSid, false, null);
+ Client parentClient =
sessionManager.getClientByPublicSID(parentSid, null);
if (parentClient == null) {
rejectClient();
}
}
Client rcm =
sessionManager.addClientListItem(conn.getClient().getId(),
conn.getScope().getName(), conn.getRemotePort(),
- conn.getRemoteAddress(), swfURL, isAVClient,
null);
+ conn.getRemoteAddress(), swfURL, null);
- SessionVariablesUtil.initClient(conn.getClient(), isAVClient,
rcm.getPublicSID());
+ SessionVariablesUtil.initClient(conn.getClient(),
rcm.getPublicSID());
//TODO add similar code for other connections, merge with above
block
if (map.containsKey("screenClient")) {
//TODO add check for room rights
@@ -201,7 +198,7 @@ public class ScopeApplicationAdapter ext
IConnection current = Red5.getConnectionLocal();
Client control =
sessionManager.getClientByStreamId(current.getClient().getId(), null);
- Client client =
sessionManager.getClientByPublicSID(control.getStreamPublishName(), false,
null);
+ Client client =
sessionManager.getClientByPublicSID(control.getStreamPublishName(), null);
Map<String, String> returnMap = new HashMap<String,
String>();
@@ -288,7 +285,7 @@ public class ScopeApplicationAdapter ext
IConnection current = Red5.getConnectionLocal();
Client control =
sessionManager.getClientByStreamId(current.getClient().getId(), null);
- Client client =
sessionManager.getClientByPublicSID(control.getStreamPublishName(), false,
null);
+ Client client =
sessionManager.getClientByPublicSID(control.getStreamPublishName(), null);
if (client != null) {
boolean startRecording = Boolean.valueOf("" +
map.get("startRecording"));
@@ -422,7 +419,7 @@ public class ScopeApplicationAdapter ext
if (currentClient == null) {
return false;
}
- SessionVariablesUtil.initClient(c,
SessionVariablesUtil.isAVClient(c), newPublicSID);
+ SessionVariablesUtil.initClient(c, newPublicSID);
currentClient.setPublicSID(newPublicSID);
sessionManager.updateClientByStreamId(c.getId(),
currentClient, false, null);
return true;
@@ -551,11 +548,6 @@ public class ScopeApplicationAdapter ext
recordingService.stopRecordingShowForClient(cons, currentClient);
}
- //If the user was a
avclient, we do not broadcast a message about that to everybody
- if
(currentClient.isAvClient()) {
- continue;
- }
-
boolean isScreen =
rcl.isScreenClient();
if (isScreen &&
currentClient.getPublicSID().equals(rcl.getStreamPublishName())) {
//going to
terminate screen sharing started by this client
@@ -564,9 +556,6 @@ public class ScopeApplicationAdapter ext
} else if (isScreen) {
// screen
sharing clients do not receive events
continue;
- } else if
(rcl.isAvClient()) {
- // AVClients or
potential AVClients do not receive events
- continue;
}
// Send to all
connected users
@@ -613,10 +602,6 @@ public class ScopeApplicationAdapter ext
currentClient.setScreenPublishStarted(true);
sessionManager.updateClientByStreamId(streamid,
currentClient, false, null);
}
- //If its an audio/video client then send the session
object with the full data to everybody
- else if (currentClient.isAvClient()) {
- clientObjectSendToSync =
sessionManager.getClientByPublicSID(currentClient.getPublicSID(), false, null);
- }
log.debug("newStream SEND: " + currentClient);
@@ -642,10 +627,6 @@ public class ScopeApplicationAdapter ext
log.debug("RCL getIsRecording
newStream SEND");
recordingService.addRecordingByStreamId(current, streamid, currentClient,
rcl.getRecordingId());
}
- if (rcl.isAvClient()) {
- log.debug("RCL getIsAVClient
newStream SEND");
- return true;
- }
if (rcl.isScreenClient()) {
log.debug("RCL
getIsScreenClient newStream SEND");
return true;
@@ -783,7 +764,7 @@ public class ScopeApplicationAdapter ext
try {
log.debug("----------- addModerator: " + publicSID);
- Client currentClient =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client currentClient =
sessionManager.getClientByPublicSID(publicSID, null);
if (currentClient == null) {
return -1L;
@@ -825,7 +806,7 @@ public class ScopeApplicationAdapter ext
try {
log.debug("----------- removeModerator: " + publicSID);
- Client currentClient =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client currentClient =
sessionManager.getClientByPublicSID(publicSID, null);
if (currentClient == null) {
return -1L;
@@ -849,7 +830,7 @@ public class ScopeApplicationAdapter ext
try {
log.debug("----------- setBroadCastingFlag: " +
publicSID);
- Client currentClient =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client currentClient =
sessionManager.getClientByPublicSID(publicSID, null);
if (currentClient == null) {
return -1L;
@@ -877,7 +858,7 @@ public class ScopeApplicationAdapter ext
IConnection current = Red5.getConnectionLocal();
// String streamid = current.getClient().getId();
- final Client currentClient =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ final Client currentClient =
sessionManager.getClientByPublicSID(publicSID, null);
if (currentClient == null) {
return -1L;
@@ -914,7 +895,7 @@ public class ScopeApplicationAdapter ext
try {
log.debug("----------- switchMicMuted: " + publicSID);
- Client currentClient =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client currentClient =
sessionManager.getClientByPublicSID(publicSID, null);
if (currentClient == null) {
return -1L;
}
@@ -934,7 +915,7 @@ public class ScopeApplicationAdapter ext
public Boolean getMicMutedByPublicSID(String publicSID) {
try {
- Client currentClient =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client currentClient =
sessionManager.getClientByPublicSID(publicSID, null);
if (currentClient == null) {
return true;
}
@@ -964,7 +945,7 @@ public class ScopeApplicationAdapter ext
public synchronized Long applyForModeration(String publicSID) {
try {
- Client currentClient =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client currentClient =
sessionManager.getClientByPublicSID(publicSID, null);
List<Client> currentModList =
sessionManager.getCurrentModeratorByRoom(currentClient.getRoomId());
@@ -1028,7 +1009,7 @@ public class ScopeApplicationAdapter ext
IClient c = current.getClient();
String streamid = c.getId();
log.debug("----------- setUserAVSettings {} {} {}",
new Object[] {streamid, publicSID, avsettings, newMessage});
- Client parentClient =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client parentClient =
sessionManager.getClientByPublicSID(publicSID, null);
Client currentClient =
sessionManager.getClientByStreamId(streamid, null);
currentClient.setAvsettings(avsettings);
currentClient.setRoomId(roomId);
@@ -1041,7 +1022,7 @@ public class ScopeApplicationAdapter ext
currentClient.setFirstname(parentClient.getFirstname());
currentClient.setPicture_uri(parentClient.getPicture_uri());
sessionManager.updateAVClientByStreamId(streamid,
currentClient, null);
- SessionVariablesUtil.initClient(c, false, publicSID);
+ SessionVariablesUtil.initClient(c, publicSID);
HashMap<String, Object> hsm = new HashMap<String,
Object>();
hsm.put("client", currentClient);
@@ -1120,8 +1101,7 @@ public class ScopeApplicationAdapter ext
* @param colorObj - some color
* @return RoomStatus object
*/
- public synchronized RoomStatus setRoomValues(Long roomId, Boolean
becomeModerator, Boolean isSuperModerator,
- Long groupId, String colorObj) {
+ public synchronized RoomStatus setRoomValues(Long roomId, Boolean
becomeModerator, Boolean isSuperModerator, String colorObj) {
try {
log.debug("----------- setRoomValues");
IConnection current = Red5.getConnectionLocal();
@@ -1463,7 +1443,7 @@ public class ScopeApplicationAdapter ext
@Override
public boolean filter(IConnection conn) {
IClient client = conn.getClient();
- return
SessionVariablesUtil.isScreenClient(client) ||
SessionVariablesUtil.isAVClient(client);
+ return
SessionVariablesUtil.isScreenClient(client);
}
}.start();
} catch (Exception err) {
@@ -1689,11 +1669,9 @@ public class ScopeApplicationAdapter ext
public boolean filter(IConnection conn) {
IClient client = conn.getClient();
return (!sendScreen &&
SessionVariablesUtil.isScreenClient(client))
- ||
SessionVariablesUtil.isAVClient(client)
|| (!sendSelf &&
client.getId().equals(current.getClient().getId()));
}
}.start();
-
}
public abstract class MessageSender extends Thread {
@@ -1865,7 +1843,7 @@ public class ScopeApplicationAdapter ext
// log.debug("webAppKeyScope "+webAppKeyScope);
// Get Room Id to send it to the correct Scope
- Client currentClient =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client currentClient =
sessionManager.getClientByPublicSID(publicSID, null);
if (currentClient == null) {
throw new Exception("Could not Find RoomClient
on List publicSID: " + publicSID);
@@ -1888,9 +1866,6 @@ public class ScopeApplicationAdapter ext
if
(SessionVariablesUtil.isScreenClient(client)) {
// screen sharing clients do
not receive events
continue;
- } else if
(SessionVariablesUtil.isAVClient(client)) {
- // AVClients or potential
AVClients do not receive events
- continue;
}
if
(SessionVariablesUtil.getPublicSID(client).equals(publicSID)) {
@@ -1966,9 +1941,6 @@ public class ScopeApplicationAdapter ext
if
(SessionVariablesUtil.isScreenClient(client)) {
// screen sharing clients do
not receive events
continue;
- } else if
(SessionVariablesUtil.isAVClient(client)) {
- // AVClients or potential
AVClients do not receive events
- continue;
}
((IServiceCapableConnection)
conn).invoke("interviewStatus", new Object[] { interviewStatus }, this);
@@ -2207,7 +2179,7 @@ public class ScopeApplicationAdapter ext
currentClient.setVHeight(90);
currentClient.setPicture_uri("phone.png");
sessionManager.updateClientByStreamId(streamid, currentClient,
false, null);
- SessionVariablesUtil.initClient(c, false, publicSID);
+ SessionVariablesUtil.initClient(c, publicSID);
sendMessageToCurrentScope("addNewUser", currentClient, false);
}
Modified:
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/util/SessionVariablesUtil.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/util/SessionVariablesUtil.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/util/SessionVariablesUtil.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/util/SessionVariablesUtil.java
Wed Dec 2 05:48:38 2015
@@ -28,29 +28,15 @@ public class SessionVariablesUtil {
private static final Logger log =
Red5LoggerFactory.getLogger(SessionVariablesUtil.class, webAppRootKey);
private enum SESSION_VARIABLES {
- isAVClient, // if the client connection is a audio-video only
connection
isScreenClient, // if the client connection is from a Java
Web-Start application
PUBLIC_SID, // the public SID of the client
USER_ID, // the userId of the user that is using this
connection (if there is any)
}
- public static void initClient(IClient client, boolean isAVClient,
String publicSID) {
- client.setAttribute(SESSION_VARIABLES.isAVClient.toString(),
isAVClient);
+ public static void initClient(IClient client, String publicSID) {
client.setAttribute(SESSION_VARIABLES.PUBLIC_SID.toString(),
publicSID);
}
- public static boolean isAVClient(IClient client) {
- try {
- if
(client.getAttribute(SESSION_VARIABLES.isAVClient.toString()) == null) {
- throw new Exception("Connection has no
publicSID client: " + client);
- }
- return (Boolean)
client.getAttribute(SESSION_VARIABLES.isAVClient.toString());
- } catch (Exception err) {
- log.error("[isAVClient]", err);
- }
- return false;
- }
-
public static String getPublicSID(IClient client) {
try {
if
(client.getAttribute(SESSION_VARIABLES.PUBLIC_SID.toString()) == null) {
Modified:
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java
Wed Dec 2 05:48:38 2015
@@ -34,7 +34,7 @@ import org.apache.openmeetings.db.dto.ba
import org.apache.openmeetings.db.dto.server.ClientSessionInfo;
import org.apache.openmeetings.db.entity.room.Client;
import org.apache.openmeetings.db.entity.server.Server;
-import org.apache.openmeetings.util.OpenmeetingsVariables;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
import org.apache.openmeetings.util.crypt.ManageCryptStyle;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
@@ -49,9 +49,7 @@ import org.springframework.beans.factory
*
*/
public class SessionManager implements ISessionManager {
-
- protected static final Logger log = Red5LoggerFactory.getLogger(
- SessionManager.class,
OpenmeetingsVariables.webAppRootKey);
+ protected static final Logger log =
Red5LoggerFactory.getLogger(SessionManager.class, webAppRootKey);
@Autowired
private ServerUtil serverUtil;
@@ -75,7 +73,7 @@ public class SessionManager implements I
public synchronized Client addClientListItem(String streamId,
String scopeName, Integer remotePort, String
remoteAddress,
- String swfUrl, boolean isAVClient, Server
server) {
+ String swfUrl, Server server) {
try {
// Store the Connection into a bean and add it
to the HashMap
@@ -94,7 +92,6 @@ public class SessionManager implements I
rcm.setSwfurl(swfUrl);
rcm.setIsMod(new Boolean(false));
rcm.setCanDraw(new Boolean(false));
- rcm.setAvClient(isAVClient);
if (cache.containsKey(null, streamId)) {
log.error("Tried to add an existing
Client " + streamId);
@@ -131,27 +128,20 @@ public class SessionManager implements I
return null;
}
- public Client getClientByPublicSID(String publicSID, boolean
isAVClient, Server server) {
+ public Client getClientByPublicSID(String publicSID, Server
server) {
try {
- for (Client rcl :
cache.getClientsByPublicSID(server, publicSID)) {
- if (rcl.isAvClient() != isAVClient) {
- continue;
- }
- return rcl;
- }
+ List<Client> list =
cache.getClientsByPublicSID(server, publicSID);
+ return list == null || list.isEmpty() ? null :
list.get(0);
} catch (Exception err) {
log.error("[getClientByPublicSID]", err);
}
return null;
}
- public ClientSessionInfo getClientByPublicSIDAnyServer(String
publicSID, boolean isAVClient) {
+ public ClientSessionInfo getClientByPublicSIDAnyServer(String
publicSID) {
try {
for (Entry<Long,List<Client>> entry :
cache.getClientsByPublicSID(publicSID).entrySet()) {
for (Client rcl : entry.getValue()) {
- if (rcl.isAvClient() !=
isAVClient) {
- continue;
- }
return new
ClientSessionInfo(rcl, entry.getKey());
}
}
@@ -169,10 +159,6 @@ public class SessionManager implements I
continue;
}
- if (rcl.isAvClient()) {
- continue;
- }
-
return rcl;
}
} catch (Exception err) {
@@ -184,7 +170,7 @@ public class SessionManager implements I
public synchronized Boolean updateAVClientByStreamId(String
streamId, Client rcm, Server server) {
try {
// get the corresponding user session object
and update the settings
- Client rclUsual =
getClientByPublicSID(rcm.getPublicSID(), false, server);
+ Client rclUsual =
getClientByPublicSID(rcm.getPublicSID(), server);
if (rclUsual != null) {
rclUsual.setBroadCastID(rcm.getBroadCastID());
rclUsual.setAvsettings(rcm.getAvsettings());
@@ -250,9 +236,6 @@ public class SessionManager implements I
if (rcl.isScreenClient()) {
continue;
}
- if (rcl.isAvClient()) {
- continue;
- }
// Only parse really those users out
that are really a full session object
// and no pseudo session object like
the audio/video or screen
@@ -335,13 +318,11 @@ public class SessionManager implements I
};
public Client addClientListItem(String streamId, String scopeName,
- Integer remotePort, String remoteAddress, String swfUrl,
- boolean isAVClient, Server server) {
+ Integer remotePort, String remoteAddress, String
swfUrl, Server server) {
if (server == null) {
server = serverUtil.getCurrentServer();
}
- return sessionManager.addClientListItem(streamId, scopeName,
- remotePort, remoteAddress, swfUrl, isAVClient,
server);
+ return sessionManager.addClientListItem(streamId, scopeName,
remotePort, remoteAddress, swfUrl, server);
}
public Collection<Client> getClients() {
@@ -359,19 +340,15 @@ public class SessionManager implements I
return sessionManager.getClientByStreamId(streamId, server);
}
- public Client getClientByPublicSID(String publicSID, boolean isAVClient,
- Server server) {
+ public Client getClientByPublicSID(String publicSID, Server server) {
if (server == null) {
server = serverUtil.getCurrentServer();
}
- return sessionManager.getClientByPublicSID(publicSID,
isAVClient,
- server);
+ return sessionManager.getClientByPublicSID(publicSID, server);
}
- public ClientSessionInfo getClientByPublicSIDAnyServer(String publicSID,
- boolean isAVClient) {
- return sessionManager.getClientByPublicSIDAnyServer(publicSID,
- isAVClient);
+ public ClientSessionInfo getClientByPublicSIDAnyServer(String
publicSID) {
+ return sessionManager.getClientByPublicSIDAnyServer(publicSID);
}
public Client getClientByUserId(Long userId) {
Modified:
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java
Wed Dec 2 05:48:38 2015
@@ -49,13 +49,12 @@ public interface ISessionManager {
* @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);
+ String swfUrl, Server server);
public abstract Collection<Client> getClients();
@@ -78,17 +77,12 @@ public interface ISessionManager {
/**
* get a client by its publicSID and the server,
- * isAVClient is normally false, as you want the data connection.
- * If you set isAVClient to true, you would obtain the RTMP
- * connection that is used for Audio/Video streaming
*
* @param publicSID
- * @param isAVClient
* @param server
* @return
*/
- public abstract Client getClientByPublicSID(String publicSID,
- boolean isAVClient, Server server);
+ public abstract Client getClientByPublicSID(String publicSID, Server
server);
/**
* same as {@link #getClientByPublicSID(String, boolean, Server)} but
it ignores
@@ -99,10 +93,9 @@ public interface ISessionManager {
* you should use {@link #getClientByPublicSID(String, boolean,
Server)}!
*
* @param publicSID
- * @param isAVClient
* @return
*/
- public ClientSessionInfo getClientByPublicSIDAnyServer(String
publicSID, boolean isAVClient);
+ public ClientSessionInfo getClientByPublicSIDAnyServer(String
publicSID);
/**
*
@@ -123,14 +116,13 @@ public interface ISessionManager {
* @param rcm
* @return
*/
- public abstract Boolean updateAVClientByStreamId(String streamId,
- Client rcm, Server server);
+ public abstract Boolean updateAVClientByStreamId(String streamId,
Client rcm, Server server);
/**
* Update the session object
*
* updateRoomCount is only <i>one</i> time true, in
- * ScopeApplicationAdapter#setRoomValues(Long, Boolean, Boolean, Long,
String)
+ * ScopeApplicationAdapter#setRoomValues(Long, Boolean, Boolean, String)
* .
*
* @param streamId
Modified:
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/room/Client.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/room/Client.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/room/Client.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/room/Client.java
Wed Dec 2 05:48:38 2015
@@ -186,12 +186,6 @@ public class Client implements IDataProv
private boolean screenClient;
/**
- * @see Client#isAvClient()
- */
- @Column(name = "is_avclient")
- private boolean avClient;
-
- /**
* @see Client#getUsercolor()
*/
@Column(name = "usercolor")
@@ -400,7 +394,7 @@ public class Client implements IDataProv
public Client() {}
public Client(String streamid, String publicSID, Long roomId,
- Long userId, String firstname, String lastname, boolean
avClient,
+ Long userId, String firstname, String lastname,
String username, String connectedSince, String scope) {
super();
this.streamid = streamid;
@@ -409,7 +403,6 @@ public class Client implements IDataProv
this.userId = userId;
this.firstname = firstname;
this.lastname = lastname;
- this.avClient = avClient;
this.username = username;
this.connectedSince =
CalendarPatterns.parseDateWithHour(connectedSince);
this.scope = scope;
@@ -836,14 +829,6 @@ public class Client implements IDataProv
this.allowRecording = allowRecording;
}
- public boolean isAvClient() {
- return avClient;
- }
-
- public void setAvClient(boolean avClient) {
- this.avClient = avClient;
- }
-
public boolean isStreamPublishStarted() {
return streamPublishStarted;
}
@@ -879,7 +864,7 @@ public class Client implements IDataProv
@Override
public String toString() {
return "Client [streamid=" + streamid + ", publicSID=" +
publicSID + ", isScreenClient=" + screenClient
- + ", avClient=" + avClient + ", isMobile = " +
mobile + ", roomId=" + roomId + ", broadCastID=" + broadCastID + ", userId="
+ + ", isMobile = " + mobile + ", roomId=" +
roomId + ", broadCastID=" + broadCastID + ", userId="
+ userId + ", avsettings=" + avsettings + ",
isRecording=" + isRecording + ", recordingId="
+ recordingId + ", recordingMetaDataId=" +
recordingMetaDataId + ", screenPublishStarted="
+ screenPublishStarted + ", interviewPodId=" +
interviewPodId + ", server=" + server + "]";
Modified:
openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
Wed Dec 2 05:48:38 2015
@@ -413,9 +413,7 @@ public class ImportInitvalues {
cfgDao.add(CONFIG_REDIRECT_URL_FOR_EXTERNAL_KEY, "", null,
"Users entered the room via invitationHash or
secureHash will be redirected to this URL on connection lost");
-
cfgDao.add(CONFIG_FLASH_PROTOCOL, "rtmp", null, "Protocol for
flash connections, can be rtmp, rtmpt, rtmpe, rtmps");
-
cfgDao.add(CONFIG_FLASH_PORT, "1935", null, "Port for flash
connections");
cfgDao.add(CONFIG_CALENDAR_FIRST_DAY, "0", null, "The day that
each week begins. The value must be a number that represents the day of the
week. Sunday=0, Monday=1, Tuesday=2, etc.");
Modified:
openmeetings/trunk/singlewebapp/openmeetings-service/src/main/java/org/apache/openmeetings/service/user/UserManager.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-service/src/main/java/org/apache/openmeetings/service/user/UserManager.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-service/src/main/java/org/apache/openmeetings/service/user/UserManager.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-service/src/main/java/org/apache/openmeetings/service/user/UserManager.java
Wed Dec 2 05:48:38 2015
@@ -463,7 +463,7 @@ public class UserManager implements IUse
// admins only
if
(AuthLevelUtil.hasWebServiceLevel(userDao.getRights(userId))) {
- Client rcl =
sessionManager.getClientByPublicSID(publicSID, false, null);
+ Client rcl =
sessionManager.getClientByPublicSID(publicSID, null);
if (rcl == null) {
return true;
Modified:
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java
Wed Dec 2 05:48:38 2015
@@ -94,7 +94,7 @@ public class ConnectionsPanel extends Ad
, c.getServer()
== null ? 0 : c.getServer().getId());
target.add(container,
details.setVisible(false));
}
- }.setEnabled(!c.isScreenClient() &&
!c.isAvClient()));
+ }.setEnabled(!c.isScreenClient()));
item.add(new AjaxEventBehavior("click") {
private static final long
serialVersionUID = 1L;
Modified:
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
Wed Dec 2 05:48:38 2015
@@ -20,9 +20,9 @@ package org.apache.openmeetings.web.room
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PORT;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PROTOCOL;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_ALLOW_REMOTE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_FPS;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_FPS_SHOW;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_ALLOW_REMOTE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_QUALITY;
import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
import static org.apache.openmeetings.web.app.Application.getBean;
@@ -30,25 +30,43 @@ import static org.apache.openmeetings.we
import static org.apache.openmeetings.web.app.WebSession.getSid;
import static org.apache.openmeetings.web.app.WebSession.getUserId;
-import java.io.IOException;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URL;
+import java.util.Properties;
+import org.apache.commons.codec.binary.Hex;
import org.apache.commons.io.IOUtils;
+import org.apache.openmeetings.core.session.SessionManager;
import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
import org.apache.openmeetings.db.dao.label.LabelDao;
+import org.apache.openmeetings.db.dao.room.RoomDao;
+import org.apache.openmeetings.db.entity.room.Client;
+import org.apache.openmeetings.db.entity.room.Room;
+import org.apache.openmeetings.util.OmFileHelper;
import org.apache.openmeetings.web.util.AjaxDownload;
import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.util.resource.StringResourceStream;
+import org.apache.wicket.util.string.Strings;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
public class StartSharingEventBehavior extends AbstractDefaultAjaxBehavior {
private static final long serialVersionUID = 1L;
private static final Logger log =
Red5LoggerFactory.getLogger(StartSharingEventBehavior.class, webAppRootKey);
+ public static final String PARAM_PUBLIC_SID = "publicSid";
+ public static final String PARAM_PROTOCOL = "protocol";
+ public static final String PARAM_PORT = "port";
private final AjaxDownload download;
private final long roomId;
+ private enum Protocol {
+ rtmp
+ , rtmpe
+ , rtmps
+ , rtmpt
+ }
public StartSharingEventBehavior(long _roomId) {
this.roomId = _roomId;
@@ -68,22 +86,37 @@ public class StartSharingEventBehavior e
getComponent().add(download);
}
+ private String getParam(String name) {
+ return
getComponent().getRequest().getRequestParameters().getParameterValue(name).toString();
+ }
+
@Override
protected void respond(AjaxRequestTarget target) {
+ //TODO deny download in case other screen sharing is in progress
String app = "";
- InputStream jnlp = null;
- try {
+ try (InputStream jnlp =
getClass().getClassLoader().getResourceAsStream("APPLICATION.jnlp")) {
ConfigurationDao cfgDao =
getBean(ConfigurationDao.class);
- jnlp =
getClass().getClassLoader().getResourceAsStream("APPLICATION.jnlp");
app = IOUtils.toString(jnlp, "UTF-8");
String baseUrl = cfgDao.getBaseUrl();
URL url = new URL(baseUrl);
+ Room room = getBean(RoomDao.class).get(roomId);
+ SessionManager sessionManager =
getBean(SessionManager.class);
+ Client rc =
sessionManager.getClientByPublicSID(getParam(PARAM_PUBLIC_SID), null);//TODO
not necessary
String path = url.getPath();
path = path.substring(1, path.indexOf('/', 2) + 1);
- app = app.replace("$codebase", baseUrl + "screenshare")
+ String port = getParam(PARAM_PORT);
+ if (Strings.isEmpty(port)) {
+ cfgDao.getConfValue(CONFIG_FLASH_PORT,
String.class, "");
+ }
+ String _protocol = getParam(PARAM_PROTOCOL);
+ if (Strings.isEmpty(_protocol)) {
+ _protocol =
cfgDao.getConfValue(CONFIG_FLASH_PROTOCOL, String.class, "");
+ }
+ Protocol protocol = Protocol.valueOf(_protocol);
+ app = addKeystore(app).replace("$codebase", baseUrl +
"screenshare")
.replace("$applicationName",
cfgDao.getAppName())
- .replace("$protocol",
cfgDao.getConfValue(CONFIG_FLASH_PROTOCOL, String.class, ""))
- .replace("$port",
cfgDao.getConfValue(CONFIG_FLASH_PORT, String.class, ""))
+ .replace("$protocol", protocol.name())
+ .replace("$port", port)
.replace("$host", url.getHost())
.replace("$app", path + roomId)
.replace("$userId", "" + getUserId())
@@ -100,19 +133,11 @@ public class StartSharingEventBehavior e
.replace("$defaultFps",
cfgDao.getConfValue(CONFIG_SCREENSHARING_FPS, String.class, ""))
.replace("$showFps",
cfgDao.getConfValue(CONFIG_SCREENSHARING_FPS_SHOW, String.class, "true"))
.replace("$allowRemote",
cfgDao.getConfValue(CONFIG_SCREENSHARING_ALLOW_REMOTE, String.class, "true"))
- .replace("$allowRecording", "true")
//FIXME add/remove Room.allowRecording + Client.allowRecording
- .replace("$allowPublishing", "true")
//FIXME add/remove
- .replace("$keystore", "--dummy--")
//FIXME add/remove
- .replace("$password", "--dummy--")
//FIXME add/remove
+ .replace("$allowRecording", "" +
(room.isAllowRecording() && rc.isAllowRecording() && (0 ==
sessionManager.getRecordingCount(roomId))))
+ .replace("$allowPublishing", "" + (0 ==
sessionManager.getPublishingCount(roomId)))
;
} catch (Exception e) {
log.error("Unexpected error while creating jnlp file",
e);
- } finally {
- if (jnlp != null) {
- try {
- jnlp.close();
- } catch (IOException e) {}
- }
}
download.setResourceStream(new StringResourceStream(app,
"application/x-java-jnlp-file"));
download.initiate(target);
@@ -131,4 +156,43 @@ public class StartSharingEventBehavior e
}
return result.toString();
}
+
+ private String addKeystore(String app) {
+ log.debug("RTMP Sharer Keystore :: start");
+ String keystore = "--dummy--", password = "--dummy--";
+ File conf = new File(OmFileHelper.getRootDir(), "conf");
+ File keyStore = new File(conf, "keystore.screen");
+ if (keyStore.exists()) {
+ try (FileInputStream fis = new
FileInputStream(keyStore); FileInputStream ris = new FileInputStream(new
File(conf, "red5.properties"))) {
+ Properties red5Props = new Properties();
+ red5Props.load(ris);
+
+ byte keyBytes[] = new
byte[(int)keyStore.length()];
+ fis.read(keyBytes);
+
+ keystore = Hex.encodeHexString(keyBytes);
+ password =
red5Props.getProperty("rtmps.screen.keystorepass");
+
+ /*
+ KeyStore ksIn =
KeyStore.getInstance(KeyStore.getDefaultType());
+ ksIn.load(new FileInputStream(keyStore),
red5Props.getProperty("rtmps.keystorepass").toCharArray());
+ ByteArrayInputStream bin = new
ByteArrayInputStream()
+
+ byte fileContent[] = new
byte[(int)file.length()];
+ sb = addArgument(sb, Object arg)
+ ctx.put("$KEYSTORE", users_id);
+ /*
+ KeyStore ksOut =
KeyStore.getInstance(KeyStore.getDefaultType());
+ for (Certificate cert :
ksIn.getCertificateChain("red5")) {
+ PublicKey pub = cert.getPublicKey();
+ TrustedCertificateEntry tce = new
TrustedCertificateEntry(cert);
+ tce.
+ }
+ */
+ } catch (Exception e) {
+ //no op
+ }
+ }
+ return app.replace("$keystore", keystore).replace("$password",
password);
+ }
}
Modified:
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/poll/TestClientListManager.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/poll/TestClientListManager.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/poll/TestClientListManager.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/poll/TestClientListManager.java
Wed Dec 2 05:48:38 2015
@@ -37,7 +37,7 @@ public class TestClientListManager exten
assertNotNull("RoomClientId created is null",
sessionManager.addClientListItem(rnd.nextLong()
+ "ABCDE"
+ rnd.nextLong(), "scopeName",
66666, "remoteAddress",
- "swfUrl", false, null));
+ "swfUrl", null));
}
}
Modified:
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/session/TestHashMapSession.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/session/TestHashMapSession.java?rev=1717570&r1=1717569&r2=1717570&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/session/TestHashMapSession.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-web/src/test/java/org/apache/openmeetings/test/session/TestHashMapSession.java
Wed Dec 2 05:48:38 2015
@@ -68,7 +68,6 @@ public class TestHashMapSession extends
rcm.setSwfurl("swfUrl");
rcm.setIsMod(new Boolean(false));
rcm.setCanDraw(new Boolean(false));
- rcm.setAvClient(false);
if (cache.containsKey(null, streamId)) {
log.error("Tried to add an existing Client " +
streamId);