directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r895316 - in /directory: apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/ apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchroni...
Date Sun, 03 Jan 2010 01:50:53 GMT
Author: elecharny
Date: Sun Jan  3 01:50:52 2010
New Revision: 895316

URL: http://svn.apache.org/viewvc?rev=895316&view=rev
Log:
o Removed the useless method Rdn.getValue(), replaced it by getNormValue()
o Used AttributeUtils.createAttributes
o Added a test in LdapDN

Modified:
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
    directory/apacheds/branches/apacheds-schema/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/branches/apacheds-schema/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/apacheds-schema/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java
    directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
Sun Jan  3 01:50:52 2010
@@ -485,7 +485,7 @@
                 + "' expected to be CN oid of " + CN_OID + " but was " + rdn.getNormType()
);
         }
 
-        return ( String ) rdn.getValue();
+        return ( String ) rdn.getNormValue();
     }
 
 

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
Sun Jan  3 01:50:52 2010
@@ -156,7 +156,7 @@
         }
         
         Rdn rdn = dn.getRdn( 1 );
-        return ( String ) rdn.getValue();
+        return ( String ) rdn.getNormValue();
     }
 
 
@@ -212,7 +212,7 @@
                 ResultCodeEnum.NAMING_VIOLATION );
         }
         
