jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r431887 [1/2] - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ./ lock/ operation/ state/ version/ xml/
Date Wed, 16 Aug 2006 12:24:32 GMT
Author: angela
Date: Wed Aug 16 05:24:30 2006
New Revision: 431887

URL: http://svn.apache.org/viewvc?rev=431887&view=rev
Log:
work in progress

- operations: rename getAffectedIds to getAffectedStates
- operations: return ItemState params instead of ids whereever possible and
  let OperationVisitor deal with all kind of issues arising with SPI ids.
- AddNode/AddProperty operations: don't list state to be created as affected. Not required since operations are collected upon refresh/save, in which case a 'new' item can never be the starting point.
- transient move: let parent NodeState handle the move/renaming of child states
- transient reorder: let parent NodeState handle the reorder logic
- NodeState: remove unused methods and mark setParent private
- NodeImpl: protected getNodeId() no more used by subclasses in version package.

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/DefaultVersionManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java Wed Aug 16 05:24:30 2006
@@ -328,7 +328,7 @@
             } else {
                 ps.print("- ");
             }
-            ps.println(state.getId() + "\t" + LogUtil.safeGetJCRPath(state, session.getNamespaceResolver(), hierMgr) + " (" + item + ")");
+            ps.println(state + "\t" + LogUtil.safeGetJCRPath(state, session.getNamespaceResolver(), hierMgr) + " (" + item + ")");
         }
     }
 
@@ -349,7 +349,7 @@
                     evictItem(state);
                 }
             }
-            throw new AccessDeniedException("cannot read item " + state.getId());
+            throw new AccessDeniedException("Cannot read item: " + state);
         }
     }
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java Wed Aug 16 05:24:30 2006
@@ -55,7 +55,6 @@
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.NodeId;
-import org.apache.jackrabbit.spi.PropertyId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -232,7 +231,9 @@
     /**
      * @see Node#orderBefore(String, String)
      */
-    public void orderBefore(String srcChildRelPath, String destChildRelPath) throws UnsupportedRepositoryOperationException, VersionException, ConstraintViolationException, ItemNotFoundException, LockException, RepositoryException {
+    public synchronized void orderBefore(String srcChildRelPath,
+                                         String destChildRelPath)
+        throws UnsupportedRepositoryOperationException, VersionException, ConstraintViolationException, ItemNotFoundException, LockException, RepositoryException {
         checkIsWritable();
 
         if (!getPrimaryNodeType().hasOrderableChildNodes()) {
@@ -254,8 +255,7 @@
         Path.PathElement srcName = getReorderPath(srcChildRelPath).getNameElement();
         Path.PathElement beforeName = (destChildRelPath == null) ? null : getReorderPath(destChildRelPath).getNameElement();
 
-        NodeState nState = getNodeState();
-        Operation op = ReorderNodes.create(nState, srcName, beforeName);
+        Operation op = ReorderNodes.create(getNodeState(), srcName, beforeName);
         session.getSessionItemStateManager().execute(op);
     }
 
@@ -674,8 +674,7 @@
             allMixins[currentMixins.length + i] = mixinQNames[i];
         }
         // perform the operation
-        PropertyId mixinPId = session.getIdFactory().createPropertyId(getNodeId(), QName.JCR_MIXINTYPES);
-        Operation op = SetMixin.create(mixinPId, allMixins);
+        Operation op = SetMixin.create(getNodeState(), allMixins);
         session.getSessionItemStateManager().execute(op);
     }
 
@@ -717,8 +716,7 @@
 
         // delegate to operation
         QName[] mixins = (QName[]) remainingMixins.toArray(new QName[remainingMixins.size()]);
-        PropertyId mixinPId = session.getIdFactory().createPropertyId(getNodeId(), QName.JCR_MIXINTYPES);
-        Operation op = SetMixin.create(mixinPId, mixins);
+        Operation op = SetMixin.create(getNodeState(), mixins);
         session.getSessionItemStateManager().execute(op);
     }
 
@@ -837,8 +835,8 @@
         }
 
         if (version instanceof VersionImpl) {
-            NodeId versionId = ((VersionImpl)version).getNodeId();
-            session.getVersionManager().resolveMergeConflict(getNodeId(), versionId, done);
+            NodeState versionState = ((NodeImpl)version).getNodeState();
+            session.getVersionManager().resolveMergeConflict(getNodeState(), versionState, done);
         } else {
             throw new RepositoryException("Incompatible Version object :" + version);
         }
@@ -858,7 +856,7 @@
         // make sure the specified workspace is visible for the current session.
         session.checkAccessibleWorkspace(srcWorkspaceName);
 
-        Operation op = Update.create(getNodeId(), srcWorkspaceName);
+        Operation op = Update.create(getNodeState(), srcWorkspaceName);
         session.getSessionItemStateManager().execute(op);
     }
 
@@ -878,7 +876,7 @@
         session.checkAccessibleWorkspace(srcWorkspace);
 
         // TODO: improve... (and review return value of VM.merge)
