*
* @param rowIndex
* @return data transfer object
*/
public WebSocketMessageDTO getDTO(int rowIndex) {
WebSocketMessageDTO message = getRowObject(rowIndex);
if (message == null) {
return null;
}
String pk = message.toString();
if (fullMessagesCache.containsKey(pk)) {
return (WebSocketMessageDTO) fullMessagesCache.get(pk);
} else if (message.id == null) {
return message;
} else {
try {
WebSocketMessageDTO fullMessage = table.getMessage(message.id, message.channel.id);
fullMessagesCache.put(pk, fullMessage);
return fullMessage;
} catch (SQLException e) {
logger.error("Error retrieving full message!",e);