org.xwiki.messagestream
Interface MessageStream


@Role
public interface MessageStream

The message stream allows to post and retrieve short messages, from one user to one of a few possible targets: direct private messages to another user, messages to a group of users, personal messages to all the users that "follow" the sender.

Since:
3.0M3
Version:
$Id: 37cb09c318e066e2bf59309881f7fc3bce51eeb9 $

Method Summary
 void deleteMessage(String id)
          Delete an existing message, identified by its unique ID, if the current user is the author of that message.
 List<Event> getRecentDirectMessages()
          Get the 30 most recent direct messages sent to the current user.
 List<Event> getRecentDirectMessages(int limit, int offset)
          Get the most recent direct messages sent to the current user, at most limit, and skipping the first offset.
 List<Event> getRecentMessagesForGroup(DocumentReference group)
          Get the 30 most recent messages sent to the specified group.
 List<Event> getRecentMessagesForGroup(DocumentReference group, int limit, int offset)
          Get the most recent messages sent to the specified group, at most limit, and skipping the first offset.
 List<Event> getRecentPersonalMessages()
          Get the 30 most recent messages posted by the current user.
 List<Event> getRecentPersonalMessages(DocumentReference author)
          Get the 30 most recent personal messages posted by the specified user.
 List<Event> getRecentPersonalMessages(DocumentReference author, int limit, int offset)
          Get the most recent direct messages sent to the current user, at most limit, and skipping the first offset.
 List<Event> getRecentPersonalMessages(int limit, int offset)
          Get the most recent messages posted by the current user, at most limit, and skipping the first offset.
 void postDirectMessageToUser(String message, DocumentReference user)
          Post a private message to another user.
 void postMessageToGroup(String message, DocumentReference group)
          Post a message to a specific group of users.
 void postPersonalMessage(String message)
          Post a message to the current user's personal stream, displayed on his profile page and aggregated into their follower's streams.
 void postPublicMessage(String message)
          Post a message to the current user's stream, visible to everyone.
 

Method Detail

postPublicMessage

void postPublicMessage(String message)
Post a message to the current user's stream, visible to everyone.

Parameters:
message - the message to store

postPersonalMessage

void postPersonalMessage(String message)
Post a message to the current user's personal stream, displayed on his profile page and aggregated into their follower's streams.

Parameters:
message - the message to store

getRecentPersonalMessages

List<Event> getRecentPersonalMessages()
Get the 30 most recent messages posted by the current user.

Returns:
a list of recent personal messages

getRecentPersonalMessages

List<Event> getRecentPersonalMessages(int limit,
                                      int offset)
Get the most recent messages posted by the current user, at most limit, and skipping the first offset.

Parameters:
limit - the maximum number of messages to return
offset - how many messages to skip
Returns:
a list of recent personal messages, possibly empty

getRecentPersonalMessages

List<Event> getRecentPersonalMessages(DocumentReference author)
Get the 30 most recent personal messages posted by the specified user.

Parameters:
author - the user that wrote the messages
Returns:
a list of recent personal messages, possibly empty

getRecentPersonalMessages

List<Event> getRecentPersonalMessages(DocumentReference author,
                                      int limit,
                                      int offset)
Get the most recent direct messages sent to the current user, at most limit, and skipping the first offset.

Parameters:
author - the user that wrote the messages
limit - the maximum number of messages to return
offset - how many messages to skip
Returns:
a list of recent personal messages, possibly empty

postDirectMessageToUser

void postDirectMessageToUser(String message,
                             DocumentReference user)
Post a private message to another user.

Parameters:
message - the message to send
user - the target user

getRecentDirectMessages

List<Event> getRecentDirectMessages()
Get the 30 most recent direct messages sent to the current user.

Returns:
a list of recent direct messages received

getRecentDirectMessages

List<Event> getRecentDirectMessages(int limit,
                                    int offset)
Get the most recent direct messages sent to the current user, at most limit, and skipping the first offset.

Parameters:
limit - the maximum number of messages to return
offset - how many messages to skip
Returns:
a list of recent direct messages received

postMessageToGroup

void postMessageToGroup(String message,
                        DocumentReference group)
Post a message to a specific group of users.

Parameters:
message - the message to send
group - the target group

getRecentMessagesForGroup

List<Event> getRecentMessagesForGroup(DocumentReference group)
Get the 30 most recent messages sent to the specified group.

Parameters:
group - the target group for which to retrieve messages
Returns:
a list of recent messages sent to the target group

getRecentMessagesForGroup

List<Event> getRecentMessagesForGroup(DocumentReference group,
                                      int limit,
                                      int offset)
Get the most recent messages sent to the specified group, at most limit, and skipping the first offset.

Parameters:
group - the target group for which to retrieve messages
limit - the maximum number of messages to return
offset - how many messages to skip
Returns:
a list of recent messages sent to the target group

deleteMessage

void deleteMessage(String id)
Delete an existing message, identified by its unique ID, if the current user is the author of that message.

Parameters:
id - the unique ID of the message


Copyright © 2004-2013 XWiki. All Rights Reserved.