directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1421063 - /directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Date Thu, 13 Dec 2012 02:03:30 GMT
Author: elecharny
Date: Thu Dec 13 02:03:16 2012
New Revision: 1421063

URL: http://svn.apache.org/viewvc?rev=1421063&view=rev
Log:
Removed the useless Binary filter

Modified:
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java

Modified: directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1421063&r1=1421062&r2=1421063&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Thu Dec 13 02:03:16 2012
@@ -119,11 +119,6 @@ public class SchemaInterceptor extends B
      */
     private PartitionNexus nexus;
 
-    /**
-     * a binary attribute tranforming filter: String -> byte[]
-     */
-    private BinaryAttributeFilter binaryAttributeFilter;
-
     private TopFilter topFilter;
 
     private List<EntryFilter> filters = new ArrayList<EntryFilter>();
@@ -181,9 +176,7 @@ public class SchemaInterceptor extends B
         super.init( directoryService );
 
         nexus = directoryService.getPartitionNexus();
-        binaryAttributeFilter = new BinaryAttributeFilter();
         topFilter = new TopFilter();
-        filters.add( binaryAttributeFilter );
         filters.add( topFilter );
 
         schemaBaseDn = directoryService.getDnFactory().create( SchemaConstants.OU_SCHEMA
);
@@ -918,66 +911,8 @@ public class SchemaInterceptor extends B
         }
     }
 
-
-    private void filterBinaryAttributes( Entry entry ) throws LdapException
-    {
-        /*
-         * start converting values of attributes to byte[]s which are not
-         * human readable and those that are in the binaries set
-         */
-        for ( Attribute attribute : entry )
-        {
-            if ( !attribute.getAttributeType().getSyntax().isHumanReadable() )
-            {
-                List<Value<?>> binaries = new ArrayList<Value<?>>();
-
-                for ( Value<?> value : attribute )
-                {
-                    binaries.add( new BinaryValue( attribute.getAttributeType(), value.getBytes()
) );
-                }
-
-                attribute.clear();
-
-                for ( Value<?> value : binaries )
-                {
-                    attribute.add( value );
-                }
-            }
-        }
-    }
-
     
     /**
-     * A special filter over entry attributes which replaces Attribute String values with
their respective byte[]
-     * representations using schema information and the value held in the JNDI environment
property:
-     * <code>java.naming.ldap.attributes.binary</code>.
-     *
-     * @see <a href= "http://java.sun.com/j2se/1.4.2/docs/guide/jndi/jndi-ldap-gl.html#binary">
-     *      java.naming.ldap.attributes.binary</a>
-     */
-    private class BinaryAttributeFilter implements EntryFilter
-    {
-        /**
-         * {@inheritDoc}
-         */
-        public boolean accept( SearchingOperationContext operation, Entry entry ) throws
Exception
-        {
-            filterBinaryAttributes( entry );
-
-            return true;
-        }
-        
-        
-        /**
-         * {@inheritDoc}
-         */
-        public String toString( String tabs )
-        {
-            return tabs + "BinaryAttributeFilter";
-        }
-    }
-
-    /**
      * Filters objectClass attribute to inject top when not present.
      */
     private class TopFilter implements EntryFilter
@@ -1231,7 +1166,6 @@ public class SchemaInterceptor extends B
     public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
     {
         EntryFilteringCursor cursor = next( listContext );
-        cursor.addEntryFilter( binaryAttributeFilter );
 
         return cursor;
     }
@@ -1246,8 +1180,6 @@ public class SchemaInterceptor extends B
         
         ServerEntryUtils.filterContents( result, lookupContext );
 
-        filterBinaryAttributes( result );
-
         return result;
     }
 



Mime
View raw message