-        Collection failedIds = session.getVersionManager().merge(getNodeId(), srcWorkspace, bestEffort);
+        Collection failedIds = session.getVersionManager().merge(getNodeState(), srcWorkspace, bestEffort);
         if (failedIds.isEmpty()) {
             return IteratorHelper.EMPTY;
         } else {
@@ -1057,7 +1055,7 @@
      */
     private void restore(NodeId nodeId, Version version, boolean removeExisting) throws PathNotFoundException, ItemExistsException, VersionException, ConstraintViolationException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException {
         if (version instanceof VersionImpl) {
-            NodeId versionId = ((VersionImpl)version).getNodeId();
+            NodeId versionId = ((NodeImpl)version).getNodeId();
             session.getVersionManager().restore(nodeId, versionId, removeExisting);
         } else {
             throw new RepositoryException("Unexpected error: Failed to retrieve a valid ID for the given version " + version.getPath());
@@ -1423,8 +1421,7 @@
     private Property createProperty(QName qName, int type, QPropertyDefinition def,
                                     QValue[] qvs)
         throws PathNotFoundException, ConstraintViolationException, RepositoryException {
-        PropertyId newPId = session.getIdFactory().createPropertyId(getNodeId(), qName);
-        Operation op = AddProperty.create(newPId, type, def, qvs);
+        Operation op = AddProperty.create(getNodeState(), qName, type, def, qvs);
         session.getSessionItemStateManager().execute(op);
         return getProperty(qName);
     }
@@ -1495,12 +1492,11 @@
     }
 
     /**
-     * Return the id of this <code>Node</code>. Protected for usage within
-     * <code>VersionImpl</code> and <code>VersionHistoryImpl</code>.
+     * Return the id of this <code>Node</code>.
      *
      * @return the id of this <code>Node</code>
      */
-    protected NodeId getNodeId() {
+    private NodeId getNodeId() {
         return getNodeState().getNodeId();
     }
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java Wed Aug 16 05:24:30 2006
@@ -238,7 +238,8 @@
         NodeId[] versionIds = new NodeId[versions.length];
         for (int i = 0; i < versions.length; i++) {
             if (versions[i] instanceof VersionImpl) {
-                versionIds[i] = ((VersionImpl)versions[i]).getNodeId();
+                ItemState vState = ((NodeImpl)versions[i]).getItemState();
+                versionIds[i] = (NodeId) vState.getId();
             } else {
                 throw new RepositoryException("Unexpected error: Failed to retrieve a valid ID for the given version " + versions[i].getPath());
             }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java Wed Aug 16 05:24:30 2006
@@ -73,6 +73,7 @@
 import org.apache.jackrabbit.spi.Event;
 import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.spi.QNodeTypeDefinition;
+import org.apache.jackrabbit.spi.PropertyId;
 import org.apache.jackrabbit.value.QValue;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
@@ -554,13 +555,15 @@
             }
         }
         //-----------------------< OperationVisitor >---------------------------
+        // TODO: review retrival of ItemIds for transient modifications 
 
         public void visit(AddNode operation) throws RepositoryException {
-            batch.addNode(operation.getParentId(), operation.getNodeName(), operation.getNodeTypeName(), operation.getUuid());
+            NodeId parentId = operation.getParentState().getNodeId();
+            batch.addNode(parentId, operation.getNodeName(), operation.getNodeTypeName(), operation.getUuid());
         }
 
         public void visit(AddProperty operation) throws RepositoryException {
-            org.apache.jackrabbit.spi.NodeId parentId = operation.getParentId();
+            NodeId parentId = operation.getParentState().getNodeId();
             QName propertyName = operation.getPropertyName();
             int type = operation.getPropertyType();
             if (operation.isMultiValued()) {
@@ -589,35 +592,43 @@
         }
 
         public void visit(Clone operation) throws NoSuchWorkspaceException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
-            events = service.clone(sessionInfo, operation.getWorkspaceName(), operation.getNodeId(), operation.getDestinationParentId(), operation.getDestinationName(), operation.isRemoveExisting());
+            NodeId nId = operation.getNodeState().getNodeId();
+            NodeId destParentId = operation.getDestinationParentState().getNodeId();
+            events = service.clone(sessionInfo, operation.getWorkspaceName(), nId, destParentId, operation.getDestinationName(), operation.isRemoveExisting());
         }
 
         public void visit(Copy operation) throws NoSuchWorkspaceException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
-            events = service.copy(sessionInfo, operation.getWorkspaceName(), operation.getNodeId(), operation.getDestinationParentId(), operation.getDestinationName());
+            NodeId nId = operation.getNodeState().getNodeId();
+            NodeId destParentId = operation.getDestinationParentState().getNodeId();
+            events = service.copy(sessionInfo, operation.getWorkspaceName(), nId, destParentId, operation.getDestinationName());
         }
 
         public void visit(Move operation) throws LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+            NodeId moveId = operation.getNodeState().getNodeId();
+            NodeId destParentId = operation.getDestinationParentState().getNodeId();
             if (batch == null) {
-                events = service.move(sessionInfo, operation.getNodeId(), operation.getDestinationParentId(), operation.getDestinationName());
+                events = service.move(sessionInfo, moveId, destParentId, operation.getDestinationName());
             } else {
-                batch.move(operation.getNodeId(), operation.getDestinationParentId(), operation.getDestinationName());
+                batch.move(moveId, destParentId, operation.getDestinationName());
             }
         }
 
         public void visit(Update operation) throws NoSuchWorkspaceException, AccessDeniedException, LockException, InvalidItemStateException, RepositoryException {
-            events = service.update(sessionInfo, operation.getNodeId(), operation.getSourceWorkspaceName());
+            NodeId nId = operation.getNodeState().getNodeId();
+            events = service.update(sessionInfo, nId, operation.getSourceWorkspaceName());
         }
 
         public void visit(Remove operation) throws RepositoryException {
-            batch.remove(operation.getRemoveId());
+            ItemId id = operation.getRemoveState().getId();
+            batch.remove(id);
         }
 
         public void visit(SetMixin operation) throws RepositoryException {
-            batch.setMixins(operation.getNodeId(), operation.getMixinNames());
+            batch.setMixins(operation.getNodeState().getNodeId(), operation.getMixinNames());
         }
 
         public void visit(SetPropertyValue operation) throws RepositoryException {
-            org.apache.jackrabbit.spi.PropertyId id = operation.getPropertyId();
+            PropertyId id = operation.getPropertyState().getPropertyId();
             int type = operation.getPropertyType();
             if (operation.isMultiValued()) {
                 QValue[] values = operation.getValues();
@@ -645,15 +656,18 @@
         }
 
         public void visit(ReorderNodes operation) throws RepositoryException {
-            batch.reorderNodes(operation.getParentId(), operation.getInsertNodeId(), operation.getBeforeNodeId());
+            NodeId parentId = operation.getParentState().getNodeId();
+            NodeId insertId = operation.getInsertNodeId();
+            NodeId beforeId = operation.getBeforeNodeId();
+            batch.reorderNodes(parentId, insertId, beforeId);
         }
 
         public void visit(Checkout operation) throws UnsupportedRepositoryOperationException, LockException, RepositoryException {
-            events = service.checkout(sessionInfo, operation.getNodeId());
+            events = service.checkout(sessionInfo, operation.getNodeState().getNodeId());
         }
 
         public void visit(Checkin operation) throws UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException {
-            events = service.checkin(sessionInfo, operation.getNodeId());
+            events = service.checkin(sessionInfo, operation.getNodeState().getNodeId());
         }
 
         public void visit(Restore operation) throws VersionException, PathNotFoundException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException {
@@ -675,15 +689,16 @@
         }
 
         public void visit(Merge operation) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException {
-            events = service.merge(sessionInfo, operation.getNodeId(), operation.getSourceWorkspaceName(), operation.bestEffort());
+            NodeId nId = operation.getNodeState().getNodeId();
+            events = service.merge(sessionInfo, nId, operation.getSourceWorkspaceName(), operation.bestEffort());
             // todo: improve.... inform operation about modified items (build mergefailed iterator)
             operation.getEventListener().onEvent(events, true);
         }
 
         public void visit(ResolveMergeConflict operation) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException {
             try {
-                NodeId nId = operation.getNodeId();
-                NodeId vId = operation.getVersionId();
+                NodeId nId = operation.getNodeState().getNodeId();
+                NodeId vId = operation.getVersionState().getNodeId();
 
                 PropertyState mergeFailedState = (PropertyState) cache.getItemState(
                         getIdFactory().createPropertyId(nId, QName.JCR_MERGEFAILED));
@@ -726,23 +741,30 @@
         }
 
         public void visit(LockOperation operation) throws AccessDeniedException, InvalidItemStateException, UnsupportedRepositoryOperationException, LockException, RepositoryException {
-            events = service.lock(sessionInfo, operation.getNodeId(), operation.isDeep());
+            NodeId nId = operation.getNodeState().getNodeId();
+            events = service.lock(sessionInfo, nId, operation.isDeep());
         }
 
         public void visit(LockRefresh operation) throws AccessDeniedException, InvalidItemStateException, UnsupportedRepositoryOperationException, LockException, RepositoryException {
-            events = service.refreshLock(sessionInfo, operation.getNodeId());
+            NodeId nId = operation.getNodeState().getNodeId();
+            events = service.refreshLock(sessionInfo, nId);
         }
 
         public void visit(LockRelease operation) throws AccessDeniedException, InvalidItemStateException, UnsupportedRepositoryOperationException, LockException, RepositoryException {
-            events = service.unlock(sessionInfo, operation.getNodeId());
+            NodeId nId = operation.getNodeState().getNodeId();
+            events = service.unlock(sessionInfo, nId);
         }
 
         public void visit(AddLabel operation) throws VersionException, RepositoryException {
-            events = service.addVersionLabel(sessionInfo, operation.getVersionHistoryId(), operation.getVersionId(), operation.getLabel(), operation.moveLabel());
+            NodeId vhId = operation.getVersionHistoryState().getNodeId();
+            NodeId vId = operation.getVersionState().getNodeId();
+            events = service.addVersionLabel(sessionInfo, vhId, vId, operation.getLabel(), operation.moveLabel());
         }
 
         public void visit(RemoveLabel operation) throws VersionException, RepositoryException {
-            events = service.removeVersionLabel(sessionInfo, operation.getVersionHistoryId(), operation.getVersionId(), operation.getLabel());
+            NodeId vhId = operation.getVersionHistoryState().getNodeId();
+            NodeId vId = operation.getVersionState().getNodeId();
+            events = service.removeVersionLabel(sessionInfo, vhId, vId, operation.getLabel());
         }
     }
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java Wed Aug 16 05:24:30 2006
@@ -84,7 +84,7 @@
         }
 
         // execute the operation
