You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2014/10/01 16:45:24 UTC

svn commit: r1628719 - in /openmeetings: branches/3.0.x/src/main/java/org/apache/openmeetings/remote/ branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remo...

Author: solomax
Date: Wed Oct  1 14:45:24 2014
New Revision: 1628719

URL: http://svn.apache.org/r1628719
Log:
[OPENMEETINGS-826] MobileService is corrected and added

Added:
    openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java
Modified:
    openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/MobileService.java
    openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
    openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
    openmeetings/trunk/singlewebapp/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml

Modified: openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/MobileService.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/MobileService.java?rev=1628719&r1=1628718&r2=1628719&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/MobileService.java (original)
+++ openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/MobileService.java Wed Oct  1 14:45:24 2014
@@ -1,9 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.openmeetings.remote;
 
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
@@ -110,9 +129,10 @@ public class MobileService implements IP
 						Map<String, Object> map = new Hashtable<String, Object>();
 						map.put("streamId", c.getStreamid());
 						map.put("broadCastId", c.getBroadCastID());
-						map.put("userId", c.getUser_id());
+						map.put("userId", c.getUser_id() == null ? "" : c.getUser_id());
 						map.put("firstname", c.getFirstname());
 						map.put("lastname", c.getLastname());
+						map.put("publicSid", c.getPublicSID());
 						result.add(map);
 					}
 				}
@@ -167,7 +187,7 @@ public class MobileService implements IP
 		return result;
 	}
 	
