jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1174620 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: hierarchy/ state/
Date Fri, 23 Sep 2011 09:42:45 GMT
Author: mduerig
Date: Fri Sep 23 09:42:44 2011
New Revision: 1174620

URL: http://svn.apache.org/viewvc?rev=1174620&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
refactor: pull getId and getWorkspaceId up to base class

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntry.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java?rev=1174620&r1=1174619&r2=1174620&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java
Fri Sep 23 09:42:44 2011
@@ -22,6 +22,7 @@ import org.apache.jackrabbit.jcr2spi.sta
 import org.apache.jackrabbit.jcr2spi.state.Status;
 import org.apache.jackrabbit.jcr2spi.state.TransientItemStateFactory;
 import org.apache.jackrabbit.spi.IdFactory;
+import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.spi.ItemInfoCache;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
@@ -190,6 +191,22 @@ public abstract class HierarchyEntry<STA
     public abstract void complete(Operation operation) throws RepositoryException;
 
     /**
+     * @return the {@code ItemId} of this child node entry.
+     */
+    public abstract ItemId getId() throws RepositoryException;
+
+    /**
+     * Returns the ID that must be used for resolving this entry OR loading its
+     * children entries from the persistent layer. This is the same as
+     * {@code getId()} unless this entry or any of its ancestors has been
+     * transiently moved.
+     *
+     * @return
+     * @see #getId()
+     */
+    public abstract ItemId getWorkspaceId() throws RepositoryException;
+
+    /**
      * @return the item state or {@code null} if the entry isn't resolved.
      */
     STATE_TYPE internalGetItemState() {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java?rev=1174620&r1=1174619&r2=1174620&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java
Fri Sep 23 09:42:44 2011
@@ -295,6 +295,7 @@ public class NodeEntry extends Hierarchy
     /**
      * @return the {@code NodeId} of this child node entry.
      */
+    @Override
     public NodeId getId() throws RepositoryException {
         return getId(false);
     }
@@ -308,6 +309,7 @@ public class NodeEntry extends Hierarchy
      * @return
      * @see #getId()
      */
+    @Override
     public NodeId getWorkspaceId() throws RepositoryException {
         return getId(true);
     }
@@ -324,8 +326,8 @@ public class NodeEntry extends Hierarchy
         }
     }
 
-    private static NodeId buildNodeId(NodeEntry entry, PathFactory pathFactory, IdFactory
idFactory,
-            boolean wspId) throws RepositoryException {
+    private static NodeId buildNodeId(NodeEntry entry, PathFactory pathFactory, IdFactory
idFactory, boolean wspId)
+            throws RepositoryException {
 
         PathBuilder pathBuilder = new PathBuilder(pathFactory);
         while (entry.getParent() != null && entry.getUniqueID() == null) {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntry.java?rev=1174620&r1=1174619&r2=1174620&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntry.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntry.java
Fri Sep 23 09:42:44 2011
@@ -63,8 +63,9 @@ public class PropertyEntry extends Hiera
     //------------------------------------------------------< PropertyEntry >---
 
     /**
-     * @return the {@code NodeId} of this child node entry.
+     * @return the {@code PropertyId} of this child node entry.
      */
+    @Override
     public PropertyId getId() throws RepositoryException {
         return getIdFactory().createPropertyId(parent.getId(), getName());
     }
@@ -78,6 +79,7 @@ public class PropertyEntry extends Hiera
      * @return
      * @see #getId()
      */
+    @Override
     public PropertyId getWorkspaceId() throws RepositoryException {
         return getIdFactory().createPropertyId(parent.getWorkspaceId(), getName());
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java?rev=1174620&r1=1174619&r2=1174620&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
Fri Sep 23 09:42:44 2011
@@ -113,11 +113,6 @@ public abstract class ItemState<ENTRY_TY
         this.definitionProvider = definitionProvider;
     }
 
-    /**
-     *
-     * @param parent
-     * @return
-     */
     private static Status getInitialStatus(NodeEntry parent) {
         Status status = Status.EXISTING;
         // walk up hierarchy and check if any of the parents is transiently
@@ -179,7 +174,9 @@ public abstract class ItemState<ENTRY_TY
      *
      * @return the identifier of this item state..
      */
-    public abstract ItemId getId() throws RepositoryException;
+    public ItemId getId() throws RepositoryException {
+        return getHierarchyEntry().getId();
+    }
 
     /**
      * Utility method:
@@ -188,7 +185,9 @@ public abstract class ItemState<ENTRY_TY
      *
      * @return the identifier of this item state..
      */
-    public abstract ItemId getWorkspaceId() throws RepositoryException;
+    public ItemId getWorkspaceId() throws RepositoryException {
+        return getHierarchyEntry().getWorkspaceId();
+    }
 
     /**
      * Utility method:

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java?rev=1174620&r1=1174619&r2=1174620&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
Fri Sep 23 09:42:44 2011
@@ -19,7 +19,6 @@ package org.apache.jackrabbit.jcr2spi.st
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
-import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.NodeInfo;
@@ -106,16 +105,6 @@ public class NodeState extends ItemState
     }
 
     @Override
-    public ItemId getId() throws RepositoryException {
-        return getNodeId();
-    }
-
-    @Override
-    public ItemId getWorkspaceId() throws RepositoryException {
-        return getNodeEntry().getWorkspaceId();
-    }
-
-    @Override
     public MergeResult merge(ItemState<?> another, boolean keepChanges) {
         boolean modified = false;
         if (another != null && another != this) {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java?rev=1174620&r1=1174619&r2=1174620&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
Fri Sep 23 09:42:44 2011
@@ -18,7 +18,6 @@ package org.apache.jackrabbit.jcr2spi.st
 
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
-import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.spi.PropertyInfo;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QValue;
@@ -105,16 +104,6 @@ public class PropertyState extends ItemS
         return false;
     }
 
-    @Override
-    public ItemId getId() throws RepositoryException {
-        return getHierarchyEntry().getId();
-    }
-
-    @Override
-    public ItemId getWorkspaceId() throws RepositoryException {
-        return getHierarchyEntry().getWorkspaceId();
-    }
-
     /**
      * If {@code keepChanges} is true, this method only compares the existing
      * values with the values from 'another' and returns true, if the underlying



Mime
View raw message