use of org.apache.openmeetings.axis.services.RoomServicePortType in project openolat by klemens.
the class OpenMeetingsManagerImpl method closeOpenMeetingsRoom.
/**
* In OpenMeetings, close can mean open :-)
* @param roomId The room id
* @param status false = close, true = open
* @throws OpenMeetingsException
*/
private OpenMeetingsRoom closeOpenMeetingsRoom(OpenMeetingsRoom room, boolean status) throws OpenMeetingsException {
int responseCode = 0;
try {
String adminSID = adminLogin();
RoomServicePortType roomWs = getRoomWebService();
// OpenMeetings doc: false = close, true = open
log.audit("Room state changed (true = close, false = open): " + status);
responseCode = roomWs.closeRoom(adminSID, room.getRoomId(), status);
if (responseCode < 0) {
throw new OpenMeetingsException(responseCode);
}
return getRoomById(adminSID, room, room.getRoomId());
} catch (OpenMeetingsException e) {
log.error("", e);
throw e;
} catch (Exception e) {
log.error("", e);
throw translateException(e, responseCode);
}
}
use of org.apache.openmeetings.axis.services.RoomServicePortType in project openolat by klemens.
the class OpenMeetingsManagerImpl method updateRoom.
@Override
public OpenMeetingsRoom updateRoom(BusinessGroup group, OLATResourceable ores, String subIdentifier, OpenMeetingsRoom room) {
try {
String sid = adminLogin();
RoomServicePortType roomWs = getRoomWebService();
long returned = roomWs.updateRoomWithModerationQuestionsAudioTypeAndHideOptions(sid, room.getRoomId(), room.getName(), room.getType(), room.getComment(), room.getSize(), false, false, false, 0, room.isModerated(), false, room.isAudioOnly(), false, false, false, false, false, false, false);
if (returned >= 0) {
log.audit("Room updated");
openMeetingsDao.updateReference(group, ores, subIdentifier, room);
return room;
}
return null;
} catch (Exception e) {
log.error("", e);
return null;
}
}
use of org.apache.openmeetings.axis.services.RoomServicePortType in project openolat by klemens.
the class OpenMeetingsManagerImpl method getOpenOLATRooms.
@Override
public List<OpenMeetingsRoom> getOpenOLATRooms() {
try {
String adminSID = adminLogin();
RoomServicePortType roomWs = getRoomWebService();
GetRoomsWithCurrentUsersByListAndType getRooms = new GetRoomsWithCurrentUsersByListAndType();
getRooms.setAsc(true);
getRooms.setExternalRoomType(getOpenOLATExternalType());
getRooms.setOrderby("name");
getRooms.setStart(0);
getRooms.setMax(2000);
getRooms.setSID(adminSID);
Map<Long, RoomReturnInfo> realRooms = new HashMap<Long, RoomReturnInfo>();
// get rooms on openmeetings
List<RoomReturn> roomsRet = roomWs.getRoomsWithCurrentUsersByListAndType(adminSID, 0, 2000, "name", true, getOpenOLATExternalType());
if (roomsRet != null) {
for (RoomReturn roomRet : roomsRet) {
RoomReturnInfo info = new RoomReturnInfo();
info.setName(roomRet.getName());
info.setRoomId(roomRet.getRoomId());
int numOfUsers = 0;
if (roomRet.getRoomUser() != null) {
for (RoomUser user : roomRet.getRoomUser()) {
if (user != null) {
numOfUsers++;
}
}
}
info.setNumOfUsers(numOfUsers);
realRooms.put(new Long(roomRet.getRoomId()), info);
}
}
// get properties saved
List<OpenMeetingsRoomReference> props = openMeetingsDao.getReferences();
Map<Long, String> roomIdToResources = getResourceNames(props);
List<OpenMeetingsRoom> rooms = new ArrayList<OpenMeetingsRoom>();
for (OpenMeetingsRoomReference prop : props) {
Long roomId = new Long(prop.getRoomId());
RoomReturnInfo infos = realRooms.get(roomId);
if (infos != null) {
OpenMeetingsRoom room = openMeetingsDao.deserializeRoom(prop.getConfig());
room.setReference(prop);
room.setName(infos.getName());
room.setNumOfUsers(infos.getNumOfUsers());
String resourceName = roomIdToResources.get(roomId);
if (resourceName != null) {
room.setResourceName(resourceName);
}
rooms.add(room);
}
}
return rooms;
} catch (Exception e) {
log.error("", e);
return null;
}
}
use of org.apache.openmeetings.axis.services.RoomServicePortType in project OpenOLAT by OpenOLAT.
the class OpenMeetingsManagerImpl method addRoom.
@Override
public OpenMeetingsRoom addRoom(BusinessGroup group, OLATResourceable ores, String subIdentifier, OpenMeetingsRoom room) {
if (room.getRoomId() < 0) {
updateRoom(group, ores, subIdentifier, room);
}
try {
String sid = adminLogin();
RoomServicePortType roomWs = getRoomWebService();
long returned = roomWs.addRoomWithModerationAndRecordingFlags(sid, room.getName(), room.getType(), room.getComment(), room.getSize(), false, false, false, 0, room.isModerated(), getOpenOLATExternalType(), true, room.isAudioOnly(), false, true);
if (returned >= 0) {
room.setRoomId(returned);
log.audit("Room created");
OpenMeetingsRoomReference ref = openMeetingsDao.createReference(group, ores, subIdentifier, room);
room.setReference(ref);
return room;
}
return null;
} catch (Exception e) {
log.error("", e);
return null;
}
}
use of org.apache.openmeetings.axis.services.RoomServicePortType in project OpenOLAT by OpenOLAT.
the class OpenMeetingsManagerImpl method closeOpenMeetingsRoom.
/**
* In OpenMeetings, close can mean open :-)
* @param roomId The room id
* @param status false = close, true = open
* @throws OpenMeetingsException
*/
private OpenMeetingsRoom closeOpenMeetingsRoom(OpenMeetingsRoom room, boolean status) throws OpenMeetingsException {
int responseCode = 0;
try {
String adminSID = adminLogin();
RoomServicePortType roomWs = getRoomWebService();
// OpenMeetings doc: false = close, true = open
log.audit("Room state changed (true = close, false = open): " + status);
responseCode = roomWs.closeRoom(adminSID, room.getRoomId(), status);
if (responseCode < 0) {
throw new OpenMeetingsException(responseCode);
}
return getRoomById(adminSID, room, room.getRoomId());
} catch (OpenMeetingsException e) {
log.error("", e);
throw e;
} catch (Exception e) {
log.error("", e);
throw translateException(e, responseCode);
}
}
Aggregations