PubSubDAOMongo

public class PubSubDAOMongo extends PubSubDAO<ObjectId, MongoDataSource, tigase.pubsub.modules.mam.ExtendedQueryImpl> implements MongoRepositoryVersionAware
Author:andrzej

Fields

PUBSUB_AFFILIATIONS

public static final String PUBSUB_AFFILIATIONS

PUBSUB_ITEMS

public static final String PUBSUB_ITEMS

PUBSUB_MAM

public static final String PUBSUB_MAM

PUBSUB_NODES

public static final String PUBSUB_NODES

PUBSUB_SERVICE_JIDS

public static final String PUBSUB_SERVICE_JIDS

PUBSUB_SUBSCRIPTIONS

public static final String PUBSUB_SUBSCRIPTIONS

Constructors

PubSubDAOMongo

public PubSubDAOMongo()

Methods

addMAMItem

public void addMAMItem(BareJID serviceJid, ObjectId nodeId, String uuid, Element message, String itemId)

createNode

public ObjectId createNode(BareJID serviceJid, String nodeName, BareJID ownerJid, AbstractNodeConfig nodeConfig, NodeType nodeType, ObjectId collectionId, boolean autocreate)

createService

public void createService(BareJID serviceJid, boolean isPublic)

deleteItem

public void deleteItem(BareJID serviceJid, ObjectId nodeId, String id)

deleteNode

public void deleteNode(BareJID serviceJid, ObjectId nodeId)

deleteService

public void deleteService(BareJID serviceJid)

getAllNodesList

public String[] getAllNodesList(BareJID serviceJid)

getChildNodes

public String[] getChildNodes(BareJID serviceJid, String nodeName)

getItem

public IItems.IItem getItem(BareJID serviceJid, ObjectId nodeId, String id)

getItems

public List<IItems.IItem> getItems(BareJID serviceJid, List<ObjectId> nodeIds, Date afterDate, Date beforeDate, RSM rsm, CollectionItemsOrdering collectionItemsOrdering)

getItemsIds

public String[] getItemsIds(BareJID serviceJid, ObjectId nodeId, CollectionItemsOrdering order)

getItemsIdsSince

public String[] getItemsIdsSince(BareJID serviceJid, ObjectId nodeId, CollectionItemsOrdering order, Date since)

getItemsMeta

public List<IItems.ItemMeta> getItemsMeta(BareJID serviceJid, ObjectId nodeId, String nodeName)

getNodeAffiliations

public Map<BareJID, UsersAffiliation> getNodeAffiliations(BareJID serviceJid, ObjectId nodeId)

getNodeMeta

public INodeMeta<ObjectId> getNodeMeta(BareJID serviceJid, String nodeName)

getNodeSubscriptions

public Map<BareJID, UsersSubscription> getNodeSubscriptions(BareJID serviceJid, ObjectId nodeId)

getNodesCount

public long getNodesCount(BareJID serviceJid)

getNodesList

public String[] getNodesList(BareJID serviceJid, String nodeName)

getServices

public List<BareJID> getServices(BareJID bareJID, Boolean isPublic)

getUserAffiliations

public Map<String, UsersAffiliation> getUserAffiliations(BareJID serviceJid, BareJID jid)

getUserSubscriptions

public Map<String, UsersSubscription> getUserSubscriptions(BareJID serviceJid, BareJID jid)

newQuery

public ExtendedQueryImpl newQuery(BareJID serviceJid)

queryItems

public void queryItems(ExtendedQueryImpl query, ObjectId nodeId, MAMRepository.ItemHandler<ExtendedQueryImpl, IPubSubRepository.Item> itemHandler)

readAllValuesForField

protected <T> List<T> readAllValuesForField(MongoCollection<Document> collection, String field, Bson filter)

readAllValuesForField

protected <T> List<T> readAllValuesForField(MongoCollection<Document> collection, String field, Bson filter, Bson sort)

removeAllFromRootCollection

public void removeAllFromRootCollection(BareJID serviceJid)

removeNodeSubscription

public void removeNodeSubscription(BareJID serviceJid, ObjectId nodeId, BareJID jid)

setDataSource

public void setDataSource(MongoDataSource dataSource)

updateNodeAffiliation

public void updateNodeAffiliation(BareJID serviceJid, ObjectId nodeId, String nodeName, UsersAffiliation userAffiliation)

updateNodeConfig

public void updateNodeConfig(BareJID serviceJid, ObjectId nodeId, String serializedNodeConfig, ObjectId collectionId)

updateNodeSubscription

public void updateNodeSubscription(BareJID serviceJid, ObjectId nodeId, String nodeName, UsersSubscription userSubscription)

updateSchema

public SchemaLoader.Result updateSchema(Optional<Version> oldVersion, Version newVersion)

writeItem

public void writeItem(BareJID serviceJid, ObjectId nodeId, long timeInMilis, String id, String publisher, Element item, String uuid)