directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r658815 - in /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core: authz/ changelog/ collective/ enumeration/
Date Wed, 21 May 2008 19:15:17 GMT
Author: akarasulu
Date: Wed May 21 12:15:16 2008
New Revision: 658815

URL: http://svn.apache.org/viewvc?rev=658815&view=rev
Log:
fixing issues with Cursor verses NamingEnumeration usage in Interceptors

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/OriginalChangeLogInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilter.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=658815&r1=658814&r2=658815&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
Wed May 21 12:15:16 2008
@@ -21,9 +21,9 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.cursor.Cursor;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.ConcreteNameComponentNormalizer;
@@ -50,7 +50,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 import java.text.ParseException;
@@ -99,7 +98,7 @@
      * @param directoryService the context factory configuration for the server
      * @throws NamingException if initialization fails
      */
-    public TupleCache( DirectoryService directoryService ) throws NamingException
+    public TupleCache( DirectoryService directoryService ) throws Exception
     {
         normalizerMap = directoryService.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
         this.nexus = directoryService.getPartitionNexus();
@@ -120,7 +119,7 @@
     }
 
 
-    private void initialize( Registries registries ) throws NamingException
+    private void initialize( Registries registries ) throws Exception
     {
         // search all naming contexts for access control subentenries
         // generate ACITuple Arrays for each subentry
@@ -135,15 +134,14 @@
                 SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            NamingEnumeration<ServerSearchResult> results = nexus.search( new SearchOperationContext(
registries,
+            Cursor<ServerEntry> results = nexus.search( new SearchOperationContext(
registries,
                 baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, ctls ) );
 
-            while ( results.hasMore() )
+            while ( results.next() )
             {
-                ServerSearchResult result = results.next();
+                ServerEntry result = results.get();
                 LdapDN subentryDn = result.getDn().normalize( normalizerMap );
-                ServerEntry serverEntry = result.getServerEntry();
-                EntryAttribute aci = serverEntry.get( prescriptiveAciAT );
+                EntryAttribute aci = result.get( prescriptiveAciAT );
 
                 if ( aci == null )
                 {
@@ -152,7 +150,7 @@
                     continue;
                 }
 
-                subentryAdded( subentryDn, serverEntry );
+                subentryAdded( subentryDn, result );
             }
 
             results.close();

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=658815&r1=658814&r2=658815&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
Wed May 21 12:15:16 2008
@@ -75,7 +75,7 @@
     // -----------------------------------------------------------------------
 
 
-    public void init( DirectoryService directoryService ) throws NamingException
+    public void init( DirectoryService directoryService ) throws Exception
     {
         super.init( directoryService );
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/OriginalChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/OriginalChangeLogInterceptor.java?rev=658815&r1=658814&r2=658815&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/OriginalChangeLogInterceptor.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/OriginalChangeLogInterceptor.java
Wed May 21 12:15:16 2008
@@ -88,7 +88,7 @@
     // -----------------------------------------------------------------------
 
     
-    public void init( DirectoryService directoryService ) throws NamingException
+    public void init( DirectoryService directoryService ) throws Exception
     {
         super.init( directoryService );
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=658815&r1=658814&r2=658815&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
Wed May 21 12:15:16 2008
@@ -82,7 +82,7 @@
     private final SearchResultFilter SEARCH_FILTER = new SearchResultFilter()
     {
         public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls
controls )
-            throws NamingException
+            throws Exception
         {
             LdapDN name = ((ServerSearchResult)result).getDn();
             
@@ -99,7 +99,7 @@
         }
     };
 
-    public void init( DirectoryService directoryService ) throws NamingException
+    public void init( DirectoryService directoryService ) throws Exception
     {
         super.init( directoryService );
         nexus = directoryService.getPartitionNexus();
@@ -120,7 +120,7 @@
      * @param retAttrs array or attribute type to be specifically included in the result
entry(s)
      * @throws NamingException if there are problems accessing subentries
      */
-    private void addCollectiveAttributes( LdapDN normName, ServerEntry entry, String[] retAttrs
) throws NamingException
+    private void addCollectiveAttributes( LdapDN normName, ServerEntry entry, String[] retAttrs
) throws Exception
     {
         EntryAttribute caSubentries;
 
@@ -307,7 +307,7 @@
     // ------------------------------------------------------------------------
     // Interceptor Method Overrides
     // ------------------------------------------------------------------------
-    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext
) throws NamingException
+    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext
) throws Exception
     {
         ServerEntry result = nextInterceptor.lookup( opContext );
         
@@ -351,7 +351,7 @@
     // Partial Schema Checking
     // ------------------------------------------------------------------------
     
-    public void add( NextInterceptor next, AddOperationContext opContext ) throws NamingException
+    public void add( NextInterceptor next, AddOperationContext opContext ) throws Exception
     {
         collectiveAttributesSchemaChecker.checkAdd( opContext.getDn(), opContext.getEntry()
);
         
@@ -359,7 +359,7 @@
     }
 
 
-    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws NamingException
+    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws Exception
     {
         collectiveAttributesSchemaChecker.checkModify( opContext.getRegistries(),opContext.getDn(),
opContext.getModItems() );
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java?rev=658815&r1=658814&r2=658815&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java
Wed May 21 12:15:16 2008
@@ -60,7 +60,7 @@
         this.attrTypeRegistry = attrTypeRegistry;
     }
     
-    /* package scope*/ void checkAdd( LdapDN normName, ServerEntry entry ) throws LdapSchemaViolationException,
NamingException
+    /* package scope*/ void checkAdd( LdapDN normName, ServerEntry entry ) throws Exception
     {
         if ( entry.hasObjectClass( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRY_OC ) )
         {
@@ -78,7 +78,7 @@
         }
     }
     
-    public void checkModify( Registries registries, LdapDN normName, List<Modification>
mods ) throws NamingException
+    public void checkModify( Registries registries, LdapDN normName, List<Modification>
mods ) throws Exception
     {
         ServerEntry originalEntry = nexus.lookup( new LookupOperationContext( registries,
normName ) );
         ServerEntry targetEntry = ServerEntryUtils.toServerEntry( 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilter.java?rev=658815&r1=658814&r2=658815&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilter.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilter.java
Wed May 21 12:15:16 2008
@@ -23,7 +23,6 @@
 import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.invocation.Invocation;
 
-import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 
 
@@ -47,6 +46,7 @@
      * @param controls search controls associated with the invocation
      * @return true if the result is to be returned, false if it is to be
      * discarded from the result set
+     * @throws Exception 
      */
-    boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls
) throws NamingException;
+    boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls
) throws Exception;
 }



Mime
View raw message