RefreshNodeTask.java 912 Bytes
Newer Older
1 2 3 4
package org.jivesoftware.openfire.pubsub.cluster;

import org.jivesoftware.openfire.pubsub.Node;
import org.jivesoftware.openfire.pubsub.PubSubPersistenceManager;
5 6
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
7 8 9 10 11 12 13 14 15 16 17

/**
 * Forces the node to be refreshed from the database. This will load a node from
 * the database and then add it to the service. If the node already existed it
 * will be replaced, thereby refreshing it from persistence.
 * 
 * @author Robin Collier
 * 
 */
public class RefreshNodeTask extends NodeTask
{
18 19
    private static final Logger log = LoggerFactory.getLogger(RefreshNodeTask.class);

20 21 22 23 24 25 26 27 28
	public RefreshNodeTask()
	{
	}

	public RefreshNodeTask(Node node)
	{
		super(node);
	}

29
	@Override
30 31
	public void run()
	{
32
		log.debug("[TASK] Refreshing node - nodeID: {}", getNodeId());
33 34 35 36
		PubSubPersistenceManager.loadNode(getService(), getNodeId());
	}

}