org.mmbase.bridge.util
Class CloneUtil

java.lang.Object
  extended by org.mmbase.bridge.util.CloneUtil

public class CloneUtil
extends Object

Utility to clone mmbase bridge nodes.

Since:
MMBase-1.9.0
Version:
$Id: CloneUtil.java 40696 2010-01-22 13:24:45Z michiel $

Method Summary
static void cloneAliasses(Node localNode, Node destNode)
          Clone aliases to the destination node.
static Node cloneNode(Node localNode)
          Clone a node to a cloud, including any fields without keeping administrative information
static void cloneNodeField(Node sourceNode, Node destinationNode, Field field)
          cloneNodeField copies node fields from one node to the other
static Node cloneNodeWithRelations(Node localNode)
          Clone a node with all relations
static Relation cloneRelation(Node sourceRelation)
          Clone relation of the source node to the destination node.
static Relation cloneRelation(Node sourceRelation, Node sourceNode, Node destNode)
          Clone relation of the source node to the destination node.
static void cloneRelations(Node sourceNode, Node destNode)
          Clone relations of the source node to the destination node.
static void cloneRelations(Node sourceNode, Node destNode, String relationName, String managerName)
          Clone relations of the source node to the destination node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

cloneNodeWithRelations

public static Node cloneNodeWithRelations(Node localNode)
Clone a node with all relations

Parameters:
localNode - the node to be cloned
Returns:
the cloned copy of localNode

cloneNode

public static Node cloneNode(Node localNode)
Clone a node to a cloud, including any fields without keeping administrative information

Parameters:
localNode - the node to clone
Returns:
the newly created node in the other cloud

cloneNodeField

public static void cloneNodeField(Node sourceNode,
                                  Node destinationNode,
                                  Field field)
cloneNodeField copies node fields from one node to the other

Parameters:
sourceNode - the source node
destinationNode - destination node
field - the field to clone

cloneRelation

public static Relation cloneRelation(Node sourceRelation)
Clone relation of the source node to the destination node.

Parameters:
sourceRelation - source relation
Returns:
cloned relation

cloneRelation

public static Relation cloneRelation(Node sourceRelation,
                                     Node sourceNode,
                                     Node destNode)
Clone relation of the source node to the destination node.

Parameters:
sourceRelation - source relation
sourceNode - source node
destNode - destination node
Returns:
cloned relation

cloneRelations

public static void cloneRelations(Node sourceNode,
                                  Node destNode)
Clone relations of the source node to the destination node. In other words, create new relations between the destination node and the nodes which the source node has relations to.

Parameters:
sourceNode - source node
destNode - destination node

cloneRelations

public static void cloneRelations(Node sourceNode,
                                  Node destNode,
                                  String relationName,
                                  String managerName)
Clone relations of the source node to the destination node. In other words, create new relations between the destination node and the nodes which the source node has relations to.

Parameters:
sourceNode - source node
destNode - destination node
relationName - name of relation
managerName - manager of the other nodes which the relations are replicated for.

cloneAliasses

public static void cloneAliasses(Node localNode,
                                 Node destNode)
Clone aliases to the destination node. This only works when the node is in a different cloud

Parameters:
localNode - local node
destNode - destination/remote node


MMBase 2.0-SNAPSHOT - null