jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1177277 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/
Date Thu, 29 Sep 2011 12:06:51 GMT
Author: mduerig
Date: Thu Sep 29 12:06:51 2011
New Revision: 1177277

URL: http://svn.apache.org/viewvc?rev=1177277&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
clean up

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/TransientOperation.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
Thu Sep 29 12:06:51 2011
@@ -42,7 +42,7 @@ public abstract class AbstractCopy exten
      * @param srcPath
      * @param destPath
      */
-    AbstractCopy(Path srcPath, Path destPath, String srcWorkspaceName, HierarchyManager srcHierarchyManager,
+    protected AbstractCopy(Path srcPath, Path destPath, String srcWorkspaceName, HierarchyManager
srcHierarchyManager,
             HierarchyManager destHierarchyManager) throws RepositoryException {
 
         srcState = getNodeState(srcPath, srcHierarchyManager);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
Thu Sep 29 12:06:51 2011
@@ -96,13 +96,12 @@ public abstract class AbstractOperation 
     }
 
     /**
-     * Asserts that the NodeEntry of the given parent state has it's child node
-     * entries loaded.
+     * Load the child entries of the NodeEntry of the given parent state if necessary.
      *
      * @param parentState
      * @throws RepositoryException
      */
-    protected static void assertChildNodeEntries(NodeState parentState) throws RepositoryException
{
+    protected static void loadChildNodeEntries(NodeState parentState) throws RepositoryException
{
         parentState.getNodeEntry().getNodeEntries();
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
Thu Sep 29 12:06:51 2011
@@ -37,14 +37,9 @@ public class AddNode extends TransientOp
 
     private final List<ItemState<?>> addedStates = new ArrayList<ItemState<?>>();
 
-    private AddNode(NodeState parentState, Name nodeName, Name nodeTypeName, String uuid)
-            throws RepositoryException {
-        this(parentState, nodeName, nodeTypeName, uuid, DEFAULT_OPTIONS);
-    }
-
-    private AddNode(NodeState parentState, Name nodeName, Name nodeTypeName,
-                    String uuid, int options)
+    private AddNode(NodeState parentState, Name nodeName, Name nodeTypeName, String uuid,
int options)
             throws RepositoryException {
+        
         super(options);
         parentId = parentState.getNodeId();
         this.parentState = parentState;
@@ -123,12 +118,12 @@ public class AddNode extends TransientOp
      * @param uuid
      * @return a new {@code AddNode} operation.
      */
-    public static AddNode create(NodeState parentState, Name nodeName,
-                                   Name nodeTypeName, String uuid) throws RepositoryException
{
+    public static AddNode create(NodeState parentState, Name nodeName, Name nodeTypeName,
String uuid)
+            throws RepositoryException {
+
         // make sure the parent hierarchy entry has its child entries loaded
         // in order to be able to detect conflicts.
-        assertChildNodeEntries(parentState);
-
-        return new AddNode(parentState, nodeName, nodeTypeName, uuid);
+        loadChildNodeEntries(parentState);
+        return new AddNode(parentState, nodeName, nodeTypeName, uuid, DEFAULT_OPTIONS);
     }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
Thu Sep 29 12:06:51 2011
@@ -36,19 +36,13 @@ public class AddProperty extends Transie
 
     private final QPropertyDefinition definition;
 
-    private AddProperty(NodeState parentState, Name propName, int propertyType, QValue[]
values,
-            QPropertyDefinition definition) throws RepositoryException {
-        
-        this(parentState, propName, propertyType, values, definition, DEFAULT_OPTIONS);
-    }
-    
-    private AddProperty(NodeState parentState, Name propName, int propertyType, QValue[]
values,
-            QPropertyDefinition definition, int options) throws RepositoryException {
+    private AddProperty(NodeState parentState, Name propertyName, int propertyType, QPropertyDefinition
definition,
+            QValue[] values, int options) throws RepositoryException {
         
         super(options);
         parentId = parentState.getNodeId();
         this.parentState = parentState;
-        propertyName = propName;
+        this.propertyName = propertyName;
         this.propertyType = propertyType;
         this.values = values;
         this.definition = definition;
@@ -121,9 +115,9 @@ public class AddProperty extends Transie
      * @param values
      * @return
      */
-    public static Operation create(NodeState parentState, Name propName, int propertyType,
-            QPropertyDefinition def, QValue[] values) throws RepositoryException {
+    public static Operation create(NodeState parentState, Name propName, int propertyType,
QPropertyDefinition def,
+            QValue[] values) throws RepositoryException {
         
-        return new AddProperty(parentState, propName, propertyType, values, def);
+        return new AddProperty(parentState, propName, propertyType, def, values, DEFAULT_OPTIONS);
     }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
Thu Sep 29 12:06:51 2011
@@ -29,11 +29,9 @@ public class Clone extends AbstractCopy 
     private final boolean removeExisting;
 
     private Clone(Path srcPath, Path destPath, String srcWorkspaceName, boolean removeExisting,
-            HierarchyManager srcHierarchyManager, HierarchyManager destHierarchyManager)
+            HierarchyManager srcHierarchyManager, HierarchyManager destHierarchyManager)
throws RepositoryException {
 
-        throws RepositoryException {
         super(srcPath, destPath, srcWorkspaceName, srcHierarchyManager, destHierarchyManager);
-
         this.removeExisting = removeExisting;
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
Thu Sep 29 12:06:51 2011
@@ -186,8 +186,8 @@ public class Move extends TransientOpera
 
             // force child node entries list to be present before the move is executed
             // on the hierarchy entry.
-            assertChildNodeEntries(srcParentState);
-            assertChildNodeEntries(destParentState);
+            loadChildNodeEntries(srcParentState);
+            loadChildNodeEntries(destParentState);
 
             if (destEntry.hasNodeEntry(destName)) {
                 NodeEntry existing = destEntry.getNodeEntry(destName, Path.INDEX_DEFAULT);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
Thu Sep 29 12:06:51 2011
@@ -36,10 +36,6 @@ public class Remove extends TransientOpe
     protected ItemState<?> removeState;
     protected NodeState parent;
 
-    private Remove(ItemState<?> removeState, NodeState parent) throws RepositoryException
{
-        this(removeState, parent, REMOVE_OPTIONS);
-    }
-
     private Remove(ItemState<?> removeState, NodeState parent, int options) throws
RepositoryException {
         super(options);
         removeId = removeState.getId();
@@ -91,8 +87,8 @@ public class Remove extends TransientOpe
         if (state.isNode() && Unchecked.<NodeState>cast(state).getDefinition().allowsSameNameSiblings())
{
             // in case of SNS-siblings make sure the parent hierarchy entry has
             // its child entries loaded.
-            assertChildNodeEntries(state.getParent());
+            loadChildNodeEntries(state.getParent());
         }
-        return new Remove(state, state.getParent());
+        return new Remove(state, state.getParent(), REMOVE_OPTIONS);
     }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
Thu Sep 29 12:06:51 2011
@@ -107,14 +107,12 @@ public class ReorderNodes extends Transi
 
     public static Operation create(NodeState parentState, Path srcPath, Path beforePath)
throws RepositoryException {
         // make sure the parent hierarchy entry has its child entries loaded
-        assertChildNodeEntries(parentState);
+        loadChildNodeEntries(parentState);
 
-        NodeState insert = parentState.getChildNodeState(
-                srcPath.getName(), srcPath.getNormalizedIndex());
+        NodeState insert = parentState.getChildNodeState(srcPath.getName(), srcPath.getNormalizedIndex());
         NodeState before = null;
         if (beforePath != null) {
-            before = parentState.getChildNodeState(
-                    beforePath.getName(), beforePath.getNormalizedIndex());
+            before = parentState.getChildNodeState(beforePath.getName(), beforePath.getNormalizedIndex());
         }
         return new ReorderNodes(parentState, insert, before);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
Thu Sep 29 12:06:51 2011
@@ -39,10 +39,6 @@ public class SetMixin extends TransientO
     private final NodeState nodeState;
     private final Name[] mixinNames;
 
-    private SetMixin(NodeState nodeState, Name[] mixinNames) throws RepositoryException {
-        this(nodeState, mixinNames, SET_MIXIN_OPTIONS);
-    }
-
     private SetMixin(NodeState nodeState, Name[] mixinNames, int options) throws RepositoryException
{
         super(options);
         this.nodeState = nodeState;
@@ -108,6 +104,6 @@ public class SetMixin extends TransientO
             log.error(e.getMessage(), e);
             throw e;
         }
-        return new SetMixin(nodeState, mixinNames);
+        return new SetMixin(nodeState, mixinNames, SET_MIXIN_OPTIONS);
     }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
Thu Sep 29 12:06:51 2011
@@ -40,13 +40,7 @@ public class SetPropertyValue extends Tr
 
     private final QValue[] oldValues;
 
-    private SetPropertyValue(PropertyState propertyState, int valueType, QValue[] values)
-            throws RepositoryException {
-
-        this(propertyState, valueType, values, SET_PROPERTY_OPTIONS);
-    }
-
-    private SetPropertyValue(PropertyState propertyState, int valueType, QValue[] values,
int options)
+    private SetPropertyValue(PropertyState propertyState, QValue[] values, int valueType,
int options)
             throws RepositoryException {
 
         super(options);
@@ -129,6 +123,6 @@ public class SetPropertyValue extends Tr
             }
         }
         QValue[] cleanValues = list.toArray(new QValue[list.size()]);
-        return new SetPropertyValue(propState, valueType, cleanValues);
+        return new SetPropertyValue(propState, cleanValues, valueType, SET_PROPERTY_OPTIONS);
     }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/TransientOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/TransientOperation.java?rev=1177277&r1=1177276&r2=1177277&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/TransientOperation.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/TransientOperation.java
Thu Sep 29 12:06:51 2011
@@ -31,7 +31,7 @@ public abstract class TransientOperation
 
     private final int options;
 
-    TransientOperation(int options) {
+    protected TransientOperation(int options) {
         this.options = options;
     }
 



Mime
View raw message