| java.lang.Object echo2example.chatserver.MessageStore
MessageStore | public class MessageStore (Code) | | A store for posted Message s.
|
Constructor Summary | |
public | MessageStore() Creates a new MessageStore . |
Method Summary | |
public Message[] | getMessages(long lastRetrievedId) Retrieves all messages with ids greater than the specified id. | public Message[] | getRecentMessages() Returns an array of recently posted messages. | public synchronized void | post(String userName, String messageContent) Posts a message. |
MessageStore | public MessageStore()(Code) | | Creates a new MessageStore .
|
getMessages | public Message[] getMessages(long lastRetrievedId)(Code) | | Retrieves all messages with ids greater than the specified id.
Parameters: lastRetrievedId - the id of the last message retrieved an array containing messages posted after the message identified |
getRecentMessages | public Message[] getRecentMessages()(Code) | | Returns an array of recently posted messages.
This method is queried by clients that have just joined the chat room
to retrieve context on the chat.
the recently posted messages |
post | public synchronized void post(String userName, String messageContent)(Code) | | Posts a message.
Parameters: userName - the name of the user Parameters: messageContent - the message content to post |
|
|