jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r590014 [9/11] - in /jackrabbit/trunk: jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jou...
Date Tue, 30 Oct 2007 10:02:57 GMT
Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/UpdatableItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/UpdatableItemStateManager.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/UpdatableItemStateManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/UpdatableItemStateManager.java Tue Oct 30 03:02:41 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.core.NodeId;
 
 import javax.jcr.ReferentialIntegrityException;
@@ -58,7 +58,7 @@
      * @return a node state
      * @throws IllegalStateException if the manager is not in edit mode.
      */
-    NodeState createNew(NodeId id, QName nodeTypeName,
+    NodeState createNew(NodeId id, Name nodeTypeName,
                         NodeId parentId) throws IllegalStateException;
 
     /**
@@ -71,7 +71,7 @@
      * @return a property state
      * @throws IllegalStateException if the manager is not in edit mode.
      */
-    PropertyState createNew(QName propName, NodeId parentId)
+    PropertyState createNew(Name propName, NodeId parentId)
             throws IllegalStateException;
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java Tue Oct 30 03:02:41 2007
@@ -18,14 +18,11 @@
 
 import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.fs.FileSystemResource;
-import org.apache.jackrabbit.name.MalformedPathException;
-import org.apache.jackrabbit.name.NameException;
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.name.NoPrefixDeclaredException;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.NameFormat;
-import org.apache.jackrabbit.name.PathFormat;
+import org.apache.jackrabbit.conversion.MalformedPathException;
+import org.apache.jackrabbit.conversion.NameException;
+import org.apache.jackrabbit.conversion.NamePathResolver;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.util.ISO8601;
 import org.apache.jackrabbit.uuid.UUID;
 import org.apache.jackrabbit.value.BinaryValue;
@@ -37,6 +34,8 @@
 import org.apache.jackrabbit.value.PathValue;
 import org.apache.jackrabbit.value.ReferenceValue;
 import org.apache.jackrabbit.value.StringValue;
+import org.apache.jackrabbit.name.PathFactoryImpl;
+import org.apache.jackrabbit.name.NameFactoryImpl;
 
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
@@ -62,7 +61,7 @@
  * <tr>DOUBLE<td></td><td>Double</td></tr>
  * <tr>DATE<td></td><td>Calendar</td></tr>
  * <tr>BOOLEAN<td></td><td>Boolean</td></tr>
- * <tr>NAME<td></td><td>QName</td></tr>
+ * <tr>NAME<td></td><td>Name</td></tr>
  * <tr>PATH<td></td><td>Path</td></tr>
  * <tr>BINARY<td></td><td>BLOBFileValue</td></tr>
  * <tr>REFERENCE<td></td><td>UUID</td></tr>
@@ -96,12 +95,12 @@
      * Large binary values are stored in a temporary file.
      * 
      * @param value the JCR value
-     * @param nsResolver the namespace resolver
+     * @param resolver
      * @return the created internal value
      */
-    public static InternalValue create(Value value, NamespaceResolver nsResolver)
+    public static InternalValue create(Value value, NamePathResolver resolver)
             throws ValueFormatException, RepositoryException {
-        return create(value, nsResolver, null);
+        return create(value, resolver, null);
     }
 
     /**
@@ -109,11 +108,11 @@
      * If the data store is enabled, large binary values are stored in the data store.
      * 
      * @param value the JCR value
-     * @param nsResolver the namespace resolver
+     * @param resolver
      * @param store the data store
      * @return the created internal value
      */
-    public static InternalValue create(Value value, NamespaceResolver nsResolver, DataStore store)
+    public static InternalValue create(Value value, NamePathResolver resolver, DataStore store)
             throws ValueFormatException, RepositoryException {
         if (value == null) {
             throw new IllegalArgumentException("null value");
@@ -153,13 +152,13 @@
                 return create(new UUID(value.getString()));
             case PropertyType.NAME:
                 try {
-                    return create(NameFormat.parse(value.getString(), nsResolver));
+                    return create(resolver.getQName(value.getString()));
                 } catch (NameException e) {
                     throw new ValueFormatException(e.getMessage());
                 }
             case PropertyType.PATH:
                 try {
-                    return create(PathFormat.parse(value.getString(), nsResolver));
+                    return create(resolver.getQPath(value.getString()));
                 } catch (MalformedPathException mpe) {
                     throw new ValueFormatException(mpe.getMessage());
                 }
@@ -302,7 +301,7 @@
      * @param value
      * @return the created value
      */
-    public static InternalValue create(QName value) {
+    public static InternalValue create(Name value) {
         return new InternalValue(value);
     }
 
@@ -310,7 +309,7 @@
      * @param values
      * @return the created value
      */
-    public static InternalValue[] create(QName[] values) {
+    public static InternalValue[] create(Name[] values) {
         InternalValue[] ret = new InternalValue[values.length];
         for (int i = 0; i < values.length; i++) {
             ret[i] = new InternalValue(values[i]);
@@ -348,11 +347,11 @@
 
     //----------------------------------------------------< conversions, etc. >
     /**
-     * @param nsResolver
+     * @param resolver
      * @return
      * @throws RepositoryException
      */
-    public Value toJCRValue(NamespaceResolver nsResolver)
+    public Value toJCRValue(NamePathResolver resolver)
             throws RepositoryException {
         switch (type) {
             case PropertyType.BINARY:
@@ -368,14 +367,9 @@
             case PropertyType.REFERENCE:
                 return ReferenceValue.valueOf(val.toString());
             case PropertyType.PATH:
-                try {
-                    return PathValue.valueOf(PathFormat.format((Path) val, nsResolver));
-                } catch (NoPrefixDeclaredException npde) {
-                    // should never get here...
-                    throw new RepositoryException("internal error: encountered unregistered namespace", npde);
-                }
+                return PathValue.valueOf(resolver.getJCRPath((Path) val));
             case PropertyType.NAME:
-                return NameValue.valueOf((QName) val, nsResolver);
+                return NameValue.valueOf(resolver.getJCRName((Name) val));
             case PropertyType.STRING:
                 return new StringValue((String) val);
             default:
@@ -406,9 +400,9 @@
         return ((Boolean) val).booleanValue();
     }    
 
-    public QName getQName() {
+    public Name getQName() {
         assert val != null && type == PropertyType.NAME;
-        return (QName) val;
+        return (Name) val;
     }
     
     public Path getPath() {
@@ -501,9 +495,9 @@
             case PropertyType.REFERENCE:
                 return create(new UUID(s));
             case PropertyType.PATH:
-                return create(Path.valueOf(s));
+                return create(PathFactoryImpl.getInstance().create(s));
             case PropertyType.NAME:
-                return create(QName.valueOf(s));
+                return create(NameFactoryImpl.getInstance().create(s));
             case PropertyType.STRING:
                 return create(s);
 
@@ -556,7 +550,7 @@
         type = PropertyType.STRING;
     }
 
-    private InternalValue(QName value) {
+    private InternalValue(Name value) {
         val = value;
         type = PropertyType.NAME;
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java Tue Oct 30 03:02:41 2007
@@ -24,8 +24,10 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.LocalItemStateManager;
 import org.apache.jackrabbit.core.state.NodeState;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.uuid.UUID;
+import org.apache.jackrabbit.name.NameConstants;
+import org.apache.jackrabbit.name.NameFactoryImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -300,14 +302,14 @@
             String uuid = node.getNodeId().getUUID().toString();
             NodeStateEx root = historyRoot;
             for (int i = 0; i < 3; i++) {
-                QName name = new QName(QName.NS_DEFAULT_URI, uuid.substring(i * 2, i * 2 + 2));
+                Name name = NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, uuid.substring(i * 2, i * 2 + 2));
                 if (!root.hasNode(name)) {
-                    root.addNode(name, QName.REP_VERSIONSTORAGE, null, false);
+                    root.addNode(name, NameConstants.REP_VERSIONSTORAGE, null, false);
                     root.store();
                 }
                 root = root.getNode(name, 1);
             }
-            QName historyNodeName = new QName(QName.NS_DEFAULT_URI, uuid);
+            Name historyNodeName = NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, uuid);
             if (root.hasNode(historyNodeName)) {
                 // already exists
                 return null;
@@ -345,13 +347,13 @@
         String uuid = node.getNodeId().getUUID().toString();
         NodeStateEx n = historyRoot;
         for (int i = 0; i < 3; i++) {
-            QName name = new QName(QName.NS_DEFAULT_URI, uuid.substring(i * 2, i * 2 + 2));
+            Name name = NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, uuid.substring(i * 2, i * 2 + 2));
             if (!n.hasNode(name)) {
                 return null;
             }
             n = n.getNode(name, 1);
         }
-        QName historyNodeName = new QName(QName.NS_DEFAULT_URI, uuid);
+        Name historyNodeName = NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, uuid);
         if (!n.hasNode(historyNodeName)) {
             return null;
         }
@@ -372,7 +374,7 @@
         WriteOperation operation = startWriteOperation();
         try {
             String versionName = calculateCheckinVersionName(history, node);
-            InternalVersionImpl v = history.checkin(new QName("", versionName), node);
+            InternalVersionImpl v = history.checkin(NameFactoryImpl.getInstance().create("", versionName), node);
             operation.save();
             return v;
         } catch (ItemStateException e) {
@@ -427,7 +429,7 @@
                                                  NodeImpl node)
             throws RepositoryException {
         // 1. search a predecessor, suitable for generating the new name
-        Value[] values = node.getProperty(QName.JCR_PREDECESSORS).getValues();
+        Value[] values = node.getProperty(NameConstants.JCR_PREDECESSORS).getValues();
         InternalVersion best = null;
         for (int i = 0; i < values.length; i++) {
             InternalVersion pred = history.getVersion(NodeId.valueOf(values[i].getString()));
@@ -442,7 +444,7 @@
         if (pos > 0) {
             String newVersionName = versionName.substring(0, pos + 1)
                 + (Integer.parseInt(versionName.substring(pos + 1)) + 1);
-            while (history.hasVersion(new QName("", newVersionName))) {
+            while (history.hasVersion(NameFactoryImpl.getInstance().create("", newVersionName))) {
                 versionName += ".0";
                 newVersionName = versionName;
             }
@@ -462,7 +464,7 @@
      *  not have a version with <code>name</code>.
      * @throws javax.jcr.RepositoryException if any other error occurs.
      */
-    protected void removeVersion(InternalVersionHistoryImpl history, QName name)
+    protected void removeVersion(InternalVersionHistoryImpl history, Name name)
             throws VersionException, RepositoryException {
         WriteOperation operation = startWriteOperation();
         try {
@@ -485,7 +487,7 @@
      * @throws RepositoryException if an error occurs
      */
     protected InternalVersion setVersionLabel(InternalVersionHistoryImpl history,
-                                              QName version, QName label,
+                                              Name version, Name label,
                                               boolean move)
             throws RepositoryException {
         WriteOperation operation = startWriteOperation();

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFreeze.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFreeze.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFreeze.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFreeze.java Tue Oct 30 03:02:41 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.version;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 /**
  * the base interface for nodes that were versioned and turned either into
@@ -29,6 +29,6 @@
      *
      * @return the name of the node.
      */
-    QName getName();
+    Name getName();
 
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNode.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNode.java Tue Oct 30 03:02:41 2007
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.core.version;
 
 import org.apache.jackrabbit.core.state.PropertyState;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.uuid.UUID;
 
 import javax.jcr.version.VersionException;
@@ -57,14 +57,14 @@
      *
      * @return the name of the frozen primary type.
      */
-    QName getFrozenPrimaryType();
+    Name getFrozenPrimaryType();
 
     /**
      * Returns the list of names of the frozen mixin types.
      *
      * @return the list of names of the frozen mixin types.
      */
-    QName[] getFrozenMixinTypes();
+    Name[] getFrozenMixinTypes();
 
     /**
      * Checks if this frozen node has the frozen version history

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java Tue Oct 30 03:02:41 2007
@@ -24,8 +24,9 @@
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.uuid.UUID;
+import org.apache.jackrabbit.name.NameConstants;
 
 import javax.jcr.NodeIterator;
 import javax.jcr.PropertyIterator;
@@ -78,12 +79,12 @@
     /**
      * the frozen primary type of the orginal node
      */
-    private QName frozenPrimaryType = null;
+    private Name frozenPrimaryType = null;
 
     /**
      * the frozen list of mixin types of the original node
      */
-    private QName[] frozenMixinTypes = null;
+    private Name[] frozenMixinTypes = null;
 
     /**
      * Creates a new frozen node based on the given persistance node.
@@ -107,26 +108,26 @@
 
         for (int i = 0; i < props.length; i++) {
             PropertyState prop = props[i];
-            if (prop.getName().equals(QName.JCR_FROZENUUID)) {
+            if (prop.getName().equals(NameConstants.JCR_FROZENUUID)) {
                 // special property
-                frozenUUID = UUID.fromString(node.getPropertyValue(QName.JCR_FROZENUUID).getString());
-            } else if (prop.getName().equals(QName.JCR_FROZENPRIMARYTYPE)) {
+                frozenUUID = UUID.fromString(node.getPropertyValue(NameConstants.JCR_FROZENUUID).getString());
+            } else if (prop.getName().equals(NameConstants.JCR_FROZENPRIMARYTYPE)) {
                 // special property
-                frozenPrimaryType = node.getPropertyValue(QName.JCR_FROZENPRIMARYTYPE).getQName();
-            } else if (prop.getName().equals(QName.JCR_FROZENMIXINTYPES)) {
+                frozenPrimaryType = node.getPropertyValue(NameConstants.JCR_FROZENPRIMARYTYPE).getQName();
+            } else if (prop.getName().equals(NameConstants.JCR_FROZENMIXINTYPES)) {
                 // special property
-                InternalValue[] values = node.getPropertyValues(QName.JCR_FROZENMIXINTYPES);
+                InternalValue[] values = node.getPropertyValues(NameConstants.JCR_FROZENMIXINTYPES);
                 if (values == null) {
-                    frozenMixinTypes = new QName[0];
+                    frozenMixinTypes = new Name[0];
                 } else {
-                    frozenMixinTypes = new QName[values.length];
+                    frozenMixinTypes = new Name[values.length];
                     for (int j = 0; j < values.length; j++) {
                         frozenMixinTypes[j] = values[j].getQName();
                     }
                 }
-            } else if (prop.getName().equals(QName.JCR_PRIMARYTYPE)) {
+            } else if (prop.getName().equals(NameConstants.JCR_PRIMARYTYPE)) {
                 // ignore
-            } else if (prop.getName().equals(QName.JCR_UUID)) {
+            } else if (prop.getName().equals(NameConstants.JCR_UUID)) {
                 // ignore
             } else {
                 propList.add(prop);
@@ -136,7 +137,7 @@
 
         // do some checks
         if (frozenMixinTypes == null) {
-            frozenMixinTypes = new QName[0];
+            frozenMixinTypes = new Name[0];
         }
         if (frozenPrimaryType == null) {
             throw new RepositoryException("Illegal frozen node. Must have 'frozenPrimaryType'");
@@ -146,7 +147,7 @@
     /**
      * {@inheritDoc}
      */
-    public QName getName() {
+    public Name getName() {
         return node.getName();
     }
 
@@ -218,14 +219,14 @@
     /**
      * {@inheritDoc}
      */
-    public QName getFrozenPrimaryType() {
+    public Name getFrozenPrimaryType() {
         return frozenPrimaryType;
     }
 
     /**
      * {@inheritDoc}
      */
-    public QName[] getFrozenMixinTypes() {
+    public Name[] getFrozenMixinTypes() {
         return frozenMixinTypes;
     }
 
@@ -242,7 +243,7 @@
      * @return
      * @throws RepositoryException
      */
-    protected static NodeStateEx checkin(NodeStateEx parent, QName name,
+    protected static NodeStateEx checkin(NodeStateEx parent, Name name,
                                          NodeImpl src)
             throws RepositoryException {
         return checkin(parent, name, src, MODE_VERSION);
@@ -261,25 +262,25 @@
      * @return
      * @throws RepositoryException
      */
-    private static NodeStateEx checkin(NodeStateEx parent, QName name,
+    private static NodeStateEx checkin(NodeStateEx parent, Name name,
                                        NodeImpl src, int mode)
             throws RepositoryException {
 
         // create new node
-        NodeStateEx node = parent.addNode(name, QName.NT_FROZENNODE, null, true);
+        NodeStateEx node = parent.addNode(name, NameConstants.NT_FROZENNODE, null, true);
 
         // initialize the internal properties
-        node.setPropertyValue(QName.JCR_FROZENUUID,
+        node.setPropertyValue(NameConstants.JCR_FROZENUUID,
                 InternalValue.create(src.internalGetUUID().toString()));
-        node.setPropertyValue(QName.JCR_FROZENPRIMARYTYPE,
+        node.setPropertyValue(NameConstants.JCR_FROZENPRIMARYTYPE,
                 InternalValue.create(((NodeTypeImpl) src.getPrimaryNodeType()).getQName()));
-        if (src.hasProperty(QName.JCR_MIXINTYPES)) {
+        if (src.hasProperty(NameConstants.JCR_MIXINTYPES)) {
             NodeType[] mixins = src.getMixinNodeTypes();
             InternalValue[] ivalues = new InternalValue[mixins.length];
             for (int i = 0; i < mixins.length; i++) {
                 ivalues[i] = InternalValue.create(((NodeTypeImpl) mixins[i]).getQName());
             }
-            node.setPropertyValues(QName.JCR_FROZENMIXINTYPES, PropertyType.NAME, ivalues);
+            node.setPropertyValues(NameConstants.JCR_FROZENMIXINTYPES, PropertyType.NAME, ivalues);
         }
 
         // add the properties
@@ -303,9 +304,9 @@
                 case OnParentVersionAction.VERSION:
                 case OnParentVersionAction.COPY:
                     // ignore frozen properties
-                    if (!prop.getQName().equals(QName.JCR_PRIMARYTYPE)
-                            && !prop.getQName().equals(QName.JCR_MIXINTYPES)
-                            && !prop.getQName().equals(QName.JCR_UUID)) {
+                    if (!prop.getQName().equals(NameConstants.JCR_PRIMARYTYPE)
+                            && !prop.getQName().equals(NameConstants.JCR_MIXINTYPES)
+                            && !prop.getQName().equals(NameConstants.JCR_UUID)) {
                         node.copyFrom(prop);
                     }
                     break;
@@ -330,10 +331,10 @@
                 case OnParentVersionAction.INITIALIZE:
                     break;
                 case OnParentVersionAction.VERSION:
-                    if (child.isNodeType(QName.MIX_VERSIONABLE)) {
+                    if (child.isNodeType(NameConstants.MIX_VERSIONABLE)) {
                         // create frozen versionable child
-                        NodeStateEx newChild = node.addNode(child.getQName(), QName.NT_VERSIONEDCHILD, null, false);
-                        newChild.setPropertyValue(QName.JCR_CHILDVERSIONHISTORY,
+                        NodeStateEx newChild = node.addNode(child.getQName(), NameConstants.NT_VERSIONEDCHILD, null, false);
+                        newChild.setPropertyValue(NameConstants.JCR_CHILDVERSIONHISTORY,
                                 InternalValue.create(new UUID(child.getVersionHistory().getUUID())));
                         /*
                         newChild.setPropertyValue(JCR_BASEVERSION,

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenVHImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenVHImpl.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenVHImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenVHImpl.java Tue Oct 30 03:02:41 2007
@@ -16,8 +16,9 @@
  */
 package org.apache.jackrabbit.core.version;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.name.NameConstants;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.version.VersionException;
@@ -42,7 +43,7 @@
     /**
      * {@inheritDoc}
      */
-    public QName getName() {
+    public Name getName() {
         return node.getName();
     }
 
@@ -57,7 +58,7 @@
      * {@inheritDoc}
      */
     public NodeId getVersionHistoryId() {
-        return new NodeId(node.getPropertyValue(QName.JCR_CHILDVERSIONHISTORY).getUUID());
+        return new NodeId(node.getPropertyValue(NameConstants.JCR_CHILDVERSIONHISTORY).getUUID());
     }
 
     /**
@@ -76,7 +77,7 @@
      * {@inheritDoc}
      */
     public NodeId getBaseVersionId() {
-        return new NodeId(node.getPropertyValue(QName.JCR_BASEVERSION).getUUID());
+        return new NodeId(node.getPropertyValue(NameConstants.JCR_BASEVERSION).getUUID());
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersion.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersion.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersion.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersion.java Tue Oct 30 03:02:41 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.version;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 import javax.jcr.version.Version;
 import java.util.Calendar;
@@ -31,7 +31,7 @@
      *
      * @return the name of this version.
      */
-    QName getName();
+    Name getName();
 
     /**
      * Returns the frozen node of this version or <code>null</code> if this is
@@ -95,12 +95,12 @@
      * @return <code>true</code> if the label is assigned to this version;
      *         <code>false</code> otherwise.
      */
-    boolean hasLabel(QName label);
+    boolean hasLabel(Name label);
 
     /**
      * returns the labels that are assigned to this version
      *
      * @return a string array of labels.
      */
-    QName[] getLabels();
+    Name[] getLabels();
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java Tue Oct 30 03:02:41 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.version;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.uuid.UUID;
 
@@ -40,7 +40,7 @@
      *
      * @see javax.jcr.version.VersionHistory#getVersion(java.lang.String)
      */
-    InternalVersion getVersion(QName versionName) throws VersionException;
+    InternalVersion getVersion(Name versionName) throws VersionException;
 
     /**
      * Checks if the version with the given name exists in this version history.
@@ -49,7 +49,7 @@
      * @return <code>true</code> if the version exists;
      *         <code>false</code> otherwise.
      */
-    boolean hasVersion(QName versionName);
+    boolean hasVersion(Name versionName);
 
     /**
      * Checks if the version for the given uuid exists in this history.
@@ -75,7 +75,7 @@
      *
      * @see javax.jcr.version.VersionHistory#getVersionByLabel(java.lang.String)
      */
-    InternalVersion getVersionByLabel(QName label);
+    InternalVersion getVersionByLabel(Name label);
 
     /**
      * Returns an iterator over all versions (not ordered yet), including the
@@ -105,7 +105,7 @@
      *
      * @return the labels
      */
-    QName[] getVersionLabels();
+    Name[] getVersionLabels();
 
     /**
      * Returns the Id of the version labels node.

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java Tue Oct 30 03:02:41 2007
@@ -22,8 +22,9 @@
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.uuid.UUID;
+import org.apache.jackrabbit.name.NameConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -110,13 +111,13 @@
         historyId = node.getNodeId();
 
         // get versionable id
-        versionableId = NodeId.valueOf(node.getPropertyValue(QName.JCR_VERSIONABLEUUID).toString());
+        versionableId = NodeId.valueOf(node.getPropertyValue(NameConstants.JCR_VERSIONABLEUUID).toString());
 
         // get entries
         NodeStateEx[] children = node.getChildNodes();
         for (int i = 0; i < children.length; i++) {
             NodeStateEx child = children[i];
-            if (child.getName().equals(QName.JCR_VERSIONLABELS)) {
+            if (child.getName().equals(NameConstants.JCR_VERSIONLABELS)) {
                 labelNode = child;
                 continue;
             }
@@ -144,7 +145,7 @@
             for (int i = 0; i < labels.length; i++) {
                 PropertyState pState = labels[i];
                 if (pState.getType() == PropertyType.REFERENCE) {
-                    QName name = pState.getName();
+                    Name name = pState.getName();
                     UUID ref = pState.getValues()[0].getUUID();
                     InternalVersionImpl v = (InternalVersionImpl) getVersion(new NodeId(ref));
                     if (v != null) {
@@ -215,7 +216,7 @@
     /**
      * {@inheritDoc}
      */
-    public InternalVersion getVersion(QName versionName) throws VersionException {
+    public InternalVersion getVersion(Name versionName) throws VersionException {
         // maybe add cache by name?
         Iterator iter = versionCache.values().iterator();
         while (iter.hasNext()) {
@@ -230,7 +231,7 @@
     /**
      * {@inheritDoc}
      */
-    public boolean hasVersion(QName versionName) {
+    public boolean hasVersion(Name versionName) {
         // maybe add cache?
         Iterator iter = versionCache.values().iterator();
         while (iter.hasNext()) {
@@ -259,7 +260,7 @@
     /**
      * {@inheritDoc}
      */
-    public InternalVersion getVersionByLabel(QName label) {
+    public InternalVersion getVersionByLabel(Name label) {
         return (InternalVersion) labelCache.get(label);
     }
 
@@ -287,8 +288,8 @@
     /**
      * {@inheritDoc}
      */
-    public QName[] getVersionLabels() {
-        return (QName[]) labelCache.keySet().toArray(new QName[labelCache.size()]);
+    public Name[] getVersionLabels() {
+        return (Name[]) labelCache.keySet().toArray(new Name[labelCache.size()]);
     }
 
     /**
@@ -310,7 +311,7 @@
      * @param versionName
      * @throws VersionException
      */
-    void removeVersion(QName versionName) throws RepositoryException {
+    void removeVersion(Name versionName) throws RepositoryException {
 
         InternalVersionImpl v = (InternalVersionImpl) getVersion(versionName);
         if (v.equals(rootVersion)) {
@@ -325,7 +326,7 @@
         }
 
         // unregister from labels
-        QName[] labels = v.internalGetLabels();
+        Name[] labels = v.internalGetLabels();
         for (int i = 0; i < labels.length; i++) {
             v.internalRemoveLabel(labels[i]);
             labelNode.removeProperty(labels[i]);
@@ -358,7 +359,7 @@
      * @return the version that was previously assigned by this label or <code>null</code>.
      * @throws VersionException
      */
-    InternalVersion setVersionLabel(QName versionName, QName label, boolean move)
+    InternalVersion setVersionLabel(Name versionName, Name label, boolean move)
             throws VersionException {
 
         InternalVersion version =
@@ -413,11 +414,11 @@
      * @return
      * @throws RepositoryException
      */
-    InternalVersionImpl checkin(QName name, NodeImpl src)
+    InternalVersionImpl checkin(Name name, NodeImpl src)
             throws RepositoryException {
 
         // copy predecessors from src node
-        Value[] preds = src.getProperty(QName.JCR_PREDECESSORS).getValues();
+        Value[] preds = src.getProperty(NameConstants.JCR_PREDECESSORS).getValues();
         InternalValue[] predecessors = new InternalValue[preds.length];
         for (int i = 0; i < preds.length; i++) {
             UUID predId = UUID.fromString(preds[i].getString());
@@ -429,15 +430,15 @@
         }
 
         NodeId versionId = new NodeId(UUID.randomUUID());
-        NodeStateEx vNode = node.addNode(name, QName.NT_VERSION, versionId, true);
+        NodeStateEx vNode = node.addNode(name, NameConstants.NT_VERSION, versionId, true);
 
         // initialize 'created', 'predecessors' and 'successors'
-        vNode.setPropertyValue(QName.JCR_CREATED, InternalValue.create(Calendar.getInstance()));
-        vNode.setPropertyValues(QName.JCR_PREDECESSORS, PropertyType.REFERENCE, predecessors);
-        vNode.setPropertyValues(QName.JCR_SUCCESSORS, PropertyType.REFERENCE, InternalValue.EMPTY_ARRAY);
+        vNode.setPropertyValue(NameConstants.JCR_CREATED, InternalValue.create(Calendar.getInstance()));
+        vNode.setPropertyValues(NameConstants.JCR_PREDECESSORS, PropertyType.REFERENCE, predecessors);
+        vNode.setPropertyValues(NameConstants.JCR_SUCCESSORS, PropertyType.REFERENCE, InternalValue.EMPTY_ARRAY);
 
         // checkin source node
-        InternalFrozenNodeImpl.checkin(vNode, QName.JCR_FROZENNODE, src);
+        InternalFrozenNodeImpl.checkin(vNode, NameConstants.JCR_FROZENNODE, src);
 
         // update version graph
         InternalVersionImpl version = new InternalVersionImpl(this, vNode, name);
@@ -465,35 +466,35 @@
      */
     static InternalVersionHistoryImpl create(AbstractVersionManager vMgr,
                                              NodeStateEx parent,
-                                             NodeId historyId, QName name,
+                                             NodeId historyId, Name name,
                                              NodeState nodeState)
             throws RepositoryException {
 
         // create history node
-        NodeStateEx pNode = parent.addNode(name, QName.NT_VERSIONHISTORY, historyId, true);
+        NodeStateEx pNode = parent.addNode(name, NameConstants.NT_VERSIONHISTORY, historyId, true);
 
         // set the versionable uuid
         String versionableUUID = nodeState.getNodeId().getUUID().toString();
-        pNode.setPropertyValue(QName.JCR_VERSIONABLEUUID, InternalValue.create(versionableUUID));
+        pNode.setPropertyValue(NameConstants.JCR_VERSIONABLEUUID, InternalValue.create(versionableUUID));
 
         // create label node
-        pNode.addNode(QName.JCR_VERSIONLABELS, QName.NT_VERSIONLABELS, null, false);
+        pNode.addNode(NameConstants.JCR_VERSIONLABELS, NameConstants.NT_VERSIONLABELS, null, false);
 
         // create root version
         NodeId versionId = new NodeId(UUID.randomUUID());
-        NodeStateEx vNode = pNode.addNode(QName.JCR_ROOTVERSION, QName.NT_VERSION, versionId, true);
+        NodeStateEx vNode = pNode.addNode(NameConstants.JCR_ROOTVERSION, NameConstants.NT_VERSION, versionId, true);
 
         // initialize 'created' and 'predecessors'
-        vNode.setPropertyValue(QName.JCR_CREATED, InternalValue.create(Calendar.getInstance()));
-        vNode.setPropertyValues(QName.JCR_PREDECESSORS, PropertyType.REFERENCE, InternalValue.EMPTY_ARRAY);
-        vNode.setPropertyValues(QName.JCR_SUCCESSORS, PropertyType.REFERENCE, InternalValue.EMPTY_ARRAY);
+        vNode.setPropertyValue(NameConstants.JCR_CREATED, InternalValue.create(Calendar.getInstance()));
+        vNode.setPropertyValues(NameConstants.JCR_PREDECESSORS, PropertyType.REFERENCE, InternalValue.EMPTY_ARRAY);
+        vNode.setPropertyValues(NameConstants.JCR_SUCCESSORS, PropertyType.REFERENCE, InternalValue.EMPTY_ARRAY);
 
         // add also an empty frozen node to the root version
-        NodeStateEx node = vNode.addNode(QName.JCR_FROZENNODE, QName.NT_FROZENNODE, null, true);
+        NodeStateEx node = vNode.addNode(NameConstants.JCR_FROZENNODE, NameConstants.NT_FROZENNODE, null, true);
 
         // initialize the internal properties
-        node.setPropertyValue(QName.JCR_FROZENUUID, InternalValue.create(versionableUUID));
-        node.setPropertyValue(QName.JCR_FROZENPRIMARYTYPE,
+        node.setPropertyValue(NameConstants.JCR_FROZENUUID, InternalValue.create(versionableUUID));
+        node.setPropertyValue(NameConstants.JCR_FROZENPRIMARYTYPE,
                 InternalValue.create(nodeState.getNodeTypeName()));
 
         Set mixins = nodeState.getMixinTypeNames();
@@ -501,9 +502,9 @@
             InternalValue[] ivalues = new InternalValue[mixins.size()];
             Iterator iter = mixins.iterator();
             for (int i = 0; i < mixins.size(); i++) {
-                ivalues[i] = InternalValue.create((QName) iter.next());
+                ivalues[i] = InternalValue.create((Name) iter.next());
             }
-            node.setPropertyValues(QName.JCR_FROZENMIXINTYPES, PropertyType.NAME, ivalues);
+            node.setPropertyValues(NameConstants.JCR_FROZENMIXINTYPES, PropertyType.NAME, ivalues);
         }
 
         parent.store();

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java Tue Oct 30 03:02:41 2007
@@ -19,7 +19,8 @@
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.core.NodeId;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.name.NameConstants;
 
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
@@ -53,7 +54,7 @@
     /**
      * the version name
      */
-    private final QName name;
+    private final Name name;
 
     /**
      * the version history
@@ -67,17 +68,17 @@
      *
      * @param node
      */
-    public InternalVersionImpl(InternalVersionHistoryImpl vh, NodeStateEx node, QName name) {
+    public InternalVersionImpl(InternalVersionHistoryImpl vh, NodeStateEx node, Name name) {
         super(vh.getVersionManager(), node);
         this.versionHistory = vh;
         this.name = name;
 
         // init internal values
-        InternalValue[] values = node.getPropertyValues(QName.JCR_CREATED);
+        InternalValue[] values = node.getPropertyValues(NameConstants.JCR_CREATED);
         if (values != null) {
             created = values[0].getDate();
         }
-        isRoot = name.equals(QName.JCR_ROOTVERSION);
+        isRoot = name.equals(NameConstants.JCR_ROOTVERSION);
     }
 
     /**
@@ -97,7 +98,7 @@
     /**
      * {@inheritDoc}
      */
-    public QName getName() {
+    public Name getName() {
         return name;
     }
 
@@ -107,7 +108,7 @@
     public InternalFrozenNode getFrozenNode() {
         // get frozen node
         try {
-            NodeState.ChildNodeEntry entry = node.getState().getChildNodeEntry(QName.JCR_FROZENNODE, 1);
+            NodeState.ChildNodeEntry entry = node.getState().getChildNodeEntry(NameConstants.JCR_FROZENNODE, 1);
             if (entry == null) {
                 throw new InternalError("version has no frozen node: " + getId());
             }
@@ -130,7 +131,7 @@
     public InternalVersion[] getSuccessors() {
         vMgr.acquireReadLock();
         try {
-            InternalValue[] values = node.getPropertyValues(QName.JCR_SUCCESSORS);
+            InternalValue[] values = node.getPropertyValues(NameConstants.JCR_SUCCESSORS);
             if (values != null) {
                 InternalVersion[] versions = new InternalVersion[values.length];
                 for (int i = 0; i < values.length; i++) {
@@ -150,7 +151,7 @@
      * {@inheritDoc}
      */
     public InternalVersion[] getPredecessors() {
-        InternalValue[] values = node.getPropertyValues(QName.JCR_PREDECESSORS);
+        InternalValue[] values = node.getPropertyValues(NameConstants.JCR_PREDECESSORS);
         if (values != null) {
             InternalVersion[] versions = new InternalVersion[values.length];
             for (int i = 0; i < values.length; i++) {
@@ -187,14 +188,14 @@
     /**
      * {@inheritDoc}
      */
-    public boolean hasLabel(QName label) {
+    public boolean hasLabel(Name label) {
         return internalHasLabel(label);
     }
 
     /**
      * {@inheritDoc}
      */
-    public QName[] getLabels() {
+    public Name[] getLabels() {
         return internalGetLabels();
     }
 
@@ -217,7 +218,7 @@
      *
      * @throws RepositoryException
      */
-    private void storeXCessors(List cessors, QName propname, boolean store)
+    private void storeXCessors(List cessors, Name propname, boolean store)
             throws RepositoryException {
         InternalValue[] values = new InternalValue[cessors.size()];
         for (int i = 0; i < values.length; i++) {
@@ -277,7 +278,7 @@
         List l = new ArrayList(Arrays.asList(getSuccessors()));
         if (!l.contains(succ)) {
             l.add(succ);
-            storeXCessors(l, QName.JCR_SUCCESSORS, store);
+            storeXCessors(l, NameConstants.JCR_SUCCESSORS, store);
         }
     }
 
@@ -297,7 +298,7 @@
 
         // attach v's predecessors
         l.addAll(Arrays.asList(v.getPredecessors()));
-        storeXCessors(l, QName.JCR_PREDECESSORS, store);
+        storeXCessors(l, NameConstants.JCR_PREDECESSORS, store);
     }
 
     /**
@@ -316,7 +317,7 @@
 
         // attach v's successors
         l.addAll(Arrays.asList(v.getSuccessors()));
-        storeXCessors(l, QName.JCR_SUCCESSORS, store);
+        storeXCessors(l, NameConstants.JCR_SUCCESSORS, store);
     }
 
     /**
@@ -325,7 +326,7 @@
      * @param label
      * @return <code>true</code> if the label was added
      */
-    boolean internalAddLabel(QName label) {
+    boolean internalAddLabel(Name label) {
         if (labelCache == null) {
             labelCache = new HashSet();
         }
@@ -338,7 +339,7 @@
      * @param label
      * @return <code>true</code> if the label was removed
      */
-    boolean internalRemoveLabel(QName label) {
+    boolean internalRemoveLabel(Name label) {
         if (labelCache == null) {
             return false;
         } else {
@@ -352,7 +353,7 @@
      * @param label
      * @return <code>true</code> if the label exists
      */
-    boolean internalHasLabel(QName label) {
+    boolean internalHasLabel(Name label) {
         if (labelCache == null) {
             return false;
         } else {
@@ -365,11 +366,11 @@
      *
      * @return the internal labels
      */
-    QName[] internalGetLabels() {
+    Name[] internalGetLabels() {
         if (labelCache == null) {
-            return new QName[0];
+            return new Name[0];
         } else {
-            return (QName[]) labelCache.toArray(new QName[labelCache.size()]);
+            return (Name[]) labelCache.toArray(new Name[labelCache.size()]);
         }
     }
 
@@ -386,7 +387,7 @@
      * @throws RepositoryException
      */
     void legacyResolveSuccessors() throws RepositoryException {
-        InternalValue[] values = node.getPropertyValues(QName.JCR_PREDECESSORS);
+        InternalValue[] values = node.getPropertyValues(NameConstants.JCR_PREDECESSORS);
         if (values != null) {
             for (int i = 0; i < values.length; i++) {
                 NodeId vId = new NodeId(values[i].getUUID());

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java Tue Oct 30 03:02:41 2007
@@ -30,8 +30,9 @@
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.state.UpdatableItemStateManager;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.uuid.UUID;
+import org.apache.jackrabbit.name.NameConstants;
 
 import java.util.HashSet;
 import java.util.Iterator;
@@ -65,7 +66,7 @@
     /**
      * the cached name
      */
-    private QName name;
+    private Name name;
 
     /**
      * Creates a new persistent node
@@ -75,7 +76,7 @@
      */
     public NodeStateEx(UpdatableItemStateManager stateMgr,
                        NodeTypeRegistry ntReg,
-                       NodeState nodeState, QName name) {
+                       NodeState nodeState, Name name) {
         this.nodeState = nodeState;
         this.ntReg = ntReg;
         this.stateMgr = stateMgr;
@@ -88,7 +89,7 @@
      *
      * @return the name of this node
      */
-    public QName getName() {
+    public Name getName() {
         if (name == null) {
             try {
                 NodeId parentId = nodeState.getParentId();
@@ -138,7 +139,7 @@
         PropertyState[] props = new PropertyState[set.size()];
         int i = 0;
         for (Iterator iter = set.iterator(); iter.hasNext();) {
-            QName propName = (QName) iter.next();
+            Name propName = (Name) iter.next();
             PropertyId propId = new PropertyId(nodeState.getNodeId(), propName);
             props[i++] = (PropertyState) stateMgr.getItemState(propId);
         }
@@ -151,7 +152,7 @@
      * @param name
      * @return <code>true</code> if the given property exists.
      */
-    public boolean hasProperty(QName name) {
+    public boolean hasProperty(Name name) {
         PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
         return stateMgr.hasItemState(propId);
     }
@@ -162,7 +163,7 @@
      * @param name
      * @return the values of the given property.
      */
-    public InternalValue[] getPropertyValues(QName name) {
+    public InternalValue[] getPropertyValues(Name name) {
         PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
         try {
             PropertyState ps = (PropertyState) stateMgr.getItemState(propId);
@@ -178,7 +179,7 @@
      * @param name
      * @return the value of the given property.
      */
-    public InternalValue getPropertyValue(QName name) {
+    public InternalValue getPropertyValue(Name name) {
         PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
         try {
             PropertyState ps = (PropertyState) stateMgr.getItemState(propId);
@@ -195,7 +196,7 @@
      * @param value
      * @throws RepositoryException
      */
-    public void setPropertyValue(QName name, InternalValue value)
+    public void setPropertyValue(Name name, InternalValue value)
             throws RepositoryException {
         setPropertyValues(name, value.getType(), new InternalValue[]{value}, false);
     }
@@ -208,7 +209,7 @@
      * @param values
      * @throws RepositoryException
      */
-    public void setPropertyValues(QName name, int type, InternalValue[] values)
+    public void setPropertyValues(Name name, int type, InternalValue[] values)
             throws RepositoryException {
         setPropertyValues(name, type, values, true);
     }
@@ -221,7 +222,7 @@
      * @param values
      * @throws RepositoryException
      */
-    public void setPropertyValues(QName name, int type, InternalValue[] values, boolean multiple)
+    public void setPropertyValues(Name name, int type, InternalValue[] values, boolean multiple)
             throws RepositoryException {
 
         PropertyState prop = getOrCreatePropertyState(name, type, multiple);
@@ -238,7 +239,7 @@
      * @return the property state
      * @throws RepositoryException
      */
-    private PropertyState getOrCreatePropertyState(QName name, int type, boolean multiValued)
+    private PropertyState getOrCreatePropertyState(Name name, int type, boolean multiValued)
             throws RepositoryException {
 
         PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
@@ -289,7 +290,7 @@
         // primary type
         set.add(nodeState.getNodeTypeName());
         try {
-            return ntReg.getEffectiveNodeType((QName[]) set.toArray(new QName[set.size()]));
+            return ntReg.getEffectiveNodeType((Name[]) set.toArray(new Name[set.size()]));
         } catch (NodeTypeConflictException ntce) {
             String msg = "internal error: failed to build effective node type for node " + nodeState.getNodeId();
             throw new RepositoryException(msg, ntce);
@@ -302,7 +303,7 @@
      * @param name
      * @return <code>true</code> if the given child exists.
      */
-    public boolean hasNode(QName name) {
+    public boolean hasNode(Name name) {
         return nodeState.hasChildNodeEntry(name);
     }
 
@@ -313,7 +314,7 @@
      * @return <code>true</code> if the child was removed
      * @throws RepositoryException
      */
-    public boolean removeNode(QName name) throws RepositoryException {
+    public boolean removeNode(Name name) throws RepositoryException {
         return removeNode(name, 1);
     }
 
@@ -325,7 +326,7 @@
      * @return <code>true</code> if the child was removed.
      * @throws RepositoryException
      */
-    public boolean removeNode(QName name, int index) throws RepositoryException {
+    public boolean removeNode(Name name, int index) throws RepositoryException {
         try {
             NodeState.ChildNodeEntry entry = nodeState.getChildNodeEntry(name, index);
             if (entry == null) {
@@ -353,7 +354,7 @@
         // remove properties
         Iterator iter = state.getPropertyNames().iterator();
         while (iter.hasNext()) {
-            QName name = (QName) iter.next();
+            Name name = (Name) iter.next();
             PropertyId propId = new PropertyId(id, name);
             PropertyState propState = (PropertyState) stateMgr.getItemState(propId);
             stateMgr.destroy(propState);
@@ -379,7 +380,7 @@
      * @return <code>true</code> if the property was removed.
      * @throws RepositoryException
      */
-    public boolean removeProperty(QName name) throws RepositoryException {
+    public boolean removeProperty(Name name) throws RepositoryException {
         try {
             if (!nodeState.hasPropertyName(name)) {
                 return false;
@@ -405,7 +406,7 @@
      * @return the node state.
      * @throws RepositoryException
      */
-    public NodeStateEx getNode(QName name, int index) throws RepositoryException {
+    public NodeStateEx getNode(Name name, int index) throws RepositoryException {
         NodeState.ChildNodeEntry entry = nodeState.getChildNodeEntry(name, index);
         if (entry == null) {
             return null;
@@ -428,13 +429,13 @@
      * @throws ConstraintViolationException
      * @throws RepositoryException
      */
-    public NodeStateEx addNode(QName nodeName, QName nodeTypeName,
+    public NodeStateEx addNode(Name nodeName, Name nodeTypeName,
                                NodeId id, boolean referenceable)
             throws NoSuchNodeTypeException, ConstraintViolationException, RepositoryException {
 
         NodeStateEx node = createChildNode(nodeName, nodeTypeName, id);
         if (referenceable) {
-            node.setPropertyValue(QName.JCR_UUID, InternalValue.create(node.getNodeId().getUUID().toString()));
+            node.setPropertyValue(NameConstants.JCR_UUID, InternalValue.create(node.getNodeId().getUUID().toString()));
         }
         return node;
     }
@@ -446,7 +447,7 @@
      * @param id
      * @return the newly created node.
      */
-    private NodeStateEx createChildNode(QName name, QName nodeTypeName, NodeId id)
+    private NodeStateEx createChildNode(Name name, Name nodeTypeName, NodeId id)
             throws RepositoryException {
         NodeId parentId = nodeState.getNodeId();
         // create a new node state
@@ -461,7 +462,7 @@
 
         // create Node instance wrapping new node state
         NodeStateEx node = new NodeStateEx(stateMgr, ntReg, state, name);
-        node.setPropertyValue(QName.JCR_PRIMARYTYPE, InternalValue.create(nodeTypeName));
+        node.setPropertyValue(NameConstants.JCR_PRIMARYTYPE, InternalValue.create(nodeTypeName));
 
         // add new child node entryn
         nodeState.addChildNodeEntry(name, id);
@@ -518,7 +519,7 @@
             // first store all transient properties
             Set props = state.getPropertyNames();
             for (Iterator iter = props.iterator(); iter.hasNext();) {
-                QName propName = (QName) iter.next();
+                Name propName = (Name) iter.next();
                 PropertyState pstate = (PropertyState) stateMgr.getItemState(
                         new PropertyId(state.getNodeId(), propName));
                 if (pstate.getStatus() != ItemState.STATUS_EXISTING) {
@@ -563,7 +564,7 @@
             // first discard all all transient properties
             Set props = state.getPropertyNames();
             for (Iterator iter = props.iterator(); iter.hasNext();) {
-                QName propName = (QName) iter.next();
+                Name propName = (Name) iter.next();
                 PropertyState pstate = (PropertyState) stateMgr.getItemState(
                         new PropertyId(state.getNodeId(), propName));
                 if (pstate.getStatus() != ItemState.STATUS_EXISTING) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java Tue Oct 30 03:02:41 2007
@@ -22,8 +22,8 @@
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.state.NodeState;
-import org.apache.jackrabbit.name.NameException;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.conversion.NameException;
+import org.apache.jackrabbit.spi.Name;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -102,7 +102,7 @@
     public Version getVersion(String versionName)
             throws VersionException, RepositoryException {
         try {
-            QName name = session.getQName(versionName);
+            Name name = session.getQName(versionName);
             InternalVersion v = getInternalVersionHistory().getVersion(name);
             if (v == null) {
                 throw new VersionException("No version with name '" + versionName + "' exists in this version history.");
@@ -118,7 +118,7 @@
      */
     public Version getVersionByLabel(String label) throws RepositoryException {
         try {
-            QName qLabel = session.getQName(label);
+            Name qLabel = session.getQName(label);
             InternalVersion v =
                 getInternalVersionHistory().getVersionByLabel(qLabel);
             if (v == null) {
@@ -164,7 +164,7 @@
      * @see javax.jcr.version.VersionHistory#getVersionLabels
      */
     public String[] getVersionLabels() throws RepositoryException {
-        QName[] labels = getInternalVersionHistory().getVersionLabels();
+        Name[] labels = getInternalVersionHistory().getVersionLabels();
         String[] ret = new String[labels.length];
         for (int i = 0; i < labels.length; i++) {
             ret[i] = session.getJCRName(labels[i]);
@@ -178,7 +178,7 @@
     public String[] getVersionLabels(Version version)
             throws VersionException, RepositoryException {
         checkOwnVersion(version);
-        QName[] labels = ((VersionImpl) version).getInternalVersion().getLabels();
+        Name[] labels = ((VersionImpl) version).getInternalVersion().getLabels();
         String[] ret = new String[labels.length];
         for (int i = 0; i < labels.length; i++) {
             ret[i] = session.getJCRName(labels[i]);
@@ -191,7 +191,7 @@
      */
     public boolean hasVersionLabel(String label) throws RepositoryException {
         try {
-            QName qLabel = session.getQName(label);
+            Name qLabel = session.getQName(label);
             return getInternalVersionHistory().getVersionByLabel(qLabel) != null;
         } catch (NameException e) {
             throw new IllegalArgumentException("Unable to resolve label: " + e);
@@ -205,7 +205,7 @@
             throws VersionException, RepositoryException {
         checkOwnVersion(version);
         try {
-            QName qLabel = session.getQName(label);
+            Name qLabel = session.getQName(label);
             return ((VersionImpl) version).getInternalVersion().hasLabel(qLabel);
         } catch (NameException e) {
             throw new VersionException(e);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java Tue Oct 30 03:02:41 2007
@@ -28,7 +28,7 @@
 import org.apache.jackrabbit.core.virtual.VirtualItemStateProvider;
 import org.apache.jackrabbit.core.virtual.VirtualNodeState;
 import org.apache.jackrabbit.core.virtual.VirtualPropertyState;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 import javax.jcr.RepositoryException;
 
@@ -84,7 +84,7 @@
      * @inheritDoc
      */
     public VirtualPropertyState createPropertyState(VirtualNodeState parent,
-                                                    QName name, int type,
+                                                    Name name, int type,
                                                     boolean multiValued)
             throws RepositoryException {
         throw new IllegalStateException("VersionManager should never create a VirtualPropertyState");
@@ -93,8 +93,8 @@
     /**
      * @inheritDoc
      */
-    public VirtualNodeState createNodeState(VirtualNodeState parent, QName name,
-                                            NodeId id, QName nodeTypeName)
+    public VirtualNodeState createNodeState(VirtualNodeState parent, Name name,
+                                            NodeId id, Name nodeTypeName)
             throws RepositoryException {
         throw new IllegalStateException("VersionManager should never create a VirtualNodeState");
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManager.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManager.java Tue Oct 30 03:02:41 2007
@@ -20,7 +20,7 @@
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.virtual.VirtualItemStateProvider;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -86,7 +86,7 @@
      * @param versionName
      * @throws RepositoryException
      */
-    void removeVersion(VersionHistory history, QName versionName)
+    void removeVersion(VersionHistory history, Name versionName)
             throws RepositoryException;
 
     /**
@@ -104,7 +104,7 @@
      * @return
      * @throws RepositoryException
      */
-    Version setVersionLabel(VersionHistory history, QName version, QName label,
+    Version setVersionLabel(VersionHistory history, Name version, Name label,
                             boolean move)
             throws RepositoryException;
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java Tue Oct 30 03:02:41 2007
@@ -42,9 +42,11 @@
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.core.virtual.VirtualItemStateProvider;
-import org.apache.jackrabbit.name.MalformedPathException;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.name.NameConstants;
+import org.apache.jackrabbit.name.PathBuilder;
+import org.apache.jackrabbit.conversion.MalformedPathException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -77,10 +79,10 @@
 
     static {
         try {
-            Path.PathBuilder builder = new Path.PathBuilder();
+            PathBuilder builder = new PathBuilder();
             builder.addRoot();
-            builder.addLast(QName.JCR_SYSTEM);
-            builder.addLast(QName.JCR_VERSIONSTORAGE);
+            builder.addLast(NameConstants.JCR_SYSTEM);
+            builder.addLast(NameConstants.JCR_VERSIONSTORAGE);
             VERSION_STORAGE_PATH = builder.getPath();
         } catch (MalformedPathException e) {
             // will not happen. path is always valid
@@ -142,15 +144,15 @@
             if (!pMgr.exists(rootId)) {
                 NodeState root = pMgr.createNew(rootId);
                 root.setParentId(rootParentId);
-                root.setDefinitionId(ntReg.getEffectiveNodeType(QName.REP_SYSTEM).getApplicableChildNodeDef(
-                        QName.JCR_VERSIONSTORAGE, QName.REP_VERSIONSTORAGE, ntReg).getId());
-                root.setNodeTypeName(QName.REP_VERSIONSTORAGE);
-                PropertyState pt = pMgr.createNew(new PropertyId(rootId, QName.JCR_PRIMARYTYPE));
-                pt.setDefinitionId(ntReg.getEffectiveNodeType(QName.REP_SYSTEM).getApplicablePropertyDef(
-                        QName.JCR_PRIMARYTYPE, PropertyType.NAME, false).getId());
+                root.setDefinitionId(ntReg.getEffectiveNodeType(NameConstants.REP_SYSTEM).getApplicableChildNodeDef(
+                        NameConstants.JCR_VERSIONSTORAGE, NameConstants.REP_VERSIONSTORAGE, ntReg).getId());
+                root.setNodeTypeName(NameConstants.REP_VERSIONSTORAGE);
+                PropertyState pt = pMgr.createNew(new PropertyId(rootId, NameConstants.JCR_PRIMARYTYPE));
+                pt.setDefinitionId(ntReg.getEffectiveNodeType(NameConstants.REP_SYSTEM).getApplicablePropertyDef(
+                        NameConstants.JCR_PRIMARYTYPE, PropertyType.NAME, false).getId());
                 pt.setMultiValued(false);
                 pt.setType(PropertyType.NAME);
-                pt.setValues(new InternalValue[]{InternalValue.create(QName.REP_VERSIONSTORAGE)});
+                pt.setValues(new InternalValue[]{InternalValue.create(NameConstants.REP_VERSIONSTORAGE)});
                 root.addPropertyName(pt.getName());
                 ChangeLog cl = new ChangeLog();
                 cl.added(root);
@@ -163,7 +165,7 @@
             stateMgr.addListener(this);
 
             NodeState nodeState = (NodeState) stateMgr.getItemState(rootId);
-            historyRoot = new NodeStateEx(stateMgr, ntReg, nodeState, QName.JCR_VERSIONSTORAGE);
+            historyRoot = new NodeStateEx(stateMgr, ntReg, nodeState, NameConstants.JCR_VERSIONSTORAGE);
 
             // create the virtual item state provider
             versProvider = new VersionItemStateProvider(
@@ -249,14 +251,14 @@
                         NodeStateEx pNode = new NodeStateEx(stateMgr, ntReg, state, null);
                         NodeId parentId = pNode.getParentId();
                         InternalVersionItem parent = getItem(parentId);
-                        QName ntName = state.getNodeTypeName();
-                        if (ntName.equals(QName.NT_FROZENNODE)) {
+                        Name ntName = state.getNodeTypeName();
+                        if (ntName.equals(NameConstants.NT_FROZENNODE)) {
                             item = new InternalFrozenNodeImpl(this, pNode, parent);
-                        } else if (ntName.equals(QName.NT_VERSIONEDCHILD)) {
+                        } else if (ntName.equals(NameConstants.NT_VERSIONEDCHILD)) {
                             item = new InternalFrozenVHImpl(this, pNode, parent);
-                        } else if (ntName.equals(QName.NT_VERSION)) {
+                        } else if (ntName.equals(NameConstants.NT_VERSION)) {
                             item = ((InternalVersionHistory) parent).getVersion(id);
-                        } else if (ntName.equals(QName.NT_VERSIONHISTORY)) {
+                        } else if (ntName.equals(NameConstants.NT_VERSIONHISTORY)) {
                             item = new InternalVersionHistoryImpl(this, pNode);
                         } else {
                             return null;
@@ -285,7 +287,7 @@
         InternalVersion version = (InternalVersion)
                 escFactory.doSourced((SessionImpl) node.getSession(), new SourcedTarget(){
             public Object run() throws RepositoryException {
-                String histUUID = node.getProperty(QName.JCR_VERSIONHISTORY).getString();
+                String histUUID = node.getProperty(NameConstants.JCR_VERSIONHISTORY).getString();
                 return checkin((InternalVersionHistoryImpl)
                         getVersionHistory(NodeId.valueOf(histUUID)), node);
             }
@@ -301,7 +303,7 @@
      * This method must not be synchronized since it could cause deadlocks with
      * item-reading listeners in the observation thread.
      */
-    public void removeVersion(VersionHistory history, final QName name)
+    public void removeVersion(VersionHistory history, final Name name)
             throws VersionException, RepositoryException {
 
         final VersionHistoryImpl historyImpl = (VersionHistoryImpl) history;
@@ -327,7 +329,7 @@
      * item-reading listeners in the observation thread.
      */
     public Version setVersionLabel(final VersionHistory history,
-                                   final QName version, final QName label,
+                                   final Name version, final Name label,
                                    final boolean move)
             throws RepositoryException {
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java Tue Oct 30 03:02:41 2007
@@ -39,7 +39,8 @@
 import org.apache.jackrabbit.core.virtual.VirtualItemStateProvider;
 import org.apache.jackrabbit.core.virtual.VirtualNodeState;
 import org.apache.jackrabbit.core.virtual.VirtualPropertyState;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.name.NameConstants;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -112,7 +113,7 @@
         } catch (ItemStateException e) {
             throw new RepositoryException("Unable to retrieve history root", e);
         }
-        this.historyRoot = new NodeStateEx(stateMgr, ntReg, state, QName.JCR_VERSIONSTORAGE);
+        this.historyRoot = new NodeStateEx(stateMgr, ntReg, state, NameConstants.JCR_VERSIONSTORAGE);
     }
 
     //------------------------------------------< EventStateCollectionFactory >
@@ -153,7 +154,7 @@
      */
     public Version checkin(NodeImpl node) throws RepositoryException {
         if (isInXA()) {
-            String histUUID = node.getProperty(QName.JCR_VERSIONHISTORY).getString();
+            String histUUID = node.getProperty(NameConstants.JCR_VERSIONHISTORY).getString();
             InternalVersion version = checkin((InternalVersionHistoryImpl)
                     getVersionHistory(NodeId.valueOf(histUUID)), node);
             return (Version) ((SessionImpl) node.getSession()).getNodeById(version.getId());
@@ -164,7 +165,7 @@
     /**
      * {@inheritDoc}
      */
-    public void removeVersion(VersionHistory history, QName versionName)
+    public void removeVersion(VersionHistory history, Name versionName)
             throws RepositoryException {
 
         if (isInXA()) {
@@ -179,8 +180,8 @@
     /**
      * {@inheritDoc}
      */
-    public Version setVersionLabel(VersionHistory history, QName version,
-                                   QName label, boolean move)
+    public Version setVersionLabel(VersionHistory history, Name version,
+                                   Name label, boolean move)
             throws RepositoryException {
 
         if (isInXA()) {
@@ -223,7 +224,7 @@
      * {@inheritDoc}
      */
     public VirtualPropertyState createPropertyState(VirtualNodeState parent,
-                                                    QName name, int type,
+                                                    Name name, int type,
                                                     boolean multiValued)
             throws RepositoryException {
 
@@ -233,8 +234,8 @@
     /**
      * {@inheritDoc}
      */
-    public VirtualNodeState createNodeState(VirtualNodeState parent, QName name,
-                                            NodeId id, QName nodeTypeName)
+    public VirtualNodeState createNodeState(VirtualNodeState parent, Name name,
+                                            NodeId id, Name nodeTypeName)
             throws RepositoryException {
 
         throw new IllegalStateException("Read-only");
@@ -373,7 +374,7 @@
      * <p/>
      * Before modifying version history given, make a local copy of it.
      */
-    protected void removeVersion(InternalVersionHistoryImpl history, QName name)
+    protected void removeVersion(InternalVersionHistoryImpl history, Name name)
             throws VersionException, RepositoryException {
 
         if (history.getVersionManager() != this) {
@@ -399,7 +400,7 @@
      * Before modifying version history given, make a local copy of it.
      */
     protected InternalVersion setVersionLabel(InternalVersionHistoryImpl history,
-                                              QName version, QName label,
+                                              Name version, Name label,
                                               boolean move)
             throws RepositoryException {
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java Tue Oct 30 03:02:41 2007
@@ -33,9 +33,10 @@
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.ItemStateReferenceMap;
 import org.apache.jackrabbit.core.state.ItemStateListener;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.uuid.UUID;
 import org.apache.jackrabbit.util.WeakIdentityCollection;
+import org.apache.jackrabbit.name.NameConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -251,7 +252,7 @@
      * {@inheritDoc}
      */
     public VirtualPropertyState createPropertyState(VirtualNodeState parent,
-                                                    QName name, int type,
+                                                    Name name, int type,
                                                     boolean multiValued)
             throws RepositoryException {
         PropDef def = getApplicablePropertyDef(parent, name, type, multiValued);
@@ -266,8 +267,8 @@
     /**
      * {@inheritDoc}
      */
-    public VirtualNodeState createNodeState(VirtualNodeState parent, QName name,
-                                            NodeId id, QName nodeTypeName)
+    public VirtualNodeState createNodeState(VirtualNodeState parent, Name name,
+                                            NodeId id, Name nodeTypeName)
             throws RepositoryException {
 
         NodeDefId def;
@@ -276,7 +277,7 @@
         } catch (RepositoryException re) {
             // hack, use nt:unstructured as parent
             NodeTypeRegistry ntReg = getNodeTypeRegistry();
-            EffectiveNodeType ent = ntReg.getEffectiveNodeType(QName.NT_UNSTRUCTURED);
+            EffectiveNodeType ent = ntReg.getEffectiveNodeType(NameConstants.NT_UNSTRUCTURED);
             NodeDef cnd = ent.getApplicableChildNodeDef(name, nodeTypeName, ntReg);
             ntReg.getNodeDef(cnd.getId());
             def = cnd.getId();
@@ -287,7 +288,7 @@
         if (id == null) {
             id = new NodeId(UUID.randomUUID());
         }
-        state = new VirtualNodeState(this, parent.getNodeId(), id, nodeTypeName, new QName[0]);
+        state = new VirtualNodeState(this, parent.getNodeId(), id, nodeTypeName, new Name[0]);
         state.setDefinitionId(def);
 
         cache(state);
@@ -376,7 +377,7 @@
      * @return
      * @throws RepositoryException
      */
-    protected PropDef getApplicablePropertyDef(NodeState parent, QName propertyName,
+    protected PropDef getApplicablePropertyDef(NodeState parent, Name propertyName,
                                                int type, boolean multiValued)
             throws RepositoryException {
         return getEffectiveNodeType(parent).getApplicablePropertyDef(propertyName, type, multiValued);
@@ -390,7 +391,7 @@
      * @return
      * @throws RepositoryException
      */
-    protected NodeDef getApplicableChildNodeDef(NodeState parent, QName nodeName, QName nodeTypeName)
+    protected NodeDef getApplicableChildNodeDef(NodeState parent, Name nodeName, Name nodeTypeName)
             throws RepositoryException {
         return getEffectiveNodeType(parent).getApplicableChildNodeDef(
                 nodeName, nodeTypeName, getNodeTypeRegistry());
@@ -411,7 +412,7 @@
         // primary type
         set.add(parent.getNodeTypeName());
         try {
-            return ntReg.getEffectiveNodeType((QName[]) set.toArray(new QName[set.size()]));
+            return ntReg.getEffectiveNodeType((Name[]) set.toArray(new Name[set.size()]));
         } catch (NodeTypeConflictException ntce) {
             String msg = "internal error: failed to build effective node type for node " + parent.getNodeId();
             throw new RepositoryException(msg, ntce);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualItemStateProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualItemStateProvider.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualItemStateProvider.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualItemStateProvider.java Tue Oct 30 03:02:41 2007
@@ -21,7 +21,7 @@
 import org.apache.jackrabbit.core.state.ItemStateManager;
 import org.apache.jackrabbit.core.state.NodeReferences;
 import org.apache.jackrabbit.core.state.ItemStateListener;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 import javax.jcr.RepositoryException;
 
@@ -56,7 +56,7 @@
      * @throws RepositoryException
      */
     VirtualPropertyState createPropertyState(VirtualNodeState parent,
-                                             QName name, int type,
+                                             Name name, int type,
                                              boolean multiValued)
             throws RepositoryException;
 
@@ -70,8 +70,8 @@
      * @return
      * @throws RepositoryException
      */
-    VirtualNodeState createNodeState(VirtualNodeState parent, QName name,
-                                     NodeId id, QName nodeTypeName)
+    VirtualNodeState createNodeState(VirtualNodeState parent, Name name,
+                                     NodeId id, Name nodeTypeName)
         throws RepositoryException;
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java Tue Oct 30 03:02:41 2007
@@ -21,7 +21,8 @@
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.core.NodeId;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.name.NameConstants;
 
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
@@ -60,14 +61,14 @@
     public VirtualNodeState(AbstractVISProvider stateMgr,
                             NodeId parentId,
                             NodeId id,
-                            QName nodeTypeName,
-                            QName[] mixins)
+                            Name nodeTypeName,
+                            Name[] mixins)
             throws RepositoryException {
         super(id, nodeTypeName, parentId, ItemState.STATUS_EXISTING, false);
         this.stateMgr = stateMgr;
         setContainer(stateMgr);
         // add default properties
-        setPropertyValue(QName.JCR_PRIMARYTYPE, InternalValue.create(nodeTypeName));
+        setPropertyValue(NameConstants.JCR_PRIMARYTYPE, InternalValue.create(nodeTypeName));
         setMixinNodeTypes(mixins);
     }
 
@@ -87,7 +88,7 @@
      * @param name
      * @return the values
      */
-    public InternalValue[] getPropertyValues(QName name) throws NoSuchItemStateException {
+    public InternalValue[] getPropertyValues(Name name) throws NoSuchItemStateException {
         VirtualPropertyState ps = getProperty(name);
         if (ps == null) {
             return null;
@@ -102,7 +103,7 @@
      * @param name
      * @return the value
      */
-    public InternalValue getPropertyValue(QName name) throws NoSuchItemStateException {
+    public InternalValue getPropertyValue(Name name) throws NoSuchItemStateException {
         VirtualPropertyState ps = getProperty(name);
         if (ps == null || ps.getValues().length == 0) {
             return null;
@@ -118,7 +119,7 @@
      * @return
      * @throws NoSuchItemStateException
      */
-    public VirtualPropertyState getProperty(QName name) throws NoSuchItemStateException {
+    public VirtualPropertyState getProperty(Name name) throws NoSuchItemStateException {
         return (VirtualPropertyState) properties.get(name);
     }
 
@@ -129,7 +130,7 @@
      * @param value
      * @throws javax.jcr.RepositoryException
      */
-    public void setPropertyValue(QName name, InternalValue value)
+    public void setPropertyValue(Name name, InternalValue value)
             throws RepositoryException {
         setPropertyValues(name, value.getType(), new InternalValue[]{value}, false);
     }
@@ -142,7 +143,7 @@
      * @param values
      * @throws RepositoryException
      */
-    public void setPropertyValues(QName name, int type, InternalValue[] values)
+    public void setPropertyValues(Name name, int type, InternalValue[] values)
             throws RepositoryException {
         setPropertyValues(name, type, values, true);
     }
@@ -155,7 +156,7 @@
      * @param values
      * @throws RepositoryException
      */
-    public void setPropertyValues(QName name, int type, InternalValue[] values, boolean multiple)
+    public void setPropertyValues(Name name, int type, InternalValue[] values, boolean multiple)
             throws RepositoryException {
         VirtualPropertyState prop = getOrCreatePropertyState(name, type, multiple);
         prop.setValues(values);
@@ -170,7 +171,7 @@
      * @return
      * @throws RepositoryException
      */
-    protected VirtualPropertyState getOrCreatePropertyState(QName name, int type, boolean multiValued)
+    protected VirtualPropertyState getOrCreatePropertyState(Name name, int type, boolean multiValued)
             throws RepositoryException {
 
         VirtualPropertyState prop = (VirtualPropertyState) properties.get(name);
@@ -188,7 +189,7 @@
      * @param mixins
      * @throws RepositoryException
      */
-    public void setMixinNodeTypes(QName[] mixins) throws RepositoryException {
+    public void setMixinNodeTypes(Name[] mixins) throws RepositoryException {
         if (mixins != null) {
             HashSet set = new HashSet();
             InternalValue[] values = new InternalValue[mixins.length];
@@ -197,7 +198,7 @@
                 values[i] = InternalValue.create(mixins[i]);
             }
             setMixinTypeNames(set);
-            setPropertyValues(QName.JCR_MIXINTYPES, PropertyType.NAME, values);
+            setPropertyValues(NameConstants.JCR_MIXINTYPES, PropertyType.NAME, values);
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualValueProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualValueProvider.java?rev=590014&r1=590013&r2=590014&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualValueProvider.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualValueProvider.java Tue Oct 30 03:02:41 2007
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.core.virtual;
 
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 /**
  * A <code>VirtualValueProvider</code> is used for virtual properties that
@@ -30,6 +30,6 @@
      * @param propName the name of the property
      * @return the values
      */
-    InternalValue[] getVirtualValues(QName propName);
+    InternalValue[] getVirtualValues(Name propName);
 
 }



Mime
View raw message