Package tigase.pubsub.repository
Class PubSubDAOJDBC
- java.lang.Object
-
- tigase.pubsub.repository.PubSubDAO<Long,tigase.db.DataRepository,Query>
-
- tigase.pubsub.repository.PubSubDAOJDBC
-
- All Implemented Interfaces:
tigase.db.DataSourceAware<tigase.db.DataRepository>,tigase.db.util.RepositoryVersionAware,IPubSubDAO<Long,tigase.db.DataRepository,Query>
public class PubSubDAOJDBC extends PubSubDAO<Long,tigase.db.DataRepository,Query> implements tigase.db.util.RepositoryVersionAware
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class tigase.pubsub.repository.PubSubDAO
PubSubDAO.Item<T>
-
-
Constructor Summary
Constructors Constructor Description PubSubDAOJDBC()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToRootCollection(tigase.xmpp.jid.BareJID serviceJid, String nodeName)protected IntegercountItems(Query query, String nodeIds)LongcreateNode(tigase.xmpp.jid.BareJID serviceJid, String nodeName, tigase.xmpp.jid.BareJID ownerJid, AbstractNodeConfig nodeConfig, NodeType nodeType, Long collectionId)voiddeleteItem(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String id)voiddeleteNode(tigase.xmpp.jid.BareJID serviceJid, Long nodeId)String[]getAllNodesList(tigase.xmpp.jid.BareJID serviceJid)String[]getChildNodes(tigase.xmpp.jid.BareJID serviceJid, String nodeName)protected DategetDateFromItem(tigase.xmpp.jid.BareJID serviceJid, long nodeId, String id, int field)tigase.xml.ElementgetItem(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String id)DategetItemCreationDate(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String id)protected IntegergetItemPosition(Query query, String nodeIds, String itemId)String[]getItemsIds(tigase.xmpp.jid.BareJID serviceJid, Long nodeId)String[]getItemsIdsSince(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, Date since)List<IItems.ItemMeta>getItemsMeta(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String nodeName)DategetItemUpdateDate(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String id)NodeAffiliationsgetNodeAffiliations(tigase.xmpp.jid.BareJID serviceJid, Long nodeId)StringgetNodeConfig(tigase.xmpp.jid.BareJID serviceJid, Long nodeId)LonggetNodeId(tigase.xmpp.jid.BareJID serviceJid, String nodeName)NodeMeta<Long>getNodeMeta(tigase.xmpp.jid.BareJID serviceJid, String nodeName)longgetNodesCount(tigase.xmpp.jid.BareJID serviceJid)String[]getNodesList(tigase.xmpp.jid.BareJID serviceJid, String nodeName)NodeSubscriptionsgetNodeSubscriptions(tigase.xmpp.jid.BareJID serviceJid, Long nodeId)protected StringgetStringFromItem(tigase.xmpp.jid.BareJID serviceJid, long nodeId, String id, int field)Map<String,UsersAffiliation>getUserAffiliations(tigase.xmpp.jid.BareJID serviceJid, tigase.xmpp.jid.BareJID jid)Map<String,UsersSubscription>getUserSubscriptions(tigase.xmpp.jid.BareJID serviceJid, tigase.xmpp.jid.BareJID jid)protected voidofferDao(tigase.pubsub.repository.PubSubDAOJDBC.HashCode hash)voidqueryItems(Query query, List<Long> nodesIds, tigase.xmpp.mam.MAMRepository.ItemHandler<Query,IPubSubRepository.Item> itemHandler)protected StringreadNodeConfigFormData(tigase.xmpp.jid.BareJID serviceJid, long nodeId)voidremoveAllFromRootCollection(tigase.xmpp.jid.BareJID serviceJid)voidremoveFromRootCollection(tigase.xmpp.jid.BareJID serviceJid, Long nodeId)voidremoveNodeSubscription(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, tigase.xmpp.jid.BareJID jid)voidremoveService(tigase.xmpp.jid.BareJID serviceJid)voidsetDataSource(tigase.db.DataRepository dataSource)protected intsetStatementParamsForMAM(PreparedStatement st, Query query, String nodeIds)protected tigase.pubsub.repository.PubSubDAOJDBC.HashCodetakeDao()voidupdateNodeAffiliation(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String nodeName, UsersAffiliation affiliation)voidupdateNodeConfig(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String serializedData, Long collectionId)voidupdateNodeSubscription(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String nodeName, UsersSubscription subscription)voidwriteItem(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, long timeInMilis, String id, String publisher, tigase.xml.Element item)-
Methods inherited from class tigase.pubsub.repository.PubSubDAO
calculateOffsetAndPosition, destroy, getBuddyGroups, getBuddySubscription, getNodeConfig, getUserRoster, itemDataToElement, itemDataToElement, parseConfig, parseConfigForm
-
-
-
-
Method Detail
-
addToRootCollection
public void addToRootCollection(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException- Specified by:
addToRootCollectionin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
createNode
public Long createNode(tigase.xmpp.jid.BareJID serviceJid, String nodeName, tigase.xmpp.jid.BareJID ownerJid, AbstractNodeConfig nodeConfig, NodeType nodeType, Long collectionId) throws tigase.component.exceptions.RepositoryException
- Specified by:
createNodein interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
deleteItem
public void deleteItem(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String id) throws tigase.component.exceptions.RepositoryException- Specified by:
deleteItemin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
deleteNode
public void deleteNode(tigase.xmpp.jid.BareJID serviceJid, Long nodeId) throws tigase.component.exceptions.RepositoryException- Specified by:
deleteNodein interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getAllNodesList
public String[] getAllNodesList(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException
- Specified by:
getAllNodesListin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- 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<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getItem
public tigase.xml.Element getItem(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String id) throws tigase.component.exceptions.RepositoryException- Specified by:
getItemin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getItemCreationDate
public Date getItemCreationDate(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String id) throws tigase.component.exceptions.RepositoryException
- Specified by:
getItemCreationDatein interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getItemsIds
public String[] getItemsIds(tigase.xmpp.jid.BareJID serviceJid, Long nodeId) throws tigase.component.exceptions.RepositoryException
- Specified by:
getItemsIdsin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getItemsIdsSince
public String[] getItemsIdsSince(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, Date since) throws tigase.component.exceptions.RepositoryException
- Specified by:
getItemsIdsSincein interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getItemsMeta
public List<IItems.ItemMeta> getItemsMeta(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String nodeName) throws tigase.component.exceptions.RepositoryException
- Specified by:
getItemsMetain interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getItemUpdateDate
public Date getItemUpdateDate(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String id) throws tigase.component.exceptions.RepositoryException
- Specified by:
getItemUpdateDatein interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getNodeAffiliations
public NodeAffiliations getNodeAffiliations(tigase.xmpp.jid.BareJID serviceJid, Long nodeId) throws tigase.component.exceptions.RepositoryException
- Specified by:
getNodeAffiliationsin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getNodeConfig
public String getNodeConfig(tigase.xmpp.jid.BareJID serviceJid, Long nodeId) throws tigase.component.exceptions.RepositoryException
- Specified by:
getNodeConfigin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getNodeId
public Long getNodeId(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException
- Specified by:
getNodeIdin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getNodeMeta
public NodeMeta<Long> getNodeMeta(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException
- Specified by:
getNodeMetain interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- 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<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getNodesCount
public long getNodesCount(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException- Specified by:
getNodesCountin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
getNodeSubscriptions
public NodeSubscriptions getNodeSubscriptions(tigase.xmpp.jid.BareJID serviceJid, Long nodeId) throws tigase.component.exceptions.RepositoryException
- Specified by:
getNodeSubscriptionsin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- 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<Long,tigase.db.DataRepository,Query>- 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<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
queryItems
public void queryItems(Query query, List<Long> nodesIds, tigase.xmpp.mam.MAMRepository.ItemHandler<Query,IPubSubRepository.Item> itemHandler) throws tigase.component.exceptions.RepositoryException, tigase.component.exceptions.ComponentException
- Specified by:
queryItemsin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryExceptiontigase.component.exceptions.ComponentException
-
removeAllFromRootCollection
public void removeAllFromRootCollection(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException- Specified by:
removeAllFromRootCollectionin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
removeFromRootCollection
public void removeFromRootCollection(tigase.xmpp.jid.BareJID serviceJid, Long nodeId) throws tigase.component.exceptions.RepositoryException- Specified by:
removeFromRootCollectionin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
removeNodeSubscription
public void removeNodeSubscription(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, tigase.xmpp.jid.BareJID jid) throws tigase.component.exceptions.RepositoryException- Specified by:
removeNodeSubscriptionin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
removeService
public void removeService(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException- Specified by:
removeServicein interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
updateNodeAffiliation
public void updateNodeAffiliation(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String nodeName, UsersAffiliation affiliation) throws tigase.component.exceptions.RepositoryException- Specified by:
updateNodeAffiliationin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
updateNodeConfig
public void updateNodeConfig(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String serializedData, Long collectionId) throws tigase.component.exceptions.RepositoryException- Specified by:
updateNodeConfigin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
updateNodeSubscription
public void updateNodeSubscription(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String nodeName, UsersSubscription subscription) throws tigase.component.exceptions.RepositoryException- Specified by:
updateNodeSubscriptionin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
writeItem
public void writeItem(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, long timeInMilis, String id, String publisher, tigase.xml.Element item) throws tigase.component.exceptions.RepositoryException- Specified by:
writeItemin interfaceIPubSubDAO<Long,tigase.db.DataRepository,Query>- Throws:
tigase.component.exceptions.RepositoryException
-
setDataSource
public void setDataSource(tigase.db.DataRepository dataSource)
- Specified by:
setDataSourcein interfacetigase.db.DataSourceAware<tigase.db.DataRepository>
-
getDateFromItem
protected Date getDateFromItem(tigase.xmpp.jid.BareJID serviceJid, long nodeId, String id, int field) throws tigase.component.exceptions.RepositoryException
- Throws:
tigase.component.exceptions.RepositoryException
-
getStringFromItem
protected String getStringFromItem(tigase.xmpp.jid.BareJID serviceJid, long nodeId, String id, int field) throws tigase.component.exceptions.RepositoryException
- Throws:
tigase.component.exceptions.RepositoryException
-
countItems
protected Integer countItems(Query query, String nodeIds) throws tigase.db.TigaseDBException
- Throws:
tigase.db.TigaseDBException
-
getItemPosition
protected Integer getItemPosition(Query query, String nodeIds, String itemId) throws tigase.component.exceptions.RepositoryException, tigase.component.exceptions.ComponentException
- Throws:
tigase.component.exceptions.RepositoryExceptiontigase.component.exceptions.ComponentException
-
setStatementParamsForMAM
protected int setStatementParamsForMAM(PreparedStatement st, Query query, String nodeIds) throws SQLException
- Throws:
SQLException
-
readNodeConfigFormData
protected String readNodeConfigFormData(tigase.xmpp.jid.BareJID serviceJid, long nodeId) throws tigase.component.exceptions.RepositoryException
- Throws:
tigase.component.exceptions.RepositoryException
-
takeDao
protected tigase.pubsub.repository.PubSubDAOJDBC.HashCode takeDao()
-
offerDao
protected void offerDao(tigase.pubsub.repository.PubSubDAOJDBC.HashCode hash)
-
-