Package 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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 mostlimit
, and skipping the firstoffset
.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 mostlimit
, and skipping the firstoffset
.List<Event>
getRecentPersonalMessages()
Get the 30 most recent messages posted by the current user.List<Event>
getRecentPersonalMessages(int limit, int offset)
Get the most recent messages posted by the current user, at mostlimit
, and skipping the firstoffset
.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 mostlimit
, and skipping the firstoffset
.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 mostlimit
, and skipping the firstoffset
.- Parameters:
limit
- the maximum number of messages to returnoffset
- 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 mostlimit
, and skipping the firstoffset
.- Parameters:
author
- the user that wrote the messageslimit
- the maximum number of messages to returnoffset
- 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 senduser
- 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 mostlimit
, and skipping the firstoffset
.- Parameters:
limit
- the maximum number of messages to returnoffset
- 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 sendgroup
- 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 mostlimit
, and skipping the firstoffset
.- Parameters:
group
- the target group for which to retrieve messageslimit
- the maximum number of messages to returnoffset
- 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
-
-