public class CachingPubsubPersistenceProvider extends Object implements PubSubPersistenceProvider
| Modifier and Type | Field and Description |
|---|---|
static SystemProperty<Class> |
DELEGATE |
| Constructor and Description |
|---|
CachingPubsubPersistenceProvider() |
| 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.UniqueIdentifier serviceIdentifier,
DefaultNodeConfiguration config)
Creates a new default node configuration for the specified service.
|
void |
createDefaultConfiguration(PubSubService service,
DefaultNodeConfiguration config)
Deprecated.
|
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.
|
void |
flushPendingItems(boolean sendToCluster) |
void |
flushPendingItems(Node.UniqueIdentifier nodeUniqueId) |
void |
flushPendingItems(Node.UniqueIdentifier nodeUniqueId,
boolean sendToCluster) |
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.UniqueIdentifier serviceIdentifier,
boolean isLeafType)
Loads from the database the default node configuration for the specified node type
and pubsub service.
|
DefaultNodeConfiguration |
loadDefaultConfiguration(PubSubService service,
boolean isLeafType)
Deprecated.
|
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(org.xmpp.packet.JID jid)
Loads a PEP service from the database, if it exists.
|
void |
loadSubscription(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.UniqueIdentifier serviceIdentifier,
DefaultNodeConfiguration config)
Updates the default node configuration for the specified service.
|
void |
updateDefaultConfiguration(PubSubService service,
DefaultNodeConfiguration config)
Deprecated.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitloadPEPServiceFromDB, loadSubscriptionpublic static final SystemProperty<Class> DELEGATE
public void initialize()
initialize in interface PubSubPersistenceProviderpublic void shutdown()
shutdown in interface PubSubPersistenceProviderpublic void createNode(Node node)
PubSubPersistenceProvidercreateNode in interface PubSubPersistenceProvidernode - The newly created node.public void updateNode(Node node)
PubSubPersistenceProviderupdateNode in interface PubSubPersistenceProvidernode - The updated node.public void removeNode(Node node)
PubSubPersistenceProviderremoveNode in interface PubSubPersistenceProvidernode - The node that is being deleted.public void loadNodes(PubSubService service)
PubSubPersistenceProviderloadNodes in interface PubSubPersistenceProviderservice - the pubsub service that is hosting the nodes.public void loadNode(PubSubService service, Node.UniqueIdentifier nodeIdentifier)
PubSubPersistenceProviderloadNode in interface PubSubPersistenceProviderservice - the pubsub service that is hosting the nodes.nodeIdentifier - the identifier of the node to load.public void loadSubscription(Node node, String subId)
loadSubscription in interface PubSubPersistenceProviderpublic void createAffiliation(Node node, NodeAffiliate affiliate)
PubSubPersistenceProvidercreateAffiliation in interface PubSubPersistenceProvidernode - The node where the affiliation of the user was updated.affiliate - The new affiliation of the user in the node.public void updateAffiliation(Node node, NodeAffiliate affiliate)
PubSubPersistenceProviderupdateAffiliation in interface PubSubPersistenceProvidernode - The node where the affiliation of the user was updated.affiliate - The new affiliation of the user in the node.public void removeAffiliation(Node node, NodeAffiliate affiliate)
PubSubPersistenceProviderremoveAffiliation in interface PubSubPersistenceProvidernode - The node where the affiliation of the user was updated.affiliate - The existing affiliation and subsription state of the user in the node.public void createSubscription(Node node, NodeSubscription subscription)
PubSubPersistenceProvidercreateSubscription in interface PubSubPersistenceProvidernode - The node where the user has subscribed to.subscription - The new subscription of the user to the node.public void updateSubscription(Node node, NodeSubscription subscription)
PubSubPersistenceProviderupdateSubscription in interface PubSubPersistenceProvidernode - The node where the user has subscribed to.subscription - The new subscription of the user to the node.public void removeSubscription(NodeSubscription subscription)
PubSubPersistenceProviderremoveSubscription in interface PubSubPersistenceProvidersubscription - The existing subscription of the user to the node.public void purgeNode(LeafNode leafNode)
purgeNode in interface PubSubPersistenceProviderpublic void savePublishedItem(PublishedItem item)
PubSubPersistenceProvidersavePublishedItem in interface PubSubPersistenceProvideritem - The published item to save.public void flushPendingItems(Node.UniqueIdentifier nodeUniqueId)
public void flushPendingItems(Node.UniqueIdentifier nodeUniqueId, boolean sendToCluster)
public void flushPendingItems(boolean sendToCluster)
public void removePublishedItem(PublishedItem item)
PubSubPersistenceProviderremovePublishedItem in interface PubSubPersistenceProvideritem - The published item to delete.public PEPService loadPEPServiceFromDB(org.xmpp.packet.JID jid)
PubSubPersistenceProviderloadPEPServiceFromDB in interface PubSubPersistenceProviderjid - the JID of the owner of the PEP service.public void bulkPublishedItems(List<PublishedItem> addList, List<PublishedItem> delList)
PubSubPersistenceProviderbulkPublishedItems in interface PubSubPersistenceProvideraddList - A list of items to be added.delList - A list of items to be removed.@Deprecated public DefaultNodeConfiguration loadDefaultConfiguration(PubSubService service, boolean isLeafType)
PubSubPersistenceProviderloadDefaultConfiguration in interface PubSubPersistenceProviderservice - the default node configuration used by this pubsub service.isLeafType - true if loading default configuration for leaf nodes.public DefaultNodeConfiguration loadDefaultConfiguration(PubSubService.UniqueIdentifier serviceIdentifier, boolean isLeafType)
PubSubPersistenceProviderloadDefaultConfiguration in interface PubSubPersistenceProviderserviceIdentifier - Identifier of the serviceisLeafType - true if loading default configuration for leaf nodes.@Deprecated public void createDefaultConfiguration(PubSubService service, DefaultNodeConfiguration config)
PubSubPersistenceProvidercreateDefaultConfiguration in interface PubSubPersistenceProviderservice - the default node configuration used by this pubsub service.config - the default node configuration to create in the database.public void createDefaultConfiguration(PubSubService.UniqueIdentifier serviceIdentifier, DefaultNodeConfiguration config)
PubSubPersistenceProvidercreateDefaultConfiguration in interface PubSubPersistenceProviderserviceIdentifier - Identifier of the serviceconfig - the default node configuration to create in the database.@Deprecated public void updateDefaultConfiguration(PubSubService service, DefaultNodeConfiguration config)
PubSubPersistenceProviderupdateDefaultConfiguration in interface PubSubPersistenceProviderservice - the default node configuration used by this pubsub service.config - the default node configuration to update in the database.public void updateDefaultConfiguration(PubSubService.UniqueIdentifier serviceIdentifier, DefaultNodeConfiguration config)
PubSubPersistenceProviderupdateDefaultConfiguration in interface PubSubPersistenceProviderserviceIdentifier - Identifier of the serviceconfig - the default node configuration to update in the database.public List<PublishedItem> getPublishedItems(LeafNode node)
PubSubPersistenceProviderLeafNode.getMaxPublishedItems().getPublishedItems in interface PubSubPersistenceProvidernode - the leaf node to load its published items.public List<PublishedItem> getPublishedItems(LeafNode node, int maxRows)
PubSubPersistenceProviderLeafNode.getMaxPublishedItems().getPublishedItems in interface PubSubPersistenceProvidernode - the leaf node to load its published items.public PublishedItem getLastPublishedItem(LeafNode node)
PubSubPersistenceProvidergetLastPublishedItem in interface PubSubPersistenceProvidernode - the leaf node to load its last published items.public PublishedItem getPublishedItem(LeafNode node, PublishedItem.UniqueIdentifier itemIdentifier)
getPublishedItem in interface PubSubPersistenceProviderCopyright © 2003–2020 Ignite Realtime. All rights reserved.