-        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( OBJECT_TYPE_TO_PATH.get( objectType
) ) )
+        if ( ! ( ( String ) rdn.getNormValue() ).equalsIgnoreCase( OBJECT_TYPE_TO_PATH.get(
objectType ) ) )
         {
             throw new LdapInvalidNameException( 
                 "The parent entry of a " + objectType + " should have a relative name of
ou=" + 
@@ -352,7 +352,7 @@
         {
             LdapDN dn = result.getDn();
             dn.normalize( schemaManager.getNormalizerMapping() );
-            oids.add( ( String ) dn.getRdn().getValue() );
+            oids.add( ( String ) dn.getRdn().getNormValue() );
         }
         
         return oids;

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
Sun Jan  3 01:50:52 2010
@@ -203,7 +203,7 @@
 
         // Inject the new OID
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-        String newOid = ( String ) newRdn.getValue();
+        String newOid = ( String ) newRdn.getNormValue();
         checkOidIsUnique( newOid );
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
 
@@ -247,7 +247,7 @@
         AttributeType oldAt = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
             oldSchemaName );
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-        String newOid = ( String ) newRn.getValue();
+        String newOid = ( String ) newRn.getNormValue();
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         checkOidIsUnique( newOid );
         AttributeType newAt = factory.getAttributeType( schemaManager, targetEntry, schemaManager.getRegistries(),

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
Sun Jan  3 01:50:52 2010
@@ -238,7 +238,7 @@
                     + "matchingRules using that comparator have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
 
-        String oid = ( String ) newRdn.getValue();
+        String oid = ( String ) newRdn.getNormValue();
         checkOidIsUniqueForComparator( oid );
 
         String schemaName = getSchemaName( entry.getDn() );
@@ -247,7 +247,7 @@
         {
             // Inject the new OID in the entry
             ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-            String newOid = ( String ) newRdn.getValue();
+            String newOid = ( String ) newRdn.getNormValue();
             checkOidIsUnique( newOid );
             targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
 
@@ -279,7 +279,7 @@
                     + "matchingRules using that comparator have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
 
-        String oid = ( String ) newRdn.getValue();
+        String oid = ( String ) newRdn.getNormValue();
         checkOidIsUniqueForComparator( oid );
 
         String newSchemaName = getSchemaName( newParentName );
@@ -392,7 +392,7 @@
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
-        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.COMPARATORS_AT
) )
+        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.COMPARATORS_AT
) )
         {
             throw new LdapInvalidNameException(
                 "The parent entry of a comparator should have a relative name of ou=comparators.",

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
Sun Jan  3 01:50:52 2010
@@ -203,7 +203,7 @@
         String schemaName = getSchemaName( entry.getDn() );
         MatchingRule oldMr = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(),
schemaName );
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-        String newOid = ( String ) newRdn.getValue();
+        String newOid = ( String ) newRdn.getNormValue();
         checkOidIsUnique( newOid );
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
@@ -232,7 +232,7 @@
         MatchingRule oldMr = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(),
             oldSchemaName );
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-        String newOid = ( String ) newRdn.getValue();
+        String newOid = ( String ) newRdn.getNormValue();
         checkOidIsUnique( newOid );
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
@@ -306,7 +306,7 @@
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
-        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.MATCHING_RULES_AT
) )
+        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.MATCHING_RULES_AT
) )
         {
             throw new LdapInvalidNameException(
                 "The parent entry of a syntax should have a relative name of ou=matchingRules.",

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
Sun Jan  3 01:50:52 2010
@@ -212,7 +212,7 @@
                     + "matchingRules using that normalizer have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
 
-        String newOid = ( String ) newRdn.getValue();
+        String newOid = ( String ) newRdn.getNormValue();
         checkOidIsUniqueForNormalizer( newOid );
 
         if ( isSchemaEnabled( schemaName ) )
@@ -250,7 +250,7 @@
                     + "matchingRules using that normalizer have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
 
-        String oid = ( String ) newRdn.getValue();
+        String oid = ( String ) newRdn.getNormValue();
         checkOidIsUniqueForNormalizer( oid );
         Normalizer normalizer = factory.getNormalizer( schemaManager, entry, schemaManager.getRegistries(),
             newSchemaName );
@@ -336,7 +336,7 @@
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
-        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.NORMALIZERS_AT
) )
+        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.NORMALIZERS_AT
) )
         {
             throw new LdapInvalidNameException(
                 "The parent entry of a normalizer should have a relative name of ou=normalizers.",

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
Sun Jan  3 01:50:52 2010
@@ -212,7 +212,7 @@
         //        }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-        String newOid = ( String ) newRdn.getValue();
+        String newOid = ( String ) newRdn.getNormValue();
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
 
         // Inject the new DN
@@ -265,7 +265,7 @@
 
         String newSchemaName = getSchemaName( newParentName );
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-        String newOid = ( String ) newRdn.getValue();
+        String newOid = ( String ) newRdn.getNormValue();
         checkOidIsUnique( newOid );
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         ObjectClass oc = factory.getObjectClass( schemaManager, targetEntry, schemaManager.getRegistries(),
@@ -349,7 +349,7 @@
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
-        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT
) )
+        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT
) )
         {
             throw new LdapInvalidNameException(
                 "The parent entry of a attributeType should have a relative name of ou=objectClasses.",

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
Sun Jan  3 01:50:52 2010
@@ -191,7 +191,7 @@
                 throw new LdapInvalidNameException( msg, ResultCodeEnum.NAMING_VIOLATION
);
             }
             
-            String ouValue = ( String ) opContext.getDn().getRdn().getValue();
+            String ouValue = ( String ) opContext.getDn().getRdn().getNormValue();
             ouValue = ouValue.trim().toLowerCase();
             
             if ( ! VALID_OU_VALUES.contains( ouValue ) )
@@ -246,7 +246,7 @@
                     " can be deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
             
-            String ouValue = ( String ) opContext.getDn().getRdn().getValue();
+            String ouValue = ( String ) opContext.getDn().getRdn().getNormValue();
             ouValue = ouValue.trim().toLowerCase();
             
             if ( ! VALID_OU_VALUES.contains( ouValue ) )

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
Sun Jan  3 01:50:52 2010
@@ -500,7 +500,7 @@
 
     private String getSchemaName( LdapDN schema )
     {
-        return ( String ) schema.getRdn().getValue();
+        return ( String ) schema.getRdn().getNormValue();
     }
 
     

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
Sun Jan  3 01:50:52 2010
@@ -236,7 +236,7 @@
         }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-        String newOid = ( String ) newRdn.getValue();
+        String newOid = ( String ) newRdn.getNormValue();
 
         if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
         {
@@ -273,7 +273,7 @@
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
 
-        String newOid = ( String ) newRdn.getValue();
+        String newOid = ( String ) newRdn.getNormValue();
 
         if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
         {
@@ -375,7 +375,7 @@
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
-        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.SYNTAX_CHECKERS_AT
) )
+        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.SYNTAX_CHECKERS_AT
) )
         {
             throw new LdapInvalidNameException(
                 "The parent entry of a normalizer should have a relative name of ou=syntaxCheckers.",

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java
Sun Jan  3 01:50:52 2010
@@ -270,7 +270,7 @@
         }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-        String newOid = ( String ) newRdn.getValue();
+        String newOid = ( String ) newRdn.getNormValue();
         checkOidIsUnique( newOid );
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
@@ -312,7 +312,7 @@
         }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-        String newOid = ( String ) newRn.getValue();
