Package tigase.db
Interface OfflineMsgRepositoryIfc
- All Superinterfaces:
Repository
- All Known Subinterfaces:
MsgRepositoryIfc<T>
,OfflineMessages.OfflineMsgRepositoryIfc
- All Known Implementing Classes:
JDBCMsgRepository
,MsgRepository
,MsgRepository.MsgRepositoryMDBean
,XMLMsgRepository
Interface for storing and restoring offline Elements.
Created: May 11, 2010 6:56:14 PM
Created: May 11, 2010 6:56:14 PM
- Author:
- Artur Hefczyc
-
Nested Class Summary
Nested classes/interfaces inherited from interface tigase.db.Repository
Repository.Meta, Repository.SchemaId
-
Method Summary
Modifier and TypeMethodDescriptiongetMessageExpired
(long time, boolean delete) Deprecated.loadMessagesToJID
(XMPPResourceConnection session, boolean delete) Loads all payloads for the given user'sJID
from repository.boolean
storeMessage
(JID from, JID to, Date expired, Element msg, NonAuthUserRepository userRepo) Saves the massage to the repositoryMethods inherited from interface tigase.db.Repository
initRepository
-
Method Details
-
getMessageExpired
Deprecated.Loads head of the payloads queue which holds items that would be expired after stated time with an option to delete them from repository after being retrieved. This is blocking method, which means if there is not data to return, implementation should block the call until data is available.- Parameters:
time
- time in milliseconds representing time after which given message would be considered as expireddelete
- boolean parameter controlling whether messages should be removed from repository after they retrieved.- Returns:
- head of the payloads queue which holds items that would be expired after stated time with an option to delete them from repository after being retrieved.
-
loadMessagesToJID
Queue<Element> loadMessagesToJID(XMPPResourceConnection session, boolean delete) throws UserNotFoundException, TigaseDBException Loads all payloads for the given user'sJID
from repository.- Parameters:
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.- Returns:
- a
Queue
ofElement
objects representing stored payloads for the given user'sJID
- Throws:
UserNotFoundException
TigaseDBException
-
storeMessage
boolean storeMessage(JID from, JID to, Date expired, Element msg, NonAuthUserRepository userRepo) throws UserNotFoundException, TigaseDBException Saves the massage to the repository- Parameters:
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 messages- Returns:
true
if the packet was correctly saved to repository,false
otherwise.- Throws:
UserNotFoundException
TigaseDBException
-