Search in sources :

Example 1 with Grouprequesttype

use of de.vitero.schema.licence.Grouprequesttype in project openolat by klemens.

the class ViteroManager method getLicenceForAvailableRooms.

public List<Integer> getLicenceForAvailableRooms(Date begin, Date end) throws VmsNotAvailableException {
    List<Integer> roomSizes = new ArrayList<Integer>();
    try {
        Grouprequesttype groupRequest = new Grouprequesttype();
        groupRequest.setStart(format(begin));
        groupRequest.setEnd(format(end));
        GetBookableRoomsForGroupResponse response = getLicenceWebService().getBookableRoomsForGroup(groupRequest);
        Rooms rooms = response.getRooms();
        for (Integer roomSize : rooms.getRoomsize()) {
            if (!roomSizes.contains(roomSize)) {
                roomSizes.add(roomSize);
            }
        }
    } catch (SOAPFaultException f) {
        ErrorCode code = handleAxisFault(f);
        switch(code) {
            default:
                logAxisError("Cannot get licence for available room by dates.", f);
        }
    } catch (WebServiceException e) {
        if (e.getCause() instanceof ConnectException) {
            throw new VmsNotAvailableException();
        }
        log.error("Cannot get licence for available room by dates.", e);
    }
    return roomSizes;
}
Also used : BigInteger(java.math.BigInteger) Grouprequesttype(de.vitero.schema.licence.Grouprequesttype) WebServiceException(javax.xml.ws.WebServiceException) GetBookableRoomsForGroupResponse(de.vitero.schema.licence.GetBookableRoomsForGroupResponse) ArrayList(java.util.ArrayList) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) ErrorCode(org.olat.modules.vitero.model.ErrorCode) Rooms(de.vitero.schema.licence.GetBookableRoomsForGroupResponse.Rooms) ConnectException(java.net.ConnectException)

Example 2 with Grouprequesttype

use of de.vitero.schema.licence.Grouprequesttype in project OpenOLAT by OpenOLAT.

the class ViteroManager method getLicenceForAvailableRooms.

public List<Integer> getLicenceForAvailableRooms(Date begin, Date end) throws VmsNotAvailableException {
    List<Integer> roomSizes = new ArrayList<Integer>();
    try {
        Grouprequesttype groupRequest = new Grouprequesttype();
        groupRequest.setStart(format(begin));
        groupRequest.setEnd(format(end));
        GetBookableRoomsForGroupResponse response = getLicenceWebService().getBookableRoomsForGroup(groupRequest);
        Rooms rooms = response.getRooms();
        for (Integer roomSize : rooms.getRoomsize()) {
            if (!roomSizes.contains(roomSize)) {
                roomSizes.add(roomSize);
            }
        }
    } catch (SOAPFaultException f) {
        ErrorCode code = handleAxisFault(f);
        switch(code) {
            default:
                logAxisError("Cannot get licence for available room by dates.", f);
        }
    } catch (WebServiceException e) {
        if (e.getCause() instanceof ConnectException) {
            throw new VmsNotAvailableException();
        }
        log.error("Cannot get licence for available room by dates.", e);
    }
    return roomSizes;
}
Also used : BigInteger(java.math.BigInteger) Grouprequesttype(de.vitero.schema.licence.Grouprequesttype) WebServiceException(javax.xml.ws.WebServiceException) GetBookableRoomsForGroupResponse(de.vitero.schema.licence.GetBookableRoomsForGroupResponse) ArrayList(java.util.ArrayList) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) ErrorCode(org.olat.modules.vitero.model.ErrorCode) Rooms(de.vitero.schema.licence.GetBookableRoomsForGroupResponse.Rooms) ConnectException(java.net.ConnectException)

Aggregations

GetBookableRoomsForGroupResponse (de.vitero.schema.licence.GetBookableRoomsForGroupResponse)2 Rooms (de.vitero.schema.licence.GetBookableRoomsForGroupResponse.Rooms)2 Grouprequesttype (de.vitero.schema.licence.Grouprequesttype)2 BigInteger (java.math.BigInteger)2 ConnectException (java.net.ConnectException)2 ArrayList (java.util.ArrayList)2 WebServiceException (javax.xml.ws.WebServiceException)2 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)2 ErrorCode (org.olat.modules.vitero.model.ErrorCode)2