info.magnolia.ui.framework.message
Class MessageStore
java.lang.Object
info.magnolia.ui.framework.message.MessageStore
@Singleton
public class MessageStore
- extends Object
Stores messages on behalf of MessagesManager
in the repository, every user in the system has its own set of
messages that have ids unique in combination with their userid. Ids are generated by taking the largest id in use and
incrementing it by 1.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageStore
public MessageStore()
saveMessage
public boolean saveMessage(String userName,
info.magnolia.ui.api.message.Message message)
- Stores a new message or overwrites an existing one depending on whether there's an id set. That is, the id of the
message is respected if present otherwise a new unique one is used. When the method returns the message has been
updated with a new id.
- Parameters:
userName
- user to save the message formessage
- message to save
- Returns:
- true if saving was successful or false if it failed
getNumberOfUnclearedMessagesForUser
public int getNumberOfUnclearedMessagesForUser(String userName)
findAllMessagesForUser
public List<info.magnolia.ui.api.message.Message> findAllMessagesForUser(String userName)
findMessageById
public info.magnolia.ui.api.message.Message findMessageById(String userName,
String messageId)
removeMessageById
public void removeMessageById(String userName,
String messageId)
getNumberOfUnclearedMessagesForUserAndByType
public int getNumberOfUnclearedMessagesForUserAndByType(String userName,
info.magnolia.ui.api.message.MessageType type)
Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.