You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2005/03/20 04:55:30 UTC

svn commit: r158293 - in directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi: ./ ibs/ request/interceptor/

Author: trustin
Date: Sat Mar 19 19:55:29 2005
New Revision: 158293

URL: http://svn.apache.org/viewcvs?view=rev&rev=158293
Log:
* Converted OperationalAttributeService to DefaultAttributeTagger.
* Fixed some errors and warnings.

Added:
    directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/DefaultAttributeTagger.java   (with props)
Removed:
    directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/OperationalAttributeService.java
Modified:
    directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java
    directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/JndiProvider.java
    directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/FilterServiceImpl.java
    directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/SchemaService.java
    directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/ServerExceptionService.java
    directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/Authorizer.java
    directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/InterceptorChain.java

Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java?view=diff&r1=158292&r2=158293
==============================================================================
--- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java (original)
+++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java Sat Mar 19 19:55:29 2005
@@ -39,20 +39,28 @@
 import org.apache.ldap.common.schema.Normalizer;
 import org.apache.ldap.common.util.DateUtils;
 import org.apache.ldap.common.util.StringTools;
-import org.apache.ldap.server.*;
-import org.apache.ldap.server.auth.*;
+import org.apache.ldap.server.ApplicationPartition;
+import org.apache.ldap.server.ContextPartition;
+import org.apache.ldap.server.ContextPartitionConfig;
+import org.apache.ldap.server.RootNexus;
+import org.apache.ldap.server.SystemPartition;
+import org.apache.ldap.server.auth.AbstractAuthenticator;
+import org.apache.ldap.server.auth.AnonymousAuthenticator;
+import org.apache.ldap.server.auth.AuthenticatorConfig;
+import org.apache.ldap.server.auth.AuthenticatorContext;
+import org.apache.ldap.server.auth.SimpleAuthenticator;
 import org.apache.ldap.server.db.Database;
 import org.apache.ldap.server.db.DefaultSearchEngine;
 import org.apache.ldap.server.db.ExpressionEnumerator;
 import org.apache.ldap.server.db.ExpressionEvaluator;
 import org.apache.ldap.server.db.SearchEngine;
 import org.apache.ldap.server.db.jdbm.JdbmDatabase;
-import org.apache.ldap.server.jndi.ibs.AuthorizationService;
 import org.apache.ldap.server.jndi.ibs.FilterService;
 import org.apache.ldap.server.jndi.ibs.FilterServiceImpl;
 import org.apache.ldap.server.jndi.ibs.OperationalAttributeService;
 import org.apache.ldap.server.jndi.ibs.SchemaService;
 import org.apache.ldap.server.jndi.ibs.ServerExceptionService;
+import org.apache.ldap.server.jndi.request.interceptor.Interceptor;
 import org.apache.ldap.server.schema.AttributeTypeRegistry;
 import org.apache.ldap.server.schema.ConcreteNameComponentNormalizer;
 import org.apache.ldap.server.schema.GlobalRegistries;

Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/JndiProvider.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/JndiProvider.java?view=diff&r1=158292&r2=158293
==============================================================================
--- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/JndiProvider.java (original)
+++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/JndiProvider.java Sat Mar 19 19:55:29 2005
@@ -22,6 +22,7 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.util.Hashtable;
+
 import javax.naming.Context;
 import javax.naming.NamingException;
 import javax.naming.ldap.LdapContext;
@@ -31,6 +32,9 @@
 import org.apache.ldap.server.BackendSubsystem;
 import org.apache.ldap.server.PartitionNexus;
 import org.apache.ldap.server.RootNexus;
