|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xwiki.messagestream.internal.DefaultMessageStream
@Component @Singleton public class DefaultMessageStream
Implementation of the MessageStream
that stores messages as events
in the EventStream
.
Constructor Summary | |
---|---|
DefaultMessageStream()
|
Method Summary | |
---|---|
protected Event |
createMessageEvent(String message,
String messageType)
Creates an Event object with the common fields filled in: event ID, target document, application, user... |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultMessageStream()
Method Detail |
---|
public void postPublicMessage(String message)
MessageStream
postPublicMessage
in interface MessageStream
message
- the message to storepublic void postPersonalMessage(String message)
MessageStream
postPersonalMessage
in interface MessageStream
message
- the message to storepublic void postDirectMessageToUser(String message, DocumentReference user)
MessageStream
postDirectMessageToUser
in interface MessageStream
message
- the message to senduser
- the target userpublic void postMessageToGroup(String message, DocumentReference group) throws IllegalAccessError
MessageStream
postMessageToGroup
in interface MessageStream
message
- the message to sendgroup
- the target group
IllegalAccessError
public List<Event> getRecentPersonalMessages()
MessageStream
getRecentPersonalMessages
in interface MessageStream
public List<Event> getRecentPersonalMessages(int limit, int offset)
MessageStream
limit
, and skipping the first offset
.
getRecentPersonalMessages
in interface MessageStream
limit
- the maximum number of messages to returnoffset
- how many messages to skip
public List<Event> getRecentPersonalMessages(DocumentReference author)
MessageStream
getRecentPersonalMessages
in interface MessageStream
author
- the user that wrote the messages
public List<Event> getRecentPersonalMessages(DocumentReference author, int limit, int offset)
MessageStream
limit
, and skipping the first
offset
.
getRecentPersonalMessages
in interface MessageStream
author
- the user that wrote the messageslimit
- the maximum number of messages to returnoffset
- how many messages to skip
public List<Event> getRecentDirectMessages()
MessageStream
getRecentDirectMessages
in interface MessageStream
public List<Event> getRecentDirectMessages(int limit, int offset)
MessageStream
limit
, and skipping the first
offset
.
getRecentDirectMessages
in interface MessageStream
limit
- the maximum number of messages to returnoffset
- how many messages to skip
public List<Event> getRecentMessagesForGroup(DocumentReference group)
MessageStream
getRecentMessagesForGroup
in interface MessageStream
group
- the target group for which to retrieve messages
public List<Event> getRecentMessagesForGroup(DocumentReference group, int limit, int offset)
MessageStream
limit
, and skipping the first offset
.
getRecentMessagesForGroup
in interface MessageStream
group
- the target group for which to retrieve messageslimit
- the maximum number of messages to returnoffset
- how many messages to skip
public void deleteMessage(String id)
MessageStream
deleteMessage
in interface MessageStream
id
- the unique ID of the messageprotected Event createMessageEvent(String message, String messageType)
Event
object with the common fields filled in: event ID, target document, application, user...
It also fills in the provided message body and type.
message
- the message to store in the event; at most 2000 characters are stored, longer messages are
automatically trimmedmessageType
- the type of message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |