jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r586065 [6/8] - in /jackrabbit/trunk/contrib/spi: client/src/test/java/org/apache/jackrabbit/jcr2spi/ jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ jcr2spi/src/main/java/...
Date Thu, 18 Oct 2007 18:41:57 GMT
Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/DocViewSAXEventGenerator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/DocViewSAXEventGenerator.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/DocViewSAXEventGenerator.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/DocViewSAXEventGenerator.java Thu Oct 18 11:41:45 2007
@@ -16,9 +16,8 @@
  */
 package org.apache.jackrabbit.jcr2spi.xml;
 
-import org.apache.jackrabbit.name.NameException;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.NameFormat;
+import org.apache.jackrabbit.conversion.NameException;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.util.ISO9075;
 import org.apache.jackrabbit.value.ValueHelper;
 import org.xml.sax.ContentHandler;
@@ -69,9 +68,9 @@
         props = new ArrayList();
     }
 
-    private QName getQName(String rawName) throws RepositoryException {
+    private Name getName(String rawName) throws RepositoryException {
         try {
-            return NameFormat.parse(rawName, nsResolver);
+            return nameResolver.getQName(rawName);
         } catch (NameException e) {
             // should never get here...
             String msg = "internal error: failed to resolve namespace mappings";
@@ -154,7 +153,7 @@
 
                 // attribute name (encode property name to make sure it's a valid xml name)
                 String attrName = ISO9075.encode(propName);
-                QName qName = getQName(attrName);
+                Name qName = getName(attrName);
 
                 // attribute value
                 if (prop.getType() == PropertyType.BINARY && skipBinary) {
@@ -172,7 +171,7 @@
             }
 
             // start element (node)
-            QName qName = getQName(elemName);
+            Name qName = getName(elemName);
             contentHandler.startElement(qName.getNamespaceURI(),
                     qName.getLocalName(), elemName, attrs);
         }
@@ -200,7 +199,7 @@
         }
 
         // end element (node)
-        QName qName = getQName(elemName);
+        Name qName = getName(elemName);
         contentHandler.endElement(qName.getNamespaceURI(), qName.getLocalName(),
                 elemName);
     }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java Thu Oct 18 11:41:45 2007
@@ -16,12 +16,14 @@
  */
 package org.apache.jackrabbit.jcr2spi.xml;
 
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.name.AbstractNamespaceResolver;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.namespace.AbstractNamespaceResolver;
+import org.apache.jackrabbit.namespace.NamespaceResolver;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.conversion.NameResolver;
+import org.apache.jackrabbit.conversion.ParsingNameResolver;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.helpers.DefaultHandler;
@@ -56,13 +58,14 @@
     private final Importer importer;
     private final NamespaceRegistry nsReg;
     private final NamespaceResolver nsResolver;
+    private final NameFactory nameFactory;
 
-    private Locator locator;
     private ContentHandler targetHandler;
     private boolean systemViewXML;
     private boolean initialized;
 
     private final NamespaceContext nsContext;