-	public Map<String, Object> roomConnect(String SID, Long userId, String avMode, String width, String height) {
+	public Map<String, Object> roomConnect(String SID, Long userId) {
 		Map<String, Object> result = new Hashtable<String, Object>();
 		User u = userDao.get(userId);
 		Client c = scopeAdapter.setUsernameReconnect(SID, userId, u.getLogin(), u.getFirstname(), u.getLastname(), u.getPictureuri());
@@ -178,13 +198,10 @@ public class MobileService implements IP
 		c.setRoomEnter(new Date());
 		c.setBroadCastID(broadcastId);
 		c.setIsBroadcasting(true);
-		c.setAvsettings(avMode);
-		c.setVWidth(Integer.parseInt(width));
-		c.setVHeight(Integer.parseInt(height));
 		sessionManager.updateClientByStreamId(c.getStreamid(), c, false, null);
 		result.put("broadcastId", broadcastId);
 
-		//FIXME make it async
+		//FIXME make it async + copy/paste
 		IConnection current = Red5.getConnectionLocal();
 		for (IConnection conn : current.getScope().getClientConnections()) {
 			if (conn != null) {
@@ -209,4 +226,33 @@ public class MobileService implements IP
 		}
 		return result;
 	}
+
+	public void updateAvMode(String avMode, String width, String height) {
+		IConnection current = Red5.getConnectionLocal();
+		Client c = sessionManager.getClientByStreamId(current.getClient().getId(), null);
+		c.setAvsettings(avMode);
+		c.setVWidth(Integer.parseInt(width));
+		c.setVHeight(Integer.parseInt(height));
+		sessionManager.updateClientByStreamId(c.getStreamid(), c, false, null);
+		HashMap<String, Object> hsm = new HashMap<String, Object>();
+		hsm.put("client", c);
+		hsm.put("message", new String[]{"avsettings", "0", avMode});
+
+		//FIXME should be handled async + copy/paste
+		for (IConnection conn : current.getScope().getClientConnections()) {
+			if (conn != null) {
+				if (conn instanceof IServiceCapableConnection) {
+					IClient client = conn.getClient();
+					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("sendVarsToMessageWithClient", new Object[] { hsm }, this);
+				}
+			}
+		}
+	}
 }

Modified: openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java?rev=1628719&r1=1628718&r2=1628719&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java (original)
+++ openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java Wed Oct  1 14:45:24 2014
@@ -645,30 +645,25 @@ public class ScopeApplicationAdapter ext
 			log.debug("-----------  streamPublishStart");
 			IConnection current = Red5.getConnectionLocal();
 			String streamid = current.getClient().getId();
-			Client currentClient = this.sessionManager
-					.getClientByStreamId(streamid, null);
+			Client currentClient = sessionManager.getClientByStreamId(streamid, null);
 
 			//We make a second object the has the reference to the object 
 			//that we will use to send to all participents
 			Client clientObjectSendToSync = currentClient;
 			
 			// Notify all the clients that the stream had been started
-			log.debug("start streamPublishStart broadcast start: "
-					+ stream.getPublishedName() + " CONN " + current);
+			log.debug("start streamPublishStart broadcast start: " + stream.getPublishedName() + " CONN " + current);
 
 			// In case its a screen sharing we start a new Video for that
 			if (currentClient.getIsScreenClient()) {
 
 				currentClient.setScreenPublishStarted(true);
 
-				this.sessionManager.updateClientByStreamId(current
-						.getClient().getId(), currentClient, false, null);
+				sessionManager.updateClientByStreamId(current.getClient().getId(), currentClient, false, null);
 			}
-			//If its an audio/video client then send the session object with the full 
-			//data to everybody
+			//If its an audio/video client then send the session object with the full data to everybody
 			else if (currentClient.getIsAVClient()) {
-				clientObjectSendToSync = this.sessionManager.getClientByPublicSID(
-											currentClient.getPublicSID(), false, null);
+				clientObjectSendToSync = sessionManager.getClientByPublicSID(currentClient.getPublicSID(), false, null);
 			}
 			
 			log.debug("newStream SEND: "+currentClient);
@@ -679,9 +674,7 @@ public class ScopeApplicationAdapter ext
 				if (conn != null) {
 					if (conn instanceof IServiceCapableConnection) {
 						
-						Client rcl = this.sessionManager
-								.getClientByStreamId(conn.getClient()
-										.getId(), null);
+						Client rcl = sessionManager.getClientByStreamId(conn.getClient().getId(), null);
 						
 						if (rcl == null) {
 							log.debug("RCL IS NULL newStream SEND");
@@ -1542,8 +1535,6 @@ public class ScopeApplicationAdapter ext
 			String streamid = current.getClient().getId();
 			Client currentClient = sessionManager.getClientByStreamId(streamid, null);
 
-			currentClient.setUsername(username);
-			currentClient.setUser_id(userId);
 			SessionVariablesUtil.setUserId(current.getClient(), userId);
 			currentClient.setPicture_uri(picture_uri);
 			currentClient.setUserObject(userId, username, firstname, lastname);
@@ -1560,10 +1551,10 @@ public class ScopeApplicationAdapter ext
 				if (us != null) {
 					currentClient.setExternalUserId(us.getExternalUserId());
 					currentClient.setExternalUserType(us.getExternalUserType());
-				}
-				if (us != null && us.getPictureuri() != null) {
-					// set Picture-URI
-					currentClient.setPicture_uri(us.getPictureuri());
+					if (us.getPictureuri() != null) {
+						// set Picture-URI
+						currentClient.setPicture_uri(us.getPictureuri());
+					}
 				}
 			}
 			sessionManager.updateClientByStreamId(streamid, currentClient, false, null);

Added: 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=1628719&view=auto
==============================================================================
--- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java (added)
+++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java Wed Oct  1 14:45:24 2014
@@ -0,0 +1,258 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.core.remote;
+
+import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.openmeetings.db.dao.label.FieldLanguagesValuesDao;
+import org.apache.openmeetings.db.dao.room.IRoomManager;
+import org.apache.openmeetings.db.dao.room.RoomDao;
+import org.apache.openmeetings.db.dao.server.ISessionManager;
+import org.apache.openmeetings.db.dao.server.SessiondataDao;
+import org.apache.openmeetings.db.dao.user.UserDao;
+import org.apache.openmeetings.db.entity.room.Client;
+import org.apache.openmeetings.db.entity.room.Room;
+import org.apache.openmeetings.db.entity.server.Sessiondata;
+import org.apache.openmeetings.db.entity.user.Organisation;
+import org.apache.openmeetings.db.entity.user.Organisation_Users;
+import org.apache.openmeetings.db.entity.user.User;
+import org.apache.openmeetings.core.remote.red5.ScopeApplicationAdapter;
+import org.apache.openmeetings.core.remote.util.SessionVariablesUtil;
+import org.red5.logging.Red5LoggerFactory;
+import org.red5.server.api.IClient;
+import org.red5.server.api.IConnection;
+import org.red5.server.api.Red5;
+import org.red5.server.api.service.IPendingServiceCall;
+import org.red5.server.api.service.IPendingServiceCallback;
+import org.red5.server.api.service.IServiceCapableConnection;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class MobileService implements IPendingServiceCallback {
+	private static final Logger log = Red5LoggerFactory.getLogger(MainService.class, webAppRootKey);
+	@Autowired
+	private UserDao userDao;
+	@Autowired
+	private SessiondataDao sessionDao;
+	@Autowired
+	private ISessionManager sessionManager;
+	@Autowired
+	private RoomDao roomDao;
+	@Autowired
+	private IRoomManager roomManager;
+	@Autowired
+	private FieldLanguagesValuesDao labelDao;
+	@Autowired
+	private ScopeApplicationAdapter scopeAdapter;
+
+	@Override
+	public void resultReceived(IPendingServiceCall call) {
+	}
+
+	public Map<String, Object> loginUser(String login, String password) {
+		Map<String, Object> result = new Hashtable<String, Object>();
+		try {
+			result.put("status", -1);
+			User u = userDao.login(login, password);
+			if (u != null) {
+				Sessiondata sd = sessionDao.startsession();
+				Boolean bool = sessionDao.updateUser(sd.getSession_id(), u.getId(), false, u.getLanguage_id());
+				if (bool == null) {
+					// Exception
+				} else if (!bool) {
+					// invalid Session-Object
+					result.put("status", -35);
+				} else {
+					IConnection conn = Red5.getConnectionLocal();
+					String streamId = conn.getClient().getId();
+					Client c = sessionManager.getClientByStreamId(streamId, null);
+					if (c == null) {
+						c = sessionManager.addClientListItem(streamId, conn.getScope().getName(), conn.getRemotePort(),
+							conn.getRemoteAddress(), "", false, null);
+					}
+					
+					SessionVariablesUtil.initClient(conn.getClient(), false, c.getPublicSID());
+					c.setUser_id(u.getId());
+					c.setFirstname(u.getFirstname());
+					c.setLastname(u.getLastname());
+					//c.set
+					sessionManager.updateClientByStreamId(streamId, c, false, null);
+
+					result.put("sid", sd.getSession_id());
+					result.put("publicSid", c.getPublicSID());
+					result.put("status", 0);
+					result.put("userId", u.getId());
+					result.put("firstname", u.getFirstname());
+					result.put("lastname", u.getLastname());
+					result.put("login", u.getLogin());
+					result.put("language", u.getLanguage_id()); //TODO rights
+				}
+			}
+		} catch (Exception e) {
+			log.error("[loginUser]", e);
+		}
+		return result;
+	}
+	
+	public List<Map<String, Object>> getVideoStreams() {
+		List<Map<String, Object>> result = new ArrayList<Map<String,Object>>();
+		// Notify all clients of the same scope (room)
+		IConnection current = Red5.getConnectionLocal();
+		for (IConnection conn : current.getScope().getClientConnections()) {
+			if (conn != null) {
+				if (conn instanceof IServiceCapableConnection) {
+					Client c = sessionManager.getClientByStreamId(conn.getClient().getId(), null);
+					if (c.getIsAVClient()) {
+						Map<String, Object> map = new Hashtable<String, Object>();
+						map.put("streamId", c.getStreamid());
+						map.put("broadCastId", c.getBroadCastID());
+						map.put("userId", c.getUser_id() == null ? "" : c.getUser_id());
+						map.put("firstname", c.getFirstname());
+						map.put("lastname", c.getLastname());
+						map.put("publicSid", c.getPublicSID());
+						result.add(map);
+					}
+				}
+			}
+		}
+		return result;
+	}
+
+	private void addRoom(String type, String org, boolean first, List<Map<String, Object>> result, Room r) {
+		Map<String, Object> room = new Hashtable<String, Object>();
+		room.put("id", r.getId());
+		room.put("name", r.getName());
+		room.put("type", type);
+		if (org != null) {
+			room.put("org", org);
+		}
+		room.put("first", first);
+		room.put("users", sessionManager.getClientListByRoom(r.getId()).size());
+		room.put("total", r.getNumberOfPartizipants());
+		result.add(room);
+	}
+	
+	public List<Map<String, Object>> getRooms() {
+		List<Map<String, Object>> result = new ArrayList<Map<String,Object>>();
+		// FIXME duplicated code
+		IConnection current = Red5.getConnectionLocal();
+		Client c = sessionManager.getClientByStreamId(current.getClient().getId(), null);
+		User u = userDao.get(c.getUser_id());
+		//my rooms
+		List<Room> myl = new ArrayList<Room>();
+		myl.add(roomManager.getRoomByOwnerAndTypeId(u.getId(), 1L, labelDao.getString(1306L, u.getLanguage_id())));
+		myl.add(roomManager.getRoomByOwnerAndTypeId(u.getId(), 3L, labelDao.getString(1307L, u.getLanguage_id())));
+		myl.addAll(roomDao.getAppointedRoomsByUser(u.getId()));
+		for (Room r : myl) {
+			addRoom("my", null, false, result, r);
+		}
+		
+		//private rooms
+		for (Organisation_Users ou : u.getOrganisation_users()) {
+			Organisation org = ou.getOrganisation();
+			boolean first = true;
+			for (Room r : roomDao.getOrganisationRooms(org.getId())) {
+				addRoom("private", org.getName(), first, result, r);
+				first = false;
+			}
+		}
+		
+		//public rooms
+		for (Room r : roomDao.getPublicRooms()) {
+			addRoom("public", null, false, result, r);
+		}
+		return result;
+	}
+	
+	public Map<String, Object> roomConnect(String SID, Long userId) {
+		Map<String, Object> result = new Hashtable<String, Object>();
+		User u = userDao.get(userId);
+		Client c = scopeAdapter.setUsernameReconnect(SID, userId, u.getLogin(), u.getFirstname(), u.getLastname(), u.getPictureuri());
+		 //TODO check if we need anything here
+		long broadcastId = scopeAdapter.getBroadCastId();
+		c.setSipTransport(true);
+		c.setRoom_id(Long.parseLong(c.getScope()));
+		c.setRoomEnter(new Date());
+		c.setBroadCastID(broadcastId);
+		c.setIsBroadcasting(true);
+		sessionManager.updateClientByStreamId(c.getStreamid(), c, false, null);
+		result.put("broadcastId", broadcastId);
+
+		//FIXME make it async + copy/paste
+		IConnection current = Red5.getConnectionLocal();
+		for (IConnection conn : current.getScope().getClientConnections()) {
+			if (conn != null) {
+				IClient client = conn.getClient();
+				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 (!client.getId().equals(current.getClient().getId())) {
+					// It is not needed to send back that event to the actual Moderator
+					// as it will be already triggered in the result of this Function in the Client
+					if (conn instanceof IServiceCapableConnection) {
+						((IServiceCapableConnection) conn).invoke("addNewUser", new Object[] { c }, this);
+						log.debug("sending Mobile client to " + conn);
+					}
+				}
+			}
+		}
+		return result;
+	}
+
+	public void updateAvMode(String avMode, String width, String height) {
+		IConnection current = Red5.getConnectionLocal();
+		Client c = sessionManager.getClientByStreamId(current.getClient().getId(), null);
+		c.setAvsettings(avMode);
+		c.setVWidth(Integer.parseInt(width));
+		c.setVHeight(Integer.parseInt(height));
+		sessionManager.updateClientByStreamId(c.getStreamid(), c, false, null);
+		HashMap<String, Object> hsm = new HashMap<String, Object>();
+		hsm.put("client", c);
+		hsm.put("message", new String[]{"avsettings", "0", avMode});
+
+		//FIXME should be handled async + copy/paste
+		for (IConnection conn : current.getScope().getClientConnections()) {
+			if (conn != null) {
+				if (conn instanceof IServiceCapableConnection) {
+					IClient client = conn.getClient();
+					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("sendVarsToMessageWithClient", new Object[] { hsm }, this);
+				}
+			}
+		}
+	}
+}

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=1628719&r1=1628718&r2=1628719&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 Oct  1 14:45:24 2014
@@ -166,7 +166,7 @@ public class ScopeApplicationAdapter ext
 				swfURL = conn.getConnectParams().get("swfUrl").toString();
 			}
 
-			Client rcm = this.sessionManager.addClientListItem(streamId,
+			Client rcm = sessionManager.addClientListItem(streamId,
 					conn.getScope().getName(), conn.getRemotePort(),
 					conn.getRemoteAddress(), swfURL, isAVClient, null);
 			
@@ -231,6 +231,7 @@ public class ScopeApplicationAdapter ext
 					}
 				}
 			}
