Class MongoMsgRepository

    • Nested Class Summary

      • Nested classes/interfaces inherited from class tigase.server.amp.db.MsgRepository

        tigase.server.amp.db.MsgRepository.MSG_TYPES, tigase.server.amp.db.MsgRepository.MsgDBItem<T extends Object>, tigase.server.amp.db.MsgRepository.MsgRepositoryMDBean, tigase.server.amp.db.MsgRepository.OfflineMessagesProcessor
      • Nested classes/interfaces inherited from interface tigase.db.Repository

        tigase.db.Repository.Meta, tigase.db.Repository.SchemaId
      • Nested classes/interfaces inherited from interface tigase.db.util.RepositoryVersionAware

        tigase.db.util.RepositoryVersionAware.SchemaVersion
    • Field Summary

      • Fields inherited from class tigase.server.amp.db.MsgRepository

        earliestOffline, expiredQueue, MAX_QUEUE_SIZE, MSGS_STORE_LIMIT_KEY, OFFLINE_MSGS_KEY, parser
    • Constructor Detail

      • MongoMsgRepository

        public MongoMsgRepository()
    • Method Detail

      • deleteMessage

        protected void deleteMessage​(org.bson.types.ObjectId dbId)
        Specified by:
        deleteMessage in class tigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,​MongoDataSource>
      • deleteMessagesToJID

        public int deleteMessagesToJID​(List<String> db_ids,
                                       tigase.xmpp.XMPPResourceConnection session)
                                throws tigase.db.UserNotFoundException
        Specified by:
        deleteMessagesToJID in interface tigase.db.MsgRepositoryIfc<MongoDataSource>
        Specified by:
        deleteMessagesToJID in class tigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,​MongoDataSource>
        Throws:
        tigase.db.UserNotFoundException
      • getMessageExpired

        public tigase.xml.Element getMessageExpired​(long time,
                                                    boolean delete)
        Specified by:
        getMessageExpired in interface tigase.db.OfflineMsgRepositoryIfc
        Overrides:
        getMessageExpired in class tigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,​MongoDataSource>
      • getMessagesCount

        public Map<Enum,​Long> getMessagesCount​(tigase.xmpp.jid.JID to)
                                              throws tigase.db.UserNotFoundException
        Specified by:
        getMessagesCount in interface tigase.db.MsgRepositoryIfc<MongoDataSource>
        Throws:
        tigase.db.UserNotFoundException
      • getMessagesList

        public List<tigase.xml.Element> getMessagesList​(tigase.xmpp.jid.JID to)
                                                 throws tigase.db.UserNotFoundException
        Specified by:
        getMessagesList in interface tigase.db.MsgRepositoryIfc<MongoDataSource>
        Throws:
        tigase.db.UserNotFoundException
      • initRepository

        @Deprecated
        public void initRepository​(String resource_uri,
                                   Map<String,​String> params)
                            throws tigase.db.DBInitException
        Deprecated.
        Specified by:
        initRepository in interface tigase.db.Repository
        Overrides:
        initRepository in class tigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,​MongoDataSource>
        Throws:
        tigase.db.DBInitException
      • loadExpiredQueue

        protected void loadExpiredQueue​(int max)
        Specified by:
        loadExpiredQueue in class tigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,​MongoDataSource>
      • loadExpiredQueue

        protected void loadExpiredQueue​(Date expired)
        Specified by:
        loadExpiredQueue in class tigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,​MongoDataSource>
      • loadMessagesToJID

        public Queue<tigase.xml.Element> loadMessagesToJID​(tigase.xmpp.XMPPResourceConnection session,
                                                           boolean delete)
                                                    throws tigase.db.UserNotFoundException
        Specified by:
        loadMessagesToJID in interface tigase.db.OfflineMsgRepositoryIfc
        Throws:
        tigase.db.UserNotFoundException
      • loadMessagesToJID

        public Queue<tigase.xml.Element> loadMessagesToJID​(tigase.xmpp.XMPPResourceConnection session,
                                                           boolean delete,
                                                           tigase.server.amp.db.MsgRepository.OfflineMessagesProcessor proc)
                                                    throws tigase.db.UserNotFoundException
        Throws:
        tigase.db.UserNotFoundException
      • loadMessagesToJID

        public Queue<tigase.xml.Element> loadMessagesToJID​(List<String> db_ids,
                                                           tigase.xmpp.XMPPResourceConnection session,
                                                           boolean delete,
                                                           tigase.server.amp.db.MsgRepository.OfflineMessagesProcessor proc)
                                                    throws tigase.db.UserNotFoundException
        Specified by:
        loadMessagesToJID in interface tigase.db.MsgRepositoryIfc<MongoDataSource>
        Specified by:
        loadMessagesToJID in class tigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,​MongoDataSource>
        Throws:
        tigase.db.UserNotFoundException
      • setDataSource

        public void setDataSource​(MongoDataSource dataSource)
        Specified by:
        setDataSource in interface tigase.db.DataSourceAware<MongoDataSource>
      • storeMessage

        public boolean storeMessage​(tigase.xmpp.jid.JID from,
                                    tigase.xmpp.jid.JID to,
                                    Date expired,
                                    tigase.xml.Element msg,
                                    tigase.db.NonAuthUserRepository userRepo)
                             throws tigase.db.UserNotFoundException
        Specified by:
        storeMessage in interface tigase.db.OfflineMsgRepositoryIfc
        Throws:
        tigase.db.UserNotFoundException
      • updateSchema

        public tigase.db.util.SchemaLoader.Result updateSchema​(Optional<tigase.util.Version> oldVersion,
                                                               tigase.util.Version newVersion)
                                                        throws tigase.db.TigaseDBException
        Specified by:
        updateSchema in interface tigase.db.util.RepositoryVersionAware
        Throws:
        tigase.db.TigaseDBException