Package tigase.mongodb
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.OfflineMessagesProcessorNested classes/interfaces inherited from interface tigase.db.Repository
tigase.db.Repository.Meta, tigase.db.Repository.SchemaIdNested 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddeleteMessage(org.bson.types.ObjectId dbId) intdeleteMessagesToJID(List<String> db_ids, tigase.xmpp.XMPPResourceConnection session) tigase.xml.ElementgetMessageExpired(long time, boolean delete) getMessagesCount(tigase.xmpp.jid.JID to) List<tigase.xml.Element>getMessagesList(tigase.xmpp.jid.JID to) voidinitRepository(String resource_uri, Map<String, String> params) Deprecated.protected voidloadExpiredQueue(int max) protected voidloadExpiredQueue(Date expired) 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) voidsetDataSource(MongoDataSource dataSource) booleanstoreMessage(tigase.xmpp.jid.JID from, tigase.xmpp.jid.JID to, Date expired, tigase.xml.Element msg, tigase.db.NonAuthUserRepository userRepo) tigase.db.util.SchemaLoader.ResultupdateSchema(Optional<tigase.util.Version> oldVersion, tigase.util.Version newVersion) Methods inherited from class tigase.server.amp.db.MsgRepository
getInstance, getMsgsStoreLimit, setConditionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
deleteMessagein classtigase.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:
deleteMessagesToJIDin interfacetigase.db.MsgRepositoryIfc<MongoDataSource>- Specified by:
deleteMessagesToJIDin classtigase.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:
getMessageExpiredin interfacetigase.db.OfflineMsgRepositoryIfc- Overrides:
getMessageExpiredin classtigase.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:
getMessagesCountin interfacetigase.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:
getMessagesListin interfacetigase.db.MsgRepositoryIfc<MongoDataSource>- Throws:
tigase.db.UserNotFoundException
-
initRepository
@Deprecated public void initRepository(String resource_uri, Map<String, String> params) throws tigase.db.DBInitExceptionDeprecated.- Specified by:
initRepositoryin interfacetigase.db.Repository- Overrides:
initRepositoryin classtigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,MongoDataSource> - Throws:
tigase.db.DBInitException
-
loadExpiredQueue
protected void loadExpiredQueue(int max) - Specified by:
loadExpiredQueuein classtigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,MongoDataSource>
-
loadExpiredQueue
- Specified by:
loadExpiredQueuein classtigase.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:
loadMessagesToJIDin interfacetigase.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:
loadMessagesToJIDin interfacetigase.db.MsgRepositoryIfc<MongoDataSource>- Specified by:
loadMessagesToJIDin classtigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,MongoDataSource> - Throws:
tigase.db.UserNotFoundException
-
setDataSource
- Specified by:
setDataSourcein interfacetigase.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:
storeMessagein interfacetigase.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:
updateSchemain interfacetigase.db.util.RepositoryVersionAware- Throws:
tigase.db.TigaseDBException
-