public interface PubSubPersistenceProvider
| Modifier and Type | Method and Description |
|---|---|
void |
bulkPublishedItems(List<PublishedItem> addList,
List<PublishedItem> delList)
Writes large changesets, using batches and transactions when available.
|
void |
createAffiliation(Node node,
NodeAffiliate affiliate)
Creates a new affiliation of the user in the node.
|
void |
createDefaultConfiguration(PubSubService service,
DefaultNodeConfiguration config)
Creates a new default node configuration for the specified service.
|
void |
createNode(Node node)
Schedules the node to be created in the database.
|
void |
createSubscription(Node node,
NodeSubscription subscription)
Adds the new subscription of the user to the node to the database.
|
PublishedItem |
getLastPublishedItem(LeafNode node)
Fetches the last published item for the specified node.
|
PublishedItem |
getPublishedItem(LeafNode node,
PublishedItem.UniqueIdentifier itemIdentifier) |
List<PublishedItem> |
getPublishedItems(LeafNode node)
Fetches all the results for the specified node, limited by
LeafNode.getMaxPublishedItems(). |
List<PublishedItem> |
getPublishedItems(LeafNode node,
int maxRows)
Fetches all the results for the specified node, limited by
LeafNode.getMaxPublishedItems(). |
void |
initialize() |
DefaultNodeConfiguration |
loadDefaultConfiguration(PubSubService service,
boolean isLeafType)
Loads from the database the default node configuration for the specified node type
and pubsub service.
|
void |
loadNode(PubSubService service,
Node.UniqueIdentifier nodeIdentifier)
Loads all nodes from the database and adds them to the PubSub service.
|
void |
loadNodes(PubSubService service)
Loads all nodes from the database and adds them to the PubSub service.
|
PEPService |
loadPEPServiceFromDB(String jid)
Loads a PEP service from the database, if it exists.
|
void |
loadSubscription(PubSubService service,
Node node,
String subId) |
void |
purgeNode(LeafNode leafNode) |
void |
removeAffiliation(Node node,
NodeAffiliate affiliate)
Removes the affiliation and subscription state of the user from the DB.
|
void |
removeNode(Node node)
Schedules the node to be removed in the database.
|
void |
removePublishedItem(PublishedItem item)
Removes the specified published item from the DB.
|
void |
removeSubscription(NodeSubscription subscription)
Removes the subscription of the user from the DB.
|
void |
savePublishedItem(PublishedItem item)
Creates and stores the published item in the database.
|
void |
shutdown() |
void |
updateAffiliation(Node node,
NodeAffiliate affiliate)
Updates an affiliation of the user in the node.
|
void |
updateDefaultConfiguration(PubSubService service,
DefaultNodeConfiguration config)
Updates the default node configuration for the specified service.
|
void |
updateNode(Node node)
Schedules the node to be updated in the database.
|
void |
updateSubscription(Node node,
NodeSubscription subscription)
Updates the subscription of the user to the node to the database.
|
void initialize()
void shutdown()
void createNode(Node node)
node - The newly created node.void updateNode(Node node)
node - The updated node.void removeNode(Node node)
node - The node that is being deleted.void loadNodes(PubSubService service)
service - the pubsub service that is hosting the nodes.void loadNode(PubSubService service, Node.UniqueIdentifier nodeIdentifier)
service - the pubsub service that is hosting the nodes.nodeIdentifier - the identifier of the node to load.void loadSubscription(PubSubService service, Node node, String subId)
void createAffiliation(Node node, NodeAffiliate affiliate)
node - The node where the affiliation of the user was updated.affiliate - The new affiliation of the user in the node.void updateAffiliation(Node node, NodeAffiliate affiliate)
node - The node where the affiliation of the user was updated.affiliate - The new affiliation of the user in the node.void removeAffiliation(Node node, NodeAffiliate affiliate)
node - The node where the affiliation of the user was updated.affiliate - The existing affiliation and subsription state of the user in the node.void createSubscription(Node node, NodeSubscription subscription)
node - The node where the user has subscribed to.subscription - The new subscription of the user to the node.void updateSubscription(Node node, NodeSubscription subscription)
node - The node where the user has subscribed to.subscription - The new subscription of the user to the node.void removeSubscription(NodeSubscription subscription)
subscription - The existing subscription of the user to the node.void savePublishedItem(PublishedItem item)
"xmpp.pubsub.flush.max" - maximum items in the cache (-1 to disable cache) "xmpp.pubsub.flush.timer" - number of seconds between cache flushes
item - The published item to save.void removePublishedItem(PublishedItem item)
item - The published item to delete.DefaultNodeConfiguration loadDefaultConfiguration(PubSubService service, boolean isLeafType)
service - the default node configuration used by this pubsub service.isLeafType - true if loading default configuration for leaf nodes.void createDefaultConfiguration(PubSubService service, DefaultNodeConfiguration config)
service - the default node configuration used by this pubsub service.config - the default node configuration to create in the database.void updateDefaultConfiguration(PubSubService service, DefaultNodeConfiguration config)
service - the default node configuration used by this pubsub service.config - the default node configuration to update in the database.List<PublishedItem> getPublishedItems(LeafNode node)
LeafNode.getMaxPublishedItems().node - the leaf node to load its published items.List<PublishedItem> getPublishedItems(LeafNode node, int maxRows)
LeafNode.getMaxPublishedItems().node - the leaf node to load its published items.PublishedItem getLastPublishedItem(LeafNode node)
node - the leaf node to load its last published items.PublishedItem getPublishedItem(LeafNode node, PublishedItem.UniqueIdentifier itemIdentifier)
void purgeNode(LeafNode leafNode)
PEPService loadPEPServiceFromDB(String jid)
jid - the JID of the owner of the PEP service.void bulkPublishedItems(List<PublishedItem> addList, List<PublishedItem> delList)
addList - A list of items to be added.delList - A list of items to be removed.Copyright © 2003–2020 Ignite Realtime. All rights reserved.