Search in sources :

Example 1 with RoomReturn

use of org.apache.openmeetings.axis.services.xsd.RoomReturn in project OpenOLAT by OpenOLAT.

the class OpenMeetingsManagerImpl method getUsersOf.

@Override
public List<OpenMeetingsUser> getUsersOf(OpenMeetingsRoom room) throws OpenMeetingsException {
    try {
        String adminSID = adminLogin();
        RoomServicePortType roomWs = getRoomWebService();
        RoomReturn roomClRet = roomWs.getRoomWithClientObjectsById(adminSID, room.getRoomId());
        if (roomClRet != null) {
            List<RoomUser> userArr = roomClRet.getRoomUser();
            return convert(userArr);
        }
        return Collections.emptyList();
    } catch (Exception e) {
        log.error("", e);
        throw translateException(e, 0);
    }
}
Also used : RoomUser(org.apache.openmeetings.axis.services.xsd.RoomUser) RoomReturn(org.apache.openmeetings.axis.services.xsd.RoomReturn) RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) ConnectException(java.net.ConnectException)

Example 2 with RoomReturn

use of org.apache.openmeetings.axis.services.xsd.RoomReturn in project openolat by klemens.

the class OpenMeetingsManagerImpl method getUsersOf.

@Override
public List<OpenMeetingsUser> getUsersOf(OpenMeetingsRoom room) throws OpenMeetingsException {
    try {
        String adminSID = adminLogin();
        RoomServicePortType roomWs = getRoomWebService();
        RoomReturn roomClRet = roomWs.getRoomWithClientObjectsById(adminSID, room.getRoomId());
        if (roomClRet != null) {
            List<RoomUser> userArr = roomClRet.getRoomUser();
            return convert(userArr);
        }
        return Collections.emptyList();
    } catch (Exception e) {
        log.error("", e);
        throw translateException(e, 0);
    }
}
Also used : RoomUser(org.apache.openmeetings.axis.services.xsd.RoomUser) RoomReturn(org.apache.openmeetings.axis.services.xsd.RoomReturn) RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) ConnectException(java.net.ConnectException)

Example 3 with RoomReturn

use of org.apache.openmeetings.axis.services.xsd.RoomReturn 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 4 with RoomReturn

use of org.apache.openmeetings.axis.services.xsd.RoomReturn in project OpenOLAT by OpenOLAT.

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)

Aggregations

ConnectException (java.net.ConnectException)4 RoomServicePortType (org.apache.openmeetings.axis.services.RoomServicePortType)4 RoomReturn (org.apache.openmeetings.axis.services.xsd.RoomReturn)4 RoomUser (org.apache.openmeetings.axis.services.xsd.RoomUser)4 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 GetRoomsWithCurrentUsersByListAndType (org.apache.openmeetings.axis.services.GetRoomsWithCurrentUsersByListAndType)2 OpenMeetingsRoom (org.olat.modules.openmeetings.model.OpenMeetingsRoom)2 OpenMeetingsRoomReference (org.olat.modules.openmeetings.model.OpenMeetingsRoomReference)2 RoomReturnInfo (org.olat.modules.openmeetings.model.RoomReturnInfo)2