Search in sources :

Example 1 with Userlist

use of de.vitero.schema.user.Userlist in project OpenOLAT by OpenOLAT.

the class ViteroManager method getVmsUsersByGroup.

protected List<Usertype> getVmsUsersByGroup(int groupId) throws VmsNotAvailableException {
    try {
        GetUserListByGroupRequest listRequest = new GetUserListByGroupRequest();
        listRequest.setGroupid(groupId);
        Userlist userList = getUserWebService().getUserListByGroup(listRequest);
        List<Usertype> userTypes = userList.getUser();
        return userTypes;
    } catch (SOAPFaultException f) {
        ErrorCode code = handleAxisFault(f);
        switch(code) {
            default:
                logAxisError("Cannot get the list of users in group: " + groupId, f);
        }
        return null;
    } catch (WebServiceException e) {
        if (e.getCause() instanceof ConnectException) {
            throw new VmsNotAvailableException();
        }
        log.error("Cannot get the list of users in group: " + groupId, e);
        return null;
    }
}
Also used : Usertype(de.vitero.schema.user.Usertype) GetUserListByGroupRequest(de.vitero.schema.user.GetUserListByGroupRequest) WebServiceException(javax.xml.ws.WebServiceException) Userlist(de.vitero.schema.user.Userlist) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) ErrorCode(org.olat.modules.vitero.model.ErrorCode) ConnectException(java.net.ConnectException)

Example 2 with Userlist

use of de.vitero.schema.user.Userlist in project openolat by klemens.

the class ViteroManager method getVmsUsersByGroup.

protected List<Usertype> getVmsUsersByGroup(int groupId) throws VmsNotAvailableException {
    try {
        GetUserListByGroupRequest listRequest = new GetUserListByGroupRequest();
        listRequest.setGroupid(groupId);
        Userlist userList = getUserWebService().getUserListByGroup(listRequest);
        List<Usertype> userTypes = userList.getUser();
        return userTypes;
    } catch (SOAPFaultException f) {
        ErrorCode code = handleAxisFault(f);
        switch(code) {
            default:
                logAxisError("Cannot get the list of users in group: " + groupId, f);
        }
        return null;
    } catch (WebServiceException e) {
        if (e.getCause() instanceof ConnectException) {
            throw new VmsNotAvailableException();
        }
        log.error("Cannot get the list of users in group: " + groupId, e);
        return null;
    }
}
Also used : Usertype(de.vitero.schema.user.Usertype) GetUserListByGroupRequest(de.vitero.schema.user.GetUserListByGroupRequest) WebServiceException(javax.xml.ws.WebServiceException) Userlist(de.vitero.schema.user.Userlist) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) ErrorCode(org.olat.modules.vitero.model.ErrorCode) ConnectException(java.net.ConnectException)

Example 3 with Userlist

use of de.vitero.schema.user.Userlist in project OpenOLAT by OpenOLAT.

the class ViteroManager method getCustomersUsers.

public List<Usertype> getCustomersUsers() throws VmsNotAvailableException {
    try {
        GetUserListByCustomerRequest listRequest = new GetUserListByCustomerRequest();
        listRequest.setCustomerid(viteroModule.getCustomerId());
        Userlist userList = getUserWebService().getUserListByCustomer(listRequest);
        List<Usertype> userTypes = userList.getUser();
        return userTypes;
    } catch (SOAPFaultException f) {
        ErrorCode code = handleAxisFault(f);
        switch(code) {
            default:
                logAxisError("Cannot get the list of users of customer: " + viteroModule.getCustomerId(), f);
        }
        return null;
    } catch (WebServiceException e) {
        if (e.getCause() instanceof ConnectException) {
            throw new VmsNotAvailableException();
        }
        log.error("Cannot get the list of users of customer: " + viteroModule.getCustomerId(), e);
        return null;
    }
}
Also used : Usertype(de.vitero.schema.user.Usertype) WebServiceException(javax.xml.ws.WebServiceException) Userlist(de.vitero.schema.user.Userlist) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) ErrorCode(org.olat.modules.vitero.model.ErrorCode) GetUserListByCustomerRequest(de.vitero.schema.user.GetUserListByCustomerRequest) ConnectException(java.net.ConnectException)

Example 4 with Userlist

use of de.vitero.schema.user.Userlist in project openolat by klemens.

the class ViteroManager method getCustomersUsers.

public List<Usertype> getCustomersUsers() throws VmsNotAvailableException {
    try {
        GetUserListByCustomerRequest listRequest = new GetUserListByCustomerRequest();
        listRequest.setCustomerid(viteroModule.getCustomerId());
        Userlist userList = getUserWebService().getUserListByCustomer(listRequest);
        List<Usertype> userTypes = userList.getUser();
        return userTypes;
    } catch (SOAPFaultException f) {
        ErrorCode code = handleAxisFault(f);
        switch(code) {
            default:
                logAxisError("Cannot get the list of users of customer: " + viteroModule.getCustomerId(), f);
        }
        return null;
    } catch (WebServiceException e) {
        if (e.getCause() instanceof ConnectException) {
            throw new VmsNotAvailableException();
        }
        log.error("Cannot get the list of users of customer: " + viteroModule.getCustomerId(), e);
        return null;
    }
}
Also used : Usertype(de.vitero.schema.user.Usertype) WebServiceException(javax.xml.ws.WebServiceException) Userlist(de.vitero.schema.user.Userlist) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) ErrorCode(org.olat.modules.vitero.model.ErrorCode) GetUserListByCustomerRequest(de.vitero.schema.user.GetUserListByCustomerRequest) ConnectException(java.net.ConnectException)

Aggregations

Userlist (de.vitero.schema.user.Userlist)4 Usertype (de.vitero.schema.user.Usertype)4 ConnectException (java.net.ConnectException)4 WebServiceException (javax.xml.ws.WebServiceException)4 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)4 ErrorCode (org.olat.modules.vitero.model.ErrorCode)4 GetUserListByCustomerRequest (de.vitero.schema.user.GetUserListByCustomerRequest)2 GetUserListByGroupRequest (de.vitero.schema.user.GetUserListByGroupRequest)2