jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1167238 [1/2] - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src: main/java/org/apache/jackrabbit/jcr2spi/ main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ main/java/org/apache/jackrabbit/jcr2spi/lock/ main/java/org/apache/jac...
Date Fri, 09 Sep 2011 15:04:43 GMT
Author: mduerig
Date: Fri Sep  9 15:04:41 2011
New Revision: 1167238

URL: http://svn.apache.org/viewvc?rev=1167238&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP) 
refactor: convert Status to enum

Added:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status0.java   (contents, props changed)
      - copied, changed from r1167084, jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status.java
Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.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/hierarchy/ChildNodeEntriesImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryValidation.java
    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/HierarchyEntryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/UniqueIdResolver.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/AbstractItemStateFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.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/ItemStateLifeCycleListener.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
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/Status.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/StateUtility.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AddPropertyTest.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ExternalModificationTest.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MixinModificationTest.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MoveTest.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java Fri Sep  9 15:04:41 2011
@@ -25,7 +25,7 @@ import org.apache.jackrabbit.jcr2spi.sta
 import org.apache.jackrabbit.jcr2spi.state.ItemStateLifeCycleListener;
 import org.apache.jackrabbit.jcr2spi.state.ItemStateValidator;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
@@ -142,12 +142,12 @@ public abstract class ItemImpl implement
 
     @Override
     public boolean isNew() {
-        return state.getStatus() == Status.NEW;
+        return state.getStatus() == Status0.NEW;
     }
 
     @Override
     public boolean isModified() {
-        return state.getStatus() == Status.EXISTING_MODIFIED;
+        return state.getStatus() == Status0.EXISTING_MODIFIED;
     }
 
     @Override