-        Operation op = LockOperation.create(nodeState.getNodeId(), isDeep, isSessionScoped);
+        Operation op = LockOperation.create(nodeState, isDeep, isSessionScoped);
         wspManager.execute(op);
 
         Lock lock = new LockImpl(nodeState, lhNode, isSessionScoped);
@@ -135,7 +135,7 @@
         // execute the operation. Note, that its possible that the session is
         // lock holder and still the lock was never accessed. thus the lockMap
         // does not provide sufficient and relyable information.
-        Operation op = LockRelease.create(nodeState.getNodeId());
+        Operation op = LockRelease.create(nodeState);
         wspManager.execute(op);
 
         // if unlock was successfull: clean up lock map and lock life cycle
@@ -449,7 +449,7 @@
                 throw new LockException("Session does not hold lock.");
             } else {
                 // lock is still alive -> send refresh-lock operation.
-                Operation op = LockRefresh.create(lockHoldingState.getNodeId());
+                Operation op = LockRefresh.create(lockHoldingState);
                 wspManager.execute(op);
             }
         }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java Wed Aug 16 05:24:30 2006
@@ -17,11 +17,11 @@
 package org.apache.jackrabbit.jcr2spi.operation;
 
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.ManagerProvider;
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.spi.NodeId;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -35,8 +35,8 @@
 
     private static Logger log = LoggerFactory.getLogger(AbstractCopy.class);
 
-    private final NodeId srcId;
-    private final NodeId destParentId;
+    private final NodeState srcState;
+    private final NodeState destParentState;
     private final QName destName;
     
     private final String srcWorkspaceName;
@@ -55,9 +55,9 @@
         if (!srcItemState.isNode()) {
             throw new PathNotFoundException("Source path " + LogUtil.safeGetJCRPath(srcPath, srcMgrProvider.getNamespaceResolver()) + " is not a valid path.");
         }
-        this.srcId = (NodeId)srcItemState.getId();
-        this.destParentId = getNodeId(destPath.getAncestor(1), destMgrProvider.getHierarchyManager(), destMgrProvider.getNamespaceResolver());
-        addAffectedItemId(destParentId);
+        this.srcState = (NodeState)srcItemState;
+        this.destParentState = getNodeState(destPath.getAncestor(1), destMgrProvider.getHierarchyManager(), destMgrProvider.getNamespaceResolver());
+        addAffectedItemState(destParentState);
 
         // check for illegal index present in destination path
         Path.PathElement destElement = destPath.getNameElement();
@@ -77,12 +77,12 @@
         return srcWorkspaceName;
     }
 
