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.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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
loadExpiredQueue
(int max) protected void
loadExpiredQueue
(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) void
setDataSource
(MongoDataSource dataSource) 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 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:
deleteMessagesToJID
in interfacetigase.db.MsgRepositoryIfc<MongoDataSource>
- Specified by:
deleteMessagesToJID
in 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:
getMessageExpired
in interfacetigase.db.OfflineMsgRepositoryIfc
- Overrides:
getMessageExpired
in 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:
getMessagesCount
in 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:
getMessagesList
in 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:
initRepository
in interfacetigase.db.Repository
- Overrides:
initRepository
in classtigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,
MongoDataSource> - Throws:
tigase.db.DBInitException
-
loadExpiredQueue
protected void loadExpiredQueue(int max) - Specified by:
loadExpiredQueue
in classtigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,
MongoDataSource>
-
loadExpiredQueue
- Specified by:
loadExpiredQueue
in 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:
loadMessagesToJID
in 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:
loadMessagesToJID
in interfacetigase.db.MsgRepositoryIfc<MongoDataSource>
- Specified by:
loadMessagesToJID
in classtigase.server.amp.db.MsgRepository<org.bson.types.ObjectId,
MongoDataSource> - Throws:
tigase.db.UserNotFoundException
-
setDataSource
- Specified by:
setDataSource
in 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:
storeMessage
in 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:
updateSchema
in interfacetigase.db.util.RepositoryVersionAware
- Throws:
tigase.db.TigaseDBException
-