Search in sources :

Example 1 with IClient

use of org.apache.openmeetings.db.entity.basic.IClient in project openmeetings by apache.

the class ClientManager method removeFromRoom.

public IClient removeFromRoom(IClient _c) {
    Long roomId = _c.getRoomId();
    log.debug("Removing online room client: {}, room: {}", _c.getUid(), roomId);
    if (roomId != null) {
        IMap<Long, Set<String>> rooms = rooms();
        rooms.lock(roomId);
        Set<String> clients = rooms.get(roomId);
        if (clients != null) {
            clients.remove(_c.getUid());
            rooms.put(roomId, clients);
            onlineRooms.put(roomId, clients);
        }
        rooms.unlock(roomId);
        /* FIXME TODO KurentoHandler
			if (_c instanceof StreamClient) {
				StreamClient sc = (StreamClient)_c;
				if (Client.Type.mobile != sc.getType() && Client.Type.sip != sc.getType()) {
					scopeAdapter.roomLeaveByScope(_c, roomId);
				}
			}
			 */
        if (_c instanceof Client) {
            // FIXME TODO scopeAdapter.dropSharing(_c, roomId);
            Client c = (Client) _c;
            kHandler.leaveRoom(c);
            /* FIXME TODO
				IScope sc = scopeAdapter.getChildScope(roomId);
				for (String uid : c.getStreams()) {
					scopeAdapter.sendMessageById("quit", uid, sc);
				}
				*/
            c.setRoom(null);
            c.clear();
            update(c);
        }
    }
    return _c;
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) ConcurrentHashSet(org.apache.wicket.util.collections.ConcurrentHashSet) IClient(org.apache.openmeetings.db.entity.basic.IClient) Client(org.apache.openmeetings.db.entity.basic.Client)

Aggregations

HashSet (java.util.HashSet)1 Set (java.util.Set)1 Client (org.apache.openmeetings.db.entity.basic.Client)1 IClient (org.apache.openmeetings.db.entity.basic.IClient)1 ConcurrentHashSet (org.apache.wicket.util.collections.ConcurrentHashSet)1