JSONArray list = res.asJSONArray();
int size = list.length();
ResponseList<DirectMessage> directMessages = new ResponseListImpl<DirectMessage>(size, res);
for (int i = 0; i < size; i++) {
JSONObject json = list.getJSONObject(i);
DirectMessage directMessage = new DirectMessageJSONImpl(json);
directMessages.add(directMessage);
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.registerJSONObject(directMessage, json);
}
}