jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1390394 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: SessionDelegate.java SessionImpl.java
Date Wed, 26 Sep 2012 10:39:56 GMT
Author: angela
Date: Wed Sep 26 10:39:56 2012
New Revision: 1390394

URL: http://svn.apache.org/viewvc?rev=1390394&view=rev
Log:
OAK-90 : Implement Principal Management 
- move creation of principal manager to SessionDelegate

OAK-247 	: SessionImpl should not inherit from AbstractSession 
- hasSessionLocalMappings doesn't need to be public

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java

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=1390394&r1=1390393&r2=1390394&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
Wed Sep 26 10:39:56 2012
@@ -18,7 +18,6 @@ package org.apache.jackrabbit.oak.jcr;
 
 import java.io.IOException;
 import java.util.concurrent.ScheduledExecutorService;
-
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.jcr.ItemExistsException;
@@ -34,6 +33,7 @@ import javax.jcr.observation.Observation
 import javax.jcr.query.QueryManager;
 import javax.jcr.version.VersionManager;
 
+import org.apache.jackrabbit.api.security.principal.PrincipalManager;
 import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.jackrabbit.oak.api.AuthInfo;
 import org.apache.jackrabbit.oak.api.ChangeExtractor;
@@ -47,6 +47,7 @@ import org.apache.jackrabbit.oak.api.Tre
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.jcr.observation.ObservationManagerImpl;
+import org.apache.jackrabbit.oak.jcr.security.principal.PrincipalManagerImpl;
 import org.apache.jackrabbit.oak.jcr.security.user.UserManagerImpl;
 import org.apache.jackrabbit.oak.jcr.value.ValueFactoryImpl;
 import org.apache.jackrabbit.oak.namepath.AbstractNameMapper;
@@ -54,6 +55,7 @@ import org.apache.jackrabbit.oak.namepat
 import org.apache.jackrabbit.oak.namepath.NamePathMapperImpl;
 import org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager;
 import org.apache.jackrabbit.oak.plugins.value.AnnotatingConflictHandler;
+import org.apache.jackrabbit.oak.security.principal.TmpPrincipalProvider;
 import org.apache.jackrabbit.oak.security.user.UserContextImpl;
 import org.apache.jackrabbit.oak.spi.security.user.UserContext;
 import org.apache.jackrabbit.oak.util.TODO;
@@ -482,6 +484,13 @@ public class SessionDelegate {
         return root.getLocation(path);
     }
 
+    @Nonnull
+    PrincipalManager getPrincipalManager() throws RepositoryException {
+        // TODO
+        return TODO.unimplemented().returnValue(new PrincipalManagerImpl(new TmpPrincipalProvider()));
+    }
+
+    @Nonnull
     UserManager getUserManager() throws UnsupportedRepositoryOperationException {
         // FIXME
         UserContext ctx = new UserContextImpl();
@@ -492,6 +501,7 @@ public class SessionDelegate {
 
     private class SessionNameMapper extends AbstractNameMapper {
 
+        //-----------------------------------------------------< NameMapper >---
         @Override
         @CheckForNull
         protected String getJcrPrefix(String oakPrefix) {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1390394&r1=1390393&r2=1390394&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Wed Sep 26 10:39:56 2012
@@ -52,9 +52,7 @@ import org.apache.jackrabbit.commons.Abs
 import org.apache.jackrabbit.commons.iterator.AccessControlPolicyIteratorAdapter;
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.jcr.security.principal.PrincipalManagerImpl;
 import org.apache.jackrabbit.oak.jcr.xml.XmlImportHandler;
-import org.apache.jackrabbit.oak.security.principal.TmpPrincipalProvider;
 import org.apache.jackrabbit.oak.spi.security.authentication.ImpersonationCredentials;
 import org.apache.jackrabbit.oak.util.TODO;
 import org.apache.jackrabbit.util.XMLChar;
@@ -74,6 +72,14 @@ public class SessionImpl extends Abstrac
 
     private final SessionDelegate dlg;
 
+    /**
+     * Local namespace remappings. Prefixes as keys and namespace URIs as values.
+     * <p>
+     * This map is only accessed from synchronized methods (see
+     * <a href="https://issues.apache.org/jira/browse/JCR-1793">JCR-1793</a>).
+     */
+    private final Map<String, String> namespaces = new HashMap<String, String>();
+
     SessionImpl(SessionDelegate dlg) {
         this.dlg = dlg;
     }
@@ -432,20 +438,10 @@ public class SessionImpl extends Abstrac
         throw new UnsupportedRepositoryOperationException("Retention Management is not supported.");
     }
 
-    //--------------------------------------------------< Namespaces >---
-
+    //---------------------------------------------------------< Namespaces >---
     // The code below was initially copied from JCR Commons AbstractSession, but
     // provides information the "hasRemappings" information
 
-    /**
-     * Local namespace remappings. Prefixes as keys and namespace URIs as values.
-     * <p>
-     * This map is only accessed from synchronized methods (see
-     * <a href="https://issues.apache.org/jira/browse/JCR-1793">JCR-1793</a>).
-     */
-    private final Map<String, String> namespaces =
-        new HashMap<String, String>();
-
     @Override
     public void setNamespacePrefix(String prefix, String uri) throws RepositoryException
{
         if (prefix == null) {
@@ -543,8 +539,7 @@ public class SessionImpl extends Abstrac
         }
     }
 
-    // needed for implementation of NameMapper.hasSessionLocalMappings
-    public boolean hasSessionLocalMappings() {
+    boolean hasSessionLocalMappings() {
         return !namespaces.isEmpty();
     }
 
@@ -553,8 +548,7 @@ public class SessionImpl extends Abstrac
     @Override
     @Nonnull
     public PrincipalManager getPrincipalManager() throws RepositoryException {
-        return TODO.unimplemented().returnValue(new PrincipalManagerImpl(
-                new TmpPrincipalProvider()));
+        return dlg.getPrincipalManager();
     }
 
     @Override



Mime
View raw message