Class MongoMsgRepository

java.lang.Object
tigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,MongoDataSource>
tigase.mongodb.MongoMsgRepository
All Implemented Interfaces:
tigase.db.DataSourceAware<MongoDataSource>, tigase.db.MsgRepositoryIfc<MongoDataSource>, tigase.db.OfflineMsgRepositoryIfc, tigase.db.Repository, tigase.db.util.RepositoryVersionAware, MongoRepositoryVersionAware

public class MongoMsgRepository extends tigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,MongoDataSource> implements MongoRepositoryVersionAware
Author:
andrzej
  • 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.MsgRepositoryPoolBean<T extends Object>, 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

    awaitingInExpiredQueue, earliestOffline, expiredQueue, MAX_QUEUE_SIZE, MSGS_STORE_LIMIT_KEY, OFFLINE_MSGS_KEY, parser
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    deleteMessage(org.bson.types.ObjectId dbId)
     
    int
    deleteMessagesToJID(List<String> db_ids, tigase.xmpp.XMPPResourceConnection session)
     
    tigase.xml.Element
    getMessageExpired(long time, boolean delete)
     
    getMessagesCount(tigase.xmpp.jid.JID to)
     
    List<tigase.xml.Element>
    getMessagesList(tigase.xmpp.jid.JID to)
     
    void
    initRepository(String resource_uri, Map<String,String> params)
    Deprecated.
    protected void
     
    protected void
     
    Queue<tigase.xml.Element>
    loadMessagesToJID(List<String> db_ids, tigase.xmpp.XMPPResourceConnection session, boolean delete, tigase.server.amp.db.MsgRepository.OfflineMessagesProcessor proc)
     
    Queue<tigase.xml.Element>
    loadMessagesToJID(tigase.xmpp.XMPPResourceConnection session, boolean delete)
     
    Queue<tigase.xml.Element>
    loadMessagesToJID(tigase.xmpp.XMPPResourceConnection session, boolean delete, tigase.server.amp.db.MsgRepository.OfflineMessagesProcessor proc)
     
    void
     
    boolean
    storeMessage(tigase.xmpp.jid.JID from, tigase.xmpp.jid.JID to, Date expired, tigase.xml.Element msg, tigase.db.NonAuthUserRepository userRepo)
     
    tigase.db.util.SchemaLoader.Result
    updateSchema(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

    Methods inherited from interface tigase.mongodb.MongoRepositoryVersionAware

    getVersion
  • Constructor Details

    • MongoMsgRepository

      public MongoMsgRepository()
  • Method Details

    • 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