jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1344591 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/ oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/
Date Thu, 31 May 2012 08:11:23 GMT
Author: reschke
Date: Thu May 31 08:11:23 2012
New Revision: 1344591

URL: http://svn.apache.org/viewvc?rev=1344591&view=rev
Log:
OAK-61: add hook for checking for the presence of prefix remappings (WIP)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NameMapper.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImplTest.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NameMapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NameMapper.java?rev=1344591&r1=1344590&r2=1344591&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NameMapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NameMapper.java
Thu May 31 08:11:23 2012
@@ -32,6 +32,14 @@ public interface NameMapper {
     String getOakName(String jcrName);
 
     /**
+     * Returns whether the mapper has prefix remappings; when there aren't
+     * any, prefixed names do not need to be converted at all
+     * 
+     * @return {@code true} if prefixes have been remapped
+     */
+    boolean hasSessionLocalMappings();
+
+    /**
      * Returns the JCR name for the given Oak name. The given name is
      * expected to have come from a valid Oak repository that contains
      * only valid names with proper namespace mappings. If that's not

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java?rev=1344591&r1=1344590&r2=1344591&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
Thu May 31 08:11:23 2012
@@ -51,6 +51,11 @@ public class NamePathMapperImpl implemen
         return nameMapper.getJcrName(oakName);
     }
 
+    @Override
+    public boolean hasSessionLocalMappings() {
+        return nameMapper.hasSessionLocalMappings();
+    }
+
     //---------------------------------------------------------< PathMapper >---
     @Override
     public String getOakPath(String jcrPath) {

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImplTest.java?rev=1344591&r1=1344590&r2=1344591&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImplTest.java
Thu May 31 08:11:23 2012
@@ -143,5 +143,10 @@ public class NamePathMapperImplTest {
             return "oak-" + uri2oakprefix.get(uri);
         }
 
+        @Override
+        public boolean hasSessionLocalMappings() {
+            return true;
+        }
+
     }
 }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java?rev=1344591&r1=1344590&r2=1344591&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
Thu May 31 08:11:23 2012
@@ -413,5 +413,12 @@ public class SessionDelegate {
                 return null;
             }
         }
+
+        @Override
+        public boolean hasSessionLocalMappings() {
+            // TODO OAK-61
+            // TODO right now we would have to check whether AbstractSession.namespaces is
empty
+            return true;
+        }
     }
 }



Mime
View raw message