use of org.apache.openmeetings.db.entity.room.StreamClient in project openmeetings by apache.
the class MobileService method create.
public StreamClient create(User u, Sessiondata sd) {
StreamClient c = new StreamClient();
c.setType(StreamClient.Type.mobile);
c.setSid(sd.getSessionId());
c.setUid(UUID.randomUUID().toString());
return create(c, u);
}
use of org.apache.openmeetings.db.entity.room.StreamClient in project openmeetings by apache.
the class RoomBroadcaster method sendUpdatedClient.
public static void sendUpdatedClient(Client client) {
String uid = client.getUid();
StreamClient rcl = get().getBean(StreamClientManager.class).update(getClient(uid), true);
log.debug("----------- sendUpdatedClient ");
// Notify all clients of the same scope (room)
get().getBean(ClientManager.class).update(client);
broadcast(client.getRoom().getId(), "clientUpdated", rcl);
if (rcl == null) {
return;
}
get().getBean(StreamClientManager.class).update(rcl);
}
use of org.apache.openmeetings.db.entity.room.StreamClient in project openmeetings by apache.
the class RoomBroadcaster method broadcast.
public static void broadcast(String publicSid, String method, Object obj) {
StreamClient rc = getClient(publicSid);
if (rc == null) {
return;
}
broadcast(rc.getRoomId(), method, obj);
}
use of org.apache.openmeetings.db.entity.room.StreamClient in project openmeetings by apache.
the class SessiondataDao method clearSessionByRoomId.
/**
* @param roomId - room to clear sessions
*/
public void clearSessionByRoomId(Long roomId) {
try {
for (StreamClient rcl : streamClientManager.list(roomId)) {
String aux = rcl.getSwfurl();
int start = aux.indexOf("sid=") + 4;
int end = start + 32;
if (end > aux.length()) {
end = aux.length();
}
String sid = aux.substring(start, end);
Sessiondata sData = check(sid);
if (sData != null) {
em.remove(sData);
}
}
} catch (Exception err) {
log.error("clearSessionByRoomId", err);
}
}
use of org.apache.openmeetings.db.entity.room.StreamClient in project openmeetings by apache.
the class Client method streamJson.
public JSONObject streamJson(String _sid, boolean self, IStreamClientManager mgr) {
JSONArray _streams = new JSONArray();
boolean avFound = false;
for (String _uid : streams) {
StreamClient rc = mgr.get(_uid);
if (rc == null) {
continue;
}
Type t = rc.getType();
if (Type.room == t) {
avFound = true;
}
_streams.put(RoomHelper.addScreenActivities(new JSONObject().put("type", t.name()).put("uid", self && Type.room == t ? uid : rc.getUid()).put("broadcastId", rc.getBroadcastId()).put("width", rc.getWidth()).put("height", rc.getHeight()), rc));
}
if (self && !avFound && hasAnyActivity(Activity.broadcastA, Activity.broadcastV)) {
_streams.put(new JSONObject().put("type", Type.room.name()).put("uid", uid).put("width", width).put("height", height));
}
return toJson(self).put("sid", _sid).put("streams", _streams);
}
Aggregations