use of org.apache.openmeetings.db.dto.room.Whiteboard in project openmeetings by apache.
the class WbPanel method clearAll.
private void clearAll(Long roomId, long wbId) {
Whiteboard wb = wbm.get(roomId).get(wbId);
if (wb == null) {
return;
}
JSONArray arr = getArray(wb.toJson(), null);
if (arr.length() != 0) {
addUndo(wb.getId(), new UndoObject(UndoObject.Type.remove, arr));
}
wb = wbm.clear(roomId, wbId);
sendWbAll(WbAction.clearAll, new JSONObject().put("wbId", wbId));
sendWbAll(WbAction.setSize, getAddWbJson(wb));
}
use of org.apache.openmeetings.db.dto.room.Whiteboard in project openmeetings by apache.
the class CleanupJob method cleanRoomFiles.
public void cleanRoomFiles() {
log.trace("CleanupJob.cleanRoomFiles");
final long now = System.currentTimeMillis();
if (!isInitComplete()) {
return;
}
try {
File[] folders = getStreamsDir().listFiles(File::isDirectory);
if (folders == null) {
return;
}
for (File folder : folders) {
Long roomId = null;
if (NumberUtils.isCreatable(folder.getName())) {
roomId = Long.valueOf(folder.getName());
Whiteboards wbList = wbManager.get(roomId);
for (Map.Entry<Long, Whiteboard> e : wbList.getWhiteboards().entrySet()) {
if (!e.getValue().isEmpty()) {
roomId = null;
break;
}
}
}
if (roomId != null && streamClientManager.list(roomId).isEmpty()) {
File[] files = folder.listFiles(fi -> fi.isFile() && fi.lastModified() + roomFilesTtl < now);
if (files != null && files.length > 0) {
log.debug("Room files are too old and no users in the room: {}", roomId);
FileUtils.deleteDirectory(folder);
}
}
}
} catch (Exception e) {
log.error("Unexpected exception while processing tests setup videous.", e);
}
}
use of org.apache.openmeetings.db.dto.room.Whiteboard in project openmeetings by apache.
the class WhiteboardManager method clear.
public Whiteboard clear(long roomId, Long wbId) {
Whiteboards wbs = get(roomId);
Whiteboard wb = wbs.get(wbId);
if (wb != null) {
wb.clear();
update(wbs);
}
return wb;
}
use of org.apache.openmeetings.db.dto.room.Whiteboard in project openmeetings by apache.
the class WhiteboardManager method remove.
public Whiteboard remove(long roomId, Long wbId) {
Whiteboards wbs = get(roomId);
Whiteboard wb = wbs.getWhiteboards().remove(wbId);
update(wbs);
return wb;
}
use of org.apache.openmeetings.db.dto.room.Whiteboard in project openmeetings by apache.
the class WhiteboardManager method get.
public Whiteboards get(Long roomId, Long langId) {
if (roomId == null) {
return null;
}
Whiteboards wbs = onlineWbs.get(roomId);
if (wbs == null) {
wbs = new Whiteboards(roomId);
Whiteboard wb = add(wbs, langId);
wbs.setActiveWb(wb.getId());
update(wbs);
}
return wbs;
}
Aggregations