public class PubSubDAOMongo extends tigase.pubsub.repository.PubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query> implements MongoRepositoryVersionAware
| Modifier and Type | Field and Description |
|---|---|
static String |
PUBSUB_AFFILIATIONS |
static String |
PUBSUB_ITEMS |
static String |
PUBSUB_NODES |
static String |
PUBSUB_SERVICE_JIDS |
static String |
PUBSUB_SUBSCRIPTIONS |
| Constructor and Description |
|---|
PubSubDAOMongo() |
| Modifier and Type | Method and Description |
|---|---|
void |
addToRootCollection(tigase.xmpp.jid.BareJID serviceJid,
String nodeName) |
org.bson.types.ObjectId |
createNode(tigase.xmpp.jid.BareJID serviceJid,
String nodeName,
tigase.xmpp.jid.BareJID ownerJid,
tigase.pubsub.AbstractNodeConfig nodeConfig,
tigase.pubsub.NodeType nodeType,
org.bson.types.ObjectId collectionId) |
void |
deleteItem(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String id) |
void |
deleteNode(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId) |
String[] |
getAllNodesList(tigase.xmpp.jid.BareJID serviceJid) |
String[] |
getChildNodes(tigase.xmpp.jid.BareJID serviceJid,
String nodeName) |
tigase.xml.Element |
getItem(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String id) |
Date |
getItemCreationDate(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String id) |
String[] |
getItemsIds(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId) |
String[] |
getItemsIdsSince(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
Date since) |
List<tigase.pubsub.repository.IItems.ItemMeta> |
getItemsMeta(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String nodeName) |
Date |
getItemUpdateDate(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String id) |
tigase.pubsub.repository.NodeAffiliations |
getNodeAffiliations(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId) |
String |
getNodeConfig(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId) |
org.bson.types.ObjectId |
getNodeId(tigase.xmpp.jid.BareJID serviceJid,
String nodeName) |
tigase.pubsub.repository.INodeMeta<org.bson.types.ObjectId> |
getNodeMeta(tigase.xmpp.jid.BareJID serviceJid,
String nodeName) |
long |
getNodesCount(tigase.xmpp.jid.BareJID serviceJid) |
String[] |
getNodesList(tigase.xmpp.jid.BareJID serviceJid,
String nodeName) |
tigase.pubsub.repository.NodeSubscriptions |
getNodeSubscriptions(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId) |
Map<String,tigase.pubsub.repository.stateless.UsersAffiliation> |
getUserAffiliations(tigase.xmpp.jid.BareJID serviceJid,
tigase.xmpp.jid.BareJID jid) |
Map<String,tigase.pubsub.repository.stateless.UsersSubscription> |
getUserSubscriptions(tigase.xmpp.jid.BareJID serviceJid,
tigase.xmpp.jid.BareJID jid) |
void |
queryItems(tigase.pubsub.modules.mam.Query query,
List<org.bson.types.ObjectId> nodesIds,
tigase.xmpp.mam.MAMRepository.ItemHandler<tigase.pubsub.modules.mam.Query,tigase.pubsub.repository.IPubSubRepository.Item> itemHandler) |
protected <T> List<T> |
readAllValuesForField(com.mongodb.client.MongoCollection<org.bson.Document> collection,
String field,
org.bson.Document crit) |
void |
removeAllFromRootCollection(tigase.xmpp.jid.BareJID serviceJid) |
void |
removeFromRootCollection(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId) |
void |
removeNodeSubscription(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
tigase.xmpp.jid.BareJID jid) |
void |
removeService(tigase.xmpp.jid.BareJID serviceJid) |
void |
setDataSource(MongoDataSource dataSource) |
void |
updateNodeAffiliation(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String nodeName,
tigase.pubsub.repository.stateless.UsersAffiliation userAffiliation) |
void |
updateNodeConfig(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String serializedNodeConfig,
org.bson.types.ObjectId collectionId) |
void |
updateNodeSubscription(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String nodeName,
tigase.pubsub.repository.stateless.UsersSubscription userSubscription) |
tigase.db.util.SchemaLoader.Result |
updateSchema(Optional<tigase.util.Version> oldVersion,
tigase.util.Version newVersion) |
void |
writeItem(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
long timeInMilis,
String id,
String publisher,
tigase.xml.Element item) |
calculateOffsetAndPosition, destroy, getBuddyGroups, getBuddySubscription, getNodeConfig, getUserRoster, itemDataToElement, itemDataToElement, parseConfig, parseConfigFormclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetVersionpublic static final String PUBSUB_AFFILIATIONS
public static final String PUBSUB_ITEMS
public static final String PUBSUB_NODES
public static final String PUBSUB_SERVICE_JIDS
public static final String PUBSUB_SUBSCRIPTIONS
public void addToRootCollection(tigase.xmpp.jid.BareJID serviceJid,
String nodeName)
throws tigase.component.exceptions.RepositoryException
addToRootCollection in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic org.bson.types.ObjectId createNode(tigase.xmpp.jid.BareJID serviceJid,
String nodeName,
tigase.xmpp.jid.BareJID ownerJid,
tigase.pubsub.AbstractNodeConfig nodeConfig,
tigase.pubsub.NodeType nodeType,
org.bson.types.ObjectId collectionId)
throws tigase.component.exceptions.RepositoryException
createNode in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic void deleteItem(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String id)
throws tigase.component.exceptions.RepositoryException
deleteItem in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic void deleteNode(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId)
throws tigase.component.exceptions.RepositoryException
deleteNode in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic String[] getAllNodesList(tigase.xmpp.jid.BareJID serviceJid) throws tigase.component.exceptions.RepositoryException
getAllNodesList in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic String[] getChildNodes(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException
getChildNodes in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic tigase.xml.Element getItem(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String id)
throws tigase.component.exceptions.RepositoryException
getItem in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic Date getItemCreationDate(tigase.xmpp.jid.BareJID serviceJid, org.bson.types.ObjectId nodeId, String id) throws tigase.component.exceptions.RepositoryException
getItemCreationDate in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic Date getItemUpdateDate(tigase.xmpp.jid.BareJID serviceJid, org.bson.types.ObjectId nodeId, String id) throws tigase.component.exceptions.RepositoryException
getItemUpdateDate in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic String[] getItemsIds(tigase.xmpp.jid.BareJID serviceJid, org.bson.types.ObjectId nodeId) throws tigase.component.exceptions.RepositoryException
getItemsIds in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic String[] getItemsIdsSince(tigase.xmpp.jid.BareJID serviceJid, org.bson.types.ObjectId nodeId, Date since) throws tigase.component.exceptions.RepositoryException
getItemsIdsSince in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic List<tigase.pubsub.repository.IItems.ItemMeta> getItemsMeta(tigase.xmpp.jid.BareJID serviceJid, org.bson.types.ObjectId nodeId, String nodeName) throws tigase.component.exceptions.RepositoryException
getItemsMeta in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic tigase.pubsub.repository.NodeAffiliations getNodeAffiliations(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId)
throws tigase.component.exceptions.RepositoryException
getNodeAffiliations in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic String getNodeConfig(tigase.xmpp.jid.BareJID serviceJid, org.bson.types.ObjectId nodeId) throws tigase.component.exceptions.RepositoryException
getNodeConfig in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic org.bson.types.ObjectId getNodeId(tigase.xmpp.jid.BareJID serviceJid,
String nodeName)
throws tigase.component.exceptions.RepositoryException
getNodeId in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic tigase.pubsub.repository.INodeMeta<org.bson.types.ObjectId> getNodeMeta(tigase.xmpp.jid.BareJID serviceJid,
String nodeName)
throws tigase.component.exceptions.RepositoryException
getNodeMeta in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic tigase.pubsub.repository.NodeSubscriptions getNodeSubscriptions(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId)
throws tigase.component.exceptions.RepositoryException
getNodeSubscriptions in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic long getNodesCount(tigase.xmpp.jid.BareJID serviceJid)
throws tigase.component.exceptions.RepositoryException
getNodesCount in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic String[] getNodesList(tigase.xmpp.jid.BareJID serviceJid, String nodeName) throws tigase.component.exceptions.RepositoryException
getNodesList in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic Map<String,tigase.pubsub.repository.stateless.UsersAffiliation> getUserAffiliations(tigase.xmpp.jid.BareJID serviceJid, tigase.xmpp.jid.BareJID jid) throws tigase.component.exceptions.RepositoryException
getUserAffiliations in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic Map<String,tigase.pubsub.repository.stateless.UsersSubscription> getUserSubscriptions(tigase.xmpp.jid.BareJID serviceJid, tigase.xmpp.jid.BareJID jid) throws tigase.component.exceptions.RepositoryException
getUserSubscriptions in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic void queryItems(tigase.pubsub.modules.mam.Query query,
List<org.bson.types.ObjectId> nodesIds,
tigase.xmpp.mam.MAMRepository.ItemHandler<tigase.pubsub.modules.mam.Query,tigase.pubsub.repository.IPubSubRepository.Item> itemHandler)
throws tigase.component.exceptions.RepositoryException,
tigase.component.exceptions.ComponentException
queryItems in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptiontigase.component.exceptions.ComponentExceptionprotected <T> List<T> readAllValuesForField(com.mongodb.client.MongoCollection<org.bson.Document> collection, String field, org.bson.Document crit) throws com.mongodb.MongoException
com.mongodb.MongoExceptionpublic void removeAllFromRootCollection(tigase.xmpp.jid.BareJID serviceJid)
throws tigase.component.exceptions.RepositoryException
removeAllFromRootCollection in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic void removeFromRootCollection(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId)
throws tigase.component.exceptions.RepositoryException
removeFromRootCollection in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic void removeNodeSubscription(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
tigase.xmpp.jid.BareJID jid)
throws tigase.component.exceptions.RepositoryException
removeNodeSubscription in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic void removeService(tigase.xmpp.jid.BareJID serviceJid)
throws tigase.component.exceptions.RepositoryException
removeService in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic void setDataSource(MongoDataSource dataSource)
setDataSource in interface tigase.db.DataSourceAware<MongoDataSource>public void updateNodeAffiliation(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String nodeName,
tigase.pubsub.repository.stateless.UsersAffiliation userAffiliation)
throws tigase.component.exceptions.RepositoryException
updateNodeAffiliation in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic void updateNodeConfig(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String serializedNodeConfig,
org.bson.types.ObjectId collectionId)
throws tigase.component.exceptions.RepositoryException
updateNodeConfig in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic void updateNodeSubscription(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
String nodeName,
tigase.pubsub.repository.stateless.UsersSubscription userSubscription)
throws tigase.component.exceptions.RepositoryException
updateNodeSubscription in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionpublic tigase.db.util.SchemaLoader.Result updateSchema(Optional<tigase.util.Version> oldVersion, tigase.util.Version newVersion) throws tigase.component.exceptions.RepositoryException
updateSchema in interface tigase.db.util.RepositoryVersionAwaretigase.component.exceptions.RepositoryExceptionpublic void writeItem(tigase.xmpp.jid.BareJID serviceJid,
org.bson.types.ObjectId nodeId,
long timeInMilis,
String id,
String publisher,
tigase.xml.Element item)
throws tigase.component.exceptions.RepositoryException
writeItem in interface tigase.pubsub.repository.IPubSubDAO<org.bson.types.ObjectId,MongoDataSource,tigase.pubsub.modules.mam.Query>tigase.component.exceptions.RepositoryExceptionCopyright © 2014–2019 "Tigase, Inc.". All rights reserved.