-    public NodeId getNodeId() {
-        return srcId;
+    public NodeState getNodeState() {
+        return srcState;
     }
 
-    public NodeId getDestinationParentId() {
-        return destParentId;
+    public NodeState getDestinationParentState() {
+        return destParentState;
     }
 
     public QName getDestinationName() {

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java Wed Aug 16 05:24:30 2006
@@ -16,13 +16,12 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.spi.ItemId;
-import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.jcr2spi.HierarchyManager;
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.PathNotFoundException;
 import javax.jcr.RepositoryException;
@@ -38,7 +37,7 @@
     /**
      * The collection of affected ItemIds.
      */
-    private final Collection affectedIds = new ArrayList();
+    private final Collection affectedStates = new ArrayList();
 
     /**
      * Returns the name of the class
@@ -53,17 +52,17 @@
     /**
      * @inheritDoc
      */
-    public Collection getAffectedItemIds() {
-        return Collections.unmodifiableCollection(affectedIds);
+    public Collection getAffectedItemStates() {
+        return Collections.unmodifiableCollection(affectedStates);
     }
 
     /**
-     * Adds an affected <code>ItemId</code>.
+     * Adds an affected <code>ItemState</code>.
      *
-     * @param affectedId the <code>ItemId</code>s of the affected item.
+     * @param affectedState the <code>ItemState</code>s of the affected item.
      */
-    protected void addAffectedItemId(ItemId affectedId) {
-        affectedIds.add(affectedId);
+    protected void addAffectedItemState(ItemState affectedState) {
+        affectedStates.add(affectedState);
     }
 
     /**
@@ -75,11 +74,11 @@
      * @throws PathNotFoundException
      * @throws RepositoryException
      */
-    protected static NodeId getNodeId(Path nodePath, HierarchyManager hierMgr, NamespaceResolver nsResolver) throws PathNotFoundException, RepositoryException {
+    protected static NodeState getNodeState(Path nodePath, HierarchyManager hierMgr, NamespaceResolver nsResolver) throws PathNotFoundException, RepositoryException {
         ItemState itemState = hierMgr.getItemState(nodePath);
         if (!itemState.isNode()) {
             throw new PathNotFoundException(LogUtil.safeGetJCRPath(nodePath, nsResolver));
         }
-        return (NodeId)itemState.getId();
+        return (NodeState) itemState;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java Wed Aug 16 05:24:30 2006
@@ -18,8 +18,8 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.AccessDeniedException;
@@ -36,16 +36,18 @@
 
     private static Logger log = LoggerFactory.getLogger(AddLabel.class);
 
-    private final NodeId versionHistoryId;
-    private final NodeId versionId;
+    private final NodeState versionHistoryState;
+    private final NodeState versionState;
     private final QName label;
     private final boolean moveLabel;
 
-    private AddLabel(NodeId versionHistoryId, NodeId versionId, QName label, boolean moveLabel) {
-        this.versionHistoryId = versionHistoryId;
-        this.versionId = versionId;
+    private AddLabel(NodeState versionHistoryState, NodeState versionState, QName label, boolean moveLabel) {
+        this.versionHistoryState = versionHistoryState;
+        this.versionState = versionState;
         this.label = label;
         this.moveLabel = moveLabel;
+
+        // TODO: setting affecting states?
     }
     //----------------------------------------------------------< Operation >---
     /**
@@ -64,12 +66,12 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getVersionHistoryId() {
-        return versionHistoryId;
+    public NodeState getVersionHistoryState() {
+        return versionHistoryState;
     }
 
-    public NodeId getVersionId() {
-        return versionId;
+    public NodeState getVersionState() {
+        return versionState;
     }
 
     public QName getLabel() {
@@ -83,13 +85,13 @@
     //------------------------------------------------------------< Factory >---
     /**
      *
-     * @param versionHistoryId
-     * @param versionId
+     * @param versionHistoryState
+     * @param versionState
      * @param label
      * @param moveLabel
      * @return
      */
-    public static Operation create(NodeId versionHistoryId, NodeId versionId, QName label, boolean moveLabel) {
-        return new AddLabel(versionHistoryId, versionId, label, moveLabel);
+    public static Operation create(NodeState versionHistoryState, NodeState versionState, QName label, boolean moveLabel) {
+        return new AddLabel(versionHistoryState, versionState, label, moveLabel);
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java Wed Aug 16 05:24:30 2006
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.jcr2spi.operation;
 
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
-import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.name.QName;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
@@ -38,18 +37,18 @@
 
     private static Logger log = LoggerFactory.getLogger(AddNode.class);
 
-    private final NodeId parentId;
+    private final NodeState parentState;
     private final QName nodeName;
     private final QName nodeTypeName;
-    private final NodeId id;
+    private final String uuid;
 
-    private AddNode(NodeId parentId, QName nodeName, QName nodeTypeName, NodeId id) {
-        this.parentId = parentId;
+    private AddNode(NodeState parentState, QName nodeName, QName nodeTypeName, String uuid) {
+        this.parentState = parentState;
         this.nodeName = nodeName;
         this.nodeTypeName = nodeTypeName;
-        this.id = id;
-        addAffectedItemId(parentId);
-        addAffectedItemId(id);
+        this.uuid = uuid;
+
+        addAffectedItemState(parentState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -62,8 +61,8 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getParentId() {
-        return parentId;
+    public NodeState getParentState() {
+        return parentState;
     }
 
     public QName getNodeName() {
@@ -75,14 +74,14 @@
     }
 
     public String getUuid() {
-        return (id != null) ? id.getUUID() : null;
+        return uuid;
     }
 
     //------------------------------------------------------------< Factory >---
 
     public static Operation create(NodeState parentState, QName nodeName,
-                                   QName nodeTypeName, NodeId id) {
-        AddNode an = new AddNode(parentState.getNodeId(), nodeName, nodeTypeName, id);
+                                   QName nodeTypeName, String uuid) {
+        AddNode an = new AddNode(parentState, nodeName, nodeTypeName, uuid);
         return an;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java Wed Aug 16 05:24:30 2006
@@ -18,9 +18,8 @@
 
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.spi.NodeId;
-import org.apache.jackrabbit.spi.PropertyId;
 import org.apache.jackrabbit.value.QValue;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.ItemExistsException;
@@ -36,21 +35,21 @@
  */
 public class AddProperty extends AbstractOperation {
 
-    private final NodeId parentId;
+    private final NodeState parentState;
     private final QName propertyName;
     private final int propertyType;
     private final QValue[] values;
 
     private final QPropertyDefinition definition;
 
-    private AddProperty(PropertyId newPropertyId, int propertyType, QValue[] values, QPropertyDefinition definition) {
-        this.parentId = newPropertyId.getParentId();
-        this.propertyName = newPropertyId.getQName();
+    private AddProperty(NodeState parentState, QName propName, int propertyType, QValue[] values, QPropertyDefinition definition) {
+        this.parentState = parentState;
+        this.propertyName = propName;
         this.propertyType = propertyType;
         this.values = values;
         this.definition = definition;
-        addAffectedItemId(parentId);
-        addAffectedItemId(newPropertyId);
+
+        addAffectedItemState(parentState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -63,8 +62,8 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getParentId() {
-        return parentId;
+    public NodeState getParentState() {
+        return parentState;
     }
 
     public QName getPropertyName() {
@@ -84,9 +83,18 @@
     }
 
     //------------------------------------------------------------< Factory >---
-    public static Operation create(PropertyId newPropertyId, int propertyType,
+    /**
+     *
+     * @param parentState
+     * @param propName
+     * @param propertyType
+     * @param def
+     * @param values
+     * @return
+     */
+    public static Operation create(NodeState parentState, QName propName, int propertyType,
                                    QPropertyDefinition def, QValue[] values) {
-        AddProperty ap = new AddProperty(newPropertyId, propertyType, values, def);
+        AddProperty ap = new AddProperty(parentState, propName, propertyType, values, def);
         return ap;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java Wed Aug 16 05:24:30 2006
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.AccessDeniedException;
@@ -31,11 +31,11 @@
  */
 public class Checkin extends AbstractOperation {
 
-    private final NodeId nodeId;
+    private final NodeState nodeState;
 
-    private Checkin(NodeId nodeId) {
-        this.nodeId = nodeId;
-        addAffectedItemId(nodeId);
+    private Checkin(NodeState nodeState) {
+        this.nodeState = nodeState;
+        addAffectedItemState(nodeState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -44,12 +44,12 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getNodeId() {
-        return nodeId;
+    public NodeState getNodeState() {
+        return nodeState;
     }
 
     //------------------------------------------------------------< Factory >---
-    public static Operation create(NodeId nodeId) {
-        return new Checkin(nodeId);
+    public static Operation create(NodeState nodeState) {
+        return new Checkin(nodeState);
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java Wed Aug 16 05:24:30 2006
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.AccessDeniedException;
@@ -31,11 +31,11 @@
  */
 public class Checkout extends AbstractOperation {
 
-    private final NodeId nodeId;
+    private final NodeState nodeState;
 
-    private Checkout(NodeId nodeId) {
-        this.nodeId = nodeId;
-        addAffectedItemId(nodeId);
+    private Checkout(NodeState nodeState) {
+        this.nodeState = nodeState;
+        addAffectedItemState(nodeState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -44,12 +44,12 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getNodeId() {
-        return nodeId;
+    public NodeState getNodeState() {
+        return nodeState;
     }
     
     //------------------------------------------------------------< Factory >---
-    public static Operation create(NodeId nodeId) {
-        return new Checkout(nodeId);
+    public static Operation create(NodeState nodeState) {
+        return new Checkout(nodeState);
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java Wed Aug 16 05:24:30 2006
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.AccessDeniedException;
@@ -31,16 +31,16 @@
  */
 public class LockOperation extends AbstractOperation {
 
-    private final NodeId nodeId;
+    private final NodeState nodeState;
     private final boolean isDeep;
     private final boolean isSessionScoped;
 
-    private LockOperation(NodeId nodeId, boolean isDeep, boolean isSessionScoped) {
-        this.nodeId = nodeId;
+    private LockOperation(NodeState nodeState, boolean isDeep, boolean isSessionScoped) {
+        this.nodeState = nodeState;
         this.isDeep = isDeep;
         this.isSessionScoped = isSessionScoped;
 
-        this.addAffectedItemId(nodeId);
+        this.addAffectedItemState(nodeState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -52,8 +52,8 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getNodeId() {
-        return nodeId;
+    public NodeState getNodeState() {
+        return nodeState;
     }
 
     public boolean isDeep() {
@@ -67,12 +67,12 @@
     //------------------------------------------------------------< Factory >---
     /**
      *
-     * @param nodeId
+     * @param nodeState
      * @param isDeep
      * @return
      */
-    public static Operation create(NodeId nodeId, boolean isDeep, boolean isSessionScoped) {
-        Operation lck = new LockOperation(nodeId, isDeep, isSessionScoped);
+    public static Operation create(NodeState nodeState, boolean isDeep, boolean isSessionScoped) {
+        Operation lck = new LockOperation(nodeState, isDeep, isSessionScoped);
         return lck;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java Wed Aug 16 05:24:30 2006
@@ -20,7 +20,8 @@
 import javax.jcr.AccessDeniedException;
 import javax.jcr.ItemExistsException;
 import javax.jcr.UnsupportedRepositoryOperationException;
-import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
+
 import javax.jcr.version.VersionException;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
@@ -30,12 +31,12 @@
  */
 public class LockRefresh extends AbstractOperation {
 
-    private final NodeId nodeId;
+    private final NodeState nodeState;
 
-    private LockRefresh(NodeId nodeId) {
-        this.nodeId = nodeId;
+    private LockRefresh(NodeState nodeState) {
+        this.nodeState = nodeState;
 
-        this.addAffectedItemId(nodeId);
+        this.addAffectedItemState(nodeState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -47,18 +48,18 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getNodeId() {
-        return nodeId;
+    public NodeState getNodeState() {
+        return nodeState;
     }
 
     //------------------------------------------------------------< Factory >---
     /**
      *
-     * @param nodeId
+     * @param nodeState
      * @return
      */
-    public static Operation create(NodeId nodeId) {
-        Operation lck = new LockRefresh(nodeId);
+    public static Operation create(NodeState nodeState) {
+        Operation lck = new LockRefresh(nodeState);
         return lck;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java Wed Aug 16 05:24:30 2006
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.AccessDeniedException;
@@ -31,12 +31,12 @@
  */
 public class LockRelease extends AbstractOperation {
 
-    private final NodeId nodeId;
+    private final NodeState nodeState;
 
-    private LockRelease(NodeId nodeId) {
-        this.nodeId = nodeId;
+    private LockRelease(NodeState nodeState) {
+        this.nodeState = nodeState;
 
-        this.addAffectedItemId(nodeId);
+        this.addAffectedItemState(nodeState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -48,18 +48,18 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getNodeId() {
-        return nodeId;
+    public NodeState getNodeState() {
+        return nodeState;
     }
 
     //------------------------------------------------------------< Factory >---
     /**
      *
-     * @param nodeId
+     * @param nodeState
      * @return
      */
-    public static Operation create(NodeId nodeId) {
-        Operation lck = new LockRelease(nodeId);
+    public static Operation create(NodeState nodeState) {
+        Operation lck = new LockRelease(nodeState);
         return lck;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java Wed Aug 16 05:24:30 2006
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.jcr2spi.operation;
 
 import org.apache.jackrabbit.jcr2spi.observation.InternalEventListener;
-import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.AccessDeniedException;
@@ -32,18 +32,18 @@
  */
 public class Merge extends AbstractOperation {
 
-    private final NodeId nodeId;
+    private final NodeState nodeState;
     private final String srcWorkspaceName;
     private final boolean bestEffort;
     private final InternalEventListener eventListener;
 
-    private Merge(NodeId nodeId, String srcWorkspaceName, boolean bestEffort, InternalEventListener eventListener) {
-        this.nodeId = nodeId;
+    private Merge(NodeState nodeState, String srcWorkspaceName, boolean bestEffort, InternalEventListener eventListener) {
+        this.nodeState = nodeState;
         this.srcWorkspaceName = srcWorkspaceName;
         this.bestEffort = bestEffort;
         this.eventListener = eventListener;
 
-        this.addAffectedItemId(nodeId);
+        this.addAffectedItemState(nodeState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -55,8 +55,8 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getNodeId() {
-        return nodeId;
+    public NodeState getNodeState() {
+        return nodeState;
     }
 
     public String getSourceWorkspaceName() {
@@ -74,11 +74,11 @@
     //------------------------------------------------------------< Factory >---
     /**
      *
-     * @param nodeId
+     * @param nodeState
      * @param srcWorkspaceName
      * @return
      */
-    public static Operation create(NodeId nodeId, String srcWorkspaceName, boolean bestEffort, InternalEventListener eventListener) {
-        return new Merge(nodeId, srcWorkspaceName, bestEffort, eventListener);
+    public static Operation create(NodeState nodeState, String srcWorkspaceName, boolean bestEffort, InternalEventListener eventListener) {
+        return new Merge(nodeState, srcWorkspaceName, bestEffort, eventListener);
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java Wed Aug 16 05:24:30 2006
@@ -18,11 +18,11 @@
 
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.jcr2spi.HierarchyManager;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.name.MalformedPathException;
 import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.spi.NodeId;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -42,19 +42,20 @@
 
     private static Logger log = LoggerFactory.getLogger(Move.class);
 
-    private final NodeId srcId;
-    private final NodeId srcParentId;
-    private final NodeId destParentId;
+    private final NodeState srcState;
+    private final NodeState srcParentState;
+    private final NodeState destParentState;
     private final QName destName;
 
-    private Move(NodeId srcNodeId, NodeId srcParentId, NodeId destParentId, QName destName) {
-        srcId = srcNodeId;
-        this.srcParentId = srcParentId;
-        this.destParentId = destParentId;
+    private Move(NodeState srcNodeState, NodeState srcParentState, NodeState destParentState, QName destName) {
+        this.srcState = srcNodeState;
+        this.srcParentState = srcParentState;
+        this.destParentState = destParentState;
         this.destName = destName;
-        addAffectedItemId(srcNodeId);
-        addAffectedItemId(srcParentId);
-        addAffectedItemId(destParentId);
+        
+        addAffectedItemState(srcNodeState);
+        addAffectedItemState(srcParentState);
+        addAffectedItemState(destParentState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -67,16 +68,16 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getNodeId() {
-        return srcId;
+    public NodeState getNodeState() {
+        return srcState;
     }
 
-    public NodeId getSourceParentId() {
-        return srcParentId;
+    public NodeState getSourceParentState() {
+        return srcParentState;
     }
 
-    public NodeId getDestinationParentId() {
-        return destParentId;
+    public NodeState getDestinationParentState() {
+        return destParentState;
     }
 
     public QName getDestinationName() {
@@ -113,10 +114,10 @@
             throw new RepositoryException(msg);
         }
 
-        NodeId srcId = getNodeId(srcPath, hierMgr, nsResolver);
-        NodeId srcParentId = getNodeId(srcPath.getAncestor(1), hierMgr, nsResolver);
-        NodeId destParentId = getNodeId(destPath.getAncestor(1), hierMgr, nsResolver);
-        Move move = new Move(srcId, srcParentId, destParentId, destElement.getName());
+        NodeState srcState = getNodeState(srcPath, hierMgr, nsResolver);
+        NodeState srcParentState = getNodeState(srcPath.getAncestor(1), hierMgr, nsResolver);
+        NodeState destParentState = getNodeState(destPath.getAncestor(1), hierMgr, nsResolver);
+        Move move = new Move(srcState, srcParentState, destParentState, destElement.getName());
         return move;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java Wed Aug 16 05:24:30 2006
@@ -22,7 +22,8 @@
 import javax.jcr.ItemExistsException;
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.RepositoryException;
-import org.apache.jackrabbit.spi.ItemId;
+import org.apache.jackrabbit.jcr2spi.state.ItemState;
+
 import javax.jcr.version.VersionException;
 import java.util.Collection;
 
@@ -47,10 +48,9 @@
     public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException;
 
     /**
-     * A collection of {@link ItemId}s that are
-     * affected by this operation.
+     * A collection of {@link ItemState}s that are affected by this operation.
      *
-     * @return collection of affected <code>ItemId</code>s.
+     * @return collection of affected <code>ItemState</code>s.
      */
-    public Collection getAffectedItemIds();
+    public Collection getAffectedItemStates();
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java Wed Aug 16 05:24:30 2006
@@ -17,8 +17,7 @@
 package org.apache.jackrabbit.jcr2spi.operation;
 
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
-import org.apache.jackrabbit.spi.ItemId;
-import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.AccessDeniedException;
 import javax.jcr.RepositoryException;
@@ -30,14 +29,13 @@
  */
 public class Remove extends AbstractOperation {
 
-    private ItemId removeId;
-    private NodeId parentId;
+    private ItemState removeState;
 
-    private Remove(ItemId removeId, NodeId parentId) {
-        this.removeId = removeId;
-        this.parentId = parentId;
-        addAffectedItemId(removeId);
-        addAffectedItemId(parentId);
+    private Remove(ItemState removeState) {
+        this.removeState = removeState;
+
+        addAffectedItemState(removeState);
+        addAffectedItemState(removeState.getParent());
     }
 
     //----------------------------------------------------------< Operation >---
@@ -51,21 +49,17 @@
 
     //----------------------------------------< Access Operation Parameters >---
 
-    public ItemId getRemoveId() {
-        return removeId;
+    public ItemState getRemoveState() {
+        return removeState;
     }
 
-    public NodeId getParentId() {
-        return parentId;
+    public NodeState getParentState() {
+        return removeState.getParent();
     }
 
     //------------------------------------------------------------< Factory >---
     public static Operation create(ItemState state) {
-        Remove rm = new Remove(state.getId(), state.getParent().getNodeId());
+        Remove rm = new Remove(state);
         return rm;
-    }
-
-    public static Operation create(ItemId removeId, NodeId parentId) {
-        return new Remove(removeId, parentId);
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java Wed Aug 16 05:24:30 2006
@@ -18,8 +18,8 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.AccessDeniedException;
@@ -36,14 +36,16 @@
 
     private static Logger log = LoggerFactory.getLogger(RemoveLabel.class);
 
-    private final NodeId versionHistoryId;
-    private final NodeId versionId;
+    private final NodeState versionHistoryState;
+    private final NodeState versionState;
     private final QName label;
 
-    private RemoveLabel(NodeId versionHistoryId, NodeId versionId, QName label) {
-        this.versionHistoryId = versionHistoryId;
-        this.versionId = versionId;
+    private RemoveLabel(NodeState versionHistoryState, NodeState versionState, QName label) {
+        this.versionHistoryState = versionHistoryState;
+        this.versionState = versionState;
         this.label = label;
+
+        // TODO: add affected states. required?
     }
     //----------------------------------------------------------< Operation >---
     /**
@@ -62,12 +64,12 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getVersionHistoryId() {
-        return versionHistoryId;
+    public NodeState getVersionHistoryState() {
+        return versionHistoryState;
     }
 
-    public NodeId getVersionId() {
-        return versionId;
+    public NodeState getVersionState() {
+        return versionState;
     }
 
     public QName getLabel() {
@@ -77,13 +79,12 @@
     //------------------------------------------------------------< Factory >---
     /**
      *
-     * @param versionHistoryId
-     * @param versionId
+     * @param versionHistoryState
+     * @param versionState
      * @param label
-     * @param moveLabel
      * @return
      */
-    public static Operation create(NodeId versionHistoryId, NodeId versionId, QName label) {
-        return new RemoveLabel(versionHistoryId, versionId, label);
+    public static Operation create(NodeState versionHistoryState, NodeState versionState, QName label) {
+        return new RemoveLabel(versionHistoryState, versionState, label);
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java Wed Aug 16 05:24:30 2006
@@ -31,15 +31,15 @@
  */
 public class ReorderNodes extends AbstractOperation {
 
-    private final NodeId parentId;
+    private final NodeState parentState;
     private final NodeId insertId;
     private final NodeId beforeId;
 
-    private ReorderNodes(NodeId parentId, NodeId insertId, NodeId beforeId) {
-        this.parentId = parentId;
+    private ReorderNodes(NodeState parentState, NodeId insertId, NodeId beforeId) {
+        this.parentState = parentState;
         this.insertId = insertId;
         this.beforeId = beforeId;
-        addAffectedItemId(parentId);
+        addAffectedItemState(parentState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -52,8 +52,8 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getParentId() {
-        return parentId;
+    public NodeState getParentState() {
+        return parentState;
     }
 
     public NodeId getInsertNodeId() {
@@ -70,7 +70,7 @@
                                    Path.PathElement beforeName) {
         NodeId insertId = parentState.getChildNodeEntry(srcName.getName(), srcName.getNormalizedIndex()).getId();
         NodeId beforeId = (beforeName == null) ? null : parentState.getChildNodeEntry(beforeName.getName(), beforeName.getNormalizedIndex()).getId();
-        Operation op = new ReorderNodes(parentState.getNodeId(), insertId, beforeId);
+        Operation op = new ReorderNodes(parentState, insertId, beforeId);
         return op;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java Wed Aug 16 05:24:30 2006
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.AccessDeniedException;
@@ -31,17 +31,18 @@
  */
 public class ResolveMergeConflict extends AbstractOperation {
 
-    private final NodeId nodeId;
-    private final NodeId versionId;
+    private final NodeState nodeState;
+    private final NodeState versionState;
     private final boolean resolveDone;
 
-    private ResolveMergeConflict(NodeId nodeId, NodeId versionId, boolean resolveDone) {
-        this.nodeId = nodeId;
-        this.versionId = versionId;
+    private ResolveMergeConflict(NodeState nodeState, NodeState versionState, boolean resolveDone) {
+        this.nodeState = nodeState;
+        this.versionState = versionState;
         this.resolveDone = resolveDone;
 
-        addAffectedItemId(nodeId);
-        addAffectedItemId(versionId);
+        // TODO: correct? needed?
+        addAffectedItemState(nodeState);
+        addAffectedItemState(versionState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -53,12 +54,12 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getNodeId() {
-        return nodeId;
+    public NodeState getNodeState() {
+        return nodeState;
     }
 
-    public NodeId getVersionId() {
-        return versionId;
+    public NodeState getVersionState() {
+        return versionState;
     }
 
     public boolean resolveDone() {
@@ -68,12 +69,12 @@
     //------------------------------------------------------------< Factory >---
     /**
      *
-     * @param nodeId
-     * @param versionId
+     * @param nodeState
+     * @param versionState
      * @param resolveDone
      */
-    public static Operation create(NodeId nodeId, NodeId versionId, boolean resolveDone) {
-        ResolveMergeConflict up = new ResolveMergeConflict(nodeId, versionId, resolveDone);
+    public static Operation create(NodeState nodeState, NodeState versionState, boolean resolveDone) {
+        ResolveMergeConflict up = new ResolveMergeConflict(nodeState, versionState, resolveDone);
         return up;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java Wed Aug 16 05:24:30 2006
@@ -41,10 +41,7 @@
         this.versionIds = versionIds;
         this.removeExisting = removeExisting;
 
-        addAffectedItemId(nodeId);
-        for (int i = 0; i < versionIds.length; i++) {
-            addAffectedItemId(versionIds[i]);
-        }
+        // TODO: affected states... needed?
     }
 
     //----------------------------------------------------------< Operation >---

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java Wed Aug 16 05:24:30 2006
@@ -16,9 +16,9 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.spi.PropertyId;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
+import org.apache.jackrabbit.jcr2spi.state.ItemStateException;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.AccessDeniedException;
@@ -31,14 +31,23 @@
  */
 public class SetMixin extends AbstractOperation {
 
-    private final NodeId nodeId;
+    private final NodeState nodeState;
     private final QName[] mixinNames;
 
-    private SetMixin(PropertyId propertyId, QName[] mixinNames) {
-        this.nodeId = propertyId.getParentId();
+    private SetMixin(NodeState nodeState, QName[] mixinNames) {
+        this.nodeState = nodeState;
         this.mixinNames = mixinNames;
-        addAffectedItemId(nodeId);
-        addAffectedItemId(propertyId);
+
+        // set affected states
+        addAffectedItemState(nodeState);
+        // TODO: correct?
+        if (nodeState.hasPropertyName(QName.JCR_MIXINTYPES)) {
+            try {
+                addAffectedItemState(nodeState.getPropertyState(QName.JCR_MIXINTYPES));
+            } catch (ItemStateException e) {
+                // should never occur
+            }
+        }
     }
 
     //----------------------------------------------------------< Operation >---
@@ -51,8 +60,8 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getNodeId() {
-        return nodeId;
+    public NodeState getNodeState() {
+        return nodeState;
     }
 
     public QName[] getMixinNames() {
@@ -61,8 +70,8 @@
 
     //------------------------------------------------------------< Factory >---
 
-    public static Operation create(PropertyId mixinPropertyId, QName[] mixinNames) {
-        SetMixin sm = new SetMixin(mixinPropertyId, mixinNames);
+    public static Operation create(NodeState nodeState, QName[] mixinNames) {
+        SetMixin sm = new SetMixin(nodeState, mixinNames);
         return sm;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java Wed Aug 16 05:24:30 2006
@@ -23,7 +23,6 @@
 import javax.jcr.AccessDeniedException;
 import javax.jcr.ItemExistsException;
 import javax.jcr.UnsupportedRepositoryOperationException;
-import org.apache.jackrabbit.spi.PropertyId;
 import org.apache.jackrabbit.value.QValue;
 
 import javax.jcr.version.VersionException;
@@ -35,17 +34,18 @@
  */
 public class SetPropertyValue extends AbstractOperation {
 
-    private final PropertyId propertyId;
+    private final PropertyState propertyState;
     private final QValue[] values;
     private final int propertyType;
     private final boolean isMultiValued;
 
-    private SetPropertyValue(PropertyId propertyId, int propertyType, QValue[] values, boolean isMultiValued) {
-        this.propertyId = propertyId;
+    private SetPropertyValue(PropertyState propertyState, int propertyType, QValue[] values, boolean isMultiValued) {
+        this.propertyState = propertyState;
         this.propertyType = propertyType;
         this.values = values;
         this.isMultiValued = isMultiValued;
-        addAffectedItemId(propertyId);
+        
+        addAffectedItemState(propertyState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -58,8 +58,8 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public PropertyId getPropertyId() {
-        return propertyId;
+    public PropertyState getPropertyState() {
+        return propertyState;
     }
 
     public int getPropertyType() {
@@ -77,7 +77,7 @@
     //------------------------------------------------------------< Factory >---
     public static Operation create(PropertyState propState, QValue[] iva,
                                    int valueType) {
-        SetPropertyValue sv = new SetPropertyValue(propState.getPropertyId(), valueType, iva, propState.isMultiValued());
+        SetPropertyValue sv = new SetPropertyValue(propState, valueType, iva, propState.isMultiValued());
         return sv;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java Wed Aug 16 05:24:30 2006
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.AccessDeniedException;
@@ -31,14 +31,14 @@
  */
 public class Update extends AbstractOperation {
 
-    private final NodeId nodeId;
+    private final NodeState nodeState;
     private final String srcWorkspaceName;
 
-    private Update(NodeId nodeId, String srcWorkspaceName) {
-        this.nodeId = nodeId;
+    private Update(NodeState nodeState, String srcWorkspaceName) {
+        this.nodeState = nodeState;
         this.srcWorkspaceName = srcWorkspaceName;
 
-        this.addAffectedItemId(nodeId);
+        this.addAffectedItemState(nodeState);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -50,8 +50,8 @@
     }
 
     //----------------------------------------< Access Operation Parameters >---
-    public NodeId getNodeId() {
-        return nodeId;
+    public NodeState getNodeState() {
+        return nodeState;
     }
 
     public String getSourceWorkspaceName() {
@@ -61,12 +61,12 @@
     //------------------------------------------------------------< Factory >---
     /**
      *
-     * @param nodeId
+     * @param nodeState
      * @param srcWorkspaceName
      * @return
      */
-    public static Operation create(NodeId nodeId, String srcWorkspaceName) {
-        Update up = new Update(nodeId, srcWorkspaceName);
+    public static Operation create(NodeState nodeState, String srcWorkspaceName) {
+        Update up = new Update(nodeState, srcWorkspaceName);
         return up;
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java?rev=431887&r1=431886&r2=431887&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java Wed Aug 16 05:24:30 2006
@@ -158,7 +158,7 @@
      * Copy state information from another state into this state
      * @param state source state information
      */
-    protected abstract void copy(ItemState state);
+    abstract void copy(ItemState state);
 
     /**
      * Pull state information from overlayed state.
@@ -311,7 +311,7 @@
     /**
      * Notify the life cycle listeners that this state has changed its status.
      */
-    protected void notifyStatusChanged(int oldStatus) {
+    private void notifyStatusChanged(int oldStatus) {
         // copy listeners to array to avoid ConcurrentModificationException
         ItemStateListener[] la;
         synchronized (listeners) {



Mime
View raw message