jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1167251 - in /jackrabbit/sandbox/jackrabbit-mk: jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jc...
Date Fri, 09 Sep 2011 15:39:47 GMT
Author: mduerig
Date: Fri Sep  9 15:39:47 2011
New Revision: 1167251

URL: http://svn.apache.org/viewvc?rev=1167251&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP) 
refactor: promote NamePathResolver

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrLockManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/LogUtil.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/conversion/CachingNameResolver.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
Fri Sep  9 15:39:47 2011
@@ -75,7 +75,7 @@ public abstract class ItemImpl implement
     @Override
     public String getPath() throws RepositoryException {
         checkStatus();
-        return session.getPathResolver().getJCRPath(getQPath());
+        return session.getNamePathResolver().getJCRPath(getQPath());
     }
 
     @Override
@@ -477,7 +477,7 @@ public abstract class ItemImpl implement
      * @return JCR path
      */
     String safeGetJCRPath() {
-        return LogUtil.safeGetJCRPath(getItemState(), session.getPathResolver());
+        return LogUtil.safeGetJCRPath(getItemState(), session.getNamePathResolver());
     }
 
     /**

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
Fri Sep  9 15:39:47 2011
@@ -165,7 +165,7 @@ public class ItemManagerImpl implements 
         try {
             return (Node) getItem(nodeEntry);
         } catch (ItemNotFoundException e) {
-            throw new PathNotFoundException(LogUtil.safeGetJCRPath(path, session.getPathResolver()));
+            throw new PathNotFoundException(LogUtil.safeGetJCRPath(path, session.getNamePathResolver()));
         }
     }
 
@@ -175,7 +175,7 @@ public class ItemManagerImpl implements 
         try {
             return (Property) getItem(propertyEntry);
         } catch (ItemNotFoundException e) {
-            throw new PathNotFoundException(LogUtil.safeGetJCRPath(path, session.getPathResolver()));
+            throw new PathNotFoundException(LogUtil.safeGetJCRPath(path, session.getNamePathResolver()));
         }
     }
 
@@ -184,7 +184,7 @@ public class ItemManagerImpl implements 
         session.checkIsAlive();
         ItemState state = hierarchyEntry.getItemState();
         if (!state.isValid()) {
-            throw new ItemNotFoundException(LogUtil.safeGetJCRPath(state, session.getPathResolver()));
+            throw new ItemNotFoundException(LogUtil.safeGetJCRPath(state, session.getNamePathResolver()));
         }
 
         // first try to access item from cache

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrLockManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrLockManager.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrLockManager.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrLockManager.java
Fri Sep  9 15:39:47 2011
@@ -16,15 +16,12 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.jackrabbit.jcr2spi.lock.LockStateManager;
 import org.apache.jackrabbit.spi.commons.conversion.PathResolver;
 
-import javax.jcr.lock.LockManager;
-import javax.jcr.lock.LockException;
-import javax.jcr.RepositoryException;
 import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.lock.LockManager;
 
 /**
  * {@code JcrLockManager}...
@@ -37,7 +34,7 @@ public class JcrLockManager implements L
     protected JcrLockManager(SessionImpl session) {
         lockStateMgr = session.getLockStateManager();
         itemManager = session.getItemManager();
-        resolver = session.getPathResolver();
+        resolver = session.getNamePathResolver();
     }
 
     //--------------------------------------------------------< LockManager >---

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java
Fri Sep  9 15:39:47 2011
@@ -62,7 +62,7 @@ public class JcrVersionManager implement
         this.session = session;
         vMgr = session.getVersionStateManager();
         itemManager = session.getItemManager();
-        resolver = session.getPathResolver();
+        resolver = session.getNamePathResolver();
     }
 
     //-----------------------------------------------------< VersionManager >---

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
Fri Sep  9 15:39:47 2011
@@ -16,31 +16,27 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyManager;
-import org.apache.jackrabbit.jcr2spi.security.AccessManager;
 import org.apache.jackrabbit.jcr2spi.lock.LockStateManager;
-import org.apache.jackrabbit.jcr2spi.version.VersionManager;
-import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
 import org.apache.jackrabbit.jcr2spi.nodetype.EffectiveNodeTypeProvider;
+import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
 import org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeDefinitionProvider;
+import org.apache.jackrabbit.jcr2spi.security.AccessManager;
+import org.apache.jackrabbit.jcr2spi.version.VersionManager;
 import org.apache.jackrabbit.spi.QValueFactory;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 
+import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.ValueFactory;
-import javax.jcr.RepositoryException;
 
 /**
  * {@code ManagerProvider}...
  */
 public interface ManagerProvider {
 
-    org.apache.jackrabbit.spi.commons.conversion.NamePathResolver getNamePathResolver();
-
-    NameResolver getNameResolver();
-
-    org.apache.jackrabbit.spi.commons.conversion.PathResolver getPathResolver();
+    NamePathResolver getNamePathResolver();
 
     NamespaceResolver getNamespaceResolver();
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
Fri Sep  9 15:39:47 2011
@@ -99,7 +99,7 @@ public class NodeImpl extends ItemImpl i
             // its not possible to determine a fallback nodetype that is
             // always available.
             throw new IllegalArgumentException("Unknown nodetype " +
-                    LogUtil.saveGetJCRName(nodeTypeName, session.getNameResolver()));
+                    LogUtil.saveGetJCRName(nodeTypeName, session.getNamePathResolver()));
         }
     }
 
