You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/02/07 03:53:31 UTC

svn commit: r1241336 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/api/schema/DescriptionParsers.java protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java

Author: elecharny
Date: Tue Feb  7 02:53:30 2012
New Revision: 1241336

URL: http://svn.apache.org/viewvc?rev=1241336&view=rev
Log:
o Reflected the changes made in the API in the server (about the X-NOT-HUMAN-READABLE)

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/DescriptionParsers.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/DescriptionParsers.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/DescriptionParsers.java?rev=1241336&r1=1241335&r2=1241336&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/DescriptionParsers.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/DescriptionParsers.java Tue Feb  7 02:53:30 2012
@@ -669,7 +669,7 @@ public class DescriptionParsers
      */
     private boolean isHumanReadable( LdapSyntax ldapSyntax )
     {
-        List<String> values = ldapSyntax.getExtensions().get( MetaSchemaConstants.X_IS_HUMAN_READABLE );
+        List<String> values = ldapSyntax.getExtensions().get( MetaSchemaConstants.X_NOT_HUMAN_READABLE );
 
         if ( values == null || values.size() == 0 )
         {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java?rev=1241336&r1=1241335&r2=1241336&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java Tue Feb  7 02:53:30 2012
@@ -20,7 +20,7 @@
 package org.apache.directory.server.ldap;
 
 
-import org.apache.directory.shared.ldap.codec.api.BinaryAttributeDetector;
+import org.apache.directory.shared.ldap.codec.api.DefaultBinaryAttributeDectector;
 import org.apache.directory.shared.ldap.codec.api.LdapApiServiceFactory;
 import org.apache.directory.shared.ldap.codec.api.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.MessageDecorator;
@@ -33,9 +33,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ResultResponse;
 import org.apache.directory.shared.ldap.model.message.ResultResponseRequest;
 import org.apache.directory.shared.ldap.model.message.extended.NoticeOfDisconnect;
-import org.apache.directory.shared.ldap.model.schema.AttributeType;
-import org.apache.directory.shared.ldap.model.schema.SchemaManager;
-import org.apache.directory.shared.util.Strings;
 import org.apache.mina.core.service.IoHandler;
 import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.ssl.SslFilter;
@@ -45,8 +42,8 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The MINA IoHandler implementation extending {@link DemuxingIoHandler} for 
- * the LDAP protocol.  THe {@link LdapServer} creates this multiplexing 
+ * The MINA IoHandler implementation extending {@link DemuxingIoHandler} for
+ * the LDAP protocol.  THe {@link LdapServer} creates this multiplexing
  * {@link IoHandler} handler and populates it with subordinate handlers for
  * the various kinds of LDAP {@link Request} messages.  This is done in the
  * setXxxHandler() methods of the LdapServer where Xxxx is Add, Modify, etc.
@@ -92,30 +89,15 @@ class LdapProtocolHandler extends Demuxi
         LdapMessageContainer<? extends MessageDecorator<Message>> ldapMessageContainer =
             new LdapMessageContainer<MessageDecorator<Message>>(
                 ldapServer.getDirectoryService().getLdapCodecService(),
-                new BinaryAttributeDetector()
-                {
-                    public boolean isBinary( String id )
-                    {
-                        SchemaManager schemaManager = ldapServer.getDirectoryService().getSchemaManager();
-
-                        try
-                        {
-                            AttributeType type = schemaManager.lookupAttributeTypeRegistry( id );
-                            return !type.getSyntax().isHumanReadable();
-                        }
-                        catch ( Exception e )
-                        {
-                            return !Strings.isEmpty( id ) && id.endsWith( ";binary" );
-                        }
-                    }
-                } );
+                new DefaultBinaryAttributeDectector(
+                    ldapServer.getDirectoryService().getSchemaManager() ) );
 
         session.setAttribute( "messageContainer", ldapMessageContainer );
     }
 
 
     /**
-     * This method is called when a session is closed. If we have some 
+     * This method is called when a session is closed. If we have some
      * cleanup to do, it's done there.
      * 
      * @param session the closing session
@@ -133,7 +115,7 @@ class LdapProtocolHandler extends Demuxi
     /**
      * Explicitly handles {@link LdapSession} and {@link IoSession} cleanup tasks.
      *
-     * @param ldapSession the LdapSession to cleanup after being removed from 
+     * @param ldapSession the LdapSession to cleanup after being removed from
      * the {@link LdapSessionManager}
      */
     private void cleanUpSession( LdapSession ldapSession )
@@ -181,7 +163,7 @@ class LdapProtocolHandler extends Demuxi
         // Translate SSLFilter messages into LDAP extended request
         // defined in RFC #2830, 'Lightweight Directory Access Protocol (v3):
         // Extension for Transport Layer Security'.
-        // 
+        //
         // The RFC specifies the payload should be empty, but we use
         // it to notify the TLS state changes.  This hack should be
         // OK from the viewpointd of security because StartTLS