public class XMLMsgRepository extends MsgRepository<String,XMLDataSource>
MsgRepository.MSG_TYPES, MsgRepository.MsgDBItem<T>, MsgRepository.MsgRepositoryMDBean, MsgRepository.OfflineMessagesProcessor
Repository.Meta, Repository.SchemaId
earliestOffline, expiredQueue, MAX_QUEUE_SIZE, MSGS_STORE_LIMIT_KEY, OFFLINE_MSGS_KEY, parser
Constructor and Description |
---|
XMLMsgRepository() |
Modifier and Type | Method and Description |
---|---|
protected void |
deleteMessage(String db_id) |
int |
deleteMessagesToJID(List<String> db_ids,
XMPPResourceConnection session) |
Map<Enum,Long> |
getMessagesCount(JID to) |
List<Element> |
getMessagesList(JID to) |
protected void |
loadExpiredQueue(Date expired) |
protected void |
loadExpiredQueue(int max) |
Queue<Element> |
loadMessagesToJID(List<String> db_ids,
XMPPResourceConnection session,
boolean delete,
MsgRepository.OfflineMessagesProcessor proc) |
Queue<Element> |
loadMessagesToJID(XMPPResourceConnection session,
boolean delete)
Loads all payloads for the given user's
JID from repository. |
void |
setDataSource(XMLDataSource dataSource)
Method called to provide class with instance of a data source.
|
boolean |
storeMessage(JID from,
JID to,
Date expired,
Element msg,
NonAuthUserRepository userRepo)
Saves the massage to the repository
|
getInstance, getMessageExpired, getMsgsStoreLimit, initRepository, setCondition
public void setDataSource(XMLDataSource dataSource)
DataSourceAware
public Map<Enum,Long> getMessagesCount(JID to) throws UserNotFoundException
UserNotFoundException
public List<Element> getMessagesList(JID to) throws UserNotFoundException
UserNotFoundException
public Queue<Element> loadMessagesToJID(XMPPResourceConnection session, boolean delete) throws UserNotFoundException
OfflineMsgRepositoryIfc
JID
from repository.session
- user session which keeps all the user session data and also gives an access to the user's
repository data.delete
- boolean parameter controlling whether messages should be removed from repository after they
retrieved.Queue
of Element
objects representing stored payloads for the given user's JID
UserNotFoundException
public boolean storeMessage(JID from, JID to, Date expired, Element msg, NonAuthUserRepository userRepo) throws UserNotFoundException
OfflineMsgRepositoryIfc
from
- JID
denotes address of the senderto
- JID
denotes address of the receiverexpired
- Date
object denoting expiration date of the messagemsg
- Element
payload of the stanza to be saveduserRepo
- NonAuthUserRepository
instance of non auth user repository to get user settings for
offline messagestrue
if the packet was correctly saved to repository, false
otherwise.UserNotFoundException
public Queue<Element> loadMessagesToJID(List<String> db_ids, XMPPResourceConnection session, boolean delete, MsgRepository.OfflineMessagesProcessor proc) throws UserNotFoundException
loadMessagesToJID
in interface MsgRepositoryIfc<XMLDataSource>
loadMessagesToJID
in class MsgRepository<String,XMLDataSource>
UserNotFoundException
public int deleteMessagesToJID(List<String> db_ids, XMPPResourceConnection session) throws UserNotFoundException
deleteMessagesToJID
in interface MsgRepositoryIfc<XMLDataSource>
deleteMessagesToJID
in class MsgRepository<String,XMLDataSource>
UserNotFoundException
protected void loadExpiredQueue(int max)
loadExpiredQueue
in class MsgRepository<String,XMLDataSource>
protected void loadExpiredQueue(Date expired)
loadExpiredQueue
in class MsgRepository<String,XMLDataSource>
protected void deleteMessage(String db_id)
deleteMessage
in class MsgRepository<String,XMLDataSource>
Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.