+    private final NameResolver nameResolver;
 
     /**
      * this flag is used to determine whether a namespace context needs to be
@@ -74,12 +77,14 @@
     protected boolean nsContextStarted;
 
     public ImportHandler(Importer importer, NamespaceResolver nsResolver,
-                         NamespaceRegistry nsReg) {
+                         NamespaceRegistry nsReg, NameFactory nameFactory) {
         this.importer = importer;
         this.nsResolver = nsResolver;
         this.nsReg = nsReg;
+        this.nameFactory = nameFactory;
 
         nsContext = new NamespaceContext();
+        nameResolver = new ParsingNameResolver(nameFactory, nsContext);
     }
 
     //---------------------------------------------------------< ErrorHandler >
@@ -220,12 +225,12 @@
         if (!initialized) {
             // the namespace of the first element determines the type of XML
             // (system view/document view)
-            systemViewXML = QName.NS_SV_URI.equals(namespaceURI);
+            systemViewXML = Name.NS_SV_URI.equals(namespaceURI);
 
             if (systemViewXML) {
-                targetHandler = new SysViewImportHandler(importer, nsContext);
+                targetHandler = new SysViewImportHandler(importer, nsContext, nameResolver);
             } else {
-                targetHandler = new DocViewImportHandler(importer, nsContext);
+                targetHandler = new DocViewImportHandler(importer, nsContext, nameResolver, nameFactory);
             }
             targetHandler.startDocument();
             initialized = true;
@@ -255,13 +260,6 @@
         targetHandler.endElement(namespaceURI, localName, qName);
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    public void setDocumentLocator(Locator locator) {
-        this.locator = locator;
-    }
-
     //--------------------------------------------------------< inner classes >
     /**
      * <code>NamespaceContext</code> supports scoped namespace declarations.
@@ -293,7 +291,7 @@
         }
 
         boolean declarePrefix(String prefix, String uri) {
-            if (QName.NS_DEFAULT_URI.equals(uri)) {
+            if (Name.NS_DEFAULT_URI.equals(uri)) {
                 uri = DUMMY_DEFAULT_URI;
             }
             return nsContext.declarePrefix(prefix, uri);
@@ -308,7 +306,7 @@
             if (uri == null) {
                 throw new NamespaceException("unknown prefix");
             } else if (DUMMY_DEFAULT_URI.equals(uri)) {
-                return QName.NS_DEFAULT_URI;
+                return Name.NS_DEFAULT_URI;
             } else {
                 return uri;
             }
@@ -318,7 +316,7 @@
          * {@inheritDoc}
          */
         public String getPrefix(String uri) throws NamespaceException {
-            if (QName.NS_DEFAULT_URI.equals(uri)) {
+            if (Name.NS_DEFAULT_URI.equals(uri)) {
                 uri = DUMMY_DEFAULT_URI;
             }
             String prefix = nsContext.getPrefix(uri);
@@ -328,8 +326,8 @@
                  * (default) prefix; we have to do a reverse-lookup to check
                  * whether it's the current default namespace
                  */
-                if (uri.equals(nsContext.getURI(QName.NS_EMPTY_PREFIX))) {
-                    return QName.NS_EMPTY_PREFIX;
+                if (uri.equals(nsContext.getURI(Name.NS_EMPTY_PREFIX))) {
+                    return Name.NS_EMPTY_PREFIX;
                 }
                 throw new NamespaceException("unknown uri");
             }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/Importer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/Importer.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/Importer.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/Importer.java Thu Oct 18 11:41:45 2007
@@ -16,8 +16,8 @@
  */
 package org.apache.jackrabbit.jcr2spi.xml;
 
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.namespace.NamespaceResolver;
 
 import javax.jcr.RepositoryException;
 
@@ -57,27 +57,27 @@
 
     //--------------------------------------------------------< inner classes >
     static class NodeInfo {
-        private final QName name;
-        private final QName nodeTypeName;
-        private final QName[] mixinNames;
+        private final Name name;
+        private final Name nodeTypeName;
+        private final Name[] mixinNames;
         private String uuid;
 
-        public NodeInfo(QName name, QName nodeTypeName, QName[] mixinNames, String uuid) {
+        public NodeInfo(Name name, Name nodeTypeName, Name[] mixinNames, String uuid) {
             this.name = name;
             this.nodeTypeName = nodeTypeName;
             this.mixinNames = mixinNames;
             this.uuid = uuid;
         }
 
-        public QName getName() {
+        public Name getName() {
             return name;
         }
 
-        public QName getNodeTypeName() {
+        public Name getNodeTypeName() {
             return nodeTypeName;
         }
 
-        public QName[] getMixinNames() {
+        public Name[] getMixinNames() {
             return mixinNames;
         }
 
@@ -91,17 +91,17 @@
     }
 
     static class PropInfo {
-        private final QName name;
+        private final Name name;
         private final int type;
         private final TextValue[] values;
 
-        public PropInfo(QName name, int type, TextValue[] values) {
+        public PropInfo(Name name, int type, TextValue[] values) {
             this.name = name;
             this.type = type;
             this.values = values;
         }
 
-        public QName getName() {
+        public Name getName() {
             return name;
         }
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java Thu Oct 18 11:41:45 2007
@@ -30,7 +30,7 @@
 import org.apache.jackrabbit.jcr2spi.util.ReferenceChangeTracker;
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.jcr2spi.nodetype.EffectiveNodeType;
-import org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeConflictException;
+import org.apache.jackrabbit.nodetype.NodeTypeConflictException;
 import org.apache.jackrabbit.jcr2spi.nodetype.EffectiveNodeTypeProvider;
 import org.apache.jackrabbit.jcr2spi.operation.AddNode;
 import org.apache.jackrabbit.jcr2spi.operation.Remove;
@@ -38,8 +38,7 @@
 import org.apache.jackrabbit.jcr2spi.operation.SetPropertyValue;
 import org.apache.jackrabbit.jcr2spi.operation.SetMixin;
 import org.apache.jackrabbit.jcr2spi.operation.Operation;
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.util.Base64;
 import org.apache.jackrabbit.util.TransientFileFactory;
 import org.slf4j.LoggerFactory;
@@ -56,8 +55,8 @@
 import javax.jcr.lock.LockException;
 import javax.jcr.version.VersionException;
 import javax.jcr.nodetype.ConstraintViolationException;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.name.NameConstants;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.NodeId;
@@ -65,6 +64,7 @@
 import org.apache.jackrabbit.value.ValueHelper;
 import org.apache.jackrabbit.value.ValueFormat;
 import org.apache.jackrabbit.uuid.UUID;
+import org.apache.jackrabbit.namespace.NamespaceResolver;
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -130,7 +130,7 @@
         try {
             ItemState itemState = session.getHierarchyManager().getItemState(parentPath);
             if (!itemState.isNode()) {
-                throw new PathNotFoundException(LogUtil.safeGetJCRPath(parentPath, session.getNamespaceResolver()));
+                throw new PathNotFoundException(LogUtil.safeGetJCRPath(parentPath, session.getPathResolver()));
             }
             importTarget = (NodeState) itemState;
 
@@ -142,7 +142,7 @@
             parents = new Stack();
             parents.push(importTarget);
         } catch (ItemNotFoundException e) {
-            throw new PathNotFoundException(LogUtil.safeGetJCRPath(parentPath, session.getNamespaceResolver()));
+            throw new PathNotFoundException(LogUtil.safeGetJCRPath(parentPath, session.getPathResolver()));
         }
     }
 
@@ -190,14 +190,14 @@
                    if (def.isProtected() && entExisting.includesNodeType(nodeInfo.getNodeTypeName())) {
                        // skip protected node
                        parents.push(null); // push null onto stack for skipped node
-                       log.debug("skipping protected node " + LogUtil.safeGetJCRPath(existing, session.getNamespaceResolver()));
+                       log.debug("skipping protected node " + LogUtil.safeGetJCRPath(existing, session.getPathResolver()));
                        return;
                    }
                    if (def.isAutoCreated() && entExisting.includesNodeType(nodeInfo.getNodeTypeName())) {
                        // this node has already been auto-created, no need to create it
                        nodeState = existing;
                    } else {
-                       throw new ItemExistsException(LogUtil.safeGetJCRPath(existing, session.getNamespaceResolver()));
+                       throw new ItemExistsException(LogUtil.safeGetJCRPath(existing, session.getPathResolver()));
                    }
                }
            } catch (ItemNotFoundException e) {
@@ -347,17 +347,10 @@
                 // make sure conflicting node is not importTarget or an ancestor thereof
                 Path p0 = importTarget.getQPath();
                 Path p1 = conflicting.getPath();
-                try {
-                    if (p1.equals(p0) || p1.isAncestorOf(p0)) {
-                        msg = "cannot remove ancestor node";
-                        log.debug(msg);
-                        throw new ConstraintViolationException(msg);
-                    }
-                } catch (MalformedPathException e) {
-                    // should never get here...
-                    msg = "internal error: failed to determine degree of relationship";
-                    log.error(msg, e);
-                    throw new RepositoryException(msg, e);
+                if (p1.equals(p0) || p1.isAncestorOf(p0)) {
+                    msg = "cannot remove ancestor node";
+                    log.debug(msg);
+                    throw new ConstraintViolationException(msg);
                 }
                 // do remove conflicting (recursive) including validation check
                 try {
@@ -419,9 +412,9 @@
                 // assume this property has been imported as well;
                 // rename conflicting property
                 // TODO: use better reversible escaping scheme to create unique name
-                QName newName = new QName(nodeInfo.getName().getNamespaceURI(), nodeInfo.getName().getLocalName() + "_");
+                Name newName = session.getNameFactory().create(nodeInfo.getName().getNamespaceURI(), nodeInfo.getName().getLocalName() + "_");
                 if (parent.hasPropertyName(newName)) {
-                    newName = new QName(newName.getNamespaceURI(), newName.getLocalName() + "_");
+                    newName = session.getNameFactory().create(newName.getNamespaceURI(), newName.getLocalName() + "_");
                 }
                 // since name changes, need to find new applicable definition
                 QPropertyDefinition propDef;
@@ -452,7 +445,7 @@
             log.debug("Skipping protected nodeState (" + nodeInfo.getName() + ")");
             return null;
         } else {
-            QName ntName = nodeInfo.getNodeTypeName();
+            Name ntName = nodeInfo.getNodeTypeName();
             if (ntName == null) {
                 // use default node type
                 ntName = def.getDefaultPrimaryType();
@@ -485,8 +478,8 @@
      * @throws RepositoryException
      * @throws ConstraintViolationException
      */
-    private void importProperty(PropInfo pi, NodeState parentState, NamespaceResolver nsResolver) throws RepositoryException, ConstraintViolationException {
-        QName propName = pi.getName();
+    private void importProperty(PropInfo pi, NodeState parentState, org.apache.jackrabbit.namespace.NamespaceResolver nsResolver) throws RepositoryException, ConstraintViolationException {
+        Name propName = pi.getName();
         TextValue[] tva = pi.getValues();
         int infoType = pi.getType();
 
@@ -502,7 +495,7 @@
                 def = existing.getDefinition();
                 if (def.isProtected()) {
                     // skip protected property
-                    log.debug("skipping protected property " + LogUtil.safeGetJCRPath(existing, session.getNamespaceResolver()));
+                    log.debug("skipping protected property " + LogUtil.safeGetJCRPath(existing, session.getPathResolver()));
                     return;
                 }
                 if (def.isAutoCreated()
@@ -511,7 +504,7 @@
                     // this property has already been auto-created, no need to create it
                     propState = existing;
                 } else {
-                    throw new ItemExistsException(LogUtil.safeGetJCRPath(existing, session.getNamespaceResolver()));
+                    throw new ItemExistsException(LogUtil.safeGetJCRPath(existing, session.getPathResolver()));
                 }
             } catch (ItemNotFoundException e) {
                 // property apperently doesn't exist any more
@@ -574,7 +567,7 @@
      * @return
      * @throws RepositoryException
      */
-    private QValue[] getPropertyValues(PropInfo propertyInfo, int targetType, boolean isMultiple, NamespaceResolver nsResolver) throws RepositoryException {
+    private QValue[] getPropertyValues(PropInfo propertyInfo, int targetType, boolean isMultiple, org.apache.jackrabbit.namespace.NamespaceResolver nsResolver) throws RepositoryException {
         TextValue[] tva = propertyInfo.getValues();
         // check multi-valued characteristic
         if ((tva.length == 0 || tva.length > 1) && !isMultiple) {
@@ -596,7 +589,7 @@
      * @return
      * @throws RepositoryException
      */
-    private QValue buildQValue(TextValue tv, int targetType, NamespaceResolver nsResolver) throws RepositoryException {
+    private QValue buildQValue(TextValue tv, int targetType, org.apache.jackrabbit.namespace.NamespaceResolver nsResolver) throws RepositoryException {
         QValue iv;
         try {
             switch (targetType) {
@@ -628,7 +621,7 @@
                 default:
                     // build iv using namespace context of xml document
                     Value v = ValueHelper.convert(tv.retrieve(), targetType, session.getValueFactory());
-                    iv = ValueFormat.getQValue(v, nsResolver, session.getQValueFactory());
+                    iv = ValueFormat.getQValue(v, session.getNamePathResolver(), session.getQValueFactory());
                     break;
             }
             return iv;
@@ -650,14 +643,14 @@
         List l = new ArrayList();
         l.add(nodeInfo.getNodeTypeName());
         l.addAll(Arrays.asList(nodeInfo.getMixinNames()));
-        if (l.contains(QName.MIX_REFERENCEABLE)) {
+        if (l.contains(NameConstants.MIX_REFERENCEABLE)) {
             // shortcut
             return;
         }
-        QName[] ntNames = (QName[]) l.toArray(new QName[l.size()]);
+        Name[] ntNames = (Name[]) l.toArray(new Name[l.size()]);
         try {
             EffectiveNodeType ent = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(ntNames);
-            if (!ent.includesNodeType(QName.MIX_REFERENCEABLE)) {
+            if (!ent.includesNodeType(NameConstants.MIX_REFERENCEABLE)) {
                 throw new ConstraintViolationException("XML defines jcr:uuid without defining import node to be referenceable.");
             }
         } catch (NodeTypeConflictException e) {

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SysViewImportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SysViewImportHandler.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SysViewImportHandler.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SysViewImportHandler.java Thu Oct 18 11:41:45 2007
@@ -16,17 +16,17 @@
  */
 package org.apache.jackrabbit.jcr2spi.xml;
 
-import org.apache.jackrabbit.name.IllegalNameException;
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.name.UnknownPrefixException;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.NameFormat;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.name.NameConstants;
+import org.apache.jackrabbit.conversion.NameException;
+import org.apache.jackrabbit.conversion.NameResolver;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
 import javax.jcr.InvalidSerializedDataException;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
+import javax.jcr.NamespaceException;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -48,7 +48,7 @@
     /**
      * fields used temporarily while processing sv:property and sv:value elements
      */
-    private QName currentPropName;
+    private Name currentPropName;
     private int currentPropType = PropertyType.UNDEFINED;
     // list of AppendableValue objects
     private ArrayList currentPropValues = new ArrayList();
@@ -60,8 +60,8 @@
      * @param importer
      * @param nsContext
      */
-    SysViewImportHandler(Importer importer, NamespaceResolver nsContext) {
-        super(importer, nsContext);
+    SysViewImportHandler(Importer importer, org.apache.jackrabbit.namespace.NamespaceResolver nsContext, NameResolver nameResolver) {
+        super(importer, nsContext, nameResolver);
     }
 
     private void processNode(ImportState state, boolean start, boolean end)
@@ -69,9 +69,9 @@
         if (!start && !end) {
             return;
         }
-        QName[] mixins = null;
+        Name[] mixins = null;
         if (state.mixinNames != null) {
-            mixins = (QName[]) state.mixinNames.toArray(new QName[state.mixinNames.size()]);
+            mixins = (Name[]) state.mixinNames.toArray(new Name[state.mixinNames.size()]);
         }
         Importer.NodeInfo nodeInfo = new Importer.NodeInfo(state.nodeName, state.nodeTypeName, mixins, state.uuid);
 
@@ -104,7 +104,7 @@
                              String qName, Attributes atts)
             throws SAXException {
         // check namespace
-        if (!QName.NS_SV_URI.equals(namespaceURI)) {
+        if (!Name.NS_SV_URI.equals(namespaceURI)) {
             throw new SAXException(new InvalidSerializedDataException("invalid namespace for element in system view xml document: "
                     + namespaceURI));
         }
@@ -132,11 +132,11 @@
             // push new ImportState instance onto the stack
             ImportState state = new ImportState();
             try {
-                state.nodeName = NameFormat.parse(name, nsContext);
-            } catch (IllegalNameException ine) {
-                throw new SAXException(new InvalidSerializedDataException("illegal node name: " + name, ine));
-            } catch (UnknownPrefixException upe) {
-                throw new SAXException(new InvalidSerializedDataException("illegal node name: " + name, upe));
+                state.nodeName = nameResolver.getQName(name);
+            } catch (NameException e) {
+                throw new SAXException(new InvalidSerializedDataException("illegal node name: " + name, e));
+            } catch (NamespaceException e) {
+                throw new SAXException(new InvalidSerializedDataException("illegal node name: " + name, e));
             }
             stack.push(state);
         } else if (SysViewSAXEventGenerator.PROPERTY_ELEMENT.equals(localName)) {
@@ -152,11 +152,11 @@
                         "missing mandatory sv:name attribute of element sv:property"));
             }
             try {
-                currentPropName = NameFormat.parse(name, nsContext);
-            } catch (IllegalNameException ine) {
-                throw new SAXException(new InvalidSerializedDataException("illegal property name: " + name, ine));
-            } catch (UnknownPrefixException upe) {
-                throw new SAXException(new InvalidSerializedDataException("illegal property name: " + name, upe));
+                currentPropName = nameResolver.getQName(name);
+            } catch (org.apache.jackrabbit.conversion.NameException e) {
+                throw new SAXException(new InvalidSerializedDataException("illegal property name: " + name, e));
+            } catch (NamespaceException e) {
+                throw new SAXException(new InvalidSerializedDataException("illegal property name: " + name, e));
             }
             // property type (sv:type attribute)
             String type = atts.getValue(SysViewSAXEventGenerator.PREFIXED_TYPE_ATTRIBUTE);
@@ -235,20 +235,20 @@
 
             // check if all system properties (jcr:primaryType, jcr:uuid etc.)
             // have been collected and create node as necessary
-            if (currentPropName.equals(QName.JCR_PRIMARYTYPE)) {
+            if (currentPropName.equals(NameConstants.JCR_PRIMARYTYPE)) {
                 AppendableValue val = (AppendableValue) currentPropValues.get(0);
                 String s = null;
                 try {
                     s = val.retrieve();
-                    state.nodeTypeName = NameFormat.parse(s, nsContext);
+                    state.nodeTypeName = nameResolver.getQName(s);
                 } catch (IOException ioe) {
                     throw new SAXException("error while retrieving value", ioe);
-                } catch (IllegalNameException ine) {
-                    throw new SAXException(new InvalidSerializedDataException("illegal node type name: " + s, ine));
-                } catch (UnknownPrefixException upe) {
-                    throw new SAXException(new InvalidSerializedDataException("illegal node type name: " + s, upe));
+                } catch (org.apache.jackrabbit.conversion.NameException e) {
+                    throw new SAXException(new InvalidSerializedDataException("illegal node type name: " + s, e));
+                } catch (NamespaceException e) {
+                    throw new SAXException(new InvalidSerializedDataException("illegal node type name: " + s, e));
                 }
-            } else if (currentPropName.equals(QName.JCR_MIXINTYPES)) {
+            } else if (currentPropName.equals(NameConstants.JCR_MIXINTYPES)) {
                 if (state.mixinNames == null) {
                     state.mixinNames = new ArrayList(currentPropValues.size());
                 }
@@ -258,17 +258,17 @@
                     String s = null;
                     try {
                         s = val.retrieve();
-                        QName mixin = NameFormat.parse(s, nsContext);
+                        Name mixin = nameResolver.getQName(s);
                         state.mixinNames.add(mixin);
                     } catch (IOException ioe) {
                         throw new SAXException("error while retrieving value", ioe);
-                    } catch (IllegalNameException ine) {
-                        throw new SAXException(new InvalidSerializedDataException("illegal mixin type name: " + s, ine));
-                    } catch (UnknownPrefixException upe) {
-                        throw new SAXException(new InvalidSerializedDataException("illegal mixin type name: " + s, upe));
+                    } catch (org.apache.jackrabbit.conversion.NameException e) {
+                        throw new SAXException(new InvalidSerializedDataException("illegal mixin type name: " + s, e));
+                    } catch (NamespaceException e) {
+                        throw new SAXException(new InvalidSerializedDataException("illegal mixin type name: " + s, e));
                     }
                 }
-            } else if (currentPropName.equals(QName.JCR_UUID)) {
+            } else if (currentPropName.equals(NameConstants.JCR_UUID)) {
                 AppendableValue val = (AppendableValue) currentPropValues.get(0);
                 try {
                     state.uuid = val.retrieve();
@@ -297,11 +297,11 @@
         /**
          * name of current node
          */
-        QName nodeName;
+        Name nodeName;
         /**
          * primary type of current node
          */
-        QName nodeTypeName;
+        Name nodeTypeName;
         /**
          * list of mixin types of current node
          */

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SysViewSAXEventGenerator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SysViewSAXEventGenerator.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SysViewSAXEventGenerator.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SysViewSAXEventGenerator.java Thu Oct 18 11:41:45 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.xml;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.value.ValueHelper;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
@@ -42,23 +42,23 @@
      */
     public static final String NODE_ELEMENT = "node";
     public static final String PREFIXED_NODE_ELEMENT =
-        QName.NS_SV_PREFIX + ":" + NODE_ELEMENT;
+        Name.NS_SV_PREFIX + ":" + NODE_ELEMENT;
 
     public static final String PROPERTY_ELEMENT = "property";
     public static final String PREFIXED_PROPERTY_ELEMENT =
-        QName.NS_SV_PREFIX + ":" + PROPERTY_ELEMENT;
+        Name.NS_SV_PREFIX + ":" + PROPERTY_ELEMENT;
 
     public static final String VALUE_ELEMENT = "value";
     public static final String PREFIXED_VALUE_ELEMENT =
-        QName.NS_SV_PREFIX + ":" + VALUE_ELEMENT;
+        Name.NS_SV_PREFIX + ":" + VALUE_ELEMENT;
 
     public static final String NAME_ATTRIBUTE = "name";
     public static final String PREFIXED_NAME_ATTRIBUTE =
-        QName.NS_SV_PREFIX + ":" + NAME_ATTRIBUTE;
+        Name.NS_SV_PREFIX + ":" + NAME_ATTRIBUTE;
 
     public static final String TYPE_ATTRIBUTE = "type";
     public static final String PREFIXED_TYPE_ATTRIBUTE =
-        QName.NS_SV_PREFIX + ":" + TYPE_ATTRIBUTE;
+        Name.NS_SV_PREFIX + ":" + TYPE_ATTRIBUTE;
 
     public static final String CDATA_TYPE = "CDATA";
     public static final String ENUMERATION_TYPE = "ENUMERATION";
@@ -72,8 +72,8 @@
     private static final Attributes ATTRS_BINARY_ENCODED_VALUE;
     static {
         AttributesImpl attrs = new AttributesImpl();
-        attrs.addAttribute(QName.NS_XMLNS_URI, NS_XMLSCHEMA_INSTANCE_PREFIX, "xmlns:" + NS_XMLSCHEMA_INSTANCE_PREFIX, CDATA_TYPE, NS_XMLSCHEMA_INSTANCE_URI);
-        attrs.addAttribute(QName.NS_XMLNS_URI, NS_XMLSCHEMA_PREFIX, "xmlns:" + NS_XMLSCHEMA_PREFIX, CDATA_TYPE, NS_XMLSCHEMA_URI);
+        attrs.addAttribute(Name.NS_XMLNS_URI, NS_XMLSCHEMA_INSTANCE_PREFIX, "xmlns:" + NS_XMLSCHEMA_INSTANCE_PREFIX, CDATA_TYPE, NS_XMLSCHEMA_INSTANCE_URI);
+        attrs.addAttribute(Name.NS_XMLNS_URI, NS_XMLSCHEMA_PREFIX, "xmlns:" + NS_XMLSCHEMA_PREFIX, CDATA_TYPE, NS_XMLSCHEMA_URI);
         attrs.addAttribute(NS_XMLSCHEMA_INSTANCE_URI, "type", NS_XMLSCHEMA_INSTANCE_PREFIX + ":type", "CDATA", NS_XMLSCHEMA_PREFIX + ":base64Binary");
         ATTRS_BINARY_ENCODED_VALUE = attrs;
     }
@@ -113,10 +113,10 @@
             nodeName = node.getName();
         }
 
-        attrs.addAttribute(QName.NS_SV_URI, NAME_ATTRIBUTE, PREFIXED_NAME_ATTRIBUTE,
+        attrs.addAttribute(Name.NS_SV_URI, NAME_ATTRIBUTE, PREFIXED_NAME_ATTRIBUTE,
                 CDATA_TYPE, nodeName);
         // start node element
-        contentHandler.startElement(QName.NS_SV_URI, NODE_ELEMENT,
+        contentHandler.startElement(Name.NS_SV_URI, NODE_ELEMENT,
                 PREFIXED_NODE_ELEMENT, attrs);
     }
 
@@ -142,7 +142,7 @@
     protected void leaving(Node node, int level)
             throws RepositoryException, SAXException {
         // end node element
-        contentHandler.endElement(QName.NS_SV_URI, NODE_ELEMENT, PREFIXED_NODE_ELEMENT);
+        contentHandler.endElement(Name.NS_SV_URI, NODE_ELEMENT, PREFIXED_NODE_ELEMENT);
     }
 
     /**
@@ -153,7 +153,7 @@
         String propName = prop.getName();
         AttributesImpl attrs = new AttributesImpl();
         // name attribute
-        attrs.addAttribute(QName.NS_SV_URI, NAME_ATTRIBUTE, PREFIXED_NAME_ATTRIBUTE,
+        attrs.addAttribute(Name.NS_SV_URI, NAME_ATTRIBUTE, PREFIXED_NAME_ATTRIBUTE,
                 CDATA_TYPE, propName);
         // type attribute
         int type = prop.getType();
@@ -165,19 +165,19 @@
             throw new RepositoryException("unexpected property-type ordinal: "
                     + type, iae);
         }
-        attrs.addAttribute(QName.NS_SV_URI, TYPE_ATTRIBUTE, PREFIXED_TYPE_ATTRIBUTE,
+        attrs.addAttribute(Name.NS_SV_URI, TYPE_ATTRIBUTE, PREFIXED_TYPE_ATTRIBUTE,
                 ENUMERATION_TYPE, typeName);
 
         // start property element
-        contentHandler.startElement(QName.NS_SV_URI, PROPERTY_ELEMENT,
+        contentHandler.startElement(Name.NS_SV_URI, PROPERTY_ELEMENT,
                 PREFIXED_PROPERTY_ELEMENT, attrs);
 
         // values
         if (prop.getType() == PropertyType.BINARY && skipBinary) {
             // empty value element
-            contentHandler.startElement(QName.NS_SV_URI, VALUE_ELEMENT,
+            contentHandler.startElement(Name.NS_SV_URI, VALUE_ELEMENT,
                     PREFIXED_VALUE_ELEMENT, new AttributesImpl());
-            contentHandler.endElement(QName.NS_SV_URI, VALUE_ELEMENT,
+            contentHandler.endElement(Name.NS_SV_URI, VALUE_ELEMENT,
                     PREFIXED_VALUE_ELEMENT);
         } else {
             boolean multiValued = prop.getDefinition().isMultiple();
@@ -210,7 +210,7 @@
                 }
 
                 // start value element
-                contentHandler.startElement(QName.NS_SV_URI, VALUE_ELEMENT,
+                contentHandler.startElement(Name.NS_SV_URI, VALUE_ELEMENT,
                         PREFIXED_VALUE_ELEMENT, attributes);
 
                 // characters
@@ -245,7 +245,7 @@
                 }
 
                 // end value element
-                contentHandler.endElement(QName.NS_SV_URI, VALUE_ELEMENT,
+                contentHandler.endElement(Name.NS_SV_URI, VALUE_ELEMENT,
                         PREFIXED_VALUE_ELEMENT);
 
                 if (mustSendBinary) {
@@ -261,7 +261,7 @@
      */
     protected void leaving(Property prop, int level)
             throws RepositoryException, SAXException {
-        contentHandler.endElement(QName.NS_SV_URI, PROPERTY_ELEMENT,
+        contentHandler.endElement(Name.NS_SV_URI, PROPERTY_ELEMENT,
                 PREFIXED_PROPERTY_ELEMENT);
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/TargetImportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/TargetImportHandler.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/TargetImportHandler.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/TargetImportHandler.java Thu Oct 18 11:41:45 2007
@@ -16,8 +16,9 @@
  */
 package org.apache.jackrabbit.jcr2spi.xml;
 
-import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.util.TransientFileFactory;
+import org.apache.jackrabbit.conversion.NameResolver;
+import org.apache.jackrabbit.namespace.NamespaceResolver;
 import org.xml.sax.helpers.DefaultHandler;
 import org.xml.sax.SAXException;
 import org.slf4j.LoggerFactory;
@@ -44,10 +45,12 @@
 
     protected final Importer importer;
     protected final NamespaceResolver nsContext;
+    protected final NameResolver nameResolver;
 
-    protected TargetImportHandler(Importer importer, NamespaceResolver nsContext) {
+    protected TargetImportHandler(Importer importer, NamespaceResolver nsContext, org.apache.jackrabbit.conversion.NameResolver nameResolver) {
         this.importer = importer;
         this.nsContext = nsContext;
+        this.nameResolver = nameResolver;
     }
 
     /**

Modified: jackrabbit/trunk/contrib/spi/spi-logger/src/main/java/org/apache/jackrabbit/spi/logger/RepositoryServiceLogger.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi-logger/src/main/java/org/apache/jackrabbit/spi/logger/RepositoryServiceLogger.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi-logger/src/main/java/org/apache/jackrabbit/spi/logger/RepositoryServiceLogger.java (original)
+++ jackrabbit/trunk/contrib/spi/spi-logger/src/main/java/org/apache/jackrabbit/spi/logger/RepositoryServiceLogger.java Thu Oct 18 11:41:45 2007
@@ -32,8 +32,10 @@
 import org.apache.jackrabbit.spi.QueryInfo;
 import org.apache.jackrabbit.spi.EventFilter;
 import org.apache.jackrabbit.spi.EventBundle;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.spi.PathFactory;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Credentials;
@@ -75,6 +77,22 @@
         this.log = log;
     }
 
+    public NameFactory getNameFactory() throws RepositoryException {
+        return (NameFactory) execute(new Callable() {
+            public Object call() throws RepositoryException {
+                return service.getNameFactory();
+            }
+        }, "getNameFactory()", new Object[]{});
+    }
+
+    public PathFactory getPathFactory() throws RepositoryException {
+        return (PathFactory) execute(new Callable() {
+            public Object call() throws RepositoryException {
+                return service.getPathFactory();
+            }
+        }, "PathFactory()", new Object[]{});
+    }
+
     public IdFactory getIdFactory() throws RepositoryException {
         return (IdFactory) execute(new Callable() {
             public Object call() throws RepositoryException {
@@ -267,13 +285,13 @@
     public void move(final SessionInfo sessionInfo,
                      final NodeId nodeId,
                      final NodeId nodeId1,
-                     final QName name) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
+                     final Name name) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
         execute(new Callable() {
             public Object call() throws RepositoryException {
                 service.move(sessionInfo, nodeId, nodeId1, name);
                 return null;
             }
-        }, "move(SessionInfo,NodeId,NodeId,QName)",
+        }, "move(SessionInfo,NodeId,NodeId,Name)",
                 new Object[]{nodeId, nodeId1, name});
     }
 
@@ -281,13 +299,13 @@
                      final String s,
                      final NodeId nodeId,
                      final NodeId nodeId1,
-                     final QName name) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException {
+                     final Name name) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException {
         execute(new Callable() {
             public Object call() throws RepositoryException {
                 service.copy(sessionInfo, s, nodeId, nodeId1, name);
                 return null;
             }
-        }, "copy(SessionInfo,String,NodeId,NodeId,QName)",
+        }, "copy(SessionInfo,String,NodeId,NodeId,Name)",
                 new Object[]{s, nodeId, nodeId1, name});
     }
 
@@ -307,14 +325,14 @@
                       final String s,
                       final NodeId nodeId,
                       final NodeId nodeId1,
-                      final QName name,
+                      final Name name,
                       final boolean b) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException {
         execute(new Callable() {
             public Object call() throws RepositoryException {
                 service.clone(sessionInfo, s, nodeId, nodeId1, name, b);
                 return null;
             }
-        }, "clone(SessionInfo,String,NodeId,NodeId,QName,boolean)",
+        }, "clone(SessionInfo,String,NodeId,NodeId,Name,boolean)",
                 new Object[]{s, nodeId, nodeId1, name, new Boolean(b)});
     }
 
@@ -449,27 +467,27 @@
     public void addVersionLabel(final SessionInfo sessionInfo,
                                 final NodeId nodeId,
                                 final NodeId nodeId1,
-                                final QName name,
+                                final Name name,
                                 final boolean b) throws VersionException, RepositoryException {
         execute(new Callable() {
             public Object call() throws RepositoryException {
                 service.addVersionLabel(sessionInfo, nodeId, nodeId1, name, b);
                 return null;
             }
-        }, "addVersionLabel(SessionInfo,NodeId,NodeId,QName,boolean)",
+        }, "addVersionLabel(SessionInfo,NodeId,NodeId,Name,boolean)",
                 new Object[]{nodeId, nodeId1, name, new Boolean(b)});
     }
 
     public void removeVersionLabel(final SessionInfo sessionInfo,
                                    final NodeId nodeId,
                                    final NodeId nodeId1,
-                                   final QName name) throws VersionException, RepositoryException {
+                                   final Name name) throws VersionException, RepositoryException {
         execute(new Callable() {
             public Object call() throws RepositoryException {
                 service.removeVersionLabel(sessionInfo, nodeId, nodeId1, name);
                 return null;
             }
-        }, "removeVersionLabel(SessionInfo,NodeId,NodeId,QName)",
+        }, "removeVersionLabel(SessionInfo,NodeId,NodeId,Name)",
                 new Object[]{nodeId, nodeId1, name});
     }
 
@@ -512,14 +530,14 @@
                                          final Path path,
                                          final boolean b,
                                          final String[] strings,
-                                         final QName[] qNames,
+                                         final Name[] qNames,
                                          final boolean b1)
             throws UnsupportedRepositoryOperationException, RepositoryException {
         return (EventFilter) execute(new Callable() {
             public Object call() throws RepositoryException {
                 return service.createEventFilter(sessionInfo, i, path, b, strings, qNames, b1);
             }
-        }, "createEventFilter(SessionInfo,int,Path,boolean,String[],QName[],boolean)",
+        }, "createEventFilter(SessionInfo,int,Path,boolean,String[],Name[],boolean)",
                 new Object[]{new Integer(i), path, new Boolean(b), strings, qNames, new Boolean(b1)});
     }
 
@@ -605,13 +623,13 @@
     }
 
     public Iterator getQNodeTypeDefinitions(
-            final SessionInfo sessionInfo,final QName[] ntNames)
+            final SessionInfo sessionInfo,final Name[] ntNames)
             throws RepositoryException {
         return (Iterator) execute(new Callable() {
             public Object call() throws RepositoryException {
                 return service.getQNodeTypeDefinitions(sessionInfo, ntNames);
             }
-        }, "getQNodeTypeDefinitions(SessionInfo,QName[])", new Object[]{ntNames});
+        }, "getQNodeTypeDefinitions(SessionInfo,Name[])", new Object[]{ntNames});
     }
 
     private Object execute(Callable callable, String methodName, Object[] args)

Modified: jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientBatch.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientBatch.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientBatch.java (original)
+++ jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientBatch.java Thu Oct 18 11:41:45 2007
@@ -21,9 +21,9 @@
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.PropertyId;
 import org.apache.jackrabbit.spi.ItemId;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.commons.SerializableBatch;
 import org.apache.jackrabbit.spi.rmi.remote.RemoteSessionInfo;
-import org.apache.jackrabbit.name.QName;
 
 /**
  * <code>ClientBatch</code> implements a SPI {@link Batch} which wraps a
@@ -64,8 +64,8 @@
      * {@inheritDoc}
      */
     public void addNode(NodeId parentId,
-                        QName nodeName,
-                        QName nodetypeName,
+                        Name nodeName,
+                        Name nodetypeName,
                         String uuid) {
         batch.addNode(parentId, nodeName, nodetypeName, uuid);
     }
@@ -73,7 +73,7 @@
     /**
      * {@inheritDoc}
      */
-    public void addProperty(NodeId parentId, QName propertyName, QValue value) {
+    public void addProperty(NodeId parentId, Name propertyName, QValue value) {
         batch.addProperty(parentId, propertyName, value);
     }
 
@@ -81,7 +81,7 @@
      * {@inheritDoc}
      */
     public void addProperty(NodeId parentId,
-                            QName propertyName,
+                            Name propertyName,
                             QValue[] values) {
         batch.addProperty(parentId, propertyName, values);
     }
@@ -119,7 +119,7 @@
     /**
      * {@inheritDoc}
      */
-    public void setMixins(NodeId nodeId, QName[] mixinNodeTypeIds) {
+    public void setMixins(NodeId nodeId, Name[] mixinNodeTypeIds) {
         batch.setMixins(nodeId, mixinNodeTypeIds);
     }
 
@@ -128,7 +128,7 @@
      */
     public void move(NodeId srcNodeId,
                      NodeId destParentNodeId,
-                     QName destName) {
+                     Name destName) {
         batch.move(srcNodeId, destParentNodeId, destName);
     }
 }

Modified: jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientQueryInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientQueryInfo.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientQueryInfo.java (original)
+++ jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientQueryInfo.java Thu Oct 18 11:41:45 2007
@@ -17,8 +17,8 @@
 package org.apache.jackrabbit.spi.rmi.client;
 
 import org.apache.jackrabbit.spi.QueryInfo;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.rmi.remote.RemoteQueryInfo;
-import org.apache.jackrabbit.name.QName;
 
 import javax.jcr.RangeIterator;
 import java.rmi.RemoteException;
@@ -57,7 +57,7 @@
     /**
      * {@inheritDoc}
      */
-    public QName[] getColumnNames() {
+    public Name[] getColumnNames() {
         try {
             return queryInfo.getColumnNames();
         } catch (RemoteException e) {

Modified: jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientRepositoryService.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientRepositoryService.java (original)
+++ jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientRepositoryService.java Thu Oct 18 11:41:45 2007
@@ -32,15 +32,20 @@
 import org.apache.jackrabbit.spi.EventFilter;
 import org.apache.jackrabbit.spi.EventBundle;
 import org.apache.jackrabbit.spi.NodeInfo;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.spi.PathFactory;
 import org.apache.jackrabbit.spi.rmi.remote.RemoteRepositoryService;
 import org.apache.jackrabbit.spi.rmi.remote.RemoteSessionInfo;
 import org.apache.jackrabbit.spi.rmi.remote.RemoteIterator;
 import org.apache.jackrabbit.spi.rmi.remote.RemoteQueryInfo;
 import org.apache.jackrabbit.spi.rmi.common.SerializableInputStream;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
+
 import org.apache.jackrabbit.value.QValueFactoryImpl;
 import org.apache.jackrabbit.identifier.IdFactoryImpl;
+import org.apache.jackrabbit.name.PathFactoryImpl;
+import org.apache.jackrabbit.name.NameFactoryImpl;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Credentials;
@@ -105,6 +110,14 @@
         return idFactory;
     }
 
+    public NameFactory getNameFactory() {
+        return NameFactoryImpl.getInstance();
+    }
+
+    public PathFactory getPathFactory() {
+        return PathFactoryImpl.getInstance();
+    }
+
     /**
      * {@inheritDoc}
      */
@@ -346,7 +359,7 @@
     public void move(SessionInfo sessionInfo,
                      NodeId srcNodeId,
                      NodeId destParentNodeId,
-                     QName destName) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
+                     Name destName) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
         try {
             remoteService.move(getRemoteSessionInfo(sessionInfo), srcNodeId,
                     destParentNodeId, destName);
@@ -362,7 +375,7 @@
                      String srcWorkspaceName,
                      NodeId srcNodeId,
                      NodeId destParentNodeId,
-                     QName destName) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException {
+                     Name destName) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException {
         try {
             remoteService.copy(getRemoteSessionInfo(sessionInfo),
                     srcWorkspaceName, srcNodeId, destParentNodeId, destName);
@@ -393,7 +406,7 @@
                       String srcWorkspaceName,
                       NodeId srcNodeId,
                       NodeId destParentNodeId,
-                      QName destName,
+                      Name destName,
                       boolean removeExisting) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException {
         try {
             remoteService.clone(getRemoteSessionInfo(sessionInfo),
@@ -562,7 +575,7 @@
     public void addVersionLabel(SessionInfo sessionInfo,
                                 NodeId versionHistoryId,
                                 NodeId versionId,
-                                QName label,
+                                Name label,
                                 boolean moveLabel) throws VersionException, RepositoryException {
         try {
             remoteService.addVersionLabel(getRemoteSessionInfo(sessionInfo),
@@ -578,7 +591,7 @@
     public void removeVersionLabel(SessionInfo sessionInfo,
                                    NodeId versionHistoryId,
                                    NodeId versionId,
-                                   QName label) throws VersionException, RepositoryException {
+                                   Name label) throws VersionException, RepositoryException {
         try {
             remoteService.removeVersionLabel(getRemoteSessionInfo(sessionInfo), versionHistoryId, versionId, label);
         } catch (RemoteException e) {
@@ -645,7 +658,7 @@
                                          Path absPath,
                                          boolean isDeep,
                                          String[] uuid,
-                                         QName[] nodeTypeName,
+                                         Name[] nodeTypeName,
                                          boolean noLocal)
             throws UnsupportedRepositoryOperationException, RepositoryException {
         try {
@@ -752,7 +765,7 @@
     /**
      * {@inheritDoc}
      */
-    public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo, QName[] nodetypeNames) throws RepositoryException {
+    public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) throws RepositoryException {
         try {
             RemoteIterator it = remoteService.getQNodeTypeDefinitions(getRemoteSessionInfo(sessionInfo), nodetypeNames);
             return new ClientIterator(it);

Modified: jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/common/ItemInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/common/ItemInfoImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/common/ItemInfoImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/common/ItemInfoImpl.java Thu Oct 18 11:41:45 2007
@@ -18,8 +18,8 @@
 
 import org.apache.jackrabbit.spi.ItemInfo;
 import org.apache.jackrabbit.spi.NodeId;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
 
 import java.io.Serializable;
 
@@ -38,7 +38,7 @@
     /**
      * The name of this item info.
      */
-    private final QName name;
+    private final Name name;
 
     /**
      * The path of this item info.
@@ -59,7 +59,7 @@
      * @param path     the path to this item.
      * @param isNode   if this item is a node.
      */
-    public ItemInfoImpl(NodeId parentId, QName name, Path path, boolean isNode) {
+    public ItemInfoImpl(NodeId parentId, Name name, Path path, boolean isNode) {
         this.parentId = parentId;
         this.name = name;
         this.path = path;
@@ -76,7 +76,7 @@
     /**
      * {@inheritDoc}
      */
-    public QName getQName() {
+    public Name getName() {
         return name;
     }
 

Modified: jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/remote/RemoteQueryInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/remote/RemoteQueryInfo.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/remote/RemoteQueryInfo.java (original)
+++ jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/remote/RemoteQueryInfo.java Thu Oct 18 11:41:45 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.spi.rmi.remote;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 import java.rmi.Remote;
 import java.rmi.RemoteException;
@@ -33,9 +33,9 @@
     public RemoteIterator getRows() throws RemoteException;
 
     /**
-     * @return an array of QName representing the column names of the query
+     * @return an array of Name representing the column names of the query
      *         result.
      * @see javax.jcr.query.QueryResult#getColumnNames()
      */
-    public QName[] getColumnNames() throws RemoteException;
+    public Name[] getColumnNames() throws RemoteException;
 }

Modified: jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/remote/RemoteRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/remote/RemoteRepositoryService.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/remote/RemoteRepositoryService.java (original)
+++ jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/remote/RemoteRepositoryService.java Thu Oct 18 11:41:45 2007
@@ -28,8 +28,8 @@
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.NodeInfo;
 import org.apache.jackrabbit.spi.commons.SerializableBatch;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
 
 import javax.jcr.Credentials;
 import javax.jcr.RepositoryException;
@@ -265,12 +265,12 @@
      * @param destName
      * @throws javax.jcr.RepositoryException
      * @throws RemoteException if an error occurs.
-     * @see org.apache.jackrabbit.spi.RepositoryService#move(org.apache.jackrabbit.spi.SessionInfo, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.name.QName)
+     * @see org.apache.jackrabbit.spi.RepositoryService#move(org.apache.jackrabbit.spi.SessionInfo, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.Name)
      */
     public void move(RemoteSessionInfo sessionInfo,
                      NodeId srcNodeId,
                      NodeId destParentNodeId,
-                     QName destName)
+                     Name destName)
             throws RepositoryException, RemoteException;
 
     /**
@@ -281,13 +281,13 @@
      * @param destName
      * @throws javax.jcr.RepositoryException
      * @throws RemoteException if an error occurs.
-     * @see org.apache.jackrabbit.spi.RepositoryService#copy(org.apache.jackrabbit.spi.SessionInfo, String, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.name.QName)
+     * @see org.apache.jackrabbit.spi.RepositoryService#copy(org.apache.jackrabbit.spi.SessionInfo, String, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.Name)
      */
     public void copy(RemoteSessionInfo sessionInfo,
                      String srcWorkspaceName,
                      NodeId srcNodeId,
                      NodeId destParentNodeId,
-                     QName destName)
+                     Name destName)
             throws RepositoryException, RemoteException;
 
     /**
@@ -312,13 +312,13 @@
      * @param removeExisting
      * @throws javax.jcr.RepositoryException
      * @throws RemoteException if an error occurs.
-     * @see org.apache.jackrabbit.spi.RepositoryService#clone(org.apache.jackrabbit.spi.SessionInfo, String, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.name.QName, boolean)
+     * @see org.apache.jackrabbit.spi.RepositoryService#clone(org.apache.jackrabbit.spi.SessionInfo, String, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.Name, boolean)
      */
     public void clone(RemoteSessionInfo sessionInfo,
                       String srcWorkspaceName,
                       NodeId srcNodeId,
                       NodeId destParentNodeId,
-                      QName destName,
+                      Name destName,
                       boolean removeExisting)
             throws RepositoryException, RemoteException;
 
@@ -479,12 +479,12 @@
      * @param moveLabel
      * @throws javax.jcr.RepositoryException
      * @throws RemoteException if an error occurs.
-     * @see org.apache.jackrabbit.spi.RepositoryService#addVersionLabel(org.apache.jackrabbit.spi.SessionInfo, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.name.QName, boolean)
+     * @see org.apache.jackrabbit.spi.RepositoryService#addVersionLabel(org.apache.jackrabbit.spi.SessionInfo, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.Name, boolean)
      */
     public void addVersionLabel(RemoteSessionInfo sessionInfo,
                                 NodeId versionHistoryId,
                                 NodeId versionId,
-                                QName label,
+                                Name label,
                                 boolean moveLabel)
             throws RepositoryException, RemoteException;
 
@@ -494,12 +494,12 @@
      * @param label
      * @throws javax.jcr.RepositoryException
      * @throws RemoteException if an error occurs.
-     * @see org.apache.jackrabbit.spi.RepositoryService#removeVersionLabel(org.apache.jackrabbit.spi.SessionInfo, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.name.QName)
+     * @see org.apache.jackrabbit.spi.RepositoryService#removeVersionLabel(org.apache.jackrabbit.spi.SessionInfo, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.Name)
      */
     public void removeVersionLabel(RemoteSessionInfo sessionInfo,
                                    NodeId versionHistoryId,
                                    NodeId versionId,
-                                   QName label)
+                                   Name label)
             throws RepositoryException, RemoteException;
 
     /**
@@ -564,11 +564,11 @@
      * @throws RepositoryException if an error occurs while creating the
      * EventFilter.
      * @throws RemoteException if an error occurs.
-     * @see org.apache.jackrabbit.spi.RepositoryService#createEventFilter(org.apache.jackrabbit.spi.SessionInfo, int, org.apache.jackrabbit.name.Path, boolean, String[], org.apache.jackrabbit.name.QName[], boolean)
+     * @see org.apache.jackrabbit.spi.RepositoryService#createEventFilter(org.apache.jackrabbit.spi.SessionInfo, int, org.apache.jackrabbit.spi.Path, boolean, String[], org.apache.jackrabbit.spi.Name[], boolean)
      */
     public EventFilter createEventFilter(RemoteSessionInfo sessionInfo, int eventTypes,
                                          Path absPath, boolean isDeep,
-                                         String[] uuid, QName[] nodeTypeName,
+                                         String[] uuid, Name[] nodeTypeName,
                                          boolean noLocal)
             throws RepositoryException, RemoteException;
 
@@ -680,7 +680,7 @@
      * @return
      * @throws javax.jcr.RepositoryException
      * @throws RemoteException if an error occurs.
-     * @see org.apache.jackrabbit.spi.RepositoryService#getQNodeTypeDefinition(org.apache.jackrabbit.spi.SessionInfo, QName)
+     * @see org.apache.jackrabbit.spi.RepositoryService#getQNodeTypeDefinition(org.apache.jackrabbit.spi.SessionInfo, Name)
      */
-    public RemoteIterator getQNodeTypeDefinitions(RemoteSessionInfo sessionInfo, QName[] ntNames) throws RepositoryException, RemoteException;
+    public RemoteIterator getQNodeTypeDefinitions(RemoteSessionInfo sessionInfo, Name[] ntNames) throws RepositoryException, RemoteException;
 }

Modified: jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/server/ServerQueryInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/server/ServerQueryInfo.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/server/ServerQueryInfo.java (original)
+++ jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/server/ServerQueryInfo.java Thu Oct 18 11:41:45 2007
@@ -23,7 +23,7 @@
 import org.apache.jackrabbit.spi.QueryResultRow;
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.NodeId;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.util.IteratorHelper;
 
 import java.rmi.RemoteException;
@@ -76,7 +76,7 @@
     /**
      * {@inheritDoc}
      */
-    public QName[] getColumnNames() throws RemoteException {
+    public Name[] getColumnNames() throws RemoteException {
         return queryInfo.getColumnNames();
     }
 }

Modified: jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/server/ServerRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/server/ServerRepositoryService.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/server/ServerRepositoryService.java (original)
+++ jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/server/ServerRepositoryService.java Thu Oct 18 11:41:45 2007
@@ -39,6 +39,8 @@
 import org.apache.jackrabbit.spi.Event;
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.Batch;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.commons.EventFilterImpl;
 import org.apache.jackrabbit.spi.commons.QPropertyDefinitionImpl;
 import org.apache.jackrabbit.spi.commons.QNodeDefinitionImpl;
@@ -50,8 +52,6 @@
 import org.apache.jackrabbit.spi.commons.PropertyInfoImpl;
 import org.apache.jackrabbit.spi.commons.LockInfoImpl;
 import org.apache.jackrabbit.spi.commons.SerializableBatch;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.identifier.IdFactoryImpl;
 import org.apache.jackrabbit.util.IteratorHelper;
 
@@ -383,7 +383,7 @@
     public void move(RemoteSessionInfo sessionInfo,
                      NodeId srcNodeId,
                      NodeId destParentNodeId,
-                     QName destName) throws RepositoryException, RemoteException {
+                     Name destName) throws RepositoryException, RemoteException {
         try {
             service.move(getSessionInfo(sessionInfo),
                     srcNodeId, destParentNodeId, destName);
@@ -399,7 +399,7 @@
                      String srcWorkspaceName,
                      NodeId srcNodeId,
                      NodeId destParentNodeId,
-                     QName destName) throws RepositoryException, RemoteException {
+                     Name destName) throws RepositoryException, RemoteException {
         try {
             service.copy(getSessionInfo(sessionInfo), srcWorkspaceName,
                     srcNodeId, destParentNodeId, destName);
@@ -429,7 +429,7 @@
                       String srcWorkspaceName,
                       NodeId srcNodeId,
                       NodeId destParentNodeId,
-                      QName destName,
+                      Name destName,
                       boolean removeExisting) throws RepositoryException, RemoteException {
         try {
             service.clone(getSessionInfo(sessionInfo), srcWorkspaceName,
@@ -612,7 +612,7 @@
     public void addVersionLabel(RemoteSessionInfo sessionInfo,
                                 NodeId versionHistoryId,
                                 NodeId versionId,
-                                QName label,
+                                Name label,
                                 boolean moveLabel) throws RepositoryException, RemoteException {
         try {
             service.addVersionLabel(getSessionInfo(sessionInfo),
@@ -628,7 +628,7 @@
     public void removeVersionLabel(RemoteSessionInfo sessionInfo,
                                    NodeId versionHistoryId,
                                    NodeId versionId,
-                                   QName label) throws RepositoryException, RemoteException {
+                                   Name label) throws RepositoryException, RemoteException {
         try {
             service.removeVersionLabel(getSessionInfo(sessionInfo),
                     versionHistoryId, versionId, label);
@@ -685,7 +685,7 @@
                                          Path absPath,
                                          boolean isDeep,
                                          String[] uuid,
-                                         QName[] nodeTypeName,
+                                         Name[] nodeTypeName,
                                          boolean noLocal)
             throws RepositoryException, RemoteException {
         try {
@@ -734,10 +734,10 @@
                         id = idFactory.createNodeId(nodeId.getUniqueID(), nodeId.getPath());
                     } else {
                         PropertyId propId = (PropertyId) e.getItemId();
-                        id = idFactory.createPropertyId(parentId, propId.getQName());
+                        id = idFactory.createPropertyId(parentId, propId.getName());
                     }
                     Event serEvent = new EventImpl(e.getType(),
-                            e.getQPath(), id, parentId,
+                            e.getPath(), id, parentId,
                             e.getPrimaryNodeTypeName(),
                             e.getMixinTypeNames(), e.getUserID());
                     events.add(serEvent);
@@ -829,7 +829,7 @@
      * {@inheritDoc}
      */
     public RemoteIterator getQNodeTypeDefinitions(RemoteSessionInfo sessionInfo,
-                                                 QName[] ntNames)
+                                                 Name[] ntNames)
             throws RepositoryException, RemoteException {
         Iterator it = service.getQNodeTypeDefinitions(getSessionInfo(sessionInfo), ntNames);
         return getQNodeTypeDefinitionIterator(it);
@@ -893,10 +893,10 @@
             if (filters[i] instanceof EventFilterImpl) {
                 EventFilterImpl e = (EventFilterImpl) filters[i];
                 Set nodeTypeNames = e.getNodeTypeNames();
-                QName[] ntNames = null;
+                Name[] ntNames = null;
                 if (nodeTypeNames != null) {
-                    ntNames = (QName[]) nodeTypeNames.toArray(
-                            new QName[nodeTypeNames.size()]);
+                    ntNames = (Name[]) nodeTypeNames.toArray(
+                            new Name[nodeTypeNames.size()]);
                 }
                 filters[i] = service.createEventFilter(sInfo,
                         e.getEventTypes(), e.getAbsPath(), e.isDeep(),

Modified: jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java Thu Oct 18 11:41:45 2007
@@ -18,7 +18,7 @@
 
 import org.apache.jackrabbit.spi.Event;
 import org.apache.jackrabbit.spi.ItemId;
-import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.webdav.xml.DomUtil;
 import org.apache.jackrabbit.webdav.observation.ObservationConstants;

Modified: jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ItemInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ItemInfoImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ItemInfoImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ItemInfoImpl.java Thu Oct 18 11:41:45 2007
@@ -18,16 +18,17 @@
 
 import org.apache.jackrabbit.spi.ItemInfo;
 import org.apache.jackrabbit.spi.NodeId;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.PathFormat;
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.webdav.property.DavPropertySet;
 import org.apache.jackrabbit.webdav.property.DavProperty;
 import org.apache.jackrabbit.webdav.jcr.ItemResourceConstants;
+import org.apache.jackrabbit.conversion.NamePathResolver;
+import org.apache.jackrabbit.conversion.NameException;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
+import javax.jcr.NamespaceException;
+
 /**
  * <code>ItemInfoImpl</code>...
  */
@@ -38,14 +39,14 @@
     private final NodeId parentId;
     private final Path path;
 
-    public ItemInfoImpl(NodeId parentId, DavPropertySet propSet, NamespaceResolver nsResolver)
-        throws MalformedPathException {
+    public ItemInfoImpl(NodeId parentId, DavPropertySet propSet, NamePathResolver resolver)
+            throws NameException, NamespaceException {
         // set parentId
         this.parentId = parentId;
 
         DavProperty pathProp = propSet.get(ItemResourceConstants.JCR_PATH);
         String jcrPath = pathProp.getValue().toString();
-        path = PathFormat.parse(jcrPath, nsResolver);
+        path = resolver.getQPath(jcrPath);
 
     }
 

Modified: jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/NamespaceResolverImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/NamespaceResolverImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/NamespaceResolverImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/NamespaceResolverImpl.java Thu Oct 18 11:41:45 2007
@@ -18,8 +18,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.jackrabbit.name.AbstractNamespaceResolver;
-import org.apache.jackrabbit.name.NamespaceResolver;
+import org.apache.jackrabbit.namespace.NamespaceResolver;
 
 import javax.jcr.NamespaceException;
 import java.util.Map;
@@ -29,7 +28,7 @@
 /**
  * <code>NamespaceResolverImpl</code>...
  */
-class NamespaceResolverImpl extends AbstractNamespaceResolver {
+class NamespaceResolverImpl extends org.apache.jackrabbit.namespace.AbstractNamespaceResolver {
 
     private static Logger log = LoggerFactory.getLogger(NamespaceResolverImpl.class);
 
@@ -65,7 +64,7 @@
     }
 
     /**
-     * @see NamespaceResolver#getPrefix(String)
+     * @see org.apache.jackrabbit.namespace.NamespaceResolver#getPrefix(String)
      */
     public String getPrefix(String uri) throws NamespaceException {
         String prefix = (String) uriToPrefix.get(uri);

Modified: jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/NodeInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/NodeInfoImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/NodeInfoImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/NodeInfoImpl.java Thu Oct 18 11:41:45 2007
@@ -20,15 +20,14 @@
 import org.apache.jackrabbit.webdav.jcr.ItemResourceConstants;
 import org.apache.jackrabbit.webdav.property.DavPropertySet;
 import org.apache.jackrabbit.webdav.property.DavProperty;
-import org.apache.jackrabbit.name.NameException;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.NameFormat;
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.conversion.NameException;
+import org.apache.jackrabbit.name.NameConstants;
+import org.apache.jackrabbit.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.NodeInfo;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.PropertyId;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -46,18 +45,18 @@
     private static Logger log = LoggerFactory.getLogger(NodeInfoImpl.class);
 
     private final NodeId id;
-    private final QName qName;
+    private final Name qName;
     private final int index;
 
-    private final QName primaryNodeTypeName;
-    private final QName[] mixinNodeTypeNames;
+    private final Name primaryNodeTypeName;
+    private final Name[] mixinNodeTypeNames;
 
     private final List references = new ArrayList();
     private final List propertyIds = new ArrayList();
 
     public NodeInfoImpl(NodeId id, NodeId parentId, DavPropertySet propSet,
-                        NamespaceResolver nsResolver) throws RepositoryException, MalformedPathException {
-        super(parentId, propSet, nsResolver);
+                        NamePathResolver resolver) throws RepositoryException, NameException {
+        super(parentId, propSet, resolver);
 
         // set id
         this.id = id;
@@ -71,17 +70,17 @@
                 // note, that unescaping is not required.
                 String jcrName = nameProp.getValue().toString();
                 try {
-                    qName = NameFormat.parse(jcrName, nsResolver);
+                    qName = resolver.getQName(jcrName);
                 } catch (NameException e) {
                     throw new RepositoryException("Unable to build ItemInfo object, invalid name found: " + jcrName);
                 }
             } else {
                 // root
-                qName = QName.ROOT;
+                qName = NameConstants.ROOT;
             }
         } else {
-            Path.PathElement el = id.getPath().getNameElement();
-            qName = (Path.ROOT_ELEMENT == el) ? QName.ROOT : el.getName();
+            Path.Element el = id.getPath().getNameElement();
+            qName = (el.denotesRoot()) ? NameConstants.ROOT : el.getName();
         }
 
         DavProperty indexProp = propSet.get(ItemResourceConstants.JCR_INDEX);
@@ -97,7 +96,7 @@
                 Iterator it = new NodeTypeProperty(propSet.get(ItemResourceConstants.JCR_PRIMARYNODETYPE)).getNodeTypeNames().iterator();
                 if (it.hasNext()) {
                     String jcrName = it.next().toString();
-                    primaryNodeTypeName = NameFormat.parse(jcrName, nsResolver);
+                    primaryNodeTypeName = resolver.getQName(jcrName);
                 } else {
                     throw new RepositoryException("Missing primary nodetype for node " + id + ".");
                 }
@@ -106,16 +105,16 @@
             }
             if (propSet.contains(ItemResourceConstants.JCR_MIXINNODETYPES)) {
                 Set mixinNames = new NodeTypeProperty(propSet.get(ItemResourceConstants.JCR_MIXINNODETYPES)).getNodeTypeNames();
-                mixinNodeTypeNames = new QName[mixinNames.size()];
+                mixinNodeTypeNames = new Name[mixinNames.size()];
                 Iterator it = mixinNames.iterator();
                 int i = 0;
                 while(it.hasNext()) {
                     String jcrName = it.next().toString();
-                    mixinNodeTypeNames[i] = NameFormat.parse(jcrName, nsResolver);
+                    mixinNodeTypeNames[i] = resolver.getQName(jcrName);
                     i++;
                 }
             } else {
-                mixinNodeTypeNames = QName.EMPTY_ARRAY;
+                mixinNodeTypeNames = Name.EMPTY_ARRAY;
             }
         } catch (NameException e) {
             throw new RepositoryException("Error while resolving nodetype names: " + e.getMessage());
@@ -127,7 +126,7 @@
         return true;
     }
 
-    public QName getQName() {
+    public Name getName() {
         return qName;
     }
 
@@ -140,11 +139,11 @@
         return index;
     }
 
-    public QName getNodetype() {
+    public Name getNodetype() {
         return primaryNodeTypeName;
     }
 
-    public QName[] getMixins() {
+    public Name[] getMixins() {
         return mixinNodeTypeNames;
     }
 

Modified: jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/PropertyInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/PropertyInfoImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/PropertyInfoImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/PropertyInfoImpl.java Thu Oct 18 11:41:45 2007
@@ -20,15 +20,15 @@
 import org.apache.jackrabbit.webdav.jcr.property.ValuesProperty;
 import org.apache.jackrabbit.webdav.jcr.ItemResourceConstants;
 import org.apache.jackrabbit.webdav.property.DavPropertySet;
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.conversion.NamePathResolver;
+import org.apache.jackrabbit.conversion.NameException;
 import org.apache.jackrabbit.value.ValueFormat;
 import org.apache.jackrabbit.spi.PropertyId;
 import org.apache.jackrabbit.spi.PropertyInfo;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.QValueFactory;
+import org.apache.jackrabbit.spi.Name;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -52,11 +52,11 @@
     private QValue[] values;
 
     public PropertyInfoImpl(PropertyId id, NodeId parentId, DavPropertySet propSet,
-                            NamespaceResolver nsResolver, ValueFactory valueFactory,
+                            NamePathResolver resolver, ValueFactory valueFactory,
                             QValueFactory qValueFactory)
-        throws RepositoryException, DavException, IOException, MalformedPathException {
+            throws RepositoryException, DavException, IOException, NameException {
 
-        super(parentId, propSet, nsResolver);
+        super(parentId, propSet, resolver);
         // set id
         this.id = id;
 
@@ -76,7 +76,7 @@
                 if (type == PropertyType.BINARY) {
                     qv = qValueFactory.create(jcrValue.getStream());
                 } else {
-                    qv = ValueFormat.getQValue(jcrValue, nsResolver, qValueFactory);
+                    qv = ValueFormat.getQValue(jcrValue, resolver, qValueFactory);
                 }
                 values = new QValue[] {qv};
             }
@@ -89,7 +89,7 @@
                 if (type == PropertyType.BINARY) {
                     values[i] = qValueFactory.create(jcrValues[i].getStream());
                 } else {
-                    values[i] = ValueFormat.getQValue(jcrValues[i], nsResolver, qValueFactory);
+                    values[i] = ValueFormat.getQValue(jcrValues[i], resolver, qValueFactory);
                 }
             }
         }
@@ -100,8 +100,8 @@
         return false;
     }
 
-    public QName getQName() {
-        return id.getQName();
+    public Name getName() {
+        return id.getName();
     }
 
     //-------------------------------------------------------< PropertyInfo >---



Mime
View raw message