directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1421695 - /directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
Date Fri, 14 Dec 2012 07:03:32 GMT
Author: elecharny
Date: Fri Dec 14 07:03:31 2012
New Revision: 1421695

URL: http://svn.apache.org/viewvc?rev=1421695&view=rev
Log:
Removed dead code

Modified:
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java

Modified: directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1421695&r1=1421694&r2=1421695&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
Fri Dec 14 07:03:31 2012
@@ -115,7 +115,9 @@ public class OperationalAttributeInterce
                 return true;
             }
 
-            return filterDenormalized( entry );
+            denormalizeEntryOpAttrs( entry );
+            
+            return true;
         }
         
         
@@ -556,131 +558,6 @@ public class OperationalAttributeInterce
     }
 
 
-    /**
-     * Filters out the user attributes within a search results attributes. The attributes
are directly
-     * modified.
-     *
-     * @param attributes the resultant attributes to filter
-     * @return true always
-     * @throws Exception if there are failures in evaluation
-     */
-    private boolean filterUserAttributes( LookupOperationContext lookupContext, Entry attributes
) throws LdapException
-    {
-        Set<String> removedAttributes = new HashSet<String>();
-
-        // Build a list of attributeType to remove
-        for ( Attribute attribute : attributes.getAttributes() )
-        {
-            AttributeType attributeType = attribute.getAttributeType();
-
-            if ( attributeType.getUsage() == UsageEnum.USER_APPLICATIONS )
-            {
-                removedAttributes.add( attributeType.getOid() );
-            }
-        }
-
-        // Now remove the attributes which are not in the list to be returned
-        for ( String returningAttribute : lookupContext.getReturningAttributesString() )
-        {
-            removedAttributes.remove( returningAttribute );
-        }
-
-        // Now, remove the attributes from the result
-        for ( String attribute : removedAttributes )
-        {
-            attributes.removeAttributes( attribute );
-        }
-
-        return true;
-    }
-
-
-    private void filter( LookupOperationContext lookupContext, Entry entry ) throws LdapException
-    {
-        Dn dn = lookupContext.getDn();
-        String[] ids = lookupContext.getReturningAttributesString();
-
-        // still need to protect against returning op attrs when ids is null
-        if ( ( ids == null ) || ( ids.length == 0 ) )
-        {
-            filterOperationalAttributes( entry );
-            return;
-        }
-
-        if ( dn.size() == 0 )
-        {
-            Set<AttributeType> removedAttributes = new HashSet<AttributeType>();
-
-            for ( Attribute attribute : entry.getAttributes() )
-            {
-                AttributeType attributeType = attribute.getAttributeType();
-
-                if ( attributeType.getUsage() != UsageEnum.USER_APPLICATIONS )
-                {
-                    // If it's not in the list of returning attribute, remove it
-                    if ( !lookupContext.contains( schemaManager, attributeType ) )
-                    {
-                        removedAttributes.add( attributeType );
-                    }
-                }
-            }
-
-            for ( AttributeType attributeType : removedAttributes )
-            {
-                entry.removeAttributes( attributeType );
-            }
-        }
-
-        denormalizeEntryOpAttrs( entry );
-
-        // do nothing past here since this explicity specifies which
-        // attributes to include - backends will automatically populate
-        // with right set of attributes using ids array
-    }
-
-
-    private void filterList( LookupOperationContext lookupContext, Entry entry ) throws LdapException
-    {
-        Dn dn = lookupContext.getDn();
-        String[] ids = lookupContext.getReturningAttributesString();
-
-        // still need to protect against returning op attrs when ids is null
-        if ( ( ids == null ) || ( ids.length == 0 ) )
-        {
-            filterOperationalAttributes( entry );
-            
-            return;
-        }
-
-        if ( dn.size() == 0 )
-        {
-            Set<AttributeType> removedAttributes = new HashSet<AttributeType>();
-
-            for ( Attribute attribute : entry.getAttributes() )
-            {
-                AttributeType attributeType = attribute.getAttributeType();
-
-                // If it's not in the list of returning attribute, remove it
-                if ( !lookupContext.contains( schemaManager, attributeType ) )
-                {
-                    removedAttributes.add( attributeType );
-                }
-            }
-
-            for ( AttributeType attributeType : removedAttributes )
-            {
-                entry.removeAttributes( attributeType );
-            }
-        }
-
-        denormalizeEntryOpAttrs( entry );
-
-        // do nothing past here since this explicity specifies which
-        // attributes to include - backends will automatically populate
-        // with right set of attributes using ids array
-    }
-
-
     private void denormalizeEntryOpAttrs( Entry entry ) throws LdapException
     {
         if ( directoryService.isDenormalizeOpAttrsEnabled() )
@@ -768,11 +645,4 @@ public class OperationalAttributeInterce
 
         return newDn;
     }
-
-
-    private boolean filterDenormalized( Entry entry ) throws Exception
-    {
-        denormalizeEntryOpAttrs( entry );
-        return true;
-    }
 }
\ No newline at end of file



Mime
View raw message