Package tigase.server.amp.db
Class MsgBroadcastRepository.MsgBroadcastRepositoryBean
- java.lang.Object
-
- tigase.db.beans.MDRepositoryBean<T>
-
- tigase.db.beans.MDRepositoryBeanWithStatistics<MsgBroadcastRepository>
-
- tigase.server.amp.db.MsgBroadcastRepository.MsgBroadcastRepositoryBean
-
- All Implemented Interfaces:
DataSourceAware,Initializable,RegistrarBean,RegistrarBeanWithDefaultBeanClass,UnregisterAware,MsgBroadcastRepositoryIfc,ComponentStatisticsProvider,StatisticsProviderIfc
- Enclosing class:
- MsgBroadcastRepository<T,S extends DataSource>
@Bean(name="msgBroadcastRepository", parent=AmpComponent.class, active=true) public static class MsgBroadcastRepository.MsgBroadcastRepositoryBean extends MDRepositoryBeanWithStatistics<MsgBroadcastRepository> implements MsgBroadcastRepositoryIfc
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMsgBroadcastRepository.MsgBroadcastRepositoryBean.MsgBroadcastRepositoryConfigBean-
Nested classes/interfaces inherited from class tigase.db.beans.MDRepositoryBean
MDRepositoryBean.MDRepositoryConfigBean<A extends DataSourceAware>, MDRepositoryBean.SelectorType
-
-
Field Summary
-
Fields inherited from class tigase.db.beans.MDRepositoryBean
aliases, dataSourceSelection
-
-
Constructor Summary
Constructors Constructor Description MsgBroadcastRepositoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringdumpBroadcastMessageKeys()protected java.lang.Class<? extends MsgBroadcastRepository>findClassForDataSource(DataSource dataSource)Method returns class implementing repository which supports data source instance provided in parameter.java.util.Collection<MsgBroadcastRepository.BroadcastMsg>getBroadcastMessages()MsgBroadcastRepository.BroadcastMsggetBroadcastMsg(java.lang.String id)java.lang.Class<?>getDefaultBeanClass()Returns default class for all bean which are defined using configuration as subbeans of bean implementing this interface.voidloadMessagesToBroadcast()voidsetDataSource(DataSource dataSource)Method called to provide class with instance of a data source.booleanupdateBroadcastMessage(java.lang.String id, Element msg, java.util.Date expire, BareJID recipient)-
Methods inherited from class tigase.db.beans.MDRepositoryBeanWithStatistics
everyHour, everyMinute, everySecond, getRepositories, getRepository, getStatistics, setStatisticsEnabled, updateDataSourceAware, wrapInProxy
-
Methods inherited from class tigase.db.beans.MDRepositoryBean
beforeUnregister, getName, initialize, initializeRepository, onDataSourceChange, register, registerIfNotExists, repositoriesStream, setDataSourceBean, unregister
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface tigase.stats.ComponentStatisticsProvider
belongsTo
-
-
-
-
Method Detail
-
setDataSource
public void setDataSource(DataSource dataSource)
Description copied from interface:DataSourceAwareMethod called to provide class with instance of a data source.- Specified by:
setDataSourcein interfaceDataSourceAware
-
loadMessagesToBroadcast
public void loadMessagesToBroadcast()
- Specified by:
loadMessagesToBroadcastin interfaceMsgBroadcastRepositoryIfc
-
getBroadcastMsg
public MsgBroadcastRepository.BroadcastMsg getBroadcastMsg(java.lang.String id)
- Specified by:
getBroadcastMsgin interfaceMsgBroadcastRepositoryIfc
-
dumpBroadcastMessageKeys
public java.lang.String dumpBroadcastMessageKeys()
- Specified by:
dumpBroadcastMessageKeysin interfaceMsgBroadcastRepositoryIfc
-
getBroadcastMessages
public java.util.Collection<MsgBroadcastRepository.BroadcastMsg> getBroadcastMessages()
- Specified by:
getBroadcastMessagesin interfaceMsgBroadcastRepositoryIfc
-
updateBroadcastMessage
public boolean updateBroadcastMessage(java.lang.String id, Element msg, java.util.Date expire, BareJID recipient)- Specified by:
updateBroadcastMessagein interfaceMsgBroadcastRepositoryIfc
-
getDefaultBeanClass
public java.lang.Class<?> getDefaultBeanClass()
Description copied from interface:RegistrarBeanWithDefaultBeanClassReturns default class for all bean which are defined using configuration as subbeans of bean implementing this interface. This allows users to have more convenient configuration file without the need to specify class for each of subbbeans if most of them will have the same class.- Specified by:
getDefaultBeanClassin interfaceRegistrarBeanWithDefaultBeanClass
-
findClassForDataSource
protected java.lang.Class<? extends MsgBroadcastRepository> findClassForDataSource(DataSource dataSource) throws DBInitException
Description copied from class:MDRepositoryBeanMethod returns class implementing repository which supports data source instance provided in parameter.- Specified by:
findClassForDataSourcein classMDRepositoryBean<MsgBroadcastRepository>- Returns:
- repository class
- Throws:
DBInitException
-
-