Search in sources :

Example 1 with Bookingid

use of de.vitero.schema.booking.Bookingid in project OpenOLAT by OpenOLAT.

the class ViteroManager method getVmsBookingById.

private Bookingtype getVmsBookingById(int id) throws VmsNotAvailableException {
    if (id < 0)
        return null;
    try {
        Bookingid bookingId = new Bookingid();
        bookingId.setBookingid(id);
        Bookingtype booking = getBookingWebService().getBookingById(bookingId);
        return booking;
    } catch (SOAPFaultException f) {
        ErrorCode code = handleAxisFault(f);
        switch(code) {
            case invalidAttribut:
                log.error("ids <= 0", f);
                break;
            case bookingDoesntExist:
                log.error("The booking does not exist", f);
                break;
            default:
                logAxisError("Cannot get booking by id: " + id, f);
        }
        return null;
    } catch (WebServiceException e) {
        if (e.getCause() instanceof ConnectException) {
            throw new VmsNotAvailableException();
        }
        log.error("Cannot get booking by id: " + id, e);
        return null;
    }
}
Also used : WebServiceException(javax.xml.ws.WebServiceException) Bookingid(de.vitero.schema.booking.Bookingid) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) ErrorCode(org.olat.modules.vitero.model.ErrorCode) Bookingtype(de.vitero.schema.booking.Bookingtype) ConnectException(java.net.ConnectException)

Example 2 with Bookingid

use of de.vitero.schema.booking.Bookingid in project openolat by klemens.

the class ViteroManager method getVmsBookingById.

private Bookingtype getVmsBookingById(int id) throws VmsNotAvailableException {
    if (id < 0)
        return null;
    try {
        Bookingid bookingId = new Bookingid();
        bookingId.setBookingid(id);
        Bookingtype booking = getBookingWebService().getBookingById(bookingId);
        return booking;
    } catch (SOAPFaultException f) {
        ErrorCode code = handleAxisFault(f);
        switch(code) {
            case invalidAttribut:
                log.error("ids <= 0", f);
                break;
            case bookingDoesntExist:
                log.error("The booking does not exist", f);
                break;
            default:
                logAxisError("Cannot get booking by id: " + id, f);
        }
        return null;
    } catch (WebServiceException e) {
        if (e.getCause() instanceof ConnectException) {
            throw new VmsNotAvailableException();
        }
        log.error("Cannot get booking by id: " + id, e);
        return null;
    }
}
Also used : WebServiceException(javax.xml.ws.WebServiceException) Bookingid(de.vitero.schema.booking.Bookingid) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) ErrorCode(org.olat.modules.vitero.model.ErrorCode) Bookingtype(de.vitero.schema.booking.Bookingtype) ConnectException(java.net.ConnectException)

Aggregations

Bookingid (de.vitero.schema.booking.Bookingid)2 Bookingtype (de.vitero.schema.booking.Bookingtype)2 ConnectException (java.net.ConnectException)2 WebServiceException (javax.xml.ws.WebServiceException)2 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)2 ErrorCode (org.olat.modules.vitero.model.ErrorCode)2