directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r328747 - in /directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server: normalization/ schema/ subtree/
Date Wed, 26 Oct 2005 21:48:06 GMT
Author: elecharny
Date: Wed Oct 26 14:47:58 2005
New Revision: 328747

URL: http://svn.apache.org/viewcvs?rev=328747&view=rev
Log:
Fixed the conversion from byte[] to String

Modified:
    directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/normalization/NormalizationService.java
    directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/normalization/ValueNormalizingVisitor.java
    directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/schema/ConcreteNameComponentNormalizer.java
    directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/schema/SchemaService.java
    directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/subtree/RefinementLeafEvaluator.java

Modified: directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/normalization/NormalizationService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/normalization/NormalizationService.java?rev=328747&r1=328746&r2=328747&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/normalization/NormalizationService.java
(original)
+++ directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/normalization/NormalizationService.java
Wed Oct 26 14:47:58 2005
@@ -289,8 +289,22 @@
             return ( String ) type.getEquality().getNormalizer().normalize( value );
         }
 
+        public String normalizeByName( String name, byte[] value ) throws NamingException
+        {
+            AttributeType type = registry.lookup( name );
+
+            return ( String ) type.getEquality().getNormalizer().normalize( value );
+        }
+
 
         public String normalizeByOid( String oid, String value ) throws NamingException
+        {
+            AttributeType type = registry.lookup( oid );
+
+            return ( String ) type.getEquality().getNormalizer().normalize( value );
+        }
+
+        public String normalizeByOid( String oid, byte[] value ) throws NamingException
         {
             AttributeType type = registry.lookup( oid );
 

Modified: directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/normalization/ValueNormalizingVisitor.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/normalization/ValueNormalizingVisitor.java?rev=328747&r1=328746&r2=328747&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/normalization/ValueNormalizingVisitor.java
(original)
+++ directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/normalization/ValueNormalizingVisitor.java
Wed Oct 26 14:47:58 2005
@@ -17,6 +17,7 @@
 package org.apache.ldap.server.normalization;
 
 
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.filter.FilterVisitor;
 import org.apache.ldap.common.filter.ExprNode;
 import org.apache.ldap.common.filter.BranchNode;
@@ -71,7 +72,7 @@
                 throw new RuntimeException( e.getMessage() );
             }
 
-            snode.setValue( normalized );
+            snode.setValue( StringUtils.getBytesUtf8( normalized ) );
             return;
         }
 

Modified: directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/schema/ConcreteNameComponentNormalizer.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/schema/ConcreteNameComponentNormalizer.java?rev=328747&r1=328746&r2=328747&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/schema/ConcreteNameComponentNormalizer.java
(original)
+++ directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/schema/ConcreteNameComponentNormalizer.java
Wed Oct 26 14:47:58 2005
@@ -59,11 +59,27 @@
         return lookup( name ).normalize( value ).toString();
     }
 
+    /**
+     * @see NameComponentNormalizer#normalizeByName(String, String)
+     */
+    public String normalizeByName( String name, byte[] value ) throws NamingException
+    {
+        return lookup( name ).normalize( value ).toString();
+    }
+
 
     /**
      * @see NameComponentNormalizer#normalizeByOid(String, String)
      */
     public String normalizeByOid( String oid, String value ) throws NamingException
+    {
+        return lookup( oid ).normalize( value ).toString();
+    }
+
+    /**
+     * @see NameComponentNormalizer#normalizeByOid(String, String)
+     */
+    public String normalizeByOid( String oid, byte[] value ) throws NamingException
     {
         return lookup( oid ).normalize( value ).toString();
     }

Modified: directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/schema/SchemaService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/schema/SchemaService.java?rev=328747&r1=328746&r2=328747&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/schema/SchemaService.java
(original)
+++ directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/schema/SchemaService.java
Wed Oct 26 14:47:58 2005
@@ -28,6 +28,7 @@
 import javax.naming.NamingException;
 import javax.naming.directory.*;
 
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.filter.ExprNode;
 import org.apache.ldap.common.filter.PresenceNode;
 import org.apache.ldap.common.filter.SimpleNode;
@@ -153,7 +154,7 @@
             SimpleNode node = ( SimpleNode ) filter;
 
             if ( node.getAttribute().equalsIgnoreCase( "objectClass" ) &&
-                    node.getValue().equalsIgnoreCase( "subschema" ) &&
+                    StringUtils.toUtf8( node.getValue() ).equalsIgnoreCase( "subschema" )
&&
                     node.getAssertionType() == SimpleNode.EQUALITY
             )
             {

Modified: directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/subtree/RefinementLeafEvaluator.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/subtree/RefinementLeafEvaluator.java?rev=328747&r1=328746&r2=328747&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/subtree/RefinementLeafEvaluator.java
(original)
+++ directory/apacheds/branches/apacheds-utf8/core/src/main/java/org/apache/ldap/server/subtree/RefinementLeafEvaluator.java
Wed Oct 26 14:47:58 2005
@@ -17,6 +17,7 @@
 package org.apache.ldap.server.subtree;
 
 
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.filter.*;
 import org.apache.ldap.server.schema.OidRegistry;
 
@@ -92,9 +93,11 @@
         }
 
         // If the filter value for the objectClass is an OID we need to resolve a name
-        if ( Character.isDigit( node.getValue().charAt( 0 ) ) )
+        String value = StringUtils.toUtf8( node.getValue() );
+        
+        if ( Character.isDigit( value.charAt( 0 ) ) )
         {
-            Iterator list = registry.getNameSet( node.getValue() ).iterator();
+            Iterator list = registry.getNameSet( value ).iterator();
             while ( list.hasNext() )
             {
                 String objectClass = ( String ) list.next();



Mime
View raw message