private List<Cookie> mapProperties(String project, User req, RakamHttpRequest request) {
InetAddress socketAddress = ((InetSocketAddress) request.context().channel()
.remoteAddress()).getAddress();
List<Cookie> cookies = null;
BatchUserOperationRequest op = new BatchUserOperationRequest(req.api,
ImmutableList.of(new BatchUserOperations(req.id, req.properties, null, null, null, null)));
for (UserPropertyMapper mapper : mappers) {
try {
List<Cookie> map = mapper.map(project, op.data, new HttpRequestParams(request), socketAddress);
if (map != null) {
if (cookies == null) {
cookies = new ArrayList<>();
}
cookies.addAll(map);
}
} catch (Exception e) {
LOGGER.error(e, "Error while mapping user properties in " + mapper.getClass().toString());
return null;
}
}
return cookies;
}