[dna-commits] DNA SVN: r421 - in trunk: dna-repository/src/main/java/org/jboss/dna/repository and 7 other directories.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Wed Aug 13 13:53:15 EDT 2008


Author: rhauch
Date: 2008-08-13 13:53:15 -0400 (Wed, 13 Aug 2008)
New Revision: 421

Modified:
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/GraphTools.java
   trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/ActsOnProperties.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/CreateNodeCommand.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicCreateNodeCommand.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGetNodeCommand.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGetPropertiesCommand.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicSetPropertiesCommand.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositorySource.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutor.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedCopyBranchCommand.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedCreateNodeCommand.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedGetNodeCommand.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedSetPropertiesCommand.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/merge/OneContributionMergeStrategy.java
   trunk/extensions/dna-connector-inmemory/src/main/java/org/jboss/dna/connector/inmemory/InMemoryRepository.java
   trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheConnection.java
Log:
Changed the 'getPropertyIterator()' command of the ActsOnPath interface to be 'getProperties()', since it returned Iterable<Property> (not Iterator<Properties>).  Also changed return type to be Collection<Property>, allowing the ability to get the number of properties.

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/GraphTools.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/GraphTools.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/GraphTools.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -82,21 +82,21 @@
         execute(getRootNodeCommand);
         // Get primary type
         NameFactory nameFactory = valueFactories.getNameFactory();
-        org.jboss.dna.spi.graph.Property primaryTypeProp = getRootNodeCommand.getProperties().get(nameFactory.create("jcr:primaryType"));
+        org.jboss.dna.spi.graph.Property primaryTypeProp = getRootNodeCommand.getPropertiesByName().get(nameFactory.create("jcr:primaryType"));
         org.jboss.dna.spi.graph.ValueFactory<String> stringFactory = valueFactories.getStringFactory();
         String primaryType = stringFactory.create(primaryTypeProp.getValues()).next();
         // Process node's properties
         NodeContent content = new NodeContent();
         org.jboss.dna.spi.graph.ValueFactory<Boolean> booleanFactory = valueFactories.getBooleanFactory();