+        String newOid = ( String ) newRn.getNormValue();
         checkOidIsUnique( newOid );
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
@@ -400,7 +400,7 @@
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
-        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( "syntaxes" ) )
+        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( "syntaxes" ) )
         {
             throw new LdapInvalidNameException(
                 "The parent entry of a syntax should have a relative name of ou=syntaxes.",

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
Sun Jan  3 01:50:52 2010
@@ -273,7 +273,7 @@
         attr = new DefaultClientAttribute( "ou", "Engineering", "People" );
         ldif.addAttribute( attr );
 
-        String uid = ( String ) dn.getRdn().getValue();
+        String uid = ( String ) dn.getRdn().getNormValue();
         ldif.putAttribute( "uid", uid );
 
         ldif.putAttribute( "l", "Bogusville" );

Modified: directory/apacheds/branches/apacheds-schema/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Sun Jan  3 01:50:52 2010
@@ -807,7 +807,7 @@
 
         if ( rdn.size() == 1 )
         {
-            serverEntry.put( rdn.getUpType(), ( String ) rdn.getValue() );
+            serverEntry.put( rdn.getUpType(), ( String ) rdn.getNormValue() );
         }
         else
         {

Modified: directory/apacheds/branches/apacheds-schema/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
Sun Jan  3 01:50:52 2010
@@ -495,7 +495,7 @@
         if ( rdn.size() == 1 )
         {
             String rdnAttribute = rdn.getUpType();
-            String rdnValue = ( String ) rdn.getValue();
+            String rdnValue = ( String ) rdn.getNormValue();
 
             // Add the Rdn attribute
             boolean doRdnPut = attributes.get( rdnAttribute ) == null;

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
Sun Jan  3 01:50:52 2010
@@ -226,7 +226,7 @@
             while ( list.next() )
             {
                 ClonedServerEntry entry = list.get();
-                children.add( ( String ) entry.getDn().getRdn().getValue() );
+                children.add( ( String ) entry.getDn().getRdn().getNormValue() );
             }
         }
         catch ( Exception e )

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Sun Jan  3 01:50:52 2010
@@ -1743,7 +1743,7 @@
         }
         
         Rdn rdn = dn.getRdn( 1 );
-        return ( String ) rdn.getValue();
+        return ( String ) rdn.getNormValue();
     }
 
 
@@ -1944,7 +1944,9 @@
     {
         for ( AttributeTypeAndValue atav : dn.getRdn() )
         {
-            if ( !entry.containsAttribute( atav.getNormType() ) )
+            EntryAttribute attribute = entry.get( atav.getNormType() );
+            
+            if ( ( attribute == null ) || ( !attribute.contains( atav.getNormValue() ) )
)
             {
                 String message = "Entry " + dn + " does not have the " + atav.getUpType()
+ " attributeType, which is part of the RDN";
                 LOG.error( message );

Modified: directory/apacheds/branches/apacheds-schema/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java
Sun Jan  3 01:50:52 2010
@@ -106,7 +106,7 @@
         assertNotNull( entry );
         
         Rdn oldRdn = oldDn.getRdn();
-        assertTrue( entry.contains( oldRdn.getUpType(), ( String ) oldRdn.getValue() ) );
+        assertTrue( entry.contains( oldRdn.getUpType(), ( String ) oldRdn.getNormValue()
) );
     }
     
     

Modified: directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java
(original)
+++ directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java
Sun Jan  3 01:50:52 2010
@@ -33,8 +33,6 @@
 import javax.naming.NoPermissionException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SchemaViolationException;
 import javax.naming.directory.SearchControls;
@@ -72,16 +70,14 @@
     /**
      * Create attributes for a person entry.
      */
-    private Attributes getPersonAttributes( String sn, String cn )
+    private Attributes getPersonAttributes( String sn, String cn ) throws Exception
     {
-        Attributes attributes = new BasicAttributes( true );
-        Attribute attribute = new BasicAttribute( "objectClass" );
-        attribute.add( "top" );
-        attribute.add( "person" );
-        attributes.put( attribute );
-        attributes.put( "cn", cn );
-        attributes.put( "sn", sn );
-        attributes.put( "description", cn + " is a person." );
+        Attributes attributes = AttributeUtils.createAttributes( 
+            "objectClass: top",
+            "objectClass: person",
+            "cn", cn,
+            "sn", sn,
+            "description", cn + " is a person." );
 
         return attributes;
     }
@@ -90,15 +86,13 @@
     /**
      * Create attributes for a organizational unit entry.
      */
-    private Attributes getOrganizationalUnitAttributes( String ou )
+    private Attributes getOrganizationalUnitAttributes( String ou ) throws Exception
     {
-        Attributes attributes = new BasicAttributes( true );
-        Attribute attribute = new BasicAttribute( "objectClass" );
-        attribute.add( "top" );
-        attribute.add( "organizationalUnit" );
-        attributes.put( attribute );
-        attributes.put( "ou", ou );
-        attributes.put( "description", ou + " is an organizational unit." );
+        Attributes attributes = AttributeUtils.createAttributes( 
+            "objectClass: top",
+            "objectClass: organizationalUnit",
+            "ou", ou,
+            "description", ou + " is an organizational unit." );
 
         return attributes;
     }
@@ -470,7 +464,7 @@
         String cnVal = "Tori Amos";
         String snVal = "Amos";
         String oldRdn = "cn=" + cnVal;
-        Attributes attributes = this.getPersonAttributes( snVal, cnVal );
+        Attributes attributes = getPersonAttributes( snVal, cnVal );
         ctx.createSubcontext( oldRdn, attributes );
 
         // modify Rdn from cn=Tori Amos to cn=<a Umlaut>\+

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
Sun Jan  3 01:50:52 2010
@@ -936,27 +936,6 @@
 
 
     /**
-     * Return the value, or the first one of we have more than one (the lowest)
-     *
-     * @return The first value of this RDN
-     */
-    public Object getValue()
-    {
-        switch ( nbAtavs )
-        {
-            case 0:
-                return null;
-
-            case 1:
-                return atav.getNormValue().get();
-
-            default:
-                return ( ( TreeSet<AttributeTypeAndValue> ) atavs ).first().getNormValue().get();
-        }
-    }
-
-
-    /**
      * Return the User Provided value
      * 
      * @return The first User provided value of this RDN

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Sun Jan  3 01:50:52 2010
@@ -20,6 +20,12 @@
 package org.apache.directory.shared.ldap.name;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -41,21 +47,12 @@
 import javax.naming.NamingException;
 import javax.naming.ldap.LdapName;
 
-import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.LdapDnParser;
-import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertSame;
-
 
 /**
  * Test the class LdapDN
@@ -3508,4 +3505,31 @@
         assertEquals( "cn=loopback+iphostnumber=\\#127.0.0.1 Z", dn4.getRdn().getNormName()
);
     }
 
+    @Test
+    public void testNorm() throws Exception
+    {
+        LdapDN dn = new LdapDN( "  ou  =  Ex\\+mple ,  ou  =  COM " );
+        
+        dn.normalize( oidOids );
+        assertEquals( "2.5.4.11=ex\\+mple,2.5.4.11=com", dn.getNormName() );
+        assertEquals( "  ou  =  Ex\\+mple ,  ou  =  COM ", dn.getUpName() );
+        
+        Rdn rdn = dn.getRdn();
+        assertEquals( "2.5.4.11", rdn.getNormType() );
+        assertEquals( "ex+mple",rdn.getNormValue() );
+        assertEquals( "2.5.4.11=ex\\+mple", rdn.getNormName() );
+        assertEquals( "ou", rdn.getUpType() );
+        assertEquals( "Ex\\+mple",rdn.getUpValue() );
+        assertEquals( "  ou  =  Ex\\+mple ", rdn.getUpName() );
+        
+        AttributeTypeAndValue atav = rdn.getAtav();
+        
+        assertEquals( "2.5.4.11=ex+mple", atav.getNormalizedValue() );
+        assertEquals( "2.5.4.11", atav.getNormType() );
+        assertEquals( "ex+mple", atav.getNormValue().get() );
+        
+        assertEquals( "ou", atav.getUpType() );
+        assertEquals( "Ex\\+mple", atav.getUpValue().get() );
+        assertEquals( "  ou =  Ex\\+mple ", atav.getUpName() );
+    }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java?rev=895316&r1=895315&r2=895316&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
Sun Jan  3 01:50:52 2010
@@ -638,7 +638,7 @@
     {
         Rdn rdn = new Rdn( " a = b + a = f + g = h + c = d " );
 
-        assertEquals( "b", rdn.getValue() );
+        assertEquals( "b", rdn.getNormValue() );
     }
 
 



Mime
View raw message