+import org.apache.ldap.server.jndi.request.interceptor.BaseInterceptor;
+import org.apache.ldap.server.jndi.request.interceptor.Interceptor;
+import org.apache.ldap.server.jndi.request.interceptor.InterceptorChain;
 
 
 /**

Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/FilterServiceImpl.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/FilterServiceImpl.java?view=diff&r1=158292&r2=158293
==============================================================================
--- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/FilterServiceImpl.java (original)
+++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/FilterServiceImpl.java Sat Mar 19 19:55:29 2005
@@ -20,6 +20,7 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+
 import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -31,9 +32,7 @@
 import org.apache.ldap.common.filter.ExprNode;
 import org.apache.ldap.server.db.ResultFilteringEnumeration;
 import org.apache.ldap.server.db.SearchResultFilter;
-import org.apache.ldap.server.jndi.BaseInterceptor;
-import org.apache.ldap.server.jndi.Invocation;
-import org.apache.ldap.server.jndi.InvocationStateEnum;
+import org.apache.ldap.server.jndi.request.interceptor.BaseInterceptor;
 
 
 /**

Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/SchemaService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/SchemaService.java?view=diff&r1=158292&r2=158293
==============================================================================
--- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/SchemaService.java (original)
+++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/SchemaService.java Sat Mar 19 19:55:29 2005
@@ -17,7 +17,12 @@
 package org.apache.ldap.server.jndi.ibs;
 
 
-import java.util.*;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
 import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -33,13 +38,19 @@
 import org.apache.ldap.common.message.LockableAttributeImpl;
 import org.apache.ldap.common.message.LockableAttributesImpl;
 import org.apache.ldap.common.name.LdapName;
-import org.apache.ldap.common.schema.*;
+import org.apache.ldap.common.schema.AttributeType;
+import org.apache.ldap.common.schema.DITContentRule;
+import org.apache.ldap.common.schema.DITStructureRule;
+import org.apache.ldap.common.schema.MatchingRule;
+import org.apache.ldap.common.schema.MatchingRuleUse;
+import org.apache.ldap.common.schema.NameForm;
+import org.apache.ldap.common.schema.ObjectClass;
+import org.apache.ldap.common.schema.SchemaUtils;
+import org.apache.ldap.common.schema.Syntax;
 import org.apache.ldap.common.util.SingletonEnumeration;
 import org.apache.ldap.server.RootNexus;
 import org.apache.ldap.server.db.SearchResultFilter;
-import org.apache.ldap.server.jndi.BaseInterceptor;
-import org.apache.ldap.server.jndi.Invocation;
-import org.apache.ldap.server.jndi.InvocationStateEnum;
+import org.apache.ldap.server.jndi.request.interceptor.BaseInterceptor;
 import org.apache.ldap.server.schema.AttributeTypeRegistry;
 import org.apache.ldap.server.schema.GlobalRegistries;
 

Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/ServerExceptionService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/ServerExceptionService.java?view=diff&r1=158292&r2=158293
==============================================================================
--- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/ServerExceptionService.java (original)
+++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ibs/ServerExceptionService.java Sat Mar 19 19:55:29 2005
@@ -18,6 +18,7 @@
 
 
 import java.util.Map;
+
 import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -26,15 +27,16 @@
 import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
 
-import org.apache.ldap.common.exception.*;
+import org.apache.ldap.common.exception.LdapContextNotEmptyException;
+import org.apache.ldap.common.exception.LdapNameAlreadyBoundException;
+import org.apache.ldap.common.exception.LdapNameNotFoundException;
+import org.apache.ldap.common.exception.LdapNamingException;
 import org.apache.ldap.common.filter.ExprNode;
 import org.apache.ldap.common.message.ResultCodeEnum;
 import org.apache.ldap.common.name.LdapName;
 import org.apache.ldap.server.RootNexus;
-import org.apache.ldap.server.exception.InterceptorException;
-import org.apache.ldap.server.jndi.BaseInterceptor;
-import org.apache.ldap.server.jndi.Invocation;
-import org.apache.ldap.server.jndi.InvocationStateEnum;
+import org.apache.ldap.server.jndi.request.interceptor.BaseInterceptor;
+import org.apache.ldap.server.jndi.request.interceptor.InterceptorException;
 
 
 /**

Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/Authorizer.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/Authorizer.java?view=diff&r1=158292&r2=158293
==============================================================================
--- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/Authorizer.java (original)
+++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/Authorizer.java Sat Mar 19 19:55:29 2005
@@ -390,14 +390,14 @@
                                        SearchControls controls )
                         throws NamingException
                 {
-                    return Authorizer.this.isSearchable( ctx, result, controls );
+                    return Authorizer.this.isSearchable( ctx, result );
                 }
             } );
 
         request.setResponse( retval );
     }
 
-    private boolean isSearchable( LdapContext ctx, SearchResult result, SearchControls controls )
+    private boolean isSearchable( LdapContext ctx, SearchResult result )
             throws NamingException
     {
         Name dn;

Added: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/DefaultAttributeTagger.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/DefaultAttributeTagger.java?view=auto&rev=158293
==============================================================================
--- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/DefaultAttributeTagger.java (added)
+++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/DefaultAttributeTagger.java Sat Mar 19 19:55:29 2005
@@ -0,0 +1,329 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.ldap.server.jndi.request.interceptor;
+
+
+import java.util.HashSet;
+import java.util.Properties;
+
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.ldap.common.schema.AttributeType;
+import org.apache.ldap.common.schema.UsageEnum;
+import org.apache.ldap.common.util.DateUtils;
+import org.apache.ldap.server.RootNexus;
+import org.apache.ldap.server.db.ResultFilteringEnumeration;
+import org.apache.ldap.server.db.SearchResultFilter;
+import org.apache.ldap.server.jndi.request.AddRequest;
+import org.apache.ldap.server.jndi.request.LookUpRequest;
+import org.apache.ldap.server.jndi.request.LookUpWithAttributeIdsRequest;
+import org.apache.ldap.server.jndi.request.ModifyManyRequest;
+import org.apache.ldap.server.jndi.request.ModifyRelativeNameRequest;
+import org.apache.ldap.server.jndi.request.ModifyRequest;
+import org.apache.ldap.server.jndi.request.MoveRequest;
+import org.apache.ldap.server.jndi.request.MoveWithNewRelativeNameRequest;
+import org.apache.ldap.server.jndi.request.SearchRequest;
+import org.apache.ldap.server.schema.AttributeTypeRegistry;
+import org.apache.ldap.server.schema.GlobalRegistries;
+
+
+/**
+ * An interceptor based service which manages the creation and modification of
+ * operational attributes as operations are performed.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class DefaultAttributeTagger extends BaseInterceptor
+{
+    /** the database search result filter to register with filter service */
+    private final SearchResultFilter SEARCH_FILTER = new SearchResultFilter()
+    {
+        public boolean accept( LdapContext ctx, SearchResult result, SearchControls controls )
+            throws NamingException
+        {
+            if ( controls.getReturningAttributes() == null )
+            {
+                return filter( result.getAttributes() );
+            }
+
+            return true;
+        }
+    };
+
+    /** the root nexus of the system */
+    private final RootNexus nexus;
+    private final AttributeTypeRegistry registry;
+
+
+    /**
+     * Creates the operational attribute management service interceptor.
+     *
+     * @param nexus the root nexus of the system
+     * @param globalRegistries the global schema object registries
+     */
+    public DefaultAttributeTagger( RootNexus nexus,
+                                   GlobalRegistries globalRegistries )
+    {
+        this.nexus = nexus;
+        if ( this.nexus == null )
+        {
+            throw new NullPointerException( "the nexus cannot be null" );
+        }
+
+        if ( globalRegistries == null )
+        {
+            throw new NullPointerException( "the global registries cannot be null" );
+        }
+        this.registry = globalRegistries.getAttributeTypeRegistry();
+    }
+
+    public void destroy() {
+    }
+
+    public void init(Properties config) throws NamingException {
+    }
+
+    /**
+     * Adds extra operational attributes to the entry before it is added.
+     *
+     * @see BaseInterceptor#add(String, Name, Attributes)
+     */
+    protected void process( NextInterceptor nextInterceptor, AddRequest request ) throws NamingException
+    {
+        String principal = getPrincipal( request ).getName();
+        Attributes entry = request.getAttributes();
+
+        BasicAttribute attribute = new BasicAttribute( "creatorsName" );
+        attribute.add( principal );
+        entry.put( attribute );
+
+        attribute = new BasicAttribute( "createTimestamp" );
+        attribute.add( DateUtils.getGeneralizedTime() );
+        entry.put( attribute );
+        
+        nextInterceptor.process( request );
+    }
+
+
+    protected void process( NextInterceptor nextInterceptor, ModifyRequest request ) throws NamingException
+    {
+        nextInterceptor.process( request );
+        
+        // add operational attributes after call in case the operation fails
+        Attributes attributes = new BasicAttributes();
+        BasicAttribute attribute = new BasicAttribute( "modifiersName" );
+        attribute.add( getPrincipal( request ).getName() );
+        attributes.put( attribute );
+
+        attribute = new BasicAttribute( "modifyTimestamp" );
+        attribute.add( DateUtils.getGeneralizedTime() );
+        attributes.put( attribute );
+
+        nexus.modify( request.getName(), DirContext.REPLACE_ATTRIBUTE, attributes );
+    }
+
+
+    protected void process( NextInterceptor nextInterceptor, ModifyManyRequest request ) throws NamingException
+    {
+        nextInterceptor.process( request );
+
+        // add operational attributes after call in case the operation fails
+        Attributes attributes = new BasicAttributes();
+        BasicAttribute attribute = new BasicAttribute( "modifiersName" );
+        attribute.add( getPrincipal( request ).getName() );
+        attributes.put( attribute );
+
+        attribute = new BasicAttribute( "modifyTimestamp" );
+        attribute.add( DateUtils.getGeneralizedTime() );
+        attributes.put( attribute );
+
+        nexus.modify( request.getName(), DirContext.REPLACE_ATTRIBUTE, attributes );
+    }
+
+
+    protected void process( NextInterceptor nextInterceptor, ModifyRelativeNameRequest request ) throws NamingException
+    {
+        nextInterceptor.process( request );
+        
+        // add operational attributes after call in case the operation fails
+        Attributes attributes = new BasicAttributes();
+        BasicAttribute attribute = new BasicAttribute( "modifiersName" );
+        attribute.add( getPrincipal( request ).getName() );
+        attributes.put( attribute );
+
+        attribute = new BasicAttribute( "modifyTimestamp" );
+        attribute.add( DateUtils.getGeneralizedTime() );
+        attributes.put( attribute );
+
+        Name newDn = request.getName().getSuffix( 1 ).add( request.getNewRelativeName() );
+        nexus.modify( newDn, DirContext.REPLACE_ATTRIBUTE, attributes );
+    }
+
+
+    protected void process( NextInterceptor nextInterceptor, MoveRequest request ) throws NamingException
+    {
+        nextInterceptor.process( request );
+
+        // add operational attributes after call in case the operation fails
+        Attributes attributes = new BasicAttributes();
+        BasicAttribute attribute = new BasicAttribute( "modifiersName" );
+        attribute.add( getPrincipal( request ).getName() );
+        attributes.put( attribute );
+
+        attribute = new BasicAttribute( "modifyTimestamp" );
+        attribute.add( DateUtils.getGeneralizedTime() );
+        attributes.put( attribute );
+
+        nexus.modify( request.getNewParentName(), DirContext.REPLACE_ATTRIBUTE, attributes );
+    }
+
+
+    protected void process( NextInterceptor nextInterceptor, MoveWithNewRelativeNameRequest request ) throws NamingException
+    {
+        nextInterceptor.process( request );
+
+        // add operational attributes after call in case the operation fails
+        Attributes attributes = new BasicAttributes();
+        BasicAttribute attribute = new BasicAttribute( "modifiersName" );
+        attribute.add( getPrincipal( request ).getName() );
+        attributes.put( attribute );
+
+        attribute = new BasicAttribute( "modifyTimestamp" );
+        attribute.add( DateUtils.getGeneralizedTime() );
+        attributes.put( attribute );
+
+        nexus.modify( request.getNewParentName(), DirContext.REPLACE_ATTRIBUTE, attributes );
+    }
+
+
+    protected void process(NextInterceptor nextInterceptor, LookUpRequest request) throws NamingException {
+        nextInterceptor.process( request );
+        
+        Attributes attributes = ( Attributes ) request.getResponse();
+        Attributes retval = ( Attributes ) attributes.clone();
+        filter( retval );
+        request.setResponse( retval );
+    }
+
+    protected void process(NextInterceptor nextInterceptor, LookUpWithAttributeIdsRequest request) throws NamingException {
+        nextInterceptor.process( request );
+        
+        Attributes attributes = ( Attributes ) request.getResponse();
+        if ( attributes == null )
+        {
+            return;
+        }
+
+        Attributes retval = ( Attributes ) attributes.clone();
+        filter( request.getName(), retval, request.getAttributeIds() );
+        request.setResponse( retval );
+    }
+
+    protected void process(NextInterceptor nextInterceptor, SearchRequest request) throws NamingException {
+        nextInterceptor.process( request );
+        
+        SearchControls searchControls = request.getSearchControls();
+        if ( searchControls.getReturningAttributes() != null )
+        {
+            return;
+        }
+
+        NamingEnumeration e ;
+        ResultFilteringEnumeration retval;
+        LdapContext ctx = ( LdapContext ) request.getContextStack().peek();
+        e = ( NamingEnumeration ) request.getResponse();
+        retval = new ResultFilteringEnumeration( e, searchControls, ctx, SEARCH_FILTER );
+        request.setResponse( retval );
+    }
+
+    /**
+     * Filters out the operational attributes within a search results
+     * attributes.  The attributes are directly modified.
+     *
+     * @param attributes the resultant attributes to filter
+     * @return true always
+     */
+    private boolean filter( Attributes attributes ) throws NamingException
+    {
+        NamingEnumeration list = attributes.getIDs();
+
+        while ( list.hasMore() )
+        {
+            String attrId = ( String ) list.next();
+
+            AttributeType type = null;
+
+            if ( registry.hasAttributeType( attrId ) )
+            {
+                type = registry.lookup( attrId );
+            }
+
+            if ( type != null && type.getUsage() != UsageEnum.USERAPPLICATIONS )
+            {
+                attributes.remove( attrId );
+            }
+        }
+        return true;
+    }
+
+    private void filter( Name dn, Attributes entry, String[] ids )
+        throws NamingException
+    {
+        // still need to protect against returning op attrs when ids is null
+        if ( ids == null )
+        {
+            DefaultAttributeTagger.this.filter( entry );
+            return;
+        }
+        
+        if ( dn.size() == 0 )
+        {
+            HashSet idsSet = new HashSet( ids.length );
+            
+            for ( int ii = 0; ii < ids.length; ii++ )
+            {
+                idsSet.add( ids[ii].toLowerCase() );
+            }
+
+            NamingEnumeration list = entry.getIDs();
+            
+            while ( list.hasMore() )
+            {
+                String attrId = ( ( String ) list.nextElement() ).toLowerCase();
+                
+                if ( ! idsSet.contains( attrId ) )
+                {
+                    entry.remove( attrId );
+                }
+            }
+        }
+        
+        // do nothing past here since this explicity specifies which
+        // attributes to include - backends will automatically populate
+        // with right set of attributes using ids array
+    }
+}
\ No newline at end of file

Propchange: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/DefaultAttributeTagger.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/InterceptorChain.java?view=diff&r1=158292&r2=158293
==============================================================================
--- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/request/interceptor/InterceptorChain.java Sat Mar 19 19:55:29 2005
@@ -139,12 +139,9 @@
         {
             throw new IllegalStateException();
         }
-        else
-        {
-            nextEntry.prevEntry.nextEntry = newEntry;
-            nextEntry.prevEntry = newEntry;
-        }
 
+        nextEntry.prevEntry.nextEntry = newEntry;
+        nextEntry.prevEntry = newEntry;
         name2entry.put( name, newEntry );
     }
     
@@ -261,7 +258,7 @@
     {
         private Entry prevEntry;
         private Entry nextEntry;
-        private final String name;
+        //private final String name;
         private final Interceptor processor;
         private final NextInterceptor nextProcessor;
 
@@ -279,7 +276,7 @@
 
             this.prevEntry = prevEntry;
             this.nextEntry = nextEntry;
-            this.name = name;
+            //this.name = name;
             this.processor = processor;
             this.nextProcessor = new NextInterceptor()
             {