Remove client when he exits meeting.
This commit is contained in:
parent
fa9371ef4c
commit
9f9f3aaf0a
@ -64,6 +64,14 @@ public class SharedNotesApplication {
|
|||||||
log.warn("Adding client to a non-existant room " + room);
|
log.warn("Adding client to a non-existant room " + room);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
public boolean removeRoomClient(String room, Long userid) {
|
||||||
|
if (roomsManager.hasRoom(room)){
|
||||||
|
roomsManager.removeRoomClient(room, userid);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
log.warn("Removing client to a non-existant room " + room);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void setRoomsManager(SharedNotesRoomsManager r) {
|
public void setRoomsManager(SharedNotesRoomsManager r) {
|
||||||
log.debug("Setting room manager");
|
log.debug("Setting room manager");
|
||||||
|
@ -87,6 +87,8 @@ public class SharedNotesHandler extends ApplicationAdapter implements IApplicati
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void roomDisconnect(IConnection connection) {
|
public void roomDisconnect(IConnection connection) {
|
||||||
|
String room = connection.getScope().getName();
|
||||||
|
sharedNotesApplication.removeRoomClient(room, Long.parseLong(Red5.getConnectionLocal().getClient().getId()));
|
||||||
log.debug(APP + ":roomDisconnect");
|
log.debug(APP + ":roomDisconnect");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,12 +69,16 @@ public class SharedNotesRoom {
|
|||||||
if (! clients.containsKey(userid)) {
|
if (! clients.containsKey(userid)) {
|
||||||
synchronized (syncObject) {
|
synchronized (syncObject) {
|
||||||
clients.put(userid, new ClientSharedNotes(userid, _document));
|
clients.put(userid, new ClientSharedNotes(userid, _document));
|
||||||
for (Iterator<ISharedNotesRoomListener> iter = listeners.values().iterator(); iter.hasNext();) {
|
}
|
||||||
log.debug("calling on listener");
|
|
||||||
ISharedNotesRoomListener listener = (ISharedNotesRoomListener) iter.next();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeRoomClient(Long userid) {
|
||||||
|
synchronized (syncObject) {
|
||||||
|
if (! clients.containsKey(userid)) {
|
||||||
|
clients.remove(userid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,15 +87,6 @@ public class SharedNotesRoom {
|
|||||||
listeners.remove(listener);
|
listeners.remove(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDocument(String document) {
|
|
||||||
for (Iterator<ISharedNotesRoomListener> iter = listeners.values().iterator(); iter.hasNext();) {
|
|
||||||
log.debug("calling on listener");
|
|
||||||
ISharedNotesRoomListener listener = (ISharedNotesRoomListener) iter.next();
|
|
||||||
log.debug("calling updateSharedNotes on listener " + listener.getName());
|
|
||||||
//listener.updateLayout(currentLayout());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String currentDocument(Long userid) {
|
public String currentDocument(Long userid) {
|
||||||
String document = "";
|
String document = "";
|
||||||
synchronized (syncObject) {
|
synchronized (syncObject) {
|
||||||
|
@ -84,6 +84,15 @@ public class SharedNotesRoomsManager {
|
|||||||
log.warn("Adding client to a non-existing room " + roomName);
|
log.warn("Adding client to a non-existing room " + roomName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeRoomClient(String roomName, Long userid) {
|
||||||
|
SharedNotesRoom r = getRoom(roomName);
|
||||||
|
if (r != null) {
|
||||||
|
r.removeRoomClient(userid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
log.warn("Removing client to a non-existing room " + roomName);
|
||||||
|
}
|
||||||
|
|
||||||
public void removeRoomListener(String roomName, ISharedNotesRoomListener listener) {
|
public void removeRoomListener(String roomName, ISharedNotesRoomListener listener) {
|
||||||
SharedNotesRoom r = getRoom(roomName);
|
SharedNotesRoom r = getRoom(roomName);
|
||||||
if (r != null) {
|
if (r != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user