@Bean(name="msgRepository", parent=Kernel.class, active=true, exportable=true) @ConfigType(value={DefaultMode,SessionManagerMode,ConnectionManagersMode,ComponentMode}) public static class MsgRepository.MsgRepositoryMDBean extends MDRepositoryBeanWithStatistics<MsgRepositoryIfc> implements MsgRepositoryIfc
| Modifier and Type | Class and Description |
|---|---|
static class |
MsgRepository.MsgRepositoryMDBean.MsgRepositoryConfigBean |
MDRepositoryBean.MDRepositoryConfigBean<A extends DataSourceAware>, MDRepositoryBean.SelectorTypeRepository.Meta, Repository.SchemaIdaliases, dataSourceSelection| Constructor and Description |
|---|
MsgRepositoryMDBean() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
belongsTo(Class<? extends BasicComponent> component) |
int |
deleteMessagesToJID(List db_ids,
XMPPResourceConnection session) |
protected Class<? extends MsgRepositoryIfc> |
findClassForDataSource(DataSource dataSource)
Method returns class implementing repository which supports data source instance provided in parameter.
|
Class<?> |
getDefaultBeanClass()
Returns default class for all bean which are defined using configuration as subbeans of bean implementing this
interface.
|
Element |
getMessageExpired(long time,
boolean delete)
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.
|
Map<Enum,Long> |
getMessagesCount(JID to) |
List<Element> |
getMessagesList(JID to) |
protected <T> T |
getValueForDomain(Map<String,T> map,
String domain) |
protected void |
initializeRepository(String domain,
MsgRepositoryIfc repo)
Method called to initialized passed repository instance for passed domain.
|
void |
initRepository(String resource_uri,
Map<String,String> params)
Deprecated.
|
Queue<Element> |
loadMessagesToJID(List 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 |
setCondition(ReentrantLock lock,
Condition condition) |
void |
setDataSource(DataSource 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
|
everyHour, everyMinute, everySecond, getRepositories, getRepository, getStatistics, setStatisticsEnabled, updateDataSourceAware, wrapInProxybeforeUnregister, getName, initialize, onDataSourceChange, register, registerIfNotExists, repositoriesStream, setDataSourceBean, unregisterpublic boolean belongsTo(Class<? extends BasicComponent> component)
belongsTo in interface ComponentStatisticsProviderpublic Element getMessageExpired(long time, boolean delete)
OfflineMsgRepositoryIfcgetMessageExpired in interface OfflineMsgRepositoryIfctime - 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.public 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 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.UserNotFoundException@Deprecated public void initRepository(String resource_uri, Map<String,String> params) 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 Repositoryresource_uri - value in most cases representing the database connection string.params - 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) throws UserNotFoundException
getMessagesCount in interface MsgRepositoryIfcUserNotFoundExceptionpublic List<Element> getMessagesList(JID to) throws UserNotFoundException
getMessagesList in interface MsgRepositoryIfcUserNotFoundExceptionpublic void setCondition(ReentrantLock lock, Condition condition)
setCondition in interface MsgRepositoryIfcpublic int deleteMessagesToJID(List db_ids, XMPPResourceConnection session) throws UserNotFoundException
deleteMessagesToJID in interface MsgRepositoryIfcUserNotFoundExceptionpublic Queue<Element> loadMessagesToJID(List db_ids, XMPPResourceConnection session, boolean delete, MsgRepository.OfflineMessagesProcessor proc) throws UserNotFoundException
loadMessagesToJID in interface MsgRepositoryIfcUserNotFoundExceptionpublic void setDataSource(DataSource dataSource)
DataSourceAwaresetDataSource in interface DataSourceAwarepublic Class<?> getDefaultBeanClass()
RegistrarBeanWithDefaultBeanClassgetDefaultBeanClass in interface RegistrarBeanWithDefaultBeanClassprotected Class<? extends MsgRepositoryIfc> findClassForDataSource(DataSource dataSource) throws DBInitException
MDRepositoryBeanfindClassForDataSource in class MDRepositoryBean<MsgRepositoryIfc>DBInitExceptionprotected void initializeRepository(String domain, MsgRepositoryIfc repo)
MDRepositoryBeaninitializeRepository in class MDRepositoryBean<MsgRepositoryIfc>Copyright © 2004–2019 "Tigase, Inc.". All rights reserved.