@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.SelectorType
Repository.Meta, Repository.SchemaId
aliases, 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, wrapInProxy
beforeUnregister, getName, initialize, onDataSourceChange, register, registerIfNotExists, repositoriesStream, setDataSourceBean, unregister
public boolean belongsTo(Class<? extends BasicComponent> component)
belongsTo
in interface ComponentStatisticsProvider
public Element getMessageExpired(long time, boolean delete)
OfflineMsgRepositoryIfc
getMessageExpired
in interface OfflineMsgRepositoryIfc
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.public Queue<Element> loadMessagesToJID(XMPPResourceConnection session, boolean delete) throws UserNotFoundException
OfflineMsgRepositoryIfc
JID
from repository.loadMessagesToJID
in interface OfflineMsgRepositoryIfc
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.Queue
of Element
objects representing stored payloads for the given user's JID
UserNotFoundException
public boolean storeMessage(JID from, JID to, Date expired, Element msg, NonAuthUserRepository userRepo) throws UserNotFoundException
OfflineMsgRepositoryIfc
storeMessage
in interface OfflineMsgRepositoryIfc
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 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
Repository
resource_uri
parameter as the database connection string or via
params
map if the required repository parameters are more complex or both.initRepository
in interface Repository
resource_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 MsgRepositoryIfc
UserNotFoundException
public List<Element> getMessagesList(JID to) throws UserNotFoundException
getMessagesList
in interface MsgRepositoryIfc
UserNotFoundException
public void setCondition(ReentrantLock lock, Condition condition)
setCondition
in interface MsgRepositoryIfc
public int deleteMessagesToJID(List db_ids, XMPPResourceConnection session) throws UserNotFoundException
deleteMessagesToJID
in interface MsgRepositoryIfc
UserNotFoundException
public Queue<Element> loadMessagesToJID(List db_ids, XMPPResourceConnection session, boolean delete, MsgRepository.OfflineMessagesProcessor proc) throws UserNotFoundException
loadMessagesToJID
in interface MsgRepositoryIfc
UserNotFoundException
public void setDataSource(DataSource dataSource)
DataSourceAware
setDataSource
in interface DataSourceAware
public Class<?> getDefaultBeanClass()
RegistrarBeanWithDefaultBeanClass
getDefaultBeanClass
in interface RegistrarBeanWithDefaultBeanClass
protected Class<? extends MsgRepositoryIfc> findClassForDataSource(DataSource dataSource) throws DBInitException
MDRepositoryBean
findClassForDataSource
in class MDRepositoryBean<MsgRepositoryIfc>
DBInitException
protected void initializeRepository(String domain, MsgRepositoryIfc repo)
MDRepositoryBean
initializeRepository
in class MDRepositoryBean<MsgRepositoryIfc>
Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.