org.jboss.dna.connector.federation.merge.strategy
Class OneContributionMergeStrategy

java.lang.Object
  extended by org.jboss.dna.connector.federation.merge.strategy.OneContributionMergeStrategy
All Implemented Interfaces:
MergeStrategy

@ThreadSafe
public class OneContributionMergeStrategy
extends Object
implements MergeStrategy

A merge strategy that is optimized for merging when there is a single contribution.

Author:
Randall Hauch

Field Summary
static boolean DEFAULT_REUSE_UUID_FROM_CONTRIBUTION
           
 
Constructor Summary
OneContributionMergeStrategy()
           
 
Method Summary
 boolean isContributionUuidUsedForFederatedNode()
           
 void merge(FederatedNode federatedNode, List<Contribution> contributions, ExecutionContext context)
          Merge the contributions into a single This method only uses the one and only one non-null Contribution in the contributions.
 void setContributionUuidUsedForFederatedNode(boolean useUuidFromContribution)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REUSE_UUID_FROM_CONTRIBUTION

public static final boolean DEFAULT_REUSE_UUID_FROM_CONTRIBUTION
See Also:
Constant Field Values
Constructor Detail

OneContributionMergeStrategy

public OneContributionMergeStrategy()
Method Detail

isContributionUuidUsedForFederatedNode

public boolean isContributionUuidUsedForFederatedNode()
Returns:
reuseUuidFromContribution

setContributionUuidUsedForFederatedNode

public void setContributionUuidUsedForFederatedNode(boolean useUuidFromContribution)
Parameters:
useUuidFromContribution - Sets useUuidFromContribution to the specified value.

merge

public void merge(FederatedNode federatedNode,
                  List<Contribution> contributions,
                  ExecutionContext context)
Merge the contributions into a single

This method only uses the one and only one non-null Contribution in the contributions.

Specified by:
merge in interface MergeStrategy
Parameters:
federatedNode - the federated node into which the contributions are to be merged; never null
contributions - the contributions to the node; never null, never empty, and never containing nulls
context - the context in which this operation is to be performed; never null
See Also:
MergeStrategy.merge(org.jboss.dna.connector.federation.merge.FederatedNode, java.util.List, org.jboss.dna.graph.ExecutionContext)


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.