public class JDBCMsgRepository extends MsgRepository<Long,DataRepository> implements RepositoryVersionAware
MsgRepository.MSG_TYPES, MsgRepository.MsgDBItem<T>, MsgRepository.MsgRepositoryMDBean, MsgRepository.OfflineMessagesProcessorRepositoryVersionAware.SchemaVersionRepository.Meta, Repository.SchemaId| Modifier and Type | Field and Description |
|---|---|
protected DataRepository |
data_repo |
earliestOffline, expiredQueue, MAX_QUEUE_SIZE, MSGS_STORE_LIMIT_KEY, OFFLINE_MSGS_KEY, parser| Constructor and Description |
|---|
JDBCMsgRepository() |
getInstance, getMessageExpired, getMsgsStoreLimit, setConditionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetVersion, updateSchemaprotected DataRepository data_repo
public void setDataSource(DataRepository data_repo)
DataSourceAwaresetDataSource in interface DataSourceAware<DataRepository>@Deprecated public void initRepository(String conn_str, Map<String,String> map) throws DBInitException
Repositoryresource_uri parameter as the database connection string or via
params map if the required repository parameters are more complex or both.initRepository in interface RepositoryinitRepository in class MsgRepository<Long,DataRepository>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<Enum,Long> getMessagesCount(JID to)
getMessagesCount in interface MsgRepositoryIfc<DataRepository>public List<Element> getMessagesList(JID to)
getMessagesList in interface MsgRepositoryIfc<DataRepository>public Queue<Element> loadMessagesToJID(List<String> db_ids, XMPPResourceConnection session, boolean delete, MsgRepository.OfflineMessagesProcessor proc) throws UserNotFoundException
loadMessagesToJID in interface MsgRepositoryIfc<DataRepository>loadMessagesToJID in class MsgRepository<Long,DataRepository>UserNotFoundExceptionpublic int deleteMessagesToJID(List<String> db_ids, XMPPResourceConnection session) throws UserNotFoundException
deleteMessagesToJID in interface MsgRepositoryIfc<DataRepository>deleteMessagesToJID in class MsgRepository<Long,DataRepository>UserNotFoundExceptionpublic Queue<Element> loadMessagesToJID(XMPPResourceConnection session, boolean delete) throws UserNotFoundException
OfflineMsgRepositoryIfcJID from repository.loadMessagesToJID in interface OfflineMsgRepositoryIfcsession - 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 JIDUserNotFoundExceptionpublic Queue<Element> loadMessagesToJID(XMPPResourceConnection session, boolean delete, MsgRepository.OfflineMessagesProcessor proc) throws UserNotFoundException
UserNotFoundExceptionpublic boolean storeMessage(JID from, JID to, Date expired, Element msg, NonAuthUserRepository userRepo) throws UserNotFoundException
OfflineMsgRepositoryIfcstoreMessage in interface OfflineMsgRepositoryIfcfrom - 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.UserNotFoundExceptionprotected Queue<Element> parseLoadedMessages(MsgRepository.OfflineMessagesProcessor proc, ResultSet rs) throws SQLException
SQLExceptionprotected void deleteMessage(Long msg_id)
deleteMessage in class MsgRepository<Long,DataRepository>protected void loadExpiredQueue(int min_elements)
loadExpiredQueue in class MsgRepository<Long,DataRepository>protected void loadExpiredQueue(Date expired)
loadExpiredQueue in class MsgRepository<Long,DataRepository>protected MsgRepository.MsgDBItem parseExpiredMessage(DomBuilderHandler domHandler, ResultSet rs) throws SQLException
SQLExceptionCopyright © 2004–2021 "Tigase, Inc.". All rights reserved.