directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r939225 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ core/src/main/java/org/apache/directory/server/core/authz/ core/sr...
Date Thu, 29 Apr 2010 08:04:34 GMT
Author: elecharny
Date: Thu Apr 29 08:04:34 2010
New Revision: 939225

URL: http://svn.apache.org/viewvc?rev=939225&view=rev
Log:
Minor cleanup and refactoring for clarity sake

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java?rev=939225&r1=939224&r2=939225&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
Thu Apr 29 08:04:34 2010
@@ -494,6 +494,7 @@ public class LdapCoreSessionConnection i
     public SearchResponse lookup( String dn, String... attributes ) throws LdapException
     {
         SearchResultEntry resp = null;
+        
         try
         {
             ClonedServerEntry entry = session.lookup( new DN( dn ), attributes );

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java?rev=939225&r1=939224&r2=939225&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
Thu Apr 29 08:04:34 2010
@@ -100,7 +100,7 @@ public class LookupOperationContext exte
      */
     public String[] getAttrsIdArray()
     {
-        if ( attrsId == null || attrsId.size() == 0 )
+        if ( ( attrsId == null ) || ( attrsId.size() == 0 ) )
         {
             return EMPTY;
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=939225&r1=939224&r2=939225&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
Thu Apr 29 08:04:34 2010
@@ -398,15 +398,17 @@ public class DefaultAuthorizationInterce
 
     public ClonedServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext
opContext ) throws Exception
     {
-        ClonedServerEntry serverEntry = nextInterceptor.lookup( opContext );
+        CoreSession session = opContext.getSession();
+        ClonedServerEntry entry = nextInterceptor.lookup( opContext );
         
-        if ( opContext.getSession().getDirectoryService().isAccessControlEnabled() || ( serverEntry
== null ) )
+        if ( session.getDirectoryService().isAccessControlEnabled() || ( entry == null )
)
         {
-            return serverEntry;
+            return entry;
         }
 
-        protectLookUp( opContext.getSession().getEffectivePrincipal().getClonedName(), opContext.getDn()
);
-        return serverEntry;
+        protectLookUp( session.getEffectivePrincipal().getClonedName(), opContext.getDn()
);
+        
+        return entry;
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=939225&r1=939224&r2=939225&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
Thu Apr 29 08:04:34 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.server.core.normalization;
 
 
+import java.util.List;
+
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
@@ -259,7 +261,9 @@ public class NormalizationInterceptor ex
     {
         opContext.getDn().normalize( schemaManager.getNormalizerMapping() );
         
-        if ( opContext.getAttrsId() != null )
+        List<String> attrIds = opContext.getAttrsId();
+        
+        if ( ( attrIds != null ) && ( attrIds.size() > 0 ) )
         {
             // We have to normalize the requested IDs
             opContext.setAttrsId( normalizeAttrsId( opContext.getAttrsIdArray() ) );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=939225&r1=939224&r2=939225&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Thu Apr 29 08:04:34 2010
@@ -627,6 +627,7 @@ public class DefaultPartitionNexus  exte
     {
         DN dn = opContext.getDn();
         
+        // This is for the case we do a lookup on the rootDSE
         if ( dn.size() == 0 )
         {
             ClonedServerEntry retval = new ClonedServerEntry( rootDSE );



Mime
View raw message