directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1745974 - in /directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers: ConcreteNameComponentNormalizer.java NoOpNormalizer.java
Date Sun, 29 May 2016 08:15:31 GMT
Author: elecharny
Date: Sun May 29 08:15:31 2016
New Revision: 1745974

URL: http://svn.apache.org/viewvc?rev=1745974&view=rev
Log:
o Return a Binary Value when normalizing a byte[]
o Allow the normalization for a byte[], returning the value as is

Modified:
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/ConcreteNameComponentNormalizer.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/NoOpNormalizer.java

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/ConcreteNameComponentNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/ConcreteNameComponentNormalizer.java?rev=1745974&r1=1745973&r2=1745974&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/ConcreteNameComponentNormalizer.java
(original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/ConcreteNameComponentNormalizer.java
Sun May 29 08:15:31 2016
@@ -20,6 +20,7 @@
 package org.apache.directory.api.ldap.model.schema.normalizers;
 
 
+import org.apache.directory.api.ldap.model.entry.Value;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
 import org.apache.directory.api.ldap.model.schema.MatchingRule;
@@ -130,9 +131,9 @@ public class ConcreteNameComponentNormal
     @Override
     public Object normalizeByName( String name, byte[] value ) throws LdapException
     {
-        String valStr = Strings.utf8ToString( value );
-
-        return lookup( name ).normalize( valStr );
+        AttributeType attributeType = schemaManager.getAttributeType( name );
+        
+        return new Value( attributeType, value );
     }
 
 

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/NoOpNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/NoOpNormalizer.java?rev=1745974&r1=1745973&r2=1745974&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/NoOpNormalizer.java
(original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/normalizers/NoOpNormalizer.java
Sun May 29 08:15:31 2016
@@ -75,4 +75,17 @@ public class NoOpNormalizer extends Norm
     {
         return value;
     }
+
+
+    /**
+     * Returns the value argument as-is without alterations all the time.
+     * 
+     * @param value any value
+     * @return the value argument returned as-is
+     * @see org.apache.directory.api.ldap.model.schema.Normalizer#normalize(String)
+     */
+    public byte[] normalize( byte[] value )
+    {
+        return value;
+    }
 }



Mime
View raw message