jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1174628 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ./ operation/ state/
Date Fri, 23 Sep 2011 09:59:57 GMT
Author: mduerig
Date: Fri Sep 23 09:59:57 2011
New Revision: 1174628

URL: http://svn.apache.org/viewvc?rev=1174628&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
refactor: covariant override getId methods to reduce casting

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/VersionManagerImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.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/SetPropertyValue.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/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/VersionManagerImpl.java?rev=1174628&r1=1174627&r2=1174628&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/VersionManagerImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/VersionManagerImpl.java
Fri Sep 23 09:59:57 2011
@@ -226,7 +226,7 @@ public class VersionManagerImpl implemen
             activityId = null;
         } else {
             NodeImpl activityNode = getValidActivity(activity, "set");
-            activityId = (NodeId) activityNode.getItemState().getId();
+            activityId = activityNode.getItemState().getId();
         }
         return oldActivity;
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?rev=1174628&r1=1174627&r2=1174628&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Fri Sep 23 09:59:57 2011
@@ -595,7 +595,7 @@ public final class WorkspaceManager impl
         // identified by the resulting id.
         // the server must be able to deal with paths and with proper ids anyway.
         // TODO: 'createNodeId' is basically wrong since isGranted is unspecific for any
item.
-        ItemId id = idFactory.createNodeId((NodeId) parentState.getWorkspaceId(), relPath);
+        ItemId id = idFactory.createNodeId(parentState.getWorkspaceId(), relPath);
         return service.isGranted(sessionInfo, id, actions);
     }
 
@@ -990,7 +990,7 @@ public final class WorkspaceManager impl
         public void visit(RemoveVersion operation) throws RepositoryException {
             NodeId versionId = (NodeId) operation.getRemoveId();
             NodeState vhState = operation.getParentState();
-            service.removeVersion(sessionInfo, (NodeId) vhState.getWorkspaceId(), versionId);
+            service.removeVersion(sessionInfo, vhState.getWorkspaceId(), versionId);
         }
 
         @Override

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=1174628&r1=1174627&r2=1174628&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
Fri Sep 23 09:59:57 2011
@@ -58,7 +58,7 @@ public class Move extends TransientOpera
         
         super(sessionMove ? MOVE_OPTIONS : ItemStateValidator.CHECK_NONE);
 
-        srcId = (NodeId) srcNodeState.getId();
+        srcId = srcNodeState.getId();
         destParentId = destParentState.getNodeId();
         this.destName = destName;
 

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=1174628&r1=1174627&r2=1174628&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
Fri Sep 23 09:59:57 2011
@@ -52,7 +52,7 @@ public class SetPropertyValue extends Tr
         super(options);
         this.propertyState = propertyState;
 
-        propertyId = (PropertyId) propertyState.getId();
+        propertyId = propertyState.getId();
         this.valueType = valueType;
         this.values = values;
 

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=1174628&r1=1174627&r2=1174628&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:59:57 2011
@@ -105,6 +105,16 @@ public class NodeState extends ItemState
     }
 
     @Override
+    public NodeId getId() throws RepositoryException {
+        return (NodeId) super.getId();
+    }
+
+    @Override
+    public NodeId getWorkspaceId() throws RepositoryException {
+        return (NodeId) super.getId();
+    }
+
+    @Override
     public MergeResult merge(ItemState<?> another, boolean keepChanges) {
         boolean modified = false;
         if (another != null && another != this) {
@@ -446,8 +456,8 @@ public class NodeState extends ItemState
             // before. The effective NT must be evaluated as if it had been
             // evaluated upon creating the workspace state.
             NodeState parent = getParent();
-            NodeId wspId = (NodeId) getWorkspaceId();
-            def = definitionProvider.getQNodeDefinition(parent.getNodeTypeNames(), getName(),
getNodeTypeName(), wspId);
+            def = definitionProvider.getQNodeDefinition(parent.getNodeTypeNames(), getName(),
getNodeTypeName(),
+                    getWorkspaceId());
         }
         return def;
     }

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=1174628&r1=1174627&r2=1174628&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:59:57 2011
@@ -18,6 +18,7 @@ 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.PropertyId;
 import org.apache.jackrabbit.spi.PropertyInfo;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QValue;
@@ -104,6 +105,16 @@ public class PropertyState extends ItemS
         return false;
     }
 
+    @Override
+    public PropertyId getId() throws RepositoryException {
+        return (PropertyId) super.getId();
+    }
+
+    @Override
+    public PropertyId getWorkspaceId() throws RepositoryException {
+        return (PropertyId) super.getId();
+    }
+
     /**
      * 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