-        for (org.jboss.dna.spi.graph.Property prop : getRootNodeCommand.getPropertyIterator()) {
+        for (org.jboss.dna.spi.graph.Property prop : getRootNodeCommand.getProperties()) {
             // Get property definition from node's primary type
             BasicGetNodeCommand getPropDefCommand = new BasicGetNodeCommand(pathFactory.create("/dna:system/dna:jcr/"
                                                                                                + primaryType + "/"
                                                                                                + prop.getName()));
             execute(getPropDefCommand);
             // Create either a single- or multiple-valued property, as defined by the property definition
-            org.jboss.dna.spi.graph.Property isMultipleProp = getPropDefCommand.getProperties().get(nameFactory.create("jcr:multiple"));
-            org.jboss.dna.spi.graph.Property requiredTypeProp = getPropDefCommand.getProperties().get(nameFactory.create("jcr:requiredType"));
+            org.jboss.dna.spi.graph.Property isMultipleProp = getPropDefCommand.getPropertiesByName().get(nameFactory.create("jcr:multiple"));
+            org.jboss.dna.spi.graph.Property requiredTypeProp = getPropDefCommand.getPropertiesByName().get(nameFactory.create("jcr:requiredType"));
             String type = stringFactory.create(requiredTypeProp.getValues()).next();
             if (booleanFactory.create(isMultipleProp.getValues()).next().booleanValue()) {
                 // jcrProps.add(new JcrMultiValuedProperty(dnaProp.getName(), type, dnaProp.getValues()));

Modified: trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -237,7 +237,7 @@
                             BasicGetNodeCommand getSourceCommand = (BasicGetNodeCommand)command;
                             if (getSourceCommand.hasNoError()) {
                                 RepositorySource source = createRepositorySource(getSourceCommand.getPath(),
-                                                                                 getSourceCommand.getProperties(),
+                                                                                 getSourceCommand.getPropertiesByName(),
                                                                                  problems);
                                 if (source != null) sources.addSource(source);
                             }

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/ActsOnProperties.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/ActsOnProperties.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/ActsOnProperties.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -21,6 +21,7 @@
  */
 package org.jboss.dna.spi.graph.commands;
 
+import java.util.Collection;
 import org.jboss.dna.spi.cache.Cacheable;
 import org.jboss.dna.spi.graph.Property;
 
@@ -38,6 +39,6 @@
      * 
      * @return the properties
      */
-    Iterable<Property> getPropertyIterator();
+    Collection<Property> getProperties();
 
 }

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/CreateNodeCommand.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/CreateNodeCommand.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/CreateNodeCommand.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -21,6 +21,7 @@
  */
 package org.jboss.dna.spi.graph.commands;
 
+import java.util.Collection;
 import java.util.Iterator;
 import org.jboss.dna.spi.graph.Property;
 
@@ -38,7 +39,7 @@
      * 
      * @return the property iterator; never null, but possibly empty
      */
-    Iterable<Property> getPropertyIterator();
+    Collection<Property> getProperties();
 
     /**
      * Get the desired behavior when a node at the target {@link ActsOnPath#getPath() path} already exists.

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicCreateNodeCommand.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicCreateNodeCommand.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicCreateNodeCommand.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -77,7 +77,7 @@
     /**
      * {@inheritDoc}
      */
-    public Iterable<Property> getPropertyIterator() {
+    public Collection<Property> getProperties() {
         return properties;
     }
 
@@ -153,7 +153,7 @@
         sb.append(" at ");
         sb.append(this.getPath());
         boolean firstProperty = true;
-        for (Property property : this.getPropertyIterator()) {
+        for (Property property : this.getProperties()) {
             if (property.isEmpty()) continue;
             if (firstProperty) {
                 sb.append(" { ");

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGetNodeCommand.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGetNodeCommand.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGetNodeCommand.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -21,6 +21,7 @@
  */
 package org.jboss.dna.spi.graph.commands.impl;
 
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -67,11 +68,11 @@
      * 
      * @return the map of property name to values
      */
-    public Iterable<Property> getPropertyIterator() {
+    public Collection<Property> getProperties() {
         return this.properties.values();
     }
 
-    public Map<Name, Property> getProperties() {
+    public Map<Name, Property> getPropertiesByName() {
         return this.properties;
     }
 
@@ -87,7 +88,7 @@
         sb.append(" at ");
         sb.append(this.getPath());
         boolean firstProperty = true;
-        for (Property property : this.getPropertyIterator()) {
+        for (Property property : this.getProperties()) {
             if (property.isEmpty()) continue;
             if (firstProperty) {
                 sb.append(" { ");

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGetPropertiesCommand.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGetPropertiesCommand.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicGetPropertiesCommand.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -74,11 +74,11 @@
      * 
      * @return the map of property name to values
      */
-    public Iterable<Property> getPropertyIterator() {
+    public Iterable<Property> getProperties() {
         return this.properties.values();
     }
 
-    public Map<Name, Property> getProperties() {
+    public Map<Name, Property> getPropertiesByName() {
         return this.properties;
     }
 
@@ -129,7 +129,7 @@
         sb.append(" at ");
         sb.append(this.getPath());
         boolean firstProperty = true;
-        for (Property property : this.getPropertyIterator()) {
+        for (Property property : this.getProperties()) {
             if (property.isEmpty()) continue;
             if (firstProperty) {
                 sb.append(" { ");

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicSetPropertiesCommand.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicSetPropertiesCommand.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/impl/BasicSetPropertiesCommand.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -21,6 +21,7 @@
  */
 package org.jboss.dna.spi.graph.commands.impl;
 
+import java.util.Collection;
 import java.util.List;
 import net.jcip.annotations.NotThreadSafe;
 import org.jboss.dna.common.util.StringUtil;
@@ -63,7 +64,7 @@
     /**
      * {@inheritDoc}
      */
-    public Iterable<Property> getPropertyIterator() {
+    public Collection<Property> getProperties() {
         return properties;
     }
 
@@ -79,7 +80,7 @@
         sb.append(" at ");
         sb.append(this.getPath());
         boolean firstProperty = true;
-        for (Property property : this.getPropertyIterator()) {
+        for (Property property : this.getProperties()) {
             if (property.isEmpty()) continue;
             if (firstProperty) {
                 sb.append(" { ");

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositorySource.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositorySource.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatedRepositorySource.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -776,7 +776,7 @@
             Projection cacheProjection = createProjection(context,
                                                           projectionParser,
                                                           getCacheRegion.getPath(),
-                                                          getCacheRegion.getProperties(),
+                                                          getCacheRegion.getPropertiesByName(),
                                                           problems);
 
             if (getCacheRegion.hasError()) {
@@ -812,7 +812,7 @@
                         Projection projection = createProjection(context,
                                                                  projectionParser,
                                                                  getProjectionCommand.getPath(),
-                                                                 getProjectionCommand.getProperties(),
+                                                                 getProjectionCommand.getPropertiesByName(),
                                                                  problems);
                         if (projection != null) sourceProjections.add(projection);
                     }
@@ -821,7 +821,7 @@
 
             // Look for the default cache policy ...
             BasicCachePolicy cachePolicy = new BasicCachePolicy();
-            Property timeToLiveProperty = getRepository.getProperties().get(nameFactory.create(CACHE_POLICY_TIME_TO_LIVE_CONFIG_PROPERTY_NAME));
+            Property timeToLiveProperty = getRepository.getPropertiesByName().get(nameFactory.create(CACHE_POLICY_TIME_TO_LIVE_CONFIG_PROPERTY_NAME));
             if (timeToLiveProperty != null && !timeToLiveProperty.isEmpty()) {
                 cachePolicy.setTimeToLive(longFactory.create(timeToLiveProperty.getValues().next()));
             }

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutor.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutor.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutor.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -199,7 +199,7 @@
     @Override
     public void execute( GetNodeCommand command ) throws RepositorySourceException, InterruptedException {
         BasicGetNodeCommand nodeInfo = getNode(command.getPath());
-        for (Property property : nodeInfo.getProperties().values()) {
+        for (Property property : nodeInfo.getProperties()) {
             command.setProperty(property);
         }
         for (Segment child : nodeInfo.getChildren()) {
@@ -215,7 +215,7 @@
     @Override
     public void execute( GetPropertiesCommand command ) throws RepositorySourceException, InterruptedException {
         BasicGetNodeCommand nodeInfo = getNode(command.getPath());
-        for (Property property : nodeInfo.getProperties().values()) {
+        for (Property property : nodeInfo.getProperties()) {
             command.setProperty(property);
         }
     }
@@ -355,7 +355,7 @@
                         BasicGetNodeCommand fromSource = new BasicGetNodeCommand(pathInSource);
                         sourceConnection.execute(getExecutionContext(), fromSource);
                         if (!fromSource.hasError()) {
-                            Collection<Property> properties = fromSource.getProperties().values();
+                            Collection<Property> properties = fromSource.getProperties();
                             Collection<Segment> children = fromSource.getChildren();
                             DateTime expTime = fromSource.getCachePolicy() == null ? expirationTime : timeFactory.create(getCurrentTimeInUtc(),
                                                                                                                          fromSource.getCachePolicy().getTimeToLive());
@@ -371,7 +371,7 @@
                         sourceConnection.execute(context, fromSourceCommands);
                         for (BasicGetNodeCommand fromSource : fromSourceCommands) {
                             if (fromSource.hasError()) continue;
-                            Collection<Property> properties = fromSource.getProperties().values();
+                            Collection<Property> properties = fromSource.getProperties();
                             Collection<Segment> children = fromSource.getChildren();
                             DateTime expTime = fromSource.getCachePolicy() == null ? expirationTime : timeFactory.create(getCurrentTimeInUtc(),
                                                                                                                          fromSource.getCachePolicy().getTimeToLive());
@@ -398,7 +398,7 @@
     }
 
     protected MergePlan getMergePlan( BasicGetNodeCommand command ) {
-        Property mergePlanProperty = command.getProperties().get(mergePlanPropertyName);
+        Property mergePlanProperty = command.getPropertiesByName().get(mergePlanPropertyName);
         if (mergePlanProperty == null || mergePlanProperty.isEmpty()) {
             return null;
         }
@@ -412,7 +412,7 @@
         final Path path = mergedNode.getPath();
 
         NodeConflictBehavior conflictBehavior = NodeConflictBehavior.UPDATE;
-        BasicCreateNodeCommand newNode = new BasicCreateNodeCommand(path, mergedNode.getProperties().values(), conflictBehavior);
+        BasicCreateNodeCommand newNode = new BasicCreateNodeCommand(path, mergedNode.getProperties(), conflictBehavior);
         newNode.setProperty(new BasicSingleValueProperty(this.uuidPropertyName, mergedNode.getUuid()));
         List<Segment> children = mergedNode.getChildren();
         GraphCommand[] intoCache = new GraphCommand[1 + children.size()];

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedCopyBranchCommand.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedCopyBranchCommand.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedCopyBranchCommand.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -27,11 +27,24 @@
 /**
  * @author Randall Hauch
  */
-public class ProjectedCopyBranchCommand extends ProjectedCopyNodeCommand implements CopyBranchCommand {
+public class ProjectedCopyBranchCommand extends ActsOnProjectedPathCommand<CopyBranchCommand> implements CopyBranchCommand {
 
+    private final Path newProjectedPath;
+
     public ProjectedCopyBranchCommand( CopyBranchCommand delegate,
                                        Path projectedPath,
                                        Path newProjectedPath ) {
-        super(delegate, projectedPath, newProjectedPath);
+        super(delegate, projectedPath);
+        assert newProjectedPath != null;
+        this.newProjectedPath = newProjectedPath;
     }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.spi.graph.commands.CopyBranchCommand#getNewPath()
+     */
+    public Path getNewPath() {
+        return newProjectedPath;
+    }
 }

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedCreateNodeCommand.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedCreateNodeCommand.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedCreateNodeCommand.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -21,6 +21,7 @@
  */
 package org.jboss.dna.connector.federation.executor;
 
+import java.util.Collection;
 import org.jboss.dna.spi.graph.Path;
 import org.jboss.dna.spi.graph.Property;
 import org.jboss.dna.spi.graph.commands.CreateNodeCommand;
@@ -48,10 +49,10 @@
     /**
      * {@inheritDoc}
      * 
-     * @see org.jboss.dna.spi.graph.commands.CreateNodeCommand#getPropertyIterator()
+     * @see org.jboss.dna.spi.graph.commands.CreateNodeCommand#getProperties()
      */
-    public Iterable<Property> getPropertyIterator() {
-        return getOriginalCommand().getPropertyIterator();
+    public Collection<Property> getProperties() {
+        return getOriginalCommand().getProperties();
     }
 
     /**

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedGetNodeCommand.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedGetNodeCommand.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedGetNodeCommand.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -21,21 +21,23 @@
  */
 package org.jboss.dna.connector.federation.executor;
 
+import org.jboss.dna.spi.cache.CachePolicy;
+import org.jboss.dna.spi.graph.DateTime;
 import org.jboss.dna.spi.graph.Path;
 import org.jboss.dna.spi.graph.Property;
-import org.jboss.dna.spi.graph.commands.GetChildrenCommand;
+import org.jboss.dna.spi.graph.Path.Segment;
 import org.jboss.dna.spi.graph.commands.GetNodeCommand;
 
 /**
  * @author Randall Hauch
  */
-public class ProjectedGetNodeCommand extends ProjectedGetChildrenCommand implements GetNodeCommand {
+public class ProjectedGetNodeCommand extends ActsOnProjectedPathCommand<GetNodeCommand> implements GetNodeCommand {
 
     /**
      */
     private static final long serialVersionUID = 1L;
 
-    public ProjectedGetNodeCommand( GetChildrenCommand delegate,
+    public ProjectedGetNodeCommand( GetNodeCommand delegate,
                                     Path projectedPath ) {
         super(delegate, projectedPath);
     }
@@ -43,10 +45,57 @@
     /**
      * {@inheritDoc}
      * 
+     * @see org.jboss.dna.spi.graph.commands.GetChildrenCommand#addChild(org.jboss.dna.spi.graph.Path.Segment,
+     *      org.jboss.dna.spi.graph.Property[])
+     */
+    public void addChild( Segment nameOfChild,
+                          Property... identityProperties ) {
+        getOriginalCommand().addChild(nameOfChild, identityProperties);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.spi.graph.commands.GetChildrenCommand#setNoChildren()
+     */
+    public void setNoChildren() {
+        getOriginalCommand().setNoChildren();
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.spi.cache.Cacheable#getCachePolicy()
+     */
+    public CachePolicy getCachePolicy() {
+        return getOriginalCommand().getCachePolicy();
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.spi.cache.Cacheable#getTimeLoaded()
+     */
+    public DateTime getTimeLoaded() {
+        return getOriginalCommand().getTimeLoaded();
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.spi.cache.Cacheable#setCachePolicy(org.jboss.dna.spi.cache.CachePolicy)
+     */
+    public void setCachePolicy( CachePolicy cachePolicy ) {
+        getOriginalCommand().setCachePolicy(cachePolicy);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
      * @see org.jboss.dna.spi.graph.commands.GetPropertiesCommand#setProperty(org.jboss.dna.spi.graph.Property)
      */
     public void setProperty( Property property ) {
-        ((GetNodeCommand)getOriginalCommand()).setProperty(property);
+        getOriginalCommand().setProperty(property);
     }
 
 }

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedSetPropertiesCommand.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedSetPropertiesCommand.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/executor/ProjectedSetPropertiesCommand.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -21,6 +21,7 @@
  */
 package org.jboss.dna.connector.federation.executor;
 
+import java.util.Collection;
 import org.jboss.dna.spi.graph.Path;
 import org.jboss.dna.spi.graph.Property;
 import org.jboss.dna.spi.graph.commands.SetPropertiesCommand;
@@ -39,10 +40,10 @@
     /**
      * {@inheritDoc}
      * 
-     * @see org.jboss.dna.spi.graph.commands.ActsOnProperties#getPropertyIterator()
+     * @see org.jboss.dna.spi.graph.commands.ActsOnProperties#getProperties()
      */
-    public Iterable<Property> getPropertyIterator() {
-        return getOriginalCommand().getPropertyIterator();
+    public Collection<Property> getProperties() {
+        return getOriginalCommand().getProperties();
     }
 
 }

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/merge/OneContributionMergeStrategy.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/merge/OneContributionMergeStrategy.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/merge/OneContributionMergeStrategy.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -57,7 +57,7 @@
             children.add(child);
         }
         // Copy the properties ...
-        Map<Name, Property> properties = federatedNode.getProperties();
+        Map<Name, Property> properties = federatedNode.getPropertiesByName();
         properties.clear();
         Iterator<Property> propertyIterator = contribution.getProperties();
         while (propertyIterator.hasNext()) {

Modified: trunk/extensions/dna-connector-inmemory/src/main/java/org/jboss/dna/connector/inmemory/InMemoryRepository.java
===================================================================
--- trunk/extensions/dna-connector-inmemory/src/main/java/org/jboss/dna/connector/inmemory/InMemoryRepository.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/extensions/dna-connector-inmemory/src/main/java/org/jboss/dna/connector/inmemory/InMemoryRepository.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -352,7 +352,7 @@
                 throw new PathNotFoundException(path, lowestExisting, InMemoryConnectorI18n.nodeDoesNotExist.text(parent));
             }
             UUID uuid = null;
-            for (Property property : command.getPropertyIterator()) {
+            for (Property property : command.getProperties()) {
                 if (property.getName().equals(uuidPropertyName)) {
                     uuid = getExecutionContext().getValueFactories().getUuidFactory().create(property.getValues().next());
                     break;
@@ -360,7 +360,7 @@
             }
             Node node = createNode(getExecutionContext(), parentNode, path.getLastSegment().getName(), uuid);
             // Now add the properties to the supplied node ...
-            for (Property property : command.getPropertyIterator()) {
+            for (Property property : command.getProperties()) {
                 Name propName = property.getName();
                 if (property.size() == 0) {
                     node.getProperties().remove(propName);
@@ -397,7 +397,7 @@
         public void execute( SetPropertiesCommand command ) {
             Node node = getTargetNode(command);
             // Now set (or remove) the properties to the supplied node ...
-            for (Property property : command.getPropertyIterator()) {
+            for (Property property : command.getProperties()) {
                 Name propName = property.getName();
                 if (property.size() == 0) {
                     node.getProperties().remove(propName);

Modified: trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheConnection.java
===================================================================
--- trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheConnection.java	2008-08-13 15:51:18 UTC (rev 420)
+++ trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheConnection.java	2008-08-13 17:53:15 UTC (rev 421)
@@ -478,7 +478,7 @@
                 node.put(uuidPropertyName, generateUuid());
             }
             // Now add the properties to the supplied node ...
-            for (Property property : command.getPropertyIterator()) {
+            for (Property property : command.getProperties()) {
                 if (property.size() == 0) continue;
                 Name propName = property.getName();
                 Object value = null;
@@ -530,7 +530,7 @@
         public void execute( SetPropertiesCommand command ) {
             Node<Name, Object> node = getNode(command.getPath());
             // Now set (or remove) the properties to the supplied node ...
-            for (Property property : command.getPropertyIterator()) {
+            for (Property property : command.getProperties()) {
                 Name propName = property.getName();
                 // Don't allow the child list property to be removed or changed
                 if (propName.equals(JBossCacheLexicon.CHILD_PATH_SEGMENT_LIST)) continue;




More information about the dna-commits mailing list