Package tigase.pubsub.repository
Class PubSubDAOPool<T,S extends tigase.db.DataSource,Q extends PubSubQuery>
java.lang.Object
tigase.db.beans.MDRepositoryBean<IPubSubDAO<T,S,Q>>
tigase.db.beans.MDRepositoryBeanWithStatistics<IPubSubDAO<T,S,Q>>
tigase.pubsub.repository.PubSubDAOPool<T,S,Q>
- All Implemented Interfaces:
tigase.db.DataSourceAware<S>,tigase.kernel.beans.Initializable,tigase.kernel.beans.RegistrarBean,tigase.kernel.beans.RegistrarBeanWithDefaultBeanClass,tigase.kernel.beans.UnregisterAware,IExtendedPubSubDAO<T,,S, Q> IPubSubDAO<T,,S, Q> tigase.stats.ComponentStatisticsProvider,tigase.stats.StatisticsProviderIfc
@Bean(name="dao",
parent=PubSubComponent.class,
active=true)
public class PubSubDAOPool<T,S extends tigase.db.DataSource,Q extends PubSubQuery>
extends tigase.db.beans.MDRepositoryBeanWithStatistics<IPubSubDAO<T,S,Q>>
implements IExtendedPubSubDAO<T,S,Q>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class tigase.db.beans.MDRepositoryBean
tigase.db.beans.MDRepositoryBean.MDRepositoryConfigBean<A extends tigase.db.DataSourceAware>, tigase.db.beans.MDRepositoryBean.SelectorType -
Field Summary
Fields inherited from class tigase.db.beans.MDRepositoryBean
aliases, dataSourceSelection -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMAMItem(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String uuid, tigase.xml.Element message, Date timestamp, String itemId) booleancreateNode(tigase.xmpp.jid.BareJID serviceJid, String nodeName, tigase.xmpp.jid.BareJID ownerJid, AbstractNodeConfig nodeConfig, NodeType nodeType, T collectionId, boolean autocreateService) voidcreateService(tigase.xmpp.jid.BareJID serviceJID, boolean isPublic) voiddeleteItem(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String id) voiddeleteNode(tigase.xmpp.jid.BareJID serviceJid, T nodeId) voiddeleteService(tigase.xmpp.jid.BareJID serviceJid) voiddestroy()protected Class<? extends IPubSubDAO<T, S, Q>> findClassForDataSource(tigase.db.DataSource dataSource) String[]getAllNodesList(tigase.xmpp.jid.BareJID serviceJid) String[]getChildNodes(tigase.xmpp.jid.BareJID serviceJid, String nodeName) Class<?> getItems(tigase.xmpp.jid.BareJID serviceJid, List<T> nodesIds, Date after, Date before, tigase.xmpp.rsm.RSM rsm, CollectionItemsOrdering ordering) String[]getItemsIds(tigase.xmpp.jid.BareJID serviceJid, T nodeId, CollectionItemsOrdering order) String[]getItemsIdsSince(tigase.xmpp.jid.BareJID serviceJid, T nodeId, CollectionItemsOrdering order, Date since) getItemsMeta(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String nodeName) tigase.xmpp.mam.MAMRepository.ItemgetMAMItem(tigase.xmpp.jid.BareJID serviceJID, T nodeId, String stableId) Map<tigase.xmpp.jid.BareJID, UsersAffiliation> getNodeAffiliations(tigase.xmpp.jid.BareJID serviceJid, T nodeId) getNodeMeta(tigase.xmpp.jid.BareJID serviceJid, String nodeName) longgetNodesCount(tigase.xmpp.jid.BareJID serviceJid) String[]getNodesList(tigase.xmpp.jid.BareJID serviceJid, String nodeName) Map<tigase.xmpp.jid.BareJID, UsersSubscription> getNodeSubscriptions(tigase.xmpp.jid.BareJID serviceJid, T nodeId) protected StringgetPoolDetails(tigase.xmpp.jid.BareJID serviceJid) Deprecated.List<tigase.xmpp.jid.BareJID> getServices(tigase.xmpp.jid.BareJID domain, Boolean isPublic) getUserAffiliations(tigase.xmpp.jid.BareJID serviceJid, tigase.xmpp.jid.BareJID jid) Map<tigase.xmpp.jid.BareJID, tigase.xmpp.impl.roster.RosterElement> getUserRoster(tigase.xmpp.jid.BareJID owner) getUserSubscriptions(tigase.xmpp.jid.BareJID serviceJid, tigase.xmpp.jid.BareJID jid) newQuery(tigase.xmpp.jid.BareJID serviceJid) protected voidofferDao(tigase.xmpp.jid.BareJID serviceJid, IPubSubDAO dao) Deprecated.parseConfig(String nodeName, String cfgData) voidqueryItems(Q query, T nodeId, tigase.xmpp.mam.MAMRepository.ItemHandler<Q, tigase.xmpp.mam.MAMRepository.Item> itemHandler) voidremoveNodeSubscription(tigase.xmpp.jid.BareJID serviceJid, T nodeId, tigase.xmpp.jid.BareJID jid) voidsetDataSource(tigase.db.DataSource dataSource) takeDao(tigase.xmpp.jid.BareJID serviceJid) voidupdateMAMItem(tigase.xmpp.jid.BareJID serviceJID, T nodeId, String stableId, tigase.xml.Element message) voidupdateNodeAffiliation(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String nodeName, UsersAffiliation affiliation) voidupdateNodeConfig(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String serializedData, T collectionId) voidupdateNodeSubscription(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String nodeName, UsersSubscription subscription) voidwriteItem(tigase.xmpp.jid.BareJID serviceJid, T nodeId, long timeInMilis, String id, String publisher, tigase.xml.Element item, String uuid) Methods inherited from class tigase.db.beans.MDRepositoryBeanWithStatistics
everyHour, everyMinute, everySecond, getRepositories, getRepository, getStatistics, setStatisticsEnabled, updateDataSourceAware, wrapInProxyMethods inherited from class tigase.db.beans.MDRepositoryBean
beforeUnregister, getName, initialize, initializeRepository, onDataSourceChange, register, registerIfNotExists, repositoriesStream, setDataSourceBean, unregisterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tigase.pubsub.repository.IPubSubDAO
addMAMItem, newQuery
-
Constructor Details
-
PubSubDAOPool
public PubSubDAOPool()
-
-
Method Details
-
belongsTo
- Specified by:
belongsToin interfacetigase.stats.ComponentStatisticsProvider
-
createNode
public T createNode(tigase.xmpp.jid.BareJID serviceJid, String nodeName, tigase.xmpp.jid.BareJID ownerJid, AbstractNodeConfig nodeConfig, NodeType nodeType, T collectionId, boolean autocreateService) throws tigase.component.exceptions.RepositoryException - Specified by:
createNodein interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
createService
public void createService(tigase.xmpp.jid.BareJID serviceJID, boolean isPublic) throws tigase.component.exceptions.RepositoryException - Specified by:
createServicein interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getMAMItem
public tigase.xmpp.mam.MAMRepository.Item getMAMItem(tigase.xmpp.jid.BareJID serviceJID, T nodeId, String stableId) throws tigase.component.exceptions.RepositoryException - Specified by:
getMAMItemin interfaceIExtendedPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
updateMAMItem
public void updateMAMItem(tigase.xmpp.jid.BareJID serviceJID, T nodeId, String stableId, tigase.xml.Element message) throws tigase.component.exceptions.RepositoryException - Specified by:
updateMAMItemin interfaceIExtendedPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getServices
public List<tigase.xmpp.jid.BareJID> getServices(tigase.xmpp.jid.BareJID domain, Boolean isPublic) throws tigase.component.exceptions.RepositoryException - Specified by:
getServicesin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
deleteItem
public void deleteItem(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String id) throws tigase.component.exceptions.RepositoryException - Specified by:
deleteItemin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
deleteNode
public void deleteNode(tigase.xmpp.jid.BareJID serviceJid, T nodeId) throws tigase.component.exceptions.RepositoryException - Specified by:
deleteNodein interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
destroy
public void destroy()- Specified by:
destroyin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery>
-
getAllNodesList
public String[] getAllNodesList(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException - Specified by:
getAllNodesListin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getChildNodes
public String[] getChildNodes(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException - Specified by:
getChildNodesin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getItem
public IItems.IItem getItem(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String id) throws tigase.component.exceptions.RepositoryException - Specified by:
getItemin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getItems
public List<IItems.IItem> getItems(tigase.xmpp.jid.BareJID serviceJid, List<T> nodesIds, Date after, Date before, tigase.xmpp.rsm.RSM rsm, CollectionItemsOrdering ordering) throws tigase.component.exceptions.RepositoryException - Specified by:
getItemsin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getItemsIds
public String[] getItemsIds(tigase.xmpp.jid.BareJID serviceJid, T nodeId, CollectionItemsOrdering order) throws tigase.component.exceptions.RepositoryException - Specified by:
getItemsIdsin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getItemsIdsSince
public String[] getItemsIdsSince(tigase.xmpp.jid.BareJID serviceJid, T nodeId, CollectionItemsOrdering order, Date since) throws tigase.component.exceptions.RepositoryException - Specified by:
getItemsIdsSincein interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getItemsMeta
public List<IItems.ItemMeta> getItemsMeta(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String nodeName) throws tigase.component.exceptions.RepositoryException - Specified by:
getItemsMetain interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getNodeAffiliations
public Map<tigase.xmpp.jid.BareJID,UsersAffiliation> getNodeAffiliations(tigase.xmpp.jid.BareJID serviceJid, T nodeId) throws tigase.component.exceptions.RepositoryException - Specified by:
getNodeAffiliationsin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getNodeMeta
public INodeMeta<T> getNodeMeta(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException - Specified by:
getNodeMetain interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getNodesCount
public long getNodesCount(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException - Specified by:
getNodesCountin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getNodesList
public String[] getNodesList(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException - Specified by:
getNodesListin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getNodeSubscriptions
public Map<tigase.xmpp.jid.BareJID,UsersSubscription> getNodeSubscriptions(tigase.xmpp.jid.BareJID serviceJid, T nodeId) throws tigase.component.exceptions.RepositoryException - Specified by:
getNodeSubscriptionsin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getUserAffiliations
public Map<String,UsersAffiliation> getUserAffiliations(tigase.xmpp.jid.BareJID serviceJid, tigase.xmpp.jid.BareJID jid) throws tigase.component.exceptions.RepositoryException - Specified by:
getUserAffiliationsin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getUserRoster
public Map<tigase.xmpp.jid.BareJID,tigase.xmpp.impl.roster.RosterElement> getUserRoster(tigase.xmpp.jid.BareJID owner) throws tigase.component.exceptions.RepositoryException - Specified by:
getUserRosterin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
getUserSubscriptions
public Map<String,UsersSubscription> getUserSubscriptions(tigase.xmpp.jid.BareJID serviceJid, tigase.xmpp.jid.BareJID jid) throws tigase.component.exceptions.RepositoryException - Specified by:
getUserSubscriptionsin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
parseConfig
public AbstractNodeConfig parseConfig(String nodeName, String cfgData) throws tigase.component.exceptions.RepositoryException - Specified by:
parseConfigin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
addMAMItem
public void addMAMItem(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String uuid, tigase.xml.Element message, Date timestamp, String itemId) throws tigase.component.exceptions.RepositoryException - Specified by:
addMAMItemin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
newQuery
- Specified by:
newQueryin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery>
-
queryItems
public void queryItems(Q query, T nodeId, tigase.xmpp.mam.MAMRepository.ItemHandler<Q, tigase.xmpp.mam.MAMRepository.Item> itemHandler) throws tigase.component.exceptions.RepositoryException, tigase.component.exceptions.ComponentException- Specified by:
queryItemsin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryExceptiontigase.component.exceptions.ComponentException
-
removeNodeSubscription
public void removeNodeSubscription(tigase.xmpp.jid.BareJID serviceJid, T nodeId, tigase.xmpp.jid.BareJID jid) throws tigase.component.exceptions.RepositoryException - Specified by:
removeNodeSubscriptionin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
takeDao
-
updateNodeAffiliation
public void updateNodeAffiliation(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String nodeName, UsersAffiliation affiliation) throws tigase.component.exceptions.RepositoryException - Specified by:
updateNodeAffiliationin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
updateNodeConfig
public void updateNodeConfig(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String serializedData, T collectionId) throws tigase.component.exceptions.RepositoryException - Specified by:
updateNodeConfigin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
updateNodeSubscription
public void updateNodeSubscription(tigase.xmpp.jid.BareJID serviceJid, T nodeId, String nodeName, UsersSubscription subscription) throws tigase.component.exceptions.RepositoryException - Specified by:
updateNodeSubscriptionin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
writeItem
public void writeItem(tigase.xmpp.jid.BareJID serviceJid, T nodeId, long timeInMilis, String id, String publisher, tigase.xml.Element item, String uuid) throws tigase.component.exceptions.RepositoryException - Specified by:
writeItemin interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
deleteService
public void deleteService(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException - Specified by:
deleteServicein interfaceIPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery> - Throws:
tigase.component.exceptions.RepositoryException
-
setDataSource
public void setDataSource(tigase.db.DataSource dataSource) - Specified by:
setDataSourcein interfacetigase.db.DataSourceAware<T>
-
getDefaultBeanClass
- Specified by:
getDefaultBeanClassin interfacetigase.kernel.beans.RegistrarBeanWithDefaultBeanClass
-
getPoolDetails
Deprecated. -
offerDao
Deprecated. -
findClassForDataSource
protected Class<? extends IPubSubDAO<T,S, findClassForDataSourceQ>> (tigase.db.DataSource dataSource) throws tigase.db.DBInitException - Specified by:
findClassForDataSourcein classtigase.db.beans.MDRepositoryBean<IPubSubDAO<T,S extends tigase.db.DataSource, Q extends PubSubQuery>> - Throws:
tigase.db.DBInitException
-