@@ -111,7 +111,7 @@ public class NodeImpl extends ItemImpl i
     @Override
     public String getName() throws RepositoryException {
         checkStatus();
-        return session.getNameResolver().getJCRName(getQName());
+        return session.getNamePathResolver().getJCRName(getQName());
     }
 
     /**
@@ -166,11 +166,12 @@ public class NodeImpl extends ItemImpl i
             if (itemMgr.nodeExists(parentPath)) {
                 parentNode = (NodeImpl) itemMgr.getNode(parentPath);
             } else if (itemMgr.propertyExists(parentPath)) {
-                String msg = "Cannot add a node to property " + LogUtil.safeGetJCRPath(parentPath,
session.getPathResolver());
+                String msg = "Cannot add a node to property " + LogUtil.safeGetJCRPath(parentPath,
session.getNamePathResolver());
                 log.debug(msg);
                 throw new ConstraintViolationException(msg);
             } else {
-                throw new PathNotFoundException("Cannot add a new node to a non-existing
parent at " + LogUtil.safeGetJCRPath(parentPath, session.getPathResolver()));
+                throw new PathNotFoundException("Cannot add a new node to a non-existing
parent at "
+                        + LogUtil.safeGetJCRPath(parentPath, session.getNamePathResolver()));
             }
         }
 
@@ -370,7 +371,7 @@ public class NodeImpl extends ItemImpl i
         if (value == null) {
             v = null;
         } else {
-            PropertyImpl.checkValidReference(value, PropertyType.REFERENCE, session.getNameResolver());
+            PropertyImpl.checkValidReference(value, PropertyType.REFERENCE, session.getNamePathResolver());
             v = session.getValueFactory().createValue(value);
         }
         return setProperty(name, v, PropertyType.REFERENCE);
@@ -623,7 +624,7 @@ public class NodeImpl extends ItemImpl i
     public boolean isNodeType(String nodeTypeName) throws RepositoryException {
         checkStatus();
         // try shortcut first (avoids parsing of name)
-        if (session.getNameResolver().getJCRName(getPrimaryNodeTypeName()).equals(nodeTypeName))
{
+        if (session.getNamePathResolver().getJCRName(getPrimaryNodeTypeName()).equals(nodeTypeName))
{
             return true;
         }
         // parse to Name and check against effective nodetype
@@ -937,7 +938,7 @@ public class NodeImpl extends ItemImpl i
                 } else {
                     Path p = referenceableNode.getQPath().computeRelativePath(getQPath());
                     // use prefix mappings of srcSession
-                    String relPath = session.getPathResolver().getJCRPath(p);
+                    String relPath = session.getNamePathResolver().getJCRPath(p);
                     if (correspondingNode.hasNode(relPath)) {
                         correspondingPath = correspondingNode.getNode(relPath).getPath();
                     } else {
@@ -1059,7 +1060,7 @@ public class NodeImpl extends ItemImpl i
             if (!targetNode.isCheckedOut()) {
                 throw new VersionException("Parent " + targetNode.safeGetJCRPath()
                     + " for non-existing restore target '"
-                    + LogUtil.safeGetJCRPath(relQPath, session.getPathResolver())
+                    + LogUtil.safeGetJCRPath(relQPath, session.getNamePathResolver())
                     + "' must be checked out.");
             }
             targetNode.checkIsLocked();
@@ -1332,11 +1333,11 @@ public class NodeImpl extends ItemImpl i
         try {
             NodeEntry nEntry = getNodeEntry().getNodeEntry(nodeName, index);
             if (nEntry == null) {
-                throw new PathNotFoundException(LogUtil.saveGetJCRName(nodeName, session.getNameResolver()));
+                throw new PathNotFoundException(LogUtil.saveGetJCRName(nodeName, session.getNamePathResolver()));
             }
             return (Node) getItemManager().getItem(nEntry);
         } catch (AccessDeniedException e) {
-            throw new PathNotFoundException(LogUtil.saveGetJCRName(nodeName, session.getNameResolver()));
+            throw new PathNotFoundException(LogUtil.saveGetJCRName(nodeName, session.getNamePathResolver()));
         }
     }
 
@@ -1352,11 +1353,11 @@ public class NodeImpl extends ItemImpl i
         try {
             PropertyEntry pEntry = getNodeEntry().getPropertyEntry(qName, true);
             if (pEntry == null) {
-                throw new PathNotFoundException(LogUtil.saveGetJCRName(qName, session.getNameResolver()));
+                throw new PathNotFoundException(LogUtil.saveGetJCRName(qName, session.getNamePathResolver()));
             }
             return (Property) getItemManager().getItem(pEntry);
         } catch (AccessDeniedException e) {
-            throw new PathNotFoundException(LogUtil.saveGetJCRName(qName, session.getNameResolver()));
+            throw new PathNotFoundException(LogUtil.saveGetJCRName(qName, session.getNamePathResolver()));
         }
     }
 
@@ -1452,7 +1453,7 @@ public class NodeImpl extends ItemImpl i
     private Name getQName(String jcrName) throws RepositoryException {
         Name qName;
         try {
-            qName = session.getNameResolver().getQName(jcrName);
+            qName = session.getNamePathResolver().getQName(jcrName);
         } catch (NameException upe) {
             throw new RepositoryException("invalid name: "+ jcrName, upe);
         }
@@ -1539,7 +1540,7 @@ public class NodeImpl extends ItemImpl i
      */
     private Path getReorderPath(String relativePath) throws RepositoryException {
         try {
-            Path p = session.getPathResolver().getQPath(relativePath);
+            Path p = session.getNamePathResolver().getQPath(relativePath);
             if (p.isAbsolute() || p.getLength() != 1 || p.getDepth() != 1) {
                 throw new RepositoryException("Invalid relative path: " + relativePath);
             }
@@ -1558,7 +1559,7 @@ public class NodeImpl extends ItemImpl i
      */
     private Path getPath(String relativeJcrPath) throws RepositoryException {
         try {
-            Path p = session.getPathResolver().getQPath(relativeJcrPath);
+            Path p = session.getNamePathResolver().getQPath(relativeJcrPath);
             return getPath(p);
         } catch (NameException e) {
             String msg = "Invalid relative path: " + relativeJcrPath;
@@ -1596,7 +1597,7 @@ public class NodeImpl extends ItemImpl i
     private NodeEntry resolveRelativeNodePath(String relPath) throws RepositoryException
{
         NodeEntry targetEntry = null;
         try {
-            Path rp = session.getPathResolver().getQPath(relPath);
+            Path rp = session.getNamePathResolver().getQPath(relPath);
             // shortcut
             if (rp.getLength() == 1) {
                 if (rp.denotesCurrent()) {
@@ -1638,7 +1639,7 @@ public class NodeImpl extends ItemImpl i
     private PropertyEntry resolveRelativePropertyPath(String relPath) throws RepositoryException
{
         PropertyEntry targetEntry = null;
         try {
-            Path rp = session.getPathResolver().getQPath(relPath);
+            Path rp = session.getNamePathResolver().getQPath(relPath);
             if (rp.getLength() == 1 && rp.denotesName()) {
                 // a single path element must always denote a name. '.' and '..'
                 // will never point to a property. If the NodeEntry does not

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
Fri Sep  9 15:39:47 2011
@@ -23,7 +23,7 @@ import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QValue;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.spi.commons.value.ValueFormat;
 import org.apache.jackrabbit.value.ValueHelper;
@@ -67,7 +67,7 @@ public class PropertyImpl extends ItemIm
     public String getName() throws RepositoryException {
         checkStatus();
         Name name = getQName();
-        return session.getNameResolver().getJCRName(name);
+        return session.getNamePathResolver().getJCRName(name);
     }
 
     /**
@@ -245,7 +245,7 @@ public class PropertyImpl extends ItemIm
         if (value == null) {
             setInternalValues(null, reqType);
         } else {
-            checkValidReference(value, reqType, session.getNameResolver());
+            checkValidReference(value, reqType, session.getNamePathResolver());
             QValue qValue = session.getQValueFactory().create(value.getUUID(), PropertyType.REFERENCE);
             setInternalValues(new QValue[]{qValue}, reqType);
         }
@@ -318,7 +318,7 @@ public class PropertyImpl extends ItemIm
             case PropertyType.PATH:
             case PropertyType.NAME:
                 String path = value.getString();
-                Path p = session.getPathResolver().getQPath(path);
+                Path p = session.getNamePathResolver().getQPath(path);
                 try {
                     return p.isAbsolute() ? session.getNode(path) : getParent().getNode(path);
                 } catch (PathNotFoundException e) {
@@ -334,7 +334,7 @@ public class PropertyImpl extends ItemIm
                 } catch (RepositoryException e) {
                     // try if STRING value can be interpreted as PATH value
                     Value pathValue = ValueHelper.convert(value, PropertyType.PATH, session.getValueFactory());
-                    p = session.getPathResolver().getQPath(pathValue.getString());
+                    p = session.getNamePathResolver().getQPath(pathValue.getString());
                     try {
                         return p.isAbsolute() ? session.getNode(pathValue.getString()) :
getParent().getNode(pathValue.getString());
                     } catch (PathNotFoundException e1) {
@@ -354,7 +354,7 @@ public class PropertyImpl extends ItemIm
         String path = pathValue.getString();
         boolean absolute;
         try {
-            Path p = session.getPathResolver().getQPath(path);
+            Path p = session.getNamePathResolver().getQPath(path);
             absolute = p.isAbsolute();
         } catch (RepositoryException e) {
             throw new ValueFormatException("Property value cannot be converted to a PATH");
@@ -568,7 +568,7 @@ public class PropertyImpl extends ItemIm
      * @throws ValueFormatException
      * @throws RepositoryException
      */
-    static void checkValidReference(Node value, int propertyType, NameResolver resolver)
throws RepositoryException {
+    static void checkValidReference(Node value, int propertyType, NamePathResolver resolver)
throws RepositoryException {
         if (propertyType == PropertyType.REFERENCE) {
             String jcrName = resolver.getJCRName(NameConstants.MIX_REFERENCEABLE);
             if (!value.isNodeType(jcrName)) {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
Fri Sep  9 15:39:47 2011
@@ -55,8 +55,6 @@ import org.apache.jackrabbit.spi.commons
 import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
 import org.apache.jackrabbit.spi.commons.conversion.NameException;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
-import org.apache.jackrabbit.spi.commons.conversion.PathResolver;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.apache.jackrabbit.spi.commons.value.ValueFactoryQImpl;
@@ -246,7 +244,7 @@ public class SessionImpl extends Abstrac
             return node;
         } else {
             // fall back
-            String mixReferenceable = getNameResolver().getJCRName(NameConstants.MIX_REFERENCEABLE);
+            String mixReferenceable = getNamePathResolver().getJCRName(NameConstants.MIX_REFERENCEABLE);
             if (node.isNodeType(mixReferenceable)) {
                 return node;
             }
@@ -274,10 +272,10 @@ public class SessionImpl extends Abstrac
                 return (Node) item;
             } else {
                 log.error("NodeId '" + id + " does not point to a Node");
-                throw new ItemNotFoundException(LogUtil.saveGetIdString(id, getPathResolver()));
+                throw new ItemNotFoundException(LogUtil.saveGetIdString(id, getNamePathResolver()));
             }
         } catch (AccessDeniedException e) {
-            throw new ItemNotFoundException(LogUtil.saveGetIdString(id, getPathResolver()));
+            throw new ItemNotFoundException(LogUtil.saveGetIdString(id, getNamePathResolver()));
         }
     }
 
@@ -322,7 +320,7 @@ public class SessionImpl extends Abstrac
         Path destPath = getQPath(destAbsPath);
 
         // all validation is performed by Move Operation and state-manager
-        Operation op = Move.create(srcPath, destPath, getHierarchyManager(), getPathResolver(),
true);
+        Operation op = Move.create(srcPath, destPath, getHierarchyManager(), getNamePathResolver(),
true);
         itemStateManager.execute(op);
     }
 
@@ -712,16 +710,6 @@ public class SessionImpl extends Abstrac
     }
 
     @Override
-    public NameResolver getNameResolver() {
-        return npResolver;
-    }
-
-    @Override
-    public PathResolver getPathResolver() {
-        return npResolver;
-    }
-
-    @Override
     public NamespaceResolver getNamespaceResolver() {
         return this;
     }
@@ -839,7 +827,7 @@ public class SessionImpl extends Abstrac
      */
     Path getQPath(String absPath) throws RepositoryException {
         try {
-            Path p = getPathResolver().getQPath(absPath);
+            Path p = getNamePathResolver().getQPath(absPath);
             if (!p.isAbsolute()) {
                 throw new RepositoryException("Not an absolute path: " + absPath);
             }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
Fri Sep  9 15:39:47 2011
@@ -23,8 +23,8 @@ import org.apache.jackrabbit.jcr2spi.loc
 import org.apache.jackrabbit.jcr2spi.lock.LockStateManager;
 import org.apache.jackrabbit.jcr2spi.nodetype.EffectiveNodeTypeProvider;
 import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
-import org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeDefinitionProvider;
+import org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.jcr2spi.observation.ObservationManagerImpl;
 import org.apache.jackrabbit.jcr2spi.operation.Clone;
 import org.apache.jackrabbit.jcr2spi.operation.Copy;
@@ -47,8 +47,6 @@ import org.apache.jackrabbit.spi.PathFac
 import org.apache.jackrabbit.spi.QValueFactory;
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
-import org.apache.jackrabbit.spi.commons.conversion.PathResolver;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -220,7 +218,7 @@ public class WorkspaceImpl implements Wo
         Path srcPath = session.getQPath(srcAbsPath);
         Path destPath = session.getQPath(destAbsPath);
 
-        Operation op = Move.create(srcPath, destPath, getHierarchyManager(), getPathResolver(),
false);
+        Operation op = Move.create(srcPath, destPath, getHierarchyManager(), getNamePathResolver(),
false);
         getUpdateableItemStateManager().execute(op);
     }
 
@@ -356,16 +354,6 @@ public class WorkspaceImpl implements Wo
     }
 
     @Override
-    public NameResolver getNameResolver() {
-        return session.getNameResolver();
-    }
-
-    @Override
-    public PathResolver getPathResolver() {
-        return session.getPathResolver();
-    }
-
-    @Override
     public NamespaceResolver getNamespaceResolver() {
         return session.getNamespaceResolver();
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
Fri Sep  9 15:39:47 2011
@@ -18,9 +18,9 @@ package org.apache.jackrabbit.jcr2spi.qu
 
 import org.apache.jackrabbit.jcr2spi.ItemManager;
 import org.apache.jackrabbit.jcr2spi.ManagerProvider;
-import org.apache.jackrabbit.spi.QueryInfo;
 import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
+import org.apache.jackrabbit.spi.QueryInfo;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
@@ -64,7 +64,7 @@ class QueryResultImpl implements QueryRe
     public String[] getSelectorNames() throws RepositoryException {
         Name[] names = queryInfo.getSelectorNames();
         String[] sn = new String[names.length];
-        NameResolver resolver = mgrProvider.getNameResolver();
+        NamePathResolver resolver = mgrProvider.getNamePathResolver();
         for (int i = 0; i < sn.length; i++) {
             sn[i] = resolver.getJCRName(names[i]);
         }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
Fri Sep  9 15:39:47 2011
@@ -118,7 +118,7 @@ public class ItemStateValidator {
      * @see LogUtil#safeGetJCRPath(ItemState, org.apache.jackrabbit.spi.commons.conversion.PathResolver)
      */
     private String safeGetJCRPath(ItemState itemState) {
-        return LogUtil.safeGetJCRPath(itemState, mgrProvider.getPathResolver());
+        return LogUtil.safeGetJCRPath(itemState, mgrProvider.getNamePathResolver());
     }
 
     //------------------------------------------------------< check methods >---

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/LogUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/LogUtil.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/LogUtil.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/LogUtil.java
Fri Sep  9 15:39:47 2011
@@ -16,17 +16,17 @@
  */
 package org.apache.jackrabbit.jcr2spi.util;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.jackrabbit.spi.Path;
-import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
+import org.apache.jackrabbit.spi.ItemId;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.conversion.PathResolver;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-import javax.jcr.RepositoryException;
 import javax.jcr.NamespaceException;
+import javax.jcr.RepositoryException;
 
 /**
  * {@code LogUtil}...
@@ -79,13 +79,13 @@ public final class LogUtil {
      * error messages etc.
      *
      * @param qName
-     * @param nameResolver
+     * @param resolver
      * @return JCR name or String representation of the given {@code Name}
      * in case the resolution fails.
      */
-    public static String saveGetJCRName(Name qName, NameResolver nameResolver) {
+    public static String saveGetJCRName(Name qName, NamePathResolver resolver) {
         try {
-            return nameResolver.getJCRName(qName);
+            return resolver.getJCRName(qName);
         } catch (NamespaceException e) {
             log.error("failed to convert " + qName + " to JCR name.");
             return qName.toString();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
Fri Sep  9 15:39:47 2011
@@ -205,7 +205,7 @@ public class VersionHistoryImpl extends 
         String[] labels = new String[qLabels.length];
 
         for (int i = 0; i < qLabels.length; i++) {
-            labels[i] = session.getNameResolver().getJCRName(qLabels[i]);
+            labels[i] = session.getNamePathResolver().getJCRName(qLabels[i]);
         }
         return labels;
     }
@@ -221,7 +221,7 @@ public class VersionHistoryImpl extends 
         for (Name qLabel : qLabels) {
             String uuid = getVersionByLabel(qLabel).getUUID();
             if (vUUID.equals(uuid)) {
-                labels.add(session.getNameResolver().getJCRName(qLabel));
+                labels.add(session.getNamePathResolver().getJCRName(qLabel));
             }
         }
         return labels.toArray(new String[labels.size()]);
@@ -314,7 +314,7 @@ public class VersionHistoryImpl extends 
      */
     private NodeState getVersionState(String versionName) throws RepositoryException {
         try {
-            Name vName = session.getNameResolver().getQName(versionName);
+            Name vName = session.getNamePathResolver().getQName(versionName);
             refreshEntry(vhEntry);
             NodeEntry vEntry = vhEntry.getNodeEntry(vName, Path.INDEX_DEFAULT, true);
             if (vEntry == null) {
@@ -353,7 +353,7 @@ public class VersionHistoryImpl extends 
      */
     private Name getQLabel(String label) throws RepositoryException {
         try {
-            return session.getNameResolver().getQName(label);
+            return session.getNamePathResolver().getQName(label);
         } catch (NameException e) {
             String error = "Invalid version label: " + e.getMessage();
             log.error(error);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java
Fri Sep  9 15:39:47 2011
@@ -16,10 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi.xml;
 
-import javax.jcr.NamespaceException;
-import javax.jcr.NamespaceRegistry;
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NameFactory;
 import org.apache.jackrabbit.spi.PathFactory;
@@ -38,6 +34,10 @@ import org.xml.sax.SAXParseException;
 import org.xml.sax.helpers.DefaultHandler;
 import org.xml.sax.helpers.NamespaceSupport;
 
+import javax.jcr.NamespaceException;
+import javax.jcr.NamespaceRegistry;
+import javax.jcr.RepositoryException;
+
 /**
  * An {@code ImportHandler} instance can be used to import serialized
  * data in System View XML or Document View XML. Processing of the XML is

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
Fri Sep  9 15:39:47 2011
@@ -130,7 +130,7 @@ public class SessionImporter implements 
             parents = new Stack<NodeState>();
             parents.push(importTarget);
         } catch (ItemNotFoundException e) {
-            throw new PathNotFoundException(LogUtil.safeGetJCRPath(parentPath, session.getPathResolver()));
+            throw new PathNotFoundException(LogUtil.safeGetJCRPath(parentPath, session.getNamePathResolver()));
         }
     }
 
@@ -177,14 +177,14 @@ public class SessionImporter implements 
                    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.getPathResolver()));
+                       log.debug("skipping protected node " + LogUtil.safeGetJCRPath(existing,
session.getNamePathResolver()));
                        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.getPathResolver()));
+                       throw new ItemExistsException(LogUtil.safeGetJCRPath(existing, session.getNamePathResolver()));
                    }
                }
            } catch (ItemNotFoundException e) {
@@ -469,7 +469,7 @@ public class SessionImporter implements 
                 def = existing.getDefinition();
                 if (def.isProtected()) {
                     // skip protected property
-                    log.debug("skipping protected property " + LogUtil.safeGetJCRPath(existing,
session.getPathResolver()));
+                    log.debug("skipping protected property " + LogUtil.safeGetJCRPath(existing,
session.getNamePathResolver()));
                     return;
                 }
                 if (def.isAutoCreated()
@@ -478,7 +478,7 @@ public class SessionImporter implements 
                     // this property has already been auto-created, no need to create it
                     propState = existing;
                 } else {
-                    throw new ItemExistsException(LogUtil.safeGetJCRPath(existing, session.getPathResolver()));
+                    throw new ItemExistsException(LogUtil.safeGetJCRPath(existing, session.getNamePathResolver()));
                 }
             } catch (ItemNotFoundException e) {
                 // property doesn't exist any more

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/conversion/CachingNameResolver.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/conversion/CachingNameResolver.java?rev=1167251&r1=1167250&r2=1167251&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/conversion/CachingNameResolver.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/conversion/CachingNameResolver.java
Fri Sep  9 15:39:47 2011
@@ -59,6 +59,7 @@ public class CachingNameResolver impleme
     }
 
     //-------------------------------------------------------< NameResolver >---
+    
     /**
      * Returns a {@code Name} for the given prefixed JCR name. The name
      * is first looked up form the generational cache and the call gets



Mime
View raw message