@@ -173,7 +173,7 @@ public abstract class ItemImpl implement
             if (session.getWorkspace().getName().equals(otherWspName)) {
                 // in addition they must provide the same id irrespective of
                 // any transient modifications.
-                if (state.getStatus() != Status.NEW && other.state.getStatus() != Status.NEW ) {
+                if (state.getStatus() != Status0.NEW && other.state.getStatus() != Status0.NEW ) {
                     // if any ancestor is _invalidated_ force it's reload in
                     // order to detect id changes.
                     updateId(state);
@@ -204,16 +204,16 @@ public abstract class ItemImpl implement
     public void refresh(boolean keepChanges) throws RepositoryException {
         // check session status
         session.checkIsAlive();
-        int status = state.getStatus();
+        Status0 status = state.getStatus();
         // check if item has been removed by this or another session
-        if (Status.isTerminal(status) || Status.EXISTING_REMOVED == status) {
+        if (Status0.isTerminal(status) || Status0.EXISTING_REMOVED == status) {
             throw new InvalidItemStateException("Item '" + this + "' doesn't exist anymore");
         }
 
         // If 'keepChanges' is true, items that do not have changes pending have
         //   their state refreshed to reflect the current saved state
         if (keepChanges) {
-            if (status != Status.NEW  &&
+            if (status != Status0.NEW  &&
                 session.getCacheBehaviour() != CacheBehaviour.OBSERVATION) {
                 // merge current transient modifications with latest changes
                 // from the 'server'.
@@ -223,7 +223,7 @@ public abstract class ItemImpl implement
             }
         } else {
             // check status of item state
-            if (status == Status.NEW) {
+            if (status == Status0.NEW) {
                 String msg = "Cannot refresh a new item (" + safeGetJCRPath() + ").";
                 log.debug(msg);
                 throw new RepositoryException(msg);
@@ -259,48 +259,51 @@ public abstract class ItemImpl implement
      * @param previousStatus
      */
     @Override
-    public void statusChanged(ItemState state, int previousStatus) {
+    public void statusChanged(ItemState state, Status0 previousStatus) {
         if (state != this.state) {
             throw new IllegalArgumentException("Invalid argument: ItemState with changed status must be this.state.");
         }
 
         switch (state.getStatus()) {
             // Nothing to do for
-            // - Status#EXISTING : modifications reverted or saved
+            // - Status0#EXISTING : modifications reverted or saved
             //   inform listeners about an update (status was MODIFIED before)
             //   or a simple refresh without modification (status was INVALIDATED).
-            case Status.EXISTING:
-                if (previousStatus == Status.INVALIDATED || previousStatus == Status.MODIFIED) {
-                    notifyUpdated(previousStatus == Status.MODIFIED);
+            case EXISTING:
+                if (previousStatus == Status0.INVALIDATED || previousStatus == Status0.MODIFIED) {
+                    notifyUpdated(previousStatus == Status0.MODIFIED);
                 }
                 break;
 
             // Nothing to do for
-            // - Status#EXISTING_MODIFIED : transient modification
-            // - Status#STALE_MODIFIED : external modifications while transient changes pending
-            // - Status#STALE_DESTROYED : external modifications while transient changes pending
-            // - Status#MODIFIED : externally modified -> marker for sessionISM states only
-            // - Status#EXISTING_REMOVED : transient removal
-            case Status.EXISTING_MODIFIED:
-            case Status.STALE_MODIFIED:
-            case Status.STALE_DESTROYED:
-            case Status.MODIFIED:
-            case Status.EXISTING_REMOVED:
+            // - Status0#EXISTING_MODIFIED : transient modification
+            // - Status0#STALE_MODIFIED : external modifications while transient changes pending
+            // - Status0#STALE_DESTROYED : external modifications while transient changes pending
+            // - Status0#MODIFIED : externally modified -> marker for sessionISM states only
+            // - Status0#EXISTING_REMOVED : transient removal
+            case EXISTING_MODIFIED:
+            case STALE_MODIFIED:
+            case STALE_DESTROYED:
+            case MODIFIED:
+            case EXISTING_REMOVED:
                 break;
 
             // Notify listeners that this item is transiently or permanently
             // destroyed.
-            // - Status#REMOVED : permanent removal. item will never get back to life
-            case Status.REMOVED:
+            // - Status0#REMOVED : permanent removal. item will never get back to life
+            case REMOVED:
                 state.removeListener(this);
                 notifyDestroyed();
                 break;
 
             // Invalid status. A state can never change its state to 'New'.
-            case Status.NEW:
+            case NEW:
                 // should never happen.
                 log.error("invalid state change to STATUS_NEW");
                 break;
+            case _UNDEFINED_:
+            case INVALIDATED:
+                break;
         }
     }
 
@@ -348,14 +351,14 @@ public abstract class ItemImpl implement
         // check session status
         session.checkIsAlive();
         // check status of this item for read operation
-        if (state.getStatus() == Status.INVALIDATED) {
+        if (state.getStatus() == Status0.INVALIDATED) {
             // refresh to get current status from persistent storage
             state.getHierarchyEntry().reload(false);
         }
         // now check if valid
         if (!state.isValid()) {
-            throw new InvalidItemStateException("Item '" + this + "' doesn't exist anymore. (Status = " +
-                    Status.getName(state.getStatus())+ ')');
+            throw new InvalidItemStateException("Item '" + this + "' doesn't exist anymore. (Status0 = " +
+                    state.getStatus() + ')');
         }
     }
 
@@ -484,7 +487,7 @@ public abstract class ItemImpl implement
      */
     private static void updateId(ItemState state) throws RepositoryException {
         HierarchyEntry he = state.getHierarchyEntry();
-        while (he.getStatus() != Status.INVALIDATED) {
+        while (he.getStatus() != Status0.INVALIDATED) {
             he = he.getParent();
             if (he == null) {
                 // root reached without intermediate invalidated entry

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java Fri Sep  9 15:04:41 2011
@@ -24,7 +24,7 @@ import org.apache.jackrabbit.jcr2spi.sta
 import org.apache.jackrabbit.jcr2spi.state.ItemStateCreationListener;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.jcr2spi.version.VersionHistoryImpl;
 import org.apache.jackrabbit.jcr2spi.version.VersionImpl;
@@ -330,9 +330,9 @@ public class ItemManagerImpl implements 
     }
 
     @Override
-    public void statusChanged(ItemState state, int previousStatus) {
-        // stop listening if an state reached Status.REMOVED.
-        if (Status.REMOVED == state.getStatus()) {
+    public void statusChanged(ItemState state, Status0 previousStatus) {
+        // stop listening if an state reached Status0.REMOVED.
+        if (Status0.REMOVED == state.getStatus()) {
             state.removeListener(this);
         }
         // otherwise: nothing to do -> Item is listening to status changes and

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java Fri Sep  9 15:04:41 2011
@@ -32,7 +32,7 @@ import org.apache.jackrabbit.jcr2spi.ope
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
 import org.apache.jackrabbit.jcr2spi.state.ItemStateValidator;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.jcr2spi.util.StateUtility;
 import org.apache.jackrabbit.spi.Name;
@@ -700,7 +700,7 @@ public class NodeImpl extends ItemImpl i
      */
     private List<Name> getMixinTypes() {
         Name[] mixinValue;
-        if (getNodeState().getStatus() == Status.EXISTING) {
+        if (getNodeState().getStatus() == Status0.EXISTING) {
             // jcr:mixinTypes must correspond to the mixins present on the node state.
             mixinValue = getNodeState().getMixinTypeNames();
         } else {
@@ -1181,7 +1181,7 @@ public class NodeImpl extends ItemImpl i
             }
         }
         // NEW nodes with inherited-mixins -> mixin not yet active
-        if (getNodeState().getStatus() == Status.NEW &&
+        if (getNodeState().getStatus() == Status0.NEW &&
             session.getNodeTypeManager().getNodeType(qName).isMixin()) {
             return false;
         }

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=1167238&r1=1167237&r2=1167238&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  9 15:04:41 2011
@@ -61,7 +61,7 @@ import org.apache.jackrabbit.jcr2spi.sta
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
 import org.apache.jackrabbit.jcr2spi.state.ItemStateFactory;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.jcr2spi.state.TransientISFactory;
 import org.apache.jackrabbit.jcr2spi.state.TransientItemStateFactory;
 import org.apache.jackrabbit.jcr2spi.state.UpdateableItemStateManager;
@@ -618,7 +618,7 @@ public final class WorkspaceManager impl
     @Override
     public boolean isGranted(NodeState parentState, Path relPath, String[] actions)
             throws RepositoryException {
-        if (parentState.getStatus() == Status.NEW) {
+        if (parentState.getStatus() == Status0.NEW) {
             return true;
         }
         // TODO: check again.
@@ -634,20 +634,20 @@ public final class WorkspaceManager impl
     @Override
     public boolean isGranted(ItemState itemState, String[] actions) throws RepositoryException {
         // a 'new' state can always be read, written and removed
-        return itemState.getStatus() == Status.NEW || service.isGranted(sessionInfo, itemState.getWorkspaceId(), actions);
+        return itemState.getStatus() == Status0.NEW || service.isGranted(sessionInfo, itemState.getWorkspaceId(), actions);
     }
 
     @Override
     public boolean canRead(ItemState itemState) throws RepositoryException {
         // a 'new' state can always be read
-        return itemState.getStatus() == Status.NEW || service.isGranted(sessionInfo, itemState.getWorkspaceId(),
+        return itemState.getStatus() == Status0.NEW || service.isGranted(sessionInfo, itemState.getWorkspaceId(),
                 AccessManager.READ);
     }
 
     @Override
     public boolean canRemove(ItemState itemState) throws RepositoryException {
         // a 'new' state can always be removed again
-        return itemState.getStatus() == Status.NEW || service.isGranted(sessionInfo, itemState.getWorkspaceId(),
+        return itemState.getStatus() == Status0.NEW || service.isGranted(sessionInfo, itemState.getWorkspaceId(),
                 AccessManager.REMOVE);
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java Fri Sep  9 15:04:41 2011
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.jcr2spi.hierarchy;
 
 import org.apache.commons.collections.list.AbstractLinkedList;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.spi.ChildInfo;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
@@ -114,9 +114,9 @@ final class ChildNodeEntriesImpl impleme
 
     @Override
     public boolean isComplete() {
-        return parent.getStatus() != Status.INVALIDATED && complete ||
-                parent.getStatus() == Status.NEW ||
-                Status.isTerminal(parent.getStatus());
+        return parent.getStatus() != Status0.INVALIDATED && complete ||
+                parent.getStatus() == Status0.NEW ||
+                Status0.isTerminal(parent.getStatus());
     }
 
     @Override

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryValidation.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryValidation.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryValidation.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryValidation.java Fri Sep  9 15:04:41 2011
@@ -16,12 +16,10 @@
  */
 package org.apache.jackrabbit.jcr2spi.hierarchy;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 
-import javax.jcr.RepositoryException;
 import javax.jcr.ItemNotFoundException;
+import javax.jcr.RepositoryException;
 import java.util.Iterator;
 
 /**
@@ -93,8 +91,8 @@ final class EntryValidation {
         if (cne == null) {
             return false;
         }
-        int status = cne.getStatus();
-        return status != Status.NEW && status != Status.REMOVED;
+        Status0 status = cne.getStatus();
+        return status != Status0.NEW && status != Status0.REMOVED;
     }
 
     /**

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=1167238&r1=1167237&r2=1167238&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  9 15:04:41 2011
@@ -18,7 +18,7 @@ package org.apache.jackrabbit.jcr2spi.hi
 
 import org.apache.jackrabbit.jcr2spi.operation.Operation;
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.spi.ItemInfoCache;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
@@ -67,13 +67,13 @@ public interface HierarchyEntry {
     /**
      * If this {@code HierarchyEntry} provides an underlying
      * {@code ItemState} this method returns the status of that state,
-     * otherwise it returns {@link Status#_UNDEFINED_}.
+     * otherwise it returns {@link org.apache.jackrabbit.jcr2spi.state.Status0#_UNDEFINED_}.
      *
-     * @return Status of the ItemState or {@link Status#_UNDEFINED_} if this
+     * @return Status of the ItemState or {@link org.apache.jackrabbit.jcr2spi.state.Status0#_UNDEFINED_} if this
      * entry has not been resolved yet.
      * @see ItemState#getStatus()
      */
-    int getStatus();
+    Status0 getStatus();
 
     /**
      * Returns {@code true} if the referenced {@code ItemState} is
@@ -116,7 +116,7 @@ public interface HierarchyEntry {
      * also invalidates the child entries recursively.<br>
      * Note, that in contrast to {@link HierarchyEntry#reload(boolean)}
      * this method only sets the status of this item state to {@link
-     * Status#INVALIDATED} and does not actually update it with the persistent
+     * org.apache.jackrabbit.jcr2spi.state.Status0#INVALIDATED} and does not actually update it with the persistent
      * state in the repository.
      */
     void invalidate(boolean recursive);
@@ -130,7 +130,7 @@ public interface HierarchyEntry {
     /**
      * Traverses the hierarchy and reverts all transient modifications such as
      * adding, modifying or removing item states. 'Existing' item states
-     * are reverted to their initial state and their status is reset to {@link Status#EXISTING}.
+     * are reverted to their initial state and their status is reset to {@link org.apache.jackrabbit.jcr2spi.state.Status0#EXISTING}.
      *
      * @throws RepositoryException if an error occurs.
      */
@@ -147,8 +147,8 @@ public interface HierarchyEntry {
 
     /**
      * Traverses the hierarchy and marks all available item states as transiently
-     * removed. They will change their status to either {@link Status#EXISTING_REMOVED} if
-     * the item is existing in the persistent storage or {@link Status#REMOVED}
+     * removed. They will change their status to either {@link org.apache.jackrabbit.jcr2spi.state.Status0#EXISTING_REMOVED} if
+     * the item is existing in the persistent storage or {@link org.apache.jackrabbit.jcr2spi.state.Status0#REMOVED}
      * if the item has been transiently added before. In the latter case, the
      * corresponding HierarchyEntries can be removed as well from their parent.
      *
@@ -161,8 +161,8 @@ public interface HierarchyEntry {
 
     /**
      * Removes this {@code HierarchyEntry} from its parent and sets the
-     * status of the underlying ItemState to {@link Status#REMOVED} or to
-     * {@link Status#STALE_DESTROYED}, respectively. If this entry is a
+     * status of the underlying ItemState to {@link org.apache.jackrabbit.jcr2spi.state.Status0#REMOVED} or to
+     * {@link org.apache.jackrabbit.jcr2spi.state.Status0#STALE_DESTROYED}, respectively. If this entry is a
      * NodeEntry all descending ItemStates must get their status changed as well.
      */
     void remove();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java Fri Sep  9 15:04:41 2011
@@ -16,11 +16,10 @@
  */
 package org.apache.jackrabbit.jcr2spi.hierarchy;
 
-import com.sun.xml.internal.bind.util.Which;
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
 import org.apache.jackrabbit.jcr2spi.state.ItemState.MergeResult;
 import org.apache.jackrabbit.jcr2spi.state.ItemStateFactory;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.jcr2spi.state.TransientItemStateFactory;
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.ItemInfoCache;
@@ -140,7 +139,7 @@ abstract class HierarchyEntryImpl implem
                 remove();
                 throw e;
             }
-        } else if (state.getStatus() == Status.INVALIDATED) {
+        } else if (state.getStatus() == Status0.INVALIDATED) {
             // completely reload this entry, but don't reload recursively
             reload(false);
         }
@@ -219,10 +218,10 @@ abstract class HierarchyEntryImpl implem
     }
 
     @Override
-    public int getStatus() {
+    public Status0 getStatus() {
         ItemState state = internalGetItemState();
         if (state == null) {
-            return Status._UNDEFINED_;
+            return Status0._UNDEFINED_;
         } else {
             return state.getStatus();
         }
@@ -257,13 +256,13 @@ abstract class HierarchyEntryImpl implem
         } else {
             // was already resolved before -> merge the existing state
             // with the passed state.
-            int currentStatus = currentState.getStatus();
-            boolean keepChanges = Status.isTransient(currentStatus) || Status.isStale(currentStatus);
+            Status0 currentStatus = currentState.getStatus();
+            boolean keepChanges = Status0.isTransient(currentStatus) || Status0.isStale(currentStatus);
             MergeResult mergeResult = currentState.merge(state, keepChanges);
-            if (currentStatus == Status.INVALIDATED) {
-                currentState.setStatus(Status.EXISTING);
+            if (currentStatus == Status0.INVALIDATED) {
+                currentState.setStatus(Status0.EXISTING);
             } else if (mergeResult.modified()) {
-                currentState.setStatus(Status.MODIFIED);
+                currentState.setStatus(Status0.MODIFIED);
             } // else: not modified. just leave status as it is.
             mergeResult.dispose();
         }
@@ -290,52 +289,57 @@ abstract class HierarchyEntryImpl implem
             return;
         }
 
-        int oldStatus = state.getStatus();
+        Status0 oldStatus = state.getStatus();
         switch (oldStatus) {
-            case Status.EXISTING_MODIFIED:
-            case Status.STALE_MODIFIED:
+            case EXISTING_MODIFIED:
+            case STALE_MODIFIED:
                 // revert state modifications
                 state.revert();
-                state.setStatus(Status.EXISTING);
+                state.setStatus(Status0.EXISTING);
                 break;
-            case Status.EXISTING_REMOVED:
+            case EXISTING_REMOVED:
                 // revert state modifications
                 state.revert();
-                state.setStatus(Status.EXISTING);
+                state.setStatus(Status0.EXISTING);
                 break;
-            case Status.NEW:
+            case NEW:
                 // reverting a NEW state is equivalent to its removal.
                 // however: no need remove the complete hierarchy as revert is
                 // always related to Item#refresh(false) which affects the
                 // complete tree (and all add-operations within it) anyway.
-                state.setStatus(Status.REMOVED);
+                state.setStatus(Status0.REMOVED);
                 parent.internalRemoveChildEntry(this);
                 break;
-            case Status.STALE_DESTROYED:
+            case STALE_DESTROYED:
                 // state does not exist any more -> reverting of pending
                 // transient changes (that lead to the stale status) can be
                 // omitted and the entry is complete removed instead.
                 remove();
                 break;
-            default:
+            case _UNDEFINED_:
+            case INVALIDATED:
+            case EXISTING:
+            case MODIFIED:
+            case REMOVED:
                 // Cannot revert EXISTING, REMOVED, INVALIDATED, MODIFIED states.
                 // State was implicitly reverted or external modifications
                 // reverted the modification.
                 log.debug("State with status " + oldStatus + " cannot be reverted.");
+                break;
         }
     }
 
     @Override
     public void reload(boolean recursive) {
-        int status = getStatus();
-        if (status == Status._UNDEFINED_) {
+        Status0 status = getStatus();
+        if (status == Status0._UNDEFINED_) {
             // unresolved: entry will be loaded and validated upon resolution.
             return;
         }
-        if (Status.isTransient(status) || Status.isStale(status) || Status.isTerminal(status)) {
+        if (Status0.isTransient(status) || Status0.isStale(status) || Status0.isTerminal(status)) {
             // transient || stale: avoid reloading
             // new || terminal: cannot be reloaded from persistent layer anyway.
-            log.debug("Skip reload for item with status " + Status.getName(status) + '.');
+            log.debug("Skip reload for item with status " + status + '.');
             return;
         }
 
@@ -370,27 +374,32 @@ abstract class HierarchyEntryImpl implem
 
         // if during recursive removal an invalidated entry is found, reload
         // it in order to determine the current status.
-        if (state.getStatus() == Status.INVALIDATED) {
+        if (state.getStatus() == Status0.INVALIDATED) {
             reload(false);
         }
 
         switch (state.getStatus()) {
-            case Status.NEW:
-                state.setStatus(Status.REMOVED);
+            case NEW:
+                state.setStatus(Status0.REMOVED);
                 parent.internalRemoveChildEntry(this);
                 break;
-            case Status.EXISTING:
-            case Status.EXISTING_MODIFIED:
-                state.setStatus(Status.EXISTING_REMOVED);
+            case EXISTING:
+            case EXISTING_MODIFIED:
+                state.setStatus(Status0.EXISTING_REMOVED);
                 // NOTE: parent does not need to be informed. an transiently
                 // removed propertyEntry is automatically moved to the 'attic'
                 // if a conflict with a new entry occurs.
                 break;
-            case Status.REMOVED:
-            case Status.STALE_DESTROYED:
-                throw new InvalidItemStateException("Item has already been removed by someone else. Status = " + Status.getName(state.getStatus()));
-            default:
-                throw new RepositoryException("Cannot transiently remove an ItemState with status " + Status.getName(state.getStatus()));
+            case REMOVED:
+            case STALE_DESTROYED:
+                throw new InvalidItemStateException("Item has already been removed by someone else. Status0 = "
+                        + state.getStatus());
+            case _UNDEFINED_:
+            case INVALIDATED:
+            case EXISTING_REMOVED:
+            case STALE_MODIFIED:
+            case MODIFIED:
+                throw new RepositoryException("Cannot transiently remove an ItemState with status " + state.getStatus());
         }
     }
 
@@ -412,14 +421,14 @@ abstract class HierarchyEntryImpl implem
      */
     void internalRemove(boolean staleParent) {
         ItemState state = internalGetItemState();
-        int status = getStatus();
+        Status0 status = getStatus();
         if (state != null) {
-            if (status == Status.EXISTING_MODIFIED) {
-                state.setStatus(Status.STALE_DESTROYED);
-            } else if (status == Status.NEW && staleParent) {
+            if (status == Status0.EXISTING_MODIFIED) {
+                state.setStatus(Status0.STALE_DESTROYED);
+            } else if (status == Status0.NEW && staleParent) {
                 // keep status NEW
             } else {
-                state.setStatus(Status.REMOVED);
+                state.setStatus(Status0.REMOVED);
                 if (!staleParent) {
                     parent.internalRemoveChildEntry(this);
                 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java Fri Sep  9 15:04:41 2011
@@ -28,7 +28,7 @@ import org.apache.jackrabbit.jcr2spi.ope
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.jcr2spi.util.StateUtility;
 import org.apache.jackrabbit.spi.ChildInfo;
 import org.apache.jackrabbit.spi.Event;
@@ -178,7 +178,7 @@ public class NodeEntryImpl extends Hiera
 
         // reload all children unless 'recursive' is false and the reload above
         // did not cause this entry to be removed -> therefore check status.
-        if (recursive && !Status.isTerminal(getStatus())) {
+        if (recursive && !Status0.isTerminal(getStatus())) {
             // recursively reload all entries including props that are in the attic.
             for (Iterator<HierarchyEntry> it = getAllChildEntries(true); it.hasNext();) {
                 HierarchyEntry ce = it.next();
@@ -236,7 +236,7 @@ public class NodeEntryImpl extends Hiera
     public void remove() {
         // handle this entry first
         super.internalRemove(false);
-        boolean staleParent = getStatus() == Status.STALE_DESTROYED;
+        boolean staleParent = getStatus() == Status0.STALE_DESTROYED;
         // now remove all child-entries (or mark them accordingly)
         for (Iterator<HierarchyEntry> it = getAllChildEntries(true); it.hasNext();) {
             HierarchyEntryImpl ce = (HierarchyEntryImpl) it.next();
@@ -248,7 +248,7 @@ public class NodeEntryImpl extends Hiera
     void internalRemove(boolean staleParent) {
         // handle this entry first
         super.internalRemove(staleParent);
-        staleParent = staleParent || getStatus() == Status.STALE_DESTROYED;
+        staleParent = staleParent || getStatus() == Status0.STALE_DESTROYED;
 
         // now remove all child-entries (or mark them accordingly)
         for (Iterator<HierarchyEntry> it = getAllChildEntries(true); it.hasNext();) {
@@ -392,7 +392,7 @@ public class NodeEntryImpl extends Hiera
 
                 // shortcut: entry is NEW and still unresolved remaining path
                 // elements -> hierarchy doesn't exist anyway.
-                if (entry.getStatus() == Status.NEW) {
+                if (entry.getStatus() == Status0.NEW) {
                     throw new PathNotFoundException(factory.saveGetJCRPath(path));
                 }
 
@@ -466,9 +466,9 @@ public class NodeEntryImpl extends Hiera
             }
         }
 
-        int st = entry.getStatus();
+        Status0 st = entry.getStatus();
         PropertyEntry pe;
-        if (i == elems.length-1 && Status.INVALIDATED != st && Status._UNDEFINED_ != st) {
+        if (i == elems.length-1 && Status0.INVALIDATED != st && Status0._UNDEFINED_ != st) {
             // all node entries present in the hierarchy and the direct ancestor
             // has already been resolved and isn't invalidated -> no need to
             // retrieve property entry from SPI
@@ -679,7 +679,7 @@ public class NodeEntryImpl extends Hiera
     @Override
     public synchronized Iterator<PropertyEntry> getPropertyEntries() {
         Collection<PropertyEntry> props;
-        if (getStatus() == Status.EXISTING_MODIFIED) {
+        if (getStatus() == Status0.EXISTING_MODIFIED) {
             // filter out removed properties
             props = new ArrayList<PropertyEntry>();
             // use array since upon validation the entry might be removed.
@@ -730,7 +730,7 @@ public class NodeEntryImpl extends Hiera
         // all property entries, that are not contained within the specified
         // collection of property names are removed from this NodeEntry.
         ItemState state = internalGetItemState();
-        if (containsExtra && (state == null || state.getStatus() == Status.INVALIDATED)) {
+        if (containsExtra && (state == null || state.getStatus() == Status0.INVALIDATED)) {
             for (Name propName : diff) {
                 PropertyEntry pEntry = properties.get(propName);
                 if (pEntry != null) {
@@ -749,11 +749,11 @@ public class NodeEntryImpl extends Hiera
         if (existing != null) {
             try {
                 PropertyState existingState = existing.getPropertyState();
-                int status = existingState.getStatus();
-                if (Status.isTerminal(status)) {
+                Status0 status = existingState.getStatus();
+                if (Status0.isTerminal(status)) {
                     // an old property-entry that is not valid any more
                     properties.remove(existing);
-                } else if (status == Status.EXISTING_REMOVED) {
+                } else if (status == Status0.EXISTING_REMOVED) {
                     // transiently removed -> move it to the attic
                     propertiesInAttic.put(propName, existing);
                 } else {
@@ -782,7 +782,7 @@ public class NodeEntryImpl extends Hiera
 
     @Override
     public void orderBefore(NodeEntry beforeEntry) throws RepositoryException {
-        if (Status.NEW == getStatus()) {
+        if (Status0.NEW == getStatus()) {
             // new states get remove upon revert
             parent.childNodeEntries.reorder(this, beforeEntry);
         } else {
@@ -803,7 +803,7 @@ public class NodeEntryImpl extends Hiera
        // original data must be stored and this entry is moved to the attic.
        if (transientMove) {
            createRevertInfo();
-           if (Status.NEW != getStatus()) {
+           if (Status0.NEW != getStatus()) {
                if (newParent == revertInfo.oldParent) {
                    // entry is either rename OR moved back to it's original
                    // parent. for the latter case make sure, there is no attic
@@ -845,7 +845,7 @@ public class NodeEntryImpl extends Hiera
         switch (childEvent.getType()) {
             case Event.NODE_ADDED:
             case Event.PROPERTY_ADDED:
-                if (child == null || child.getStatus() == Status.REMOVED) {
+                if (child == null || child.getStatus() == Status0.REMOVED) {
                     // no such child or a colliding new child existed but got
                     // removed already -> add the new entry.
                     if (childEvent.getType() ==  Event.NODE_ADDED) {
@@ -857,11 +857,11 @@ public class NodeEntryImpl extends Hiera
                     }
                 } else {
                     // item already present
-                    int status = child.getStatus();
-                    if (Status.NEW == status) {
+                    Status0 status = child.getStatus();
+                    if (Status0.NEW == status) {
                         // event conflicts with a transiently added item on this
                         // node entry -> mark the parent node (this) stale.
-                        internalGetItemState().setStatus(Status.MODIFIED);
+                        internalGetItemState().setStatus(Status0.MODIFIED);
                     } // else: child already added -> ignore
                 }
                 break;
@@ -869,10 +869,10 @@ public class NodeEntryImpl extends Hiera
             case Event.NODE_REMOVED:
             case Event.PROPERTY_REMOVED:
                 if (child != null) {
-                    int status = child.getStatus();
-                    if (Status.EXISTING_REMOVED == status) {
+                    Status0 status = child.getStatus();
+                    if (Status0.EXISTING_REMOVED == status) {
                         // colliding item removal -> mark parent stale
-                        internalGetItemState().setStatus(Status.MODIFIED);
+                        internalGetItemState().setStatus(Status0.MODIFIED);
                     }
                     child.remove();
                 } // else: child-Entry has not been loaded yet -> ignore
@@ -883,17 +883,17 @@ public class NodeEntryImpl extends Hiera
                     // prop-Entry has not been loaded yet -> add propEntry
                     internalAddPropertyEntry(eventName, true);
                 } else if (child.isAvailable()) {
-                    int status = child.getStatus();
+                    Status0 status = child.getStatus();
                     // if the child has pending changes -> stale.
                     // Reload data from server and try to merge them with the
                     // current session-state. if the latter is transiently
                     // modified and merge fails it must be marked STALE afterwards.
-                    if (Status.isStale(status))  {
+                    if (Status0.isStale(status))  {
                         // ignore. nothing to do.
-                    } else if (Status.isTransient(child.getStatus())) {
+                    } else if (Status0.isTransient(child.getStatus())) {
                         // pending changes -> don't reload entry but rather
                         // mark it stale
-                        ((HierarchyEntryImpl) child).internalGetItemState().setStatus(Status.MODIFIED);
+                        ((HierarchyEntryImpl) child).internalGetItemState().setStatus(Status0.MODIFIED);
                     } else {
                         // no pending changes -> invalidate and force reload
                         // upon next access.
@@ -1340,7 +1340,7 @@ public class NodeEntryImpl extends Hiera
                 return true;
             }
         }
-        if (getStatus() == Status.EXISTING_MODIFIED) {
+        if (getStatus() == Status0.EXISTING_MODIFIED) {
             for (NodeEntry child : siblings) {
                 if (!EntryValidation.isValidNodeEntry(child) || ((NodeEntryImpl) child).revertInfo != null && ((NodeEntryImpl) child).revertInfo.oldIndex == childIndex) {
                     return true;
@@ -1355,7 +1355,7 @@ public class NodeEntryImpl extends Hiera
      * present on this entry.
      */
     private void createRevertInfo() throws RepositoryException {
-        if (revertInfo == null && getStatus() != Status.NEW) {
+        if (revertInfo == null && getStatus() != Status0.NEW) {
             revertInfo = new RevertInfo();
         }
     }
@@ -1367,10 +1367,10 @@ public class NodeEntryImpl extends Hiera
 
         for (ItemState itemState : operation.getAddedStates()) {
             HierarchyEntry he = itemState.getHierarchyEntry();
-            if (he.getStatus() == Status.NEW) {
+            if (he.getStatus() == Status0.NEW) {
                 switch (operation.getStatus()) {
                     case Operation.STATUS_PERSISTED:
-                        ((HierarchyEntryImpl) he).internalGetItemState().setStatus(Status.EXISTING);
+                        ((HierarchyEntryImpl) he).internalGetItemState().setStatus(Status0.EXISTING);
                         he.invalidate(false);
                         break;
                     case Operation.STATUS_UNDO:
@@ -1387,13 +1387,13 @@ public class NodeEntryImpl extends Hiera
             throw new IllegalArgumentException();
         }
         PropertyEntry pe = getPropertyEntry(operation.getPropertyName());
-        if (pe != null && pe.getStatus() == Status.NEW) {
+        if (pe != null && pe.getStatus() == Status0.NEW) {
             switch (operation.getStatus()) {
                 case Operation.STATUS_PERSISTED:
                     // for autocreated/protected props, mark to be reloaded
                     // upon next access.
                     PropertyState addedState = (PropertyState) ((PropertyEntryImpl) pe).internalGetItemState();
-                    addedState.setStatus(Status.EXISTING);
+                    addedState.setStatus(Status0.EXISTING);
                     QPropertyDefinition pd = addedState.getDefinition();
                     if (pd.isAutoCreated() || pd.isProtected()) {
                         pe.invalidate(true);
@@ -1415,7 +1415,7 @@ public class NodeEntryImpl extends Hiera
         }
         switch (operation.getStatus()) {
             case Operation.STATUS_PERSISTED:
-                if (Status.isTerminal(rmEntry.getStatus())) {
+                if (Status0.isTerminal(rmEntry.getStatus())) {
                     log.debug("Removal of State " + rmEntry + " has already been completed.");
                 }
                 rmEntry.remove();
@@ -1445,8 +1445,8 @@ public class NodeEntryImpl extends Hiera
                 case Operation.STATUS_PERSISTED:
                     Name[] mixins = StateUtility.getMixinNames(pState);
                     getNodeState().setMixinTypeNames(mixins);
-                    if (pState.getStatus() == Status.NEW || pState.getStatus() == Status.EXISTING_MODIFIED) {
-                        pState.setStatus(Status.EXISTING);
+                    if (pState.getStatus() == Status0.NEW || pState.getStatus() == Status0.EXISTING_MODIFIED) {
+                        pState.setStatus(Status0.EXISTING);
                     }
                     break;
                 case Operation.STATUS_UNDO:
@@ -1469,8 +1469,8 @@ public class NodeEntryImpl extends Hiera
                     // NOTE: invalidation of this node entry is performed by
                     // ChangeLog.persisted...
                     // TODO: check if correct
-                    if (pState.getStatus() == Status.NEW || pState.getStatus() == Status.EXISTING_MODIFIED) {
-                        pState.setStatus(Status.EXISTING);
+                    if (pState.getStatus() == Status0.NEW || pState.getStatus() == Status0.EXISTING_MODIFIED) {
+                        pState.setStatus(Status0.EXISTING);
                     }
                     break;
                 case Operation.STATUS_UNDO:
@@ -1495,7 +1495,7 @@ public class NodeEntryImpl extends Hiera
                 }
                 break;
             case Operation.STATUS_UNDO:
-                if (he.getStatus() == Status.NEW) {
+                if (he.getStatus() == Status0.NEW) {
                     he.revert();
                 } else if (revertInfo != null && !revertInfo.isMoved()) {
                     revertInfo.dispose(false);
@@ -1512,15 +1512,15 @@ public class NodeEntryImpl extends Hiera
         }
         switch (operation.getStatus()) {
             case Operation.STATUS_PERSISTED:
-                if (getStatus() != Status.NEW && revertInfo != null) {
+                if (getStatus() != Status0.NEW && revertInfo != null) {
                     revertInfo.oldParent.childNodeAttic.remove(this);
                     revertInfo.dispose(true);
                 }
                 // and mark the moved state existing
-                // internalGetItemState().setStatus(Status.EXISTING);
+                // internalGetItemState().setStatus(Status0.EXISTING);
                 break;
             case Operation.STATUS_UNDO:
-                if (getStatus() == Status.NEW) {
+                if (getStatus() == Status0.NEW) {
                     revert();
                 } else if (revertInfo != null) {
                     revertMove();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java Fri Sep  9 15:04:41 2011
@@ -16,19 +16,17 @@
  */
 package org.apache.jackrabbit.jcr2spi.hierarchy;
 
-import javax.jcr.InvalidItemStateException;
-import javax.jcr.ItemNotFoundException;
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.jcr2spi.operation.Operation;
 import org.apache.jackrabbit.jcr2spi.operation.SetPropertyValue;
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.PropertyId;
 
+import javax.jcr.RepositoryException;
+
 /**
  * {@code PropertyEntryImpl} implements a reference to a property state.
  */
@@ -117,8 +115,8 @@ public class PropertyEntryImpl extends H
                 // Removal, add and implicit modification of protected
                 // properties must be persisted by save on parent.
                 PropertyState state = op.getPropertyState();
-                if (state.getStatus() != Status.REMOVED) {
-                    state.setStatus(Status.EXISTING);
+                if (state.getStatus() != Status0.REMOVED) {
+                    state.setStatus(Status0.EXISTING);
                 }
                 break;
             case Operation.STATUS_UNDO:

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/UniqueIdResolver.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/UniqueIdResolver.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/UniqueIdResolver.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/UniqueIdResolver.java Fri Sep  9 15:04:41 2011
@@ -16,14 +16,14 @@
  */
 package org.apache.jackrabbit.jcr2spi.hierarchy;
 
-import org.apache.jackrabbit.jcr2spi.state.ItemStateCreationListener;
-import org.apache.jackrabbit.jcr2spi.state.NodeState;
-import org.apache.jackrabbit.jcr2spi.state.ItemStateLifeCycleListener;
+import org.apache.commons.collections.map.ReferenceMap;
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.ItemStateCreationListener;
 import org.apache.jackrabbit.jcr2spi.state.ItemStateFactory;
+import org.apache.jackrabbit.jcr2spi.state.ItemStateLifeCycleListener;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.spi.NodeId;
-import org.apache.commons.collections.map.ReferenceMap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -86,12 +86,12 @@ public class UniqueIdResolver implements
      *
      * @param state
      * @param previousStatus
-     * @see ItemStateLifeCycleListener#statusChanged(ItemState, int)
+     * @see ItemStateLifeCycleListener#statusChanged(ItemState, org.apache.jackrabbit.jcr2spi.state.Status0)
      */
     @Override
-    public void statusChanged(ItemState state, int previousStatus) {
+    public void statusChanged(ItemState state, Status0 previousStatus) {
         synchronized (lookUp) {
-            if (Status.isTerminal(state.getStatus())) {
+            if (Status0.isTerminal(state.getStatus())) {
                 if (state.isNode()) {
                     NodeEntry entry = (NodeEntry) state.getHierarchyEntry();
                     String uniqueID = entry.getUniqueID();
@@ -104,7 +104,7 @@ public class UniqueIdResolver implements
                     }
                 }
                 // stop listening if a state reached status REMOVED.
-                if (Status.REMOVED == state.getStatus()) {
+                if (Status0.REMOVED == state.getStatus()) {
                     state.removeListener(this);
                 }
             } // else: any other status than REMOVED -> ignore.
@@ -185,7 +185,7 @@ public class UniqueIdResolver implements
     private static boolean sameEntry(NodeEntry previous, NodeEntry entry) {
         if (previous == entry) {
             return true;
-        } else if (Status.REMOVED != previous.getStatus() &&
+        } else if (Status0.REMOVED != previous.getStatus() &&
                 previous.getName().equals(entry.getName())) {
 
             NodeEntry parent = previous.getParent();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java Fri Sep  9 15:04:41 2011
@@ -29,7 +29,7 @@ import org.apache.jackrabbit.jcr2spi.sta
 import org.apache.jackrabbit.jcr2spi.state.ItemStateLifeCycleListener;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
+import org.apache.jackrabbit.jcr2spi.state.Status0;
 import org.apache.jackrabbit.spi.LockInfo;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
@@ -162,7 +162,7 @@ public class LockManagerImpl implements 
     public void checkLock(NodeState nodeState) throws RepositoryException {
         // shortcut: new status indicates that a new state was already added
         // thus, the parent state is not locked by foreign lock.
-        if (nodeState.getStatus() == Status.NEW) {
+        if (nodeState.getStatus() == Status0.NEW) {
             return;
         }
 
@@ -345,7 +345,7 @@ public class LockManagerImpl implements 
     private LockImpl getLockImpl(NodeState nodeState, boolean lazyLockDiscovery) throws RepositoryException {
         NodeState nState = nodeState;
         // access first non-NEW state
-        while (nState.getStatus() == Status.NEW) {
+        while (nState.getStatus() == Status0.NEW) {
             nState = nState.getParent();
         }
 
@@ -476,7 +476,7 @@ public class LockManagerImpl implements 
          * @return true if this lock applies to the given node state.
          */
         private boolean appliesToNodeState(NodeState nodeState) {
-            if (nodeState.getStatus() == Status.NEW) {
+            if (nodeState.getStatus() == Status0.NEW) {
                 return lockInfo.isDeep();
             } else {
                 return lockHoldingState == nodeState || lockInfo != null && lockInfo.isDeep();
@@ -607,7 +607,7 @@ public class LockManagerImpl implements 
         //-------------------------------------< ItemStateLifeCycleListener >---
 
         @Override
-        public void statusChanged(ItemState state, int previousStatus) {
+        public void statusChanged(ItemState state, Status0 previousStatus) {
             if (!isLive()) {
                 // since we only monitor the removal of the lock (by means
                 // of deletion of the jcr:lockIsDeep property, we are not interested
@@ -616,14 +616,23 @@ public class LockManagerImpl implements 
             }
 
             switch (state.getStatus()) {
-                case Status.REMOVED:
+                case REMOVED:
                     // this lock has been release by someone else (and not by
                     // a call to LockManager#unlock -> clean up and set isLive
                     // flag to false.
                     unlocked();
                     break;
-               default:
-                   // not interested
+                case _UNDEFINED_:
+                case INVALIDATED:
+                case EXISTING:
+                case EXISTING_MODIFIED:
+                case EXISTING_REMOVED:
+                case NEW:
+                case STALE_MODIFIED:
+                case STALE_DESTROYED:
+                case MODIFIED:
+                    // not interested
+                    break;
             }
         }
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/AbstractItemStateFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/AbstractItemStateFactory.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/AbstractItemStateFactory.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/AbstractItemStateFactory.java Fri Sep  9 15:04:41 2011
@@ -71,7 +71,7 @@ public abstract class AbstractItemStateF
      *
      * @param state
      */
-    void notifyUpdated(ItemState state, int previousStatus) {
+    void notifyUpdated(ItemState state, Status0 previousStatus) {
         ItemStateCreationListener[] listeners = getListeners();
         for (ItemStateCreationListener listener : listeners) {
             // now inform about creation

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java Fri Sep  9 15:04:41 2011
@@ -16,14 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi.state;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import javax.jcr.InvalidItemStateException;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.ConstraintViolationException;
-
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry;
 import org.apache.jackrabbit.jcr2spi.operation.Operation;
 import org.apache.jackrabbit.jcr2spi.operation.SetMixin;
@@ -31,6 +23,13 @@ import org.apache.jackrabbit.jcr2spi.ope
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
 /**
  * Registers changes made to states and references and consolidates
  * empty changes.
@@ -99,8 +98,8 @@ public class ChangeLog {
             HierarchyEntry he = state.getHierarchyEntry();
 
             switch (state.getStatus()) {
-                case Status.EXISTING_MODIFIED:
-                    state.setStatus(Status.EXISTING);
+                case EXISTING_MODIFIED:
+                    state.setStatus(Status0.EXISTING);
                     if (state.isNode()) {
                         if (changedPrimaryTypes.contains(state)) {
                             // primary type changed for a node -> force reloading upon next
@@ -113,22 +112,22 @@ public class ChangeLog {
                         }
                     }
                     break;
-                case Status.EXISTING_REMOVED:
+                case EXISTING_REMOVED:
                     he.remove();
                     break;
-                case Status.NEW:
+                case NEW:
                     // illegal. should not get here.
                     log.error("ChangeLog still contains NEW state: " + state.getName());
-                    state.setStatus(Status.EXISTING);
+                    state.setStatus(Status0.EXISTING);
                     break;
-                case Status.MODIFIED:
-                case Status._UNDEFINED_:
-                case Status.STALE_DESTROYED:
-                case Status.STALE_MODIFIED:
+                case MODIFIED:
+                case _UNDEFINED_:
+                case STALE_DESTROYED:
+                case STALE_MODIFIED:
                     // illegal.
-                    log.error("ChangeLog contains state (" + state.getName() + ") with illegal status " + Status.getName(state.getStatus()));
+                    log.error("ChangeLog contains state (" + state.getName() + ") with illegal status " + state.getStatus());
                     break;
-                case Status.EXISTING:
+                case EXISTING:
                     if (state.isNode() && changedMixins.contains(state)) {
                         // mixin changed for a node -> force reloading upon next
                         // access in order to be aware of modified uniqueID.
@@ -136,8 +135,8 @@ public class ChangeLog {
                     }
                     // otherwise: ignore. operations already have been completed
                     break;
-                case Status.INVALIDATED:
-                case Status.REMOVED:
+                case INVALIDATED:
+                case REMOVED:
                     he.invalidate(false);
                     break;
             }
@@ -157,25 +156,25 @@ public class ChangeLog {
         // operation undo.
         for (ItemState state : affectedStates) {
             switch (state.getStatus()) {
-                case Status.EXISTING_MODIFIED:
-                case Status.EXISTING_REMOVED:
-                case Status.STALE_MODIFIED:
-                case Status.STALE_DESTROYED:
+                case EXISTING_MODIFIED:
+                case EXISTING_REMOVED:
+                case STALE_MODIFIED:
+                case STALE_DESTROYED:
                     state.getHierarchyEntry().revert();
                     break;
-                case Status.NEW:
+                case NEW:
                     // illegal. should not get here.
                     log.error("ChangeLog still contains NEW state: " + state.getName());
                     state.getHierarchyEntry().revert();
                     break;
-                case Status.MODIFIED:
-                case Status._UNDEFINED_:
+                case MODIFIED:
+                case _UNDEFINED_:
                     // illegal.
-                    log.error("ChangeLog contains state (" + state.getName() + ") with illegal status " + Status.getName(state.getStatus()));
+                    log.error("ChangeLog contains state (" + state.getName() + ") with illegal status " + state.getStatus());
                     break;
-                case Status.EXISTING:
-                case Status.REMOVED:
-                case Status.INVALIDATED:
+                case EXISTING:
+                case REMOVED:
+                case INVALIDATED:
                     // ignore already processed
                     break;
             }

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=1167238&r1=1167237&r2=1167238&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  9 15:04:41 2011
@@ -44,7 +44,7 @@ public abstract class ItemState {
     /**
      * the internal status of this item state
      */
-    private int status;
+    private Status0 status;
 
     /**
      * The hierarchy entry this state belongs to.
@@ -83,19 +83,25 @@ public abstract class ItemState {
      * @param isf
      * @param definitionProvider
      */
-    protected ItemState(int initialStatus, HierarchyEntry entry, ItemStateFactory isf,
+    protected ItemState(Status0 initialStatus, HierarchyEntry entry, ItemStateFactory isf,
             ItemDefinitionProvider definitionProvider) {
         
         if (entry == null) {
             throw new IllegalArgumentException("Cannot build ItemState from 'null' HierarchyEntry");
         }
         switch (initialStatus) {
-            case Status.EXISTING:
-            case Status.NEW:
-            case Status.EXISTING_REMOVED:
+            case EXISTING:
+            case NEW:
+            case EXISTING_REMOVED:
                 status = initialStatus;
                 break;
-            default:
+            case _UNDEFINED_:
+            case INVALIDATED:
+            case EXISTING_MODIFIED:
+            case STALE_MODIFIED:
+            case STALE_DESTROYED:
+            case MODIFIED:
+            case REMOVED:
                 String msg = "illegal status: " + initialStatus;
                 log.debug(msg);
                 throw new IllegalArgumentException(msg);
@@ -110,13 +116,13 @@ public abstract class ItemState {
      * @param parent
      * @return
      */
-    private static int getInitialStatus(NodeEntry parent) {
-        int status = Status.EXISTING;
+    private static Status0 getInitialStatus(NodeEntry parent) {
+        Status0 status = Status0.EXISTING;
         // walk up hierarchy and check if any of the parents is transiently
         // removed, in which case the status must be set to EXISTING_REMOVED.
         while (parent != null) {
-            if (parent.getStatus() == Status.EXISTING_REMOVED) {
-                status = Status.EXISTING_REMOVED;
+            if (parent.getStatus() == Status0.EXISTING_REMOVED) {
+                status = Status0.EXISTING_REMOVED;
                 break;
             }
             parent = parent.getParent();
@@ -138,11 +144,11 @@ public abstract class ItemState {
     /**
      * Returns {@code true} if this item state is valid and can be accessed.
      * @return
-     * @see Status#isValid(int)
-     * @see Status#isStale(int)
+     * @see Status0#isValid(Status0)
+     * @see Status0#isStale(Status0)
      */
     public boolean isValid() {
-        return Status.isValid(getStatus()) || Status.isStale(getStatus());
+        return Status0.isValid(getStatus()) || Status0.isStale(getStatus());
     }
 
     /**
@@ -212,7 +218,7 @@ public abstract class ItemState {
      *
      * @return the status of this item.
      */
-    public final int getStatus() {
+    public final Status0 getStatus() {
         // Call calculateStatus to apply a possible pending invalidation
         // in the entry hierarchy.
         getHierarchyEntry().calculateStatus();
@@ -224,19 +230,19 @@ public abstract class ItemState {
      *
      * @param newStatus the new status
      */
-    public void setStatus(int newStatus) {
-        int oldStatus = status;
+    public void setStatus(Status0 newStatus) {
+        Status0 oldStatus = status;
         if (oldStatus == newStatus) {
             return;
         }
 
-        if (oldStatus == Status.REMOVED) {
-            throw new IllegalStateException("State is already in terminal status " + Status.getName(oldStatus));
+        if (oldStatus == Status0.REMOVED) {
+            throw new IllegalStateException("State is already in terminal status " + oldStatus);
         }
-        if (Status.isValidStatusChange(oldStatus, newStatus)) {
-            status = Status.getNewStatus(oldStatus, newStatus);
+        if (Status0.isValidStatusChange(oldStatus, newStatus)) {
+            status = Status0.getNewStatus(oldStatus, newStatus);
         } else {
-            throw new IllegalArgumentException("Invalid new status " + Status.getName(newStatus) + " for state with status " + Status.getName(oldStatus));
+            throw new IllegalArgumentException("Invalid new status " + newStatus + " for state with status " + oldStatus);
         }
         // Notify listeners about status change
         // copy listeners to array to avoid ConcurrentModificationException
@@ -249,10 +255,10 @@ public abstract class ItemState {
                 aLa.statusChanged(this, oldStatus);
             }
         }
-        if (status == Status.MODIFIED) {
+        if (status == Status0.MODIFIED) {
             // change back tmp MODIFIED status, that is used as marker only
             // inform listeners about (external) changes.
-            status = Status.EXISTING;
+            status = Status0.EXISTING;
         }
     }
 
@@ -299,14 +305,14 @@ public abstract class ItemState {
     }
 
     /**
-     * Invalidates this state: set its {@link Status} to {@link Status#INVALIDATED}
-     * if the current status is {@link Status#EXISTING}. Does nothing otherwise.
+     * Invalidates this state: set its {@link Status0} to {@link Status0#INVALIDATED}
+     * if the current status is {@link Status0#EXISTING}. Does nothing otherwise.
      */
     public void invalidate() {
-        if (status == Status.EXISTING) {
-            setStatus(Status.INVALIDATED);
+        if (status == Status0.EXISTING) {
+            setStatus(Status0.INVALIDATED);
         } else {
-            log.debug("Skip invalidation for item {} with status {}", getName(), Status.getName(status));
+            log.debug("Skip invalidation for item {} with status {}", getName(), status);
         }
     }
 
@@ -315,24 +321,26 @@ public abstract class ItemState {
      */
     void markModified() throws InvalidItemStateException {
         switch (status) {
-            case Status.EXISTING:
-                setStatus(Status.EXISTING_MODIFIED);
+            case EXISTING:
+                setStatus(Status0.EXISTING_MODIFIED);
                 break;
-            case Status.EXISTING_MODIFIED:
+            case EXISTING_MODIFIED:
                 // already modified, do nothing
                 break;
-            case Status.NEW:
+            case NEW:
                 // still new, do nothing
                 break;
-            case Status.STALE_DESTROYED:
-            case Status.STALE_MODIFIED:
+            case STALE_DESTROYED:
+            case STALE_MODIFIED:
                 // should actually not get here because item should check before
                 // it modifies an item state.
                 throw new InvalidItemStateException("Cannot mark stale state modified.");
-
-            case Status.EXISTING_REMOVED:
-            default:
-                String msg = "Cannot mark item state with status '" + Status.getName(status) + "' modified.";
+            case EXISTING_REMOVED:
+            case _UNDEFINED_:
+            case INVALIDATED:
+            case MODIFIED:
+            case REMOVED:
+                String msg = "Cannot mark item state with status '" + status + "' modified.";
                 throw new InvalidItemStateException(msg);
         }
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateLifeCycleListener.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateLifeCycleListener.java?rev=1167238&r1=1167237&r2=1167238&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateLifeCycleListener.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateLifeCycleListener.java Fri Sep  9 15:04:41 2011
@@ -29,5 +29,5 @@ public interface ItemStateLifeCycleListe
      * @param state          the item state, which changed its {@code status}.
      * @param previousStatus the previous status of {@code state}.
      */
-    void statusChanged(ItemState state, int previousStatus);
+    void statusChanged(ItemState state, Status0 previousStatus);
 }

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=1167238&r1=1167237&r2=1167238&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  9 15:04:41 2011
@@ -71,7 +71,7 @@ public class NodeState extends ItemState
     protected NodeState(NodeEntry entry, Name nodeTypeName, Name[] mixinTypeNames, ItemStateFactory isf,
             QNodeDefinition definition, ItemDefinitionProvider definitionProvider) {
 
-        super(Status.NEW, entry, isf, definitionProvider);
+        super(Status0.NEW, entry, isf, definitionProvider);
         this.nodeTypeName = nodeTypeName;
         setMixinTypeNames(mixinTypeNames);
         this.definition = definition;
@@ -246,14 +246,14 @@ public class NodeState extends ItemState
 
     /**
      * TODO: clarify usage
-     * In case the status of the given node state is not {@link Status#EXISTING}
+     * In case the status of the given node state is not {@link Status0#EXISTING}
      * the transiently added mixin types are taken into account as well.
      *
      * @return
      */
     public synchronized Name[] getAllNodeTypeNames() {
         Name[] allNtNames;
-        if (getStatus() == Status.EXISTING) {
+        if (getStatus() == Status0.EXISTING) {
             allNtNames = getNodeTypeNames();
         } else {
             // TODO: check if correct (and only used for creating new)

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=1167238&r1=1167237&r2=1167238&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  9 15:04:41 2011
@@ -69,7 +69,7 @@ public class PropertyState extends ItemS
     protected PropertyState(PropertyEntry entry, ItemStateFactory isf, QPropertyDefinition definition,
             ItemDefinitionProvider definitionProvider, QValue[] values, int propertyType) throws RepositoryException {
 
-        super(Status.NEW, entry, isf, definitionProvider);
+        super(Status0.NEW, entry, isf, definitionProvider);
         multiValued = definition.isMultiple();
         this.definition = definition;
         setValues(values, propertyType);
@@ -149,7 +149,7 @@ public class PropertyState extends ItemS
 
     @Override
     public boolean revert() {
-        if (getStatus() == Status.NEW) {
+        if (getStatus() == Status0.NEW) {
             throw new IllegalStateException("Cannot call revert on a NEW property state.");
         }
         if (transientData == null) {
@@ -245,7 +245,7 @@ public class PropertyState extends ItemS
      * @throws RepositoryException If an error occurs.
      */
     final void setValues(QValue[] values, int type) throws RepositoryException {
-        if (getStatus() == Status.NEW) {
+        if (getStatus() == Status0.NEW) {
             if (data == null) {
                 data = new PropertyData(type, values, getDefinition());
             } else {



Mime
View raw message