Search in sources :

Example 11 with RoomServicePortType

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);
    }
}
Also used : RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) ConnectException(java.net.ConnectException)

Example 12 with RoomServicePortType

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;
    }
}
Also used : RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) ConnectException(java.net.ConnectException)

Example 13 with RoomServicePortType

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;
    }
}
Also used : RoomUser(org.apache.openmeetings.axis.services.xsd.RoomUser) OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) GetRoomsWithCurrentUsersByListAndType(org.apache.openmeetings.axis.services.GetRoomsWithCurrentUsersByListAndType) RoomReturn(org.apache.openmeetings.axis.services.xsd.RoomReturn) HashMap(java.util.HashMap) OpenMeetingsRoomReference(org.olat.modules.openmeetings.model.OpenMeetingsRoomReference) ArrayList(java.util.ArrayList) ConnectException(java.net.ConnectException) RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) RoomReturnInfo(org.olat.modules.openmeetings.model.RoomReturnInfo)

Example 14 with RoomServicePortType

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;
    }
}
Also used : OpenMeetingsRoomReference(org.olat.modules.openmeetings.model.OpenMeetingsRoomReference) RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) ConnectException(java.net.ConnectException)

Example 15 with RoomServicePortType

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);
    }
}
Also used : RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) ConnectException(java.net.ConnectException)

Aggregations

RoomServicePortType (org.apache.openmeetings.axis.services.RoomServicePortType)20 ConnectException (java.net.ConnectException)18 ArrayList (java.util.ArrayList)4 RoomReturn (org.apache.openmeetings.axis.services.xsd.RoomReturn)4 RoomUser (org.apache.openmeetings.axis.services.xsd.RoomUser)4 OpenMeetingsRoom (org.olat.modules.openmeetings.model.OpenMeetingsRoom)4 OpenMeetingsRoomReference (org.olat.modules.openmeetings.model.OpenMeetingsRoomReference)4 HashMap (java.util.HashMap)2 GetRoomsWithCurrentUsersByListAndType (org.apache.openmeetings.axis.services.GetRoomsWithCurrentUsersByListAndType)2 RoomService (org.apache.openmeetings.axis.services.RoomService)2 FlvRecording (org.apache.openmeetings.persistence.beans.flvrecord.xsd.FlvRecording)2 Room (org.apache.openmeetings.persistence.beans.room.xsd.Room)2 OpenMeetingsRecording (org.olat.modules.openmeetings.model.OpenMeetingsRecording)2 RoomReturnInfo (org.olat.modules.openmeetings.model.RoomReturnInfo)2