public class JDBCMsgRepository extends MsgRepository<Long>
MsgRepository.BroadcastMsg, MsgRepository.MSG_TYPES, MsgRepository.MsgDBItem, MsgRepository.OfflineMessagesProcessor
Repository.Meta
broadcastMessages, broadcastMessagesLastCleanup, earliestOffline, expiredQueue, MAX_QUEUE_SIZE, MSGS_STORE_LIMIT_KEY, MSGS_STORE_LIMIT_VAL, parser
Constructor and Description |
---|
JDBCMsgRepository() |
Modifier and Type | Method and Description |
---|---|
protected void |
deleteMessage(Long msg_id) |
int |
deleteMessagesToJID(List<String> db_ids,
tigase.xmpp.JID to) |
protected void |
ensureBroadcastMessageRecipient(String id,
tigase.xmpp.BareJID recipient) |
Map<MsgRepository.MSG_TYPES,Long> |
getMessagesCount(tigase.xmpp.JID to) |
List<tigase.xml.Element> |
getMessagesList(tigase.xmpp.JID to) |
void |
initRepository(String conn_str,
Map<String,String> map)
The method is called to initialize the data repository.
|
protected void |
insertBroadcastMessage(String id,
tigase.xml.Element msg,
Date expire,
tigase.xmpp.BareJID recipient) |
protected void |
loadExpiredQueue(Date expired) |
protected void |
loadExpiredQueue(int min_elements) |
void |
loadMessagesToBroadcast() |
Queue<tigase.xml.Element> |
loadMessagesToJID(tigase.xmpp.JID to,
boolean delete)
Loads all payloads for the given user's
JID from repository. |
Queue<tigase.xml.Element> |
loadMessagesToJID(tigase.xmpp.JID to,
boolean delete,
MsgRepository.OfflineMessagesProcessor proc) |
Queue<tigase.xml.Element> |
loadMessagesToJID(List<String> db_ids,
tigase.xmpp.JID to,
boolean delete,
MsgRepository.OfflineMessagesProcessor proc) |
void |
storeMessage(tigase.xmpp.JID from,
tigase.xmpp.JID to,
Date expired,
tigase.xml.Element msg)
Saves the massage to the repository
|
dumpBroadcastMessageKeys, getBroadcastMessages, getBroadcastMsg, getInstance, getMessageExpired, getStanzaTo, updateBroadcastMessage
public void initRepository(String conn_str, Map<String,String> map) throws DBInitException
Repository
resource_uri
parameter as the database connection string or via params
map if
the required repository parameters are more complex or both.conn_str
- value in most cases representing the database connection string.map
- is a Map
with repository properties necessary to initialize
and perform all the functions. The initialization parameters are implementation dependent.DBInitException
- if there was an error during repository initialization.
Some implementations, though, perform so called lazy initialization so even though there
is a problem with the underlying repository it may not be signaled through this method
call.public Map<MsgRepository.MSG_TYPES,Long> getMessagesCount(tigase.xmpp.JID to) throws UserNotFoundException
getMessagesCount
in class MsgRepository<Long>
UserNotFoundException
public List<tigase.xml.Element> getMessagesList(tigase.xmpp.JID to) throws UserNotFoundException
getMessagesList
in class MsgRepository<Long>
UserNotFoundException
public Queue<tigase.xml.Element> loadMessagesToJID(List<String> db_ids, tigase.xmpp.JID to, boolean delete, MsgRepository.OfflineMessagesProcessor proc) throws UserNotFoundException
loadMessagesToJID
in class MsgRepository<Long>
UserNotFoundException
public int deleteMessagesToJID(List<String> db_ids, tigase.xmpp.JID to) throws UserNotFoundException
deleteMessagesToJID
in class MsgRepository<Long>
UserNotFoundException
public Queue<tigase.xml.Element> loadMessagesToJID(tigase.xmpp.JID to, boolean delete) throws UserNotFoundException
MsgRepositoryIfc
JID
from repository.to
- JID
denotes address of the receiver for which payload
stored in the repository should be retrieved.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 Queue<tigase.xml.Element> loadMessagesToJID(tigase.xmpp.JID to, boolean delete, MsgRepository.OfflineMessagesProcessor proc) throws UserNotFoundException
UserNotFoundException
public void storeMessage(tigase.xmpp.JID from, tigase.xmpp.JID to, Date expired, tigase.xml.Element msg) throws UserNotFoundException
MsgRepositoryIfc
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 savedUserNotFoundException
public void loadMessagesToBroadcast()
loadMessagesToBroadcast
in class MsgRepository<Long>
protected void insertBroadcastMessage(String id, tigase.xml.Element msg, Date expire, tigase.xmpp.BareJID recipient)
insertBroadcastMessage
in class MsgRepository<Long>
protected void ensureBroadcastMessageRecipient(String id, tigase.xmpp.BareJID recipient)
ensureBroadcastMessageRecipient
in class MsgRepository<Long>
protected void deleteMessage(Long msg_id)
deleteMessage
in class MsgRepository<Long>
protected void loadExpiredQueue(int min_elements)
loadExpiredQueue
in class MsgRepository<Long>
protected void loadExpiredQueue(Date expired)
loadExpiredQueue
in class MsgRepository<Long>
Copyright © 2015 "Tigase, Inc.". All rights reserved.