use of de.vitero.schema.booking.UpdateBookingRequest in project OpenOLAT by OpenOLAT.
the class ViteroManager method updateVmsBooking.
public ViteroStatus updateVmsBooking(ViteroBooking vBooking) throws VmsNotAvailableException {
try {
UpdateBookingRequest updateRequest = new UpdateBookingRequest();
updateRequest.setBookingid(vBooking.getBookingId());
if (StringHelper.containsNonWhitespace(vBooking.getEventName())) {
updateRequest.setEventname(vBooking.getEventName());
}
updateRequest.setEnd(format(vBooking.getEnd()));
updateRequest.setEndbuffer(vBooking.getEndBuffer());
updateRequest.setStart(format(vBooking.getStart()));
updateRequest.setStartbuffer(vBooking.getStartBuffer());
updateRequest.setTimezone(viteroModule.getTimeZoneId());
getBookingWebService().updateBooking(updateRequest);
return new ViteroStatus();
} catch (SOAPFaultException f) {
ErrorCode code = handleAxisFault(f);
switch(code) {
case unsufficientRights:
case bookingCollision:
case bookingInPast:
case noRoomsAvailable:
return new ViteroStatus(code);
case bookingDoesntExist:
case bookingDoesntExistPrime:
{
deleteGroup(vBooking);
deleteProperty(vBooking);
// ok, vms deleted, group deleted...
return new ViteroStatus(code);
}
default:
{
logAxisError("Cannot update a booking.", f);
}
}
return new ViteroStatus(ErrorCode.unkown);
} catch (WebServiceException e) {
if (e.getCause() instanceof ConnectException) {
throw new VmsNotAvailableException();
}
log.error("Cannot update a booking.", e);
return new ViteroStatus(ErrorCode.unkown);
}
}
use of de.vitero.schema.booking.UpdateBookingRequest in project openolat by klemens.
the class ViteroManager method updateVmsBooking.
public ViteroStatus updateVmsBooking(ViteroBooking vBooking) throws VmsNotAvailableException {
try {
UpdateBookingRequest updateRequest = new UpdateBookingRequest();
updateRequest.setBookingid(vBooking.getBookingId());
if (StringHelper.containsNonWhitespace(vBooking.getEventName())) {
updateRequest.setEventname(vBooking.getEventName());
}
updateRequest.setEnd(format(vBooking.getEnd()));
updateRequest.setEndbuffer(vBooking.getEndBuffer());
updateRequest.setStart(format(vBooking.getStart()));
updateRequest.setStartbuffer(vBooking.getStartBuffer());
updateRequest.setTimezone(viteroModule.getTimeZoneId());
getBookingWebService().updateBooking(updateRequest);
return new ViteroStatus();
} catch (SOAPFaultException f) {
ErrorCode code = handleAxisFault(f);
switch(code) {
case unsufficientRights:
case bookingCollision:
case bookingInPast:
case noRoomsAvailable:
return new ViteroStatus(code);
case bookingDoesntExist:
case bookingDoesntExistPrime:
{
deleteGroup(vBooking);
deleteProperty(vBooking);
// ok, vms deleted, group deleted...
return new ViteroStatus(code);
}
default:
{
logAxisError("Cannot update a booking.", f);
}
}
return new ViteroStatus(ErrorCode.unkown);
} catch (WebServiceException e) {
if (e.getCause() instanceof ConnectException) {
throw new VmsNotAvailableException();
}
log.error("Cannot update a booking.", e);
return new ViteroStatus(ErrorCode.unkown);
}
}
Aggregations