use of de.vitero.schema.licence.Modulestype.Modules in project openolat by klemens.
the class ViteroManager method getLicencedRoomSizes.
public List<Integer> getLicencedRoomSizes() throws VmsNotAvailableException {
List<Integer> roomSizes = new ArrayList<Integer>();
try {
GetModulesForCustomerRequest licenceRequest = new GetModulesForCustomerRequest();
licenceRequest.setCustomerid(viteroModule.getCustomerId());
Modulestype modules = getLicenceWebService().getModulesForCustomer(licenceRequest);
Modules modulesType = modules.getModules();
for (Module module : modulesType.getModule()) {
if ("ROOM".equals(module.getType())) {
Integer roomSize = module.getRoomsize();
if (!roomSizes.contains(roomSize)) {
roomSizes.add(roomSize);
}
}
}
} catch (SOAPFaultException f) {
ErrorCode code = handleAxisFault(f);
switch(code) {
case invalidAttribut:
log.error("ids <=0 or invalid attributs", f);
break;
default:
logAxisError("Cannot get licence for customer: " + viteroModule.getCustomerId(), f);
}
} catch (WebServiceException e) {
if (e.getCause() instanceof ConnectException) {
throw new VmsNotAvailableException();
}
log.error("Cannot get licence for customer: " + viteroModule.getCustomerId(), e);
}
return roomSizes;
}
use of de.vitero.schema.licence.Modulestype.Modules in project OpenOLAT by OpenOLAT.
the class ViteroManager method getLicencedRoomSizes.
public List<Integer> getLicencedRoomSizes() throws VmsNotAvailableException {
List<Integer> roomSizes = new ArrayList<Integer>();
try {
GetModulesForCustomerRequest licenceRequest = new GetModulesForCustomerRequest();
licenceRequest.setCustomerid(viteroModule.getCustomerId());
Modulestype modules = getLicenceWebService().getModulesForCustomer(licenceRequest);
Modules modulesType = modules.getModules();
for (Module module : modulesType.getModule()) {
if ("ROOM".equals(module.getType())) {
Integer roomSize = module.getRoomsize();
if (!roomSizes.contains(roomSize)) {
roomSizes.add(roomSize);
}
}
}
} catch (SOAPFaultException f) {
ErrorCode code = handleAxisFault(f);
switch(code) {
case invalidAttribut:
log.error("ids <=0 or invalid attributs", f);
break;
default:
logAxisError("Cannot get licence for customer: " + viteroModule.getCustomerId(), f);
}
} catch (WebServiceException e) {
if (e.getCause() instanceof ConnectException) {
throw new VmsNotAvailableException();
}
log.error("Cannot get licence for customer: " + viteroModule.getCustomerId(), e);
}
return roomSizes;
}
Aggregations