Class PubSubDAOJDBC

java.lang.Object
tigase.pubsub.repository.PubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
tigase.pubsub.repository.PubSubDAOJDBC
All Implemented Interfaces:
tigase.db.DataSourceAware<tigase.db.DataRepository>, tigase.db.util.RepositoryVersionAware, IExtendedPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>, IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>

public class PubSubDAOJDBC extends PubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl> implements tigase.db.util.RepositoryVersionAware, IExtendedPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
  • Constructor Details

    • PubSubDAOJDBC

      public PubSubDAOJDBC()
  • Method Details

    • createNode

      public Long createNode(tigase.xmpp.jid.BareJID serviceJid, String nodeName, tigase.xmpp.jid.BareJID ownerJid, AbstractNodeConfig nodeConfig, NodeType nodeType, Long collectionId, boolean autocreateService) throws tigase.component.exceptions.RepositoryException
      Specified by:
      createNode in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • createService

      public void createService(tigase.xmpp.jid.BareJID serviceJID, boolean isPublic) throws tigase.component.exceptions.RepositoryException
      Specified by:
      createService in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getMAMItem

      public tigase.xmpp.mam.MAMRepository.Item getMAMItem(tigase.xmpp.jid.BareJID ownerJid, Long nodeId, String stableId) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getMAMItem in interface IExtendedPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • updateMAMItem

      public void updateMAMItem(tigase.xmpp.jid.BareJID ownerJid, Long nodeId, String stableId, tigase.xml.Element message) throws tigase.component.exceptions.RepositoryException
      Specified by:
      updateMAMItem in interface IExtendedPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      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:
      getServices in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      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:
      deleteItem in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • deleteNode

      public void deleteNode(tigase.xmpp.jid.BareJID serviceJid, Long nodeId) throws tigase.component.exceptions.RepositoryException
      Specified by:
      deleteNode in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getAllNodesList

      public String[] getAllNodesList(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getAllNodesList in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getChildNodes

      public String[] getChildNodes(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getChildNodes in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getItem

      public IItems.IItem getItem(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String id) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getItem in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getItemsIds

      public String[] getItemsIds(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, CollectionItemsOrdering order) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getItemsIds in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getItemsIdsSince

      public String[] getItemsIdsSince(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, CollectionItemsOrdering order, Date since) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getItemsIdsSince in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getItems

      public List<IItems.IItem> getItems(tigase.xmpp.jid.BareJID serviceJid, List<Long> nodesIds, Date afterDate, Date beforeDate, tigase.xmpp.rsm.RSM rsm, CollectionItemsOrdering ordering) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getItems in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      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:
      getItemsMeta in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getNodeAffiliations

      public Map<tigase.xmpp.jid.BareJID,UsersAffiliation> getNodeAffiliations(tigase.xmpp.jid.BareJID serviceJid, Long nodeId) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getNodeAffiliations in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getNodeMeta

      public NodeMeta<Long> getNodeMeta(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getNodeMeta in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getNodesList

      public String[] getNodesList(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getNodesList in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getNodesCount

      public long getNodesCount(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getNodesCount in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • getNodeSubscriptions

      public Map<tigase.xmpp.jid.BareJID,UsersSubscription> getNodeSubscriptions(tigase.xmpp.jid.BareJID serviceJid, Long nodeId) throws tigase.component.exceptions.RepositoryException
      Specified by:
      getNodeSubscriptions in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      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:
      getUserAffiliations in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      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:
      getUserSubscriptions in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • addMAMItem

      public void addMAMItem(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, String uuid, tigase.xml.Element message, String itemId) throws tigase.component.exceptions.RepositoryException
      Specified by:
      addMAMItem in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • newQuery

      public ExtendedQueryImpl newQuery(tigase.xmpp.jid.BareJID serviceJid)
      Specified by:
      newQuery in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
    • queryItems

      public void queryItems(ExtendedQueryImpl query, Long nodeId, tigase.xmpp.mam.MAMRepository.ItemHandler<ExtendedQueryImpl,tigase.xmpp.mam.MAMRepository.Item> itemHandler) throws tigase.component.exceptions.RepositoryException, tigase.component.exceptions.ComponentException
      Specified by:
      queryItems in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
      tigase.component.exceptions.ComponentException
    • removeNodeSubscription

      public void removeNodeSubscription(tigase.xmpp.jid.BareJID serviceJid, Long nodeId, tigase.xmpp.jid.BareJID jid) throws tigase.component.exceptions.RepositoryException
      Specified by:
      removeNodeSubscription in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • deleteService

      public void deleteService(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException
      Specified by:
      deleteService in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      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:
      updateNodeAffiliation in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      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:
      updateNodeConfig in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      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:
      updateNodeSubscription in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      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, String uuid) throws tigase.component.exceptions.RepositoryException
      Specified by:
      writeItem in interface IPubSubDAO<Long,tigase.db.DataRepository,ExtendedQueryImpl>
      Throws:
      tigase.component.exceptions.RepositoryException
    • setDataSource

      public void setDataSource(tigase.db.DataRepository dataSource)
      Specified by:
      setDataSource in interface tigase.db.DataSourceAware<tigase.db.DataRepository>
    • countMAMItems

      protected Integer countMAMItems(ExtendedQueryImpl query, Long nodeId) throws tigase.db.TigaseDBException
      Throws:
      tigase.db.TigaseDBException
    • getMAMItemPosition

      protected Integer getMAMItemPosition(ExtendedQueryImpl query, Long nodeId, String itemUuid) throws tigase.component.exceptions.RepositoryException, tigase.component.exceptions.ComponentException
      Throws:
      tigase.component.exceptions.RepositoryException
      tigase.component.exceptions.ComponentException
    • setStatementParamsForMAM

      protected int setStatementParamsForMAM(PreparedStatement st, ExtendedQueryImpl query, Long nodeId) throws SQLException
      Throws:
      SQLException
    • takeDao

      protected tigase.pubsub.repository.PubSubDAOJDBC.HashCode takeDao()
    • offerDao

      protected void offerDao(tigase.pubsub.repository.PubSubDAOJDBC.HashCode hash)