jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1455495 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java
Date Tue, 12 Mar 2013 11:19:19 GMT
Author: mreutegg
Date: Tue Mar 12 11:19:19 2013
New Revision: 1455495

URL: http://svn.apache.org/r1455495
Log:
OAK-619 Lock-free MongoMK implementation
- implement getKnownPrincipal()

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java?rev=1455495&r1=1455494&r2=1455495&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java
Tue Mar 12 11:19:19 2013
@@ -27,6 +27,7 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.UnsupportedRepositoryOperationException;
 
+import org.apache.jackrabbit.api.JackrabbitSession;
 import org.apache.jackrabbit.mongomk.impl.MongoConnection;
 import org.apache.jackrabbit.mongomk.prototype.MongoMK;
 import org.apache.jackrabbit.test.NotExecutableException;
@@ -117,7 +118,11 @@ public class OakMongoMKRepositoryStub ex
 
     @Override
     public Principal getKnownPrincipal(Session session) throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException();
+        if (session instanceof JackrabbitSession) {
+            return ((JackrabbitSession) session).getPrincipalManager().getPrincipal(session.getUserID());
+        } else {
+            throw new UnsupportedRepositoryOperationException();
+        }
     }
 
     private static final Principal UNKNOWN_PRINCIPAL = new Principal() {



Mime
View raw message