Package tigase.db
Interface OfflineMsgRepositoryIfc
-
- All Superinterfaces:
Repository
- All Known Subinterfaces:
MsgRepositoryIfc<T>
,OfflineMessages.OfflineMsgRepositoryIfc
- All Known Implementing Classes:
JDBCMsgRepository
,MsgRepository
,MsgRepository.MsgRepositoryMDBean
,XMLMsgRepository
public interface OfflineMsgRepositoryIfc extends Repository
Interface for storing and restoring offline Elements.
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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Element
getMessageExpired(long time, boolean delete)
Deprecated.java.util.Queue<Element>
loadMessagesToJID(XMPPResourceConnection session, boolean delete)
Loads all payloads for the given user'sJID
from repository.boolean
storeMessage(JID from, JID to, java.util.Date expired, Element msg, NonAuthUserRepository userRepo)
Saves the massage to the repository-
Methods inherited from interface tigase.db.Repository
initRepository
-
-
-
-
Method Detail
-
getMessageExpired
@Deprecated Element getMessageExpired(long time, boolean delete)
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
java.util.Queue<Element> loadMessagesToJID(XMPPResourceConnection session, boolean delete) throws UserNotFoundException
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
-
storeMessage
boolean storeMessage(JID from, JID to, java.util.Date expired, Element msg, NonAuthUserRepository userRepo) throws UserNotFoundException
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
-
-