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;
}
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;
}
Aggregations