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 java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void deleteMessage​(org.bson.types.ObjectId dbId)  
      int deleteMessagesToJID​(java.util.List<java.lang.String> db_ids, tigase.xmpp.XMPPResourceConnection session)  
      tigase.xml.Element getMessageExpired​(long time, boolean delete)  
      java.util.Map<java.lang.Enum,​java.lang.Long> getMessagesCount​(tigase.xmpp.jid.JID to)  
      java.util.List<tigase.xml.Element> getMessagesList​(tigase.xmpp.jid.JID to)  
      void initRepository​(java.lang.String resource_uri, java.util.Map<java.lang.String,​java.lang.String> params)
      Deprecated.
      protected void loadExpiredQueue​(int max)  
      protected void loadExpiredQueue​(java.util.Date expired)  
      java.util.Queue<tigase.xml.Element> loadMessagesToJID​(java.util.List<java.lang.String> db_ids, tigase.xmpp.XMPPResourceConnection session, boolean delete, tigase.server.amp.db.MsgRepository.OfflineMessagesProcessor proc)  
      java.util.Queue<tigase.xml.Element> loadMessagesToJID​(tigase.xmpp.XMPPResourceConnection session, boolean delete)  
      java.util.Queue<tigase.xml.Element> loadMessagesToJID​(tigase.xmpp.XMPPResourceConnection session, boolean delete, tigase.server.amp.db.MsgRepository.OfflineMessagesProcessor proc)  
      void setDataSource​(MongoDataSource dataSource)  
      boolean storeMessage​(tigase.xmpp.jid.JID from, tigase.xmpp.jid.JID to, java.util.Date expired, tigase.xml.Element msg, tigase.db.NonAuthUserRepository userRepo)  
      tigase.db.util.SchemaLoader.Result updateSchema​(java.util.Optional<tigase.util.Version> oldVersion, tigase.util.Version newVersion)  
      • Methods inherited from class tigase.server.amp.db.MsgRepository

        getInstance, getMsgsStoreLimit, setCondition
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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​(java.util.List<java.lang.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 java.util.Map<java.lang.Enum,​java.lang.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 java.util.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​(java.lang.String resource_uri,
                                   java.util.Map<java.lang.String,​java.lang.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​(java.util.Date expired)
        Specified by:
        loadExpiredQueue in class tigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,​MongoDataSource>
      • loadMessagesToJID

        public java.util.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 java.util.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 java.util.Queue<tigase.xml.Element> loadMessagesToJID​(java.util.List<java.lang.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,
                                    java.util.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​(java.util.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