+			log.debug("-----------  screenSharerAction, return: " + returnMap);
 			return returnMap;
 		} catch (Exception err) {
 			log.error("[screenSharerAction]", err);
@@ -633,30 +634,25 @@ public class ScopeApplicationAdapter ext
 			log.debug("-----------  streamPublishStart");
 			IConnection current = Red5.getConnectionLocal();
 			String streamid = current.getClient().getId();
-			Client currentClient = this.sessionManager
-					.getClientByStreamId(streamid, null);
+			Client currentClient = sessionManager.getClientByStreamId(streamid, null);
 
 			//We make a second object the has the reference to the object 
 			//that we will use to send to all participents
 			Client clientObjectSendToSync = currentClient;
 			
 			// Notify all the clients that the stream had been started
-			log.debug("start streamPublishStart broadcast start: "
-					+ stream.getPublishedName() + " CONN " + current);
+			log.debug("start streamPublishStart broadcast start: " + stream.getPublishedName() + " CONN " + current);
 
 			// In case its a screen sharing we start a new Video for that
 			if (currentClient.getIsScreenClient()) {
 
 				currentClient.setScreenPublishStarted(true);
 
-				this.sessionManager.updateClientByStreamId(current
-						.getClient().getId(), currentClient, false, null);
+				sessionManager.updateClientByStreamId(current.getClient().getId(), currentClient, false, null);
 			}
-			//If its an audio/video client then send the session object with the full 
-			//data to everybody
+			//If its an audio/video client then send the session object with the full data to everybody
 			else if (currentClient.getIsAVClient()) {
-				clientObjectSendToSync = this.sessionManager.getClientByPublicSID(
-											currentClient.getPublicSID(), false, null);
+				clientObjectSendToSync = sessionManager.getClientByPublicSID(currentClient.getPublicSID(), false, null);
 			}
 			
 			log.debug("newStream SEND: "+currentClient);
@@ -667,9 +663,7 @@ public class ScopeApplicationAdapter ext
 				if (conn != null) {
 					if (conn instanceof IServiceCapableConnection) {
 						
-						Client rcl = this.sessionManager
-								.getClientByStreamId(conn.getClient()
-										.getId(), null);
+						Client rcl = sessionManager.getClientByStreamId(conn.getClient().getId(), null);
 						
 						if (rcl == null) {
 							log.debug("RCL IS NULL newStream SEND");
@@ -1125,10 +1119,10 @@ public class ScopeApplicationAdapter ext
 			log.debug("-----------  getBroadCastId");
 			IConnection current = Red5.getConnectionLocal();
 			String streamid = current.getClient().getId();
-			Client currentClient = sessionManager.getClientByStreamId(streamid, null);
-			currentClient.setBroadCastID(broadCastCounter++);
-			sessionManager.updateClientByStreamId(streamid, currentClient, false, null);
-			return currentClient.getBroadCastID();
+			Client client = sessionManager.getClientByStreamId(streamid, null);
+			client.setBroadCastID(broadCastCounter++);
+			sessionManager.updateClientByStreamId(streamid, client, false, null);
+			return client.getBroadCastID();
 		} catch (Exception err) {
 			log.error("[getBroadCastId]", err);
 		}
@@ -1527,11 +1521,8 @@ public class ScopeApplicationAdapter ext
 			log.debug("-----------  setUsernameReconnect");
 			IConnection current = Red5.getConnectionLocal();
 			String streamid = current.getClient().getId();
-			Client currentClient = this.sessionManager
-					.getClientByStreamId(streamid, null);
+			Client currentClient = sessionManager.getClientByStreamId(streamid, null);
 
-			currentClient.setUsername(username);
-			currentClient.setUser_id(userId);
 			SessionVariablesUtil.setUserId(current.getClient(), userId);
 			currentClient.setPicture_uri(picture_uri);
 			currentClient.setUserObject(userId, username, firstname, lastname);
@@ -1548,14 +1539,13 @@ public class ScopeApplicationAdapter ext
 				if (us != null) {
 					currentClient.setExternalUserId(us.getExternalUserId());
 					currentClient.setExternalUserType(us.getExternalUserType());
-				}
-				if (us != null && us.getPictureuri() != null) {
-					// set Picture-URI
-					currentClient.setPicture_uri(us.getPictureuri());
+					if (us.getPictureuri() != null) {
+						// set Picture-URI
+						currentClient.setPicture_uri(us.getPictureuri());
+					}
 				}
 			}
-			this.sessionManager.updateClientByStreamId(streamid,
-					currentClient, false, null);
+			sessionManager.updateClientByStreamId(streamid, currentClient, false, null);
 			return currentClient;
 		} catch (Exception err) {
 			log.error("[setUsername]", err);
@@ -1579,8 +1569,7 @@ public class ScopeApplicationAdapter ext
 			log.debug("-----------  setUsernameAndSession");
 			IConnection current = Red5.getConnectionLocal();
 			String streamid = current.getClient().getId();
-			Client currentClient = this.sessionManager
-					.getClientByStreamId(streamid, null);
+			Client currentClient = sessionManager.getClientByStreamId(streamid, null);
 
 			currentClient.setUsername(username);
 			currentClient.setUser_id(userId);
@@ -1606,8 +1595,7 @@ public class ScopeApplicationAdapter ext
 				// set Picture-URI
 				currentClient.setPicture_uri(us.getPictureuri());
 			}
-			this.sessionManager.updateClientByStreamId(streamid,
-					currentClient, false, null);
+			sessionManager.updateClientByStreamId(streamid, currentClient, false, null);
 			return currentClient;
 		} catch (Exception err) {
 			log.error("[setUsername]", err);

Modified: openmeetings/trunk/singlewebapp/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml?rev=1628719&r1=1628718&r2=1628719&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml (original)
+++ openmeetings/trunk/singlewebapp/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml Wed Oct  1 14:45:24 2014
@@ -90,6 +90,7 @@
 	<bean id="openmeetings.FlvExplorerConverter" class="org.apache.openmeetings.core.converter.FlvExplorerConverter" />
 	<bean id="conferenceservice.service" class="org.apache.openmeetings.core.remote.ConferenceService" />
 	<bean id="flvrecorderservice.service" class="org.apache.openmeetings.core.remote.FLVRecorderService" />
+	<bean id="mobile.service" class="org.apache.openmeetings.core.remote.MobileService" />
 	<bean id="openmeetings.FlvRecorderConverterTask" class="org.apache.openmeetings.core.data.flvrecord.converter.FlvRecorderConverterTask" />
 	<bean id="openmeetings.FlvInterviewConverterTask" class="org.apache.openmeetings.core.data.flvrecord.converter.FlvInterviewConverterTask" />
 	<bean id="openmeetings.FlvInterviewReConverterTask" class="org.apache.openmeetings.core.data.flvrecord.converter.FlvInterviewReConverterTask" />