jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1508755 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: security/principal/PrincipalManagerImpl.java security/principal/PrincipalProviderImpl.java spi/security/principal/PrincipalProvider.java
Date Wed, 31 Jul 2013 07:49:39 GMT
Author: angela
Date: Wed Jul 31 07:49:39 2013
New Revision: 1508755

URL: http://svn.apache.org/r1508755
Log:
OAK-90 : Implement Principal Management

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalManagerImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/principal/PrincipalProvider.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalManagerImpl.java?rev=1508755&r1=1508754&r2=1508755&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalManagerImpl.java
Wed Jul 31 07:49:39 2013
@@ -17,56 +17,65 @@
 package org.apache.jackrabbit.oak.security.principal;
 
 import java.security.Principal;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
-import org.apache.jackrabbit.oak.spi.security.principal.PrincipalIteratorAdapter;
 import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal;
+import org.apache.jackrabbit.oak.spi.security.principal.PrincipalIteratorAdapter;
 import org.apache.jackrabbit.oak.spi.security.principal.PrincipalProvider;
 
 /**
- * PrincipalManagerImpl...
+ * Default implementation of the {@code PrincipalManager} interface.
  */
-public class PrincipalManagerImpl implements PrincipalManager {
+class PrincipalManagerImpl implements PrincipalManager {
 
     private final PrincipalProvider principalProvider;
 
-    public PrincipalManagerImpl(PrincipalProvider principalProvider) {
+    PrincipalManagerImpl(@Nonnull PrincipalProvider principalProvider) {
         this.principalProvider = principalProvider;
     }
 
     //---------------------------------------------------< PrincipalManager >---
     @Override
-    public boolean hasPrincipal(String principalName) {
+    public boolean hasPrincipal(@Nonnull String principalName) {
         return principalProvider.getPrincipal(principalName) != null;
     }
 
     @Override
-    public Principal getPrincipal(String principalName) {
+    @CheckForNull
+    public Principal getPrincipal(@Nonnull String principalName) {
         return principalProvider.getPrincipal(principalName);
     }
 
     @Override
-    public PrincipalIterator findPrincipals(String simpleFilter) {
+    @Nonnull
+    public PrincipalIterator findPrincipals(@Nullable String simpleFilter) {
         return findPrincipals(simpleFilter, PrincipalManager.SEARCH_TYPE_ALL);
     }
 
     @Override
-    public PrincipalIterator findPrincipals(String simpleFilter, int searchType) {
+    @Nonnull
+    public PrincipalIterator findPrincipals(@Nullable String simpleFilter, int searchType)
{
         return new PrincipalIteratorAdapter(principalProvider.findPrincipals(simpleFilter,
searchType));
     }
 
     @Override
+    @Nonnull
     public PrincipalIterator getPrincipals(int searchType) {
         return new PrincipalIteratorAdapter(principalProvider.findPrincipals(searchType));
     }
 
     @Override
-    public PrincipalIterator getGroupMembership(Principal principal) {
+    @Nonnull
+    public PrincipalIterator getGroupMembership(@Nonnull Principal principal) {
         return new PrincipalIteratorAdapter(principalProvider.getGroupMembership(principal));
     }
 
     @Override
+    @Nonnull
     public Principal getEveryone() {
         Principal everyone = getPrincipal(EveryonePrincipal.NAME);
         if (everyone == null) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java?rev=1508755&r1=1508754&r2=1508755&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java
Wed Jul 31 07:49:39 2013
@@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory;
  * that operates on principal information read from user information exposed by
  * the configured {@link UserManager}.
  */
-public class PrincipalProviderImpl implements PrincipalProvider {
+class PrincipalProviderImpl implements PrincipalProvider {
 
     /**
      * logger instance
@@ -60,9 +60,9 @@ public class PrincipalProviderImpl imple
 
     private final UserManager userManager;
 
-    public PrincipalProviderImpl(@Nonnull Root root,
-                                 @Nonnull UserConfiguration userConfiguration,
-                                 @Nonnull NamePathMapper namePathMapper) {
+    PrincipalProviderImpl(@Nonnull Root root,
+                          @Nonnull UserConfiguration userConfiguration,
+                          @Nonnull NamePathMapper namePathMapper) {
         this.userManager = userConfiguration.getUserManager(root, namePathMapper);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/principal/PrincipalProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/principal/PrincipalProvider.java?rev=1508755&r1=1508754&r2=1508755&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/principal/PrincipalProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/principal/PrincipalProvider.java
Wed Jul 31 07:49:39 2013
@@ -22,6 +22,7 @@ import java.util.Iterator;
 import java.util.Set;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 /**
  * The {@code PrincipalProvider} defines methods to provide access to sources
@@ -46,7 +47,7 @@ public interface PrincipalProvider {
      * @return return the requested principal or {@code null}
      */
     @CheckForNull
-    Principal getPrincipal(String principalName);
+    Principal getPrincipal(@Nonnull String principalName);
 
     /**
      * Returns an iterator over all group principals for which the given
@@ -63,7 +64,7 @@ public interface PrincipalProvider {
      * @see java.security.acl.Group#isMember(java.security.Principal)
      */
     @Nonnull
-    Set<Group> getGroupMembership(Principal principal);
+    Set<Group> getGroupMembership(@Nonnull Principal principal);
 
     /**
      * Tries to resolve the specified {@code userID} to a valid principal and
@@ -75,7 +76,7 @@ public interface PrincipalProvider {
      * or an empty set if it cannot be resolved.
      */
     @Nonnull
-    Set<? extends Principal> getPrincipals(String userID);
+    Set<? extends Principal> getPrincipals(@Nonnull String userID);
 
     /**
      * Find the principals that match the specified nameHint and search type.
@@ -89,7 +90,7 @@ public interface PrincipalProvider {
      * @return An iterator of principals.
      */
     @Nonnull
-    Iterator<? extends Principal> findPrincipals(String nameHint, int searchType);
+    Iterator<? extends Principal> findPrincipals(@Nullable String nameHint, int searchType);
 
 
     /**



Mime
View raw message