use of fi.otavanopisto.muikku.schooldata.entity.UserProperty in project muikku by otavanopisto.
the class PyramusUserSchoolDataBridge method listUserPropertiesByUser.
@Override
public List<UserProperty> listUserPropertiesByUser(String userIdentifier) {
Long studentId = identifierMapper.getPyramusStudentId(userIdentifier);
if (studentId != null) {
Student student = pyramusClient.get("/students/students/" + studentId, Student.class);
Map<String, String> variables = student.getVariables();
List<UserProperty> userProperties = new ArrayList<>();
for (String key : variables.keySet()) {
String value = variables.get(key);
if (value != null) {
userProperties.add(new PyramusUserProperty(userIdentifier, key, value));
}
}
return userProperties;
}
logger.warning(String.format("PyramusUserSchoolDataBridge.listUserPropertiesByUser malformed user identifier %s\n%s", userIdentifier, ExceptionUtils.getStackTrace(new Throwable())));
throw new SchoolDataBridgeInternalException(String.format("Malformed user identifier %s", userIdentifier));
}
Aggregations