List<Message> messages = dao.listMessagesInTimestampOrder(offset, limit);
List<MessageGWT> gwtMessages = new ArrayList<MessageGWT>(messages.size());
for (Message message : messages)
{
MessageGWT gwtMessage = new MessageGWT();
gwtMessage.setExpiresTimestamp(message.getExpiresTimestamp());
gwtMessage.setGuid(message.getGuid());
gwtMessage.setPublishedTimestamp(message.getPublishedTimestamp());
gwtMessage.setPublisherGuid(message.getPublisherGuid());
gwtMessage.setTopicGuid(message.getTopicGuid());
gwtMessages.add(gwtMessage);
}
return gwtMessages;
}