Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.pubsub
Class PubSubPersistenceManager

java.lang.Object
  extended by org.jivesoftware.wildfire.pubsub.PubSubPersistenceManager

public class PubSubPersistenceManager
extends Object

A manager responsible for ensuring node persistence.

Author:
Matt Tucker

Constructor Summary
PubSubPersistenceManager()
           
 
Method Summary
static void createDefaultConfiguration(PubSubService service, DefaultNodeConfiguration config)
          Creates a new default node configuration for the specified service.
static void createNode(PubSubService service, Node node)
          Creates and stores the node configuration in the database.
static boolean createPublishedItem(PubSubService service, PublishedItem item)
          Creates and stores the published item in the database.
static DefaultNodeConfiguration loadDefaultConfiguration(PubSubService service, boolean isLeafType)
          Loads from the database the default node configuration for the specified node type and pubsub service.
static void loadItems(PubSubService service, LeafNode node)
          Loads and adds the published items to the specified node.
static void loadNodes(PubSubService service)
          Loads all nodes from the database and adds them to the PubSub service.
static void removeAffiliation(PubSubService service, Node node, NodeAffiliate affiliate)
          Removes the affiliation and subsription state of the user from the DB.
static boolean removeNode(PubSubService service, Node node)
          Removes the specified node from the DB.
static boolean removePublishedItem(PubSubService service, PublishedItem item)
          Removes the specified published item from the DB.
static void removeSubscription(PubSubService service, Node node, NodeSubscription subscription)
          Removes the subscription of the user from the DB.
static void saveAffiliation(PubSubService service, Node node, NodeAffiliate affiliate, boolean create)
          Update the DB with the new affiliation of the user in the node.
static void saveSubscription(PubSubService service, Node node, NodeSubscription subscription, boolean create)
          Updates the DB with the new subsription of the user to the node.
static void updateDefaultConfiguration(PubSubService service, DefaultNodeConfiguration config)
          Updates the default node configuration for the specified service.
static void updateNode(PubSubService service, Node node)
          Updates the node configuration in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PubSubPersistenceManager

public PubSubPersistenceManager()
Method Detail

createNode

public static void createNode(PubSubService service,
                              Node node)
Creates and stores the node configuration in the database.

Parameters:
service - The pubsub service that is hosting the node.
node - The newly created node.

updateNode

public static void updateNode(PubSubService service,
                              Node node)
Updates the node configuration in the database.

Parameters:
service - The pubsub service that is hosting the node.
node - The updated node.

removeNode

public static boolean removeNode(PubSubService service,
                                 Node node)
Removes the specified node from the DB.

Parameters:
service - The pubsub service that is hosting the node.
node - The node that is being deleted.
Returns:
true If the operation was successful.

loadNodes

public static void loadNodes(PubSubService service)
Loads all nodes from the database and adds them to the PubSub service.

Parameters:
service - the pubsub service that is hosting the nodes.

saveAffiliation

public static void saveAffiliation(PubSubService service,
                                   Node node,
                                   NodeAffiliate affiliate,
                                   boolean create)
Update the DB with the new affiliation of the user in the node.

Parameters:
service - The pubsub service that is hosting the node.
node - The node where the affiliation of the user was updated.
affiliate - The new affiliation of the user in the node.
create - True if this is a new affiliate.

removeAffiliation

public static void removeAffiliation(PubSubService service,
                                     Node node,
                                     NodeAffiliate affiliate)
Removes the affiliation and subsription state of the user from the DB.

Parameters:
service - The pubsub service that is hosting the node.
node - The node where the affiliation of the user was updated.
affiliate - The existing affiliation and subsription state of the user in the node.

saveSubscription

public static void saveSubscription(PubSubService service,
                                    Node node,
                                    NodeSubscription subscription,
                                    boolean create)
Updates the DB with the new subsription of the user to the node.

Parameters:
service - The pubsub service that is hosting the node.
node - The node where the user has subscribed to.
subscription - The new subscription of the user to the node.
create - True if this is a new affiliate.

removeSubscription

public static void removeSubscription(PubSubService service,
                                      Node node,
                                      NodeSubscription subscription)
Removes the subscription of the user from the DB.

Parameters:
service - The pubsub service that is hosting the node.
node - The node where the user was subscribed to.
subscription - The existing subsription of the user to the node.

loadItems

public static void loadItems(PubSubService service,
                             LeafNode node)
Loads and adds the published items to the specified node.

Parameters:
service - the pubsub service that is hosting the node.
node - the leaf node to load its published items.

createPublishedItem

public static boolean createPublishedItem(PubSubService service,
                                          PublishedItem item)
Creates and stores the published item in the database.

Parameters:
service - the pubsub service that is hosting the node.
item - The published item to save.
Returns:
true if the item was successfully saved to the database.

removePublishedItem

public static boolean removePublishedItem(PubSubService service,
                                          PublishedItem item)
Removes the specified published item from the DB.

Parameters:
service - the pubsub service that is hosting the node.
item - The published item to delete.
Returns:
true if the item was successfully deleted from the database.

loadDefaultConfiguration

public static DefaultNodeConfiguration loadDefaultConfiguration(PubSubService service,
                                                                boolean isLeafType)
Loads from the database the default node configuration for the specified node type and pubsub service.

Parameters:
service - the default node configuration used by this pubsub service.
isLeafType - true if loading default configuration for leaf nodes.
Returns:
the loaded default node configuration for the specified node type and service or null if none was found.

createDefaultConfiguration

public static void createDefaultConfiguration(PubSubService service,
                                              DefaultNodeConfiguration config)
Creates a new default node configuration for the specified service.

Parameters:
service - the default node configuration used by this pubsub service.
config - the default node configuration to create in the database.

updateDefaultConfiguration

public static void updateDefaultConfiguration(PubSubService service,
                                              DefaultNodeConfiguration config)
Updates the default node configuration for the specified service.

Parameters:
service - the default node configuration used by this pubsub service.
config - the default node configuration to update in the database.

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.