Class MessagesManager


  • public class MessagesManager
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      MessagesManager​(step.core.collections.Collection<Message> messagesCollection, step.core.collections.Collection<UserInboxItem> inboxCollection, step.core.access.UserAccessor userAccessor, step.framework.server.tables.TableRegistry tableRegistry, ch.exense.commons.app.Configuration configuration)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Message.State getMessageState​(org.bson.types.ObjectId msgId, step.core.access.User user)  
      step.framework.server.tables.Table<Message> getTable()  
      java.util.Map<java.lang.String,​Message.State> getUserInbox​(step.core.access.User user, java.util.List<Message.State> wantedStates)  
      java.util.List<Message> listAll()  
      void save​(java.util.List<step.core.access.User> audience, Message... messages)
      Saves messages by explicitly specifying which users to dispatch to.
      void save​(Message... messages)
      Saves messages using the default dispatch mechanism
      void save​(RecipientFilter filter, Message... messages)
      Saves messages by explicitly specifying a callback filter to determine which users to dispatch to.
      void setMessageState​(org.bson.types.ObjectId msgId, step.core.access.User user, Message.State state)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COLLECTION_MESSAGES

        public static final java.lang.String COLLECTION_MESSAGES
        See Also:
        Constant Field Values
      • COLLECTION_INBOX

        public static final java.lang.String COLLECTION_INBOX
        See Also:
        Constant Field Values
    • Constructor Detail

      • MessagesManager

        public MessagesManager​(step.core.collections.Collection<Message> messagesCollection,
                               step.core.collections.Collection<UserInboxItem> inboxCollection,
                               step.core.access.UserAccessor userAccessor,
                               step.framework.server.tables.TableRegistry tableRegistry,
                               ch.exense.commons.app.Configuration configuration)
    • Method Detail

      • setMessageState

        public void setMessageState​(org.bson.types.ObjectId msgId,
                                    step.core.access.User user,
                                    Message.State state)
      • getMessageState

        public Message.State getMessageState​(org.bson.types.ObjectId msgId,
                                             step.core.access.User user)
      • save

        public void save​(Message... messages)
        Saves messages using the default dispatch mechanism
        Parameters:
        messages - messages to save
      • save

        public void save​(RecipientFilter filter,
                         Message... messages)
        Saves messages by explicitly specifying a callback filter to determine which users to dispatch to. Default dispatch mechanism is bypassed.
        Parameters:
        filter - user filter
        messages - messages to save
      • save

        public void save​(java.util.List<step.core.access.User> audience,
                         Message... messages)
        Saves messages by explicitly specifying which users to dispatch to. Default dispatch mechanism is bypassed.
        Parameters:
        audience - users to send messages to
        messages - messages to save.
      • getTable

        public step.framework.server.tables.Table<Message> getTable()
      • listAll

        public java.util.List<Message> listAll()
      • getUserInbox

        public java.util.Map<java.lang.String,​Message.State> getUserInbox​(step.core.access.User user,
                                                                                java.util.List<Message.State> wantedStates)