directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r926709 - in /directory: apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/ apacheds/trunk/core-api/src/main/...
Date Tue, 23 Mar 2010 18:32:11 GMT
Author: elecharny
Date: Tue Mar 23 18:32:10 2010
New Revision: 926709

URL: http://svn.apache.org/viewvc?rev=926709&view=rev
Log:
o the DN.toNormName() method is now private
o replaced the call to toNormName() by a call to getNormName() all over the code

Modified:
    directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
    directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java

Modified: directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
(original)
+++ directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
Tue Mar 23 18:32:10 2010
@@ -206,12 +206,12 @@ public class AvlStore<E> implements Stor
             addAliasIndices( id, normName, aliasAttr.getString() );
         }
 
-        if ( !Character.isDigit( normName.toNormName().charAt( 0 ) ) )
+        if ( !Character.isDigit( normName.getNormName().charAt( 0 ) ) )
         {
-            throw new IllegalStateException( I18n.err( I18n.ERR_218, normName.toNormName()
) );
+            throw new IllegalStateException( I18n.err( I18n.ERR_218, normName.getNormName()
) );
         }
 
-        ndnIdx.add( normName.toNormName(), id );
+        ndnIdx.add( normName.getNormName(), id );
         updnIdx.add( normName.getName(), id );
         oneLevelIdx.add( parentId, id );
 
@@ -922,7 +922,7 @@ public class AvlStore<E> implements Stor
             updn.normalize( schemaManager.getNormalizerMapping() );
         }
 
-        ndnIdx.add( updn.toNormName(), id );
+        ndnIdx.add( updn.getNormName(), id );
 
         // update user provided DN index
         updnIdx.drop( id );
@@ -1822,7 +1822,7 @@ public class AvlStore<E> implements Stor
         }
 
         // L O O K U P   T A R G E T   I D
-        targetId = ndnIdx.forwardLookup( normalizedAliasTargetDn.toNormName() );
+        targetId = ndnIdx.forwardLookup( normalizedAliasTargetDn.getNormName() );
 
         /*
          * Check For Target Existance
@@ -1864,7 +1864,7 @@ public class AvlStore<E> implements Stor
          */
         ancestorDn = ( DN ) aliasDn.clone();
         ancestorDn.remove( aliasDn.size() - 1 );
-        ancestorId = getEntryId( ancestorDn.toNormName() );
+        ancestorId = getEntryId( ancestorDn.getNormName() );
 
         // check if alias parent and aliased entry are the same
         DN normalizedAliasTargetParentDn = ( DN ) normalizedAliasTargetDn.clone();
@@ -1892,7 +1892,7 @@ public class AvlStore<E> implements Stor
             }
 
             ancestorDn.remove( ancestorDn.size() - 1 );
-            ancestorId = getEntryId( ancestorDn.toNormName() );
+            ancestorId = getEntryId( ancestorDn.getNormName() );
         }
     }
 
@@ -1915,7 +1915,7 @@ public class AvlStore<E> implements Stor
 
         DN ancestorDn = ( DN ) aliasDN.clone();
         ancestorDn.remove( aliasDN.size() - 1 );
-        Long ancestorId = getEntryId( ancestorDn.toNormName() );
+        Long ancestorId = getEntryId( ancestorDn.getNormName() );
 
         /*
          * We cannot just drop all tuples in the one level and subtree userIndices

Modified: directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
(original)
+++ directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
Tue Mar 23 18:32:10 2010
@@ -401,14 +401,14 @@ public class AvlStoreTest
     {
         DN dn = new DN( "o=Good Times Co." );
         dn.normalize( schemaManager.getNormalizerMapping() );
-        assertEquals( 1L, ( long ) store.getEntryId( dn.toNormName() ) );
+        assertEquals( 1L, ( long ) store.getEntryId( dn.getNormName() ) );
         assertEquals( 11, store.count() );
-        assertEquals( "o=Good Times Co.", store.getEntryUpdn( dn.toNormName() ) );
-        assertEquals( dn.toNormName(), store.getEntryDn( 1L ) );
+        assertEquals( "o=Good Times Co.", store.getEntryUpdn( dn.getNormName() ) );
+        assertEquals( dn.getNormName(), store.getEntryDn( 1L ) );
         assertEquals( dn.getName(), store.getEntryUpdn( 1L ) );
 
         // note that the suffix entry returns 0 for it's parent which does not exist
-        assertEquals( 0L, ( long ) store.getParentId( dn.toNormName() ) );
+        assertEquals( 0L, ( long ) store.getParentId( dn.getNormName() ) );
         assertNull( store.getParentId( 0L ) );
 
         // should NOW be allowed
@@ -715,7 +715,7 @@ public class AvlStoreTest
         Modification add = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attrib
);
         mods.add( add );
 
-        ServerEntry lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
+        ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
 
         store.modify( dn, mods );
         assertTrue( lookedup.get( "sn" ).contains( attribVal ) );
@@ -726,7 +726,7 @@ public class AvlStoreTest
         entry.add( "telephoneNumber", attribVal );
 
         store.modify( dn, ModificationOperation.ADD_ATTRIBUTE, entry );
-        lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
+        lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
         assertTrue( lookedup.get( "telephoneNumber" ).contains( attribVal ) );
     }
 
@@ -747,7 +747,7 @@ public class AvlStoreTest
         Modification add = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE,
attrib );
         mods.add( add );
 
-        ServerEntry lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
+        ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
 
         assertEquals( "WAlkeR", lookedup.get( "sn" ).get().getString() ); // before replacing
 
@@ -777,7 +777,7 @@ public class AvlStoreTest
         Modification add = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE,
attrib );
         mods.add( add );
 
-        ServerEntry lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
+        ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
 
         assertNotNull( lookedup.get( "sn" ).get() );
 
@@ -820,7 +820,7 @@ public class AvlStoreTest
         Modification add = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE,
attrib );
         mods.add( add );
 
-        ServerEntry lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
+        ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
 
         assertNull( lookedup.get( "ou" ) ); // before replacing
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
Tue Mar 23 18:32:10 2010
@@ -498,7 +498,7 @@ public class SchemaPartitionDaoImpl impl
         
         if ( !rdn.getNormType().equalsIgnoreCase( CN_OID ) )
         {
-            throw new NamingException( I18n.err( I18n.ERR_434, dn.toNormName(), CN_OID, rdn.getNormType()
) );
+            throw new NamingException( I18n.err( I18n.ERR_434, dn.getNormName(), CN_OID,
rdn.getNormType() ) );
         }
 
         return ( String ) rdn.getNormValue();

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
Tue Mar 23 18:32:10 2010
@@ -189,7 +189,7 @@ public class SchemaSynchronizer implemen
         if ( !parentDn.equals( ouSchemaDN ) )
         {
             throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err(
I18n.ERR_380, ouSchemaDN.getName(),
-                    parentDn.toNormName() ) );
+                    parentDn.getNormName() ) );
         }
 
         // check if the new schema is enabled or disabled

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
Tue Mar 23 18:32:10 2010
@@ -223,7 +223,7 @@ public class AciAuthorizationInterceptor
                 get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
         DN subschemaSubentryDnName = new DN( subschemaSubentry.getString() );
         subschemaSubentryDnName.normalize( schemaManager.getNormalizerMapping() );
-        subschemaSubentryDn = subschemaSubentryDnName.toNormName();
+        subschemaSubentryDn = subschemaSubentryDnName.getNormName();
     }
 
 
@@ -455,7 +455,7 @@ public class AciAuthorizationInterceptor
         }
 
         // Assemble all the information required to make an access control decision
-        Set<DN> userGroups = groupCache.getGroups( principalDn.toNormName() );
+        Set<DN> userGroups = groupCache.getGroups( principalDn.getNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
 
         // Build the total collection of tuples to be considered for add rights
@@ -686,7 +686,7 @@ public class AciAuthorizationInterceptor
         }
 
         ClonedServerEntry entry = entryContext.lookup( name, ByPassConstants.HAS_ENTRY_BYPASS
);
-        Set<DN> userGroups = groupCache.getGroups( principalDn.toNormName() );
+        Set<DN> userGroups = groupCache.getGroups( principalDn.getNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( entryContext, tuples, name, entry.getOriginalEntry() );
         addEntryAciTuples( tuples, entry.getOriginalEntry() );
@@ -726,7 +726,7 @@ public class AciAuthorizationInterceptor
 
         LdapPrincipal principal = lookupContext.getSession().getEffectivePrincipal();
         DN userName = principal.getClonedName();
-        Set<DN> userGroups = groupCache.getGroups( userName.toNormName() );
+        Set<DN> userGroups = groupCache.getGroups( userName.getNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( lookupContext, tuples, lookupContext.getDn(), entry );
         addEntryAciTuples( tuples, entry );
@@ -1051,7 +1051,7 @@ public class AciAuthorizationInterceptor
             return next.compare( opContext );
         }
 
-        Set<DN> userGroups = groupCache.getGroups( principalDn.toNormName() );
+        Set<DN> userGroups = groupCache.getGroups( principalDn.getNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( opContext, tuples, name, entry.getOriginalEntry() );
         addEntryAciTuples( tuples, entry );
@@ -1127,7 +1127,7 @@ public class AciAuthorizationInterceptor
         
         LdapPrincipal principal = opContext.getSession().getEffectivePrincipal();
         DN userDn = principal.getClonedName();
-        Set<DN> userGroups = groupCache.getGroups( userDn.toNormName() );
+        Set<DN> userGroups = groupCache.getGroups( userDn.getNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( opContext, tuples, normName, clonedEntry.getOriginalEntry()
);
         addEntryAciTuples( tuples, clonedEntry.getOriginalEntry() );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
Tue Mar 23 18:32:10 2010
@@ -475,7 +475,7 @@ public class GroupCache
             return false;
         }
 
-        return members.contains( principalDn.toNormName() );
+        return members.contains( principalDn.getNormName() );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
Tue Mar 23 18:32:10 2010
@@ -212,7 +212,7 @@ public class TupleCache
             }
         }
 
-        tuples.put( normName.toNormName(), entryTuples );
+        tuples.put( normName.getNormName(), entryTuples );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
Tue Mar 23 18:32:10 2010
@@ -271,7 +271,7 @@ public class RelatedProtectedItemFilter 
                         EntryAttribute attr = entry.get( oid );
                         
                         if ( ( attr != null ) && 
-                             ( ( attr.contains( userName.toNormName() ) || 
+                             ( ( attr.contains( userName.getNormName() ) || 
                                ( attr.contains( userName.getName() ) ) ) ) )
                         {
                             return true;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
Tue Mar 23 18:32:10 2010
@@ -199,7 +199,7 @@ public class ChangeLogInterceptor extend
         ClonedServerEntry serverEntry;
 
         // @todo make sure we're not putting in operational attributes that cannot be user
modified
-        if ( schemaService.isSchemaSubentry( dn.toNormName() ) )
+        if ( schemaService.isSchemaSubentry( dn.getNormName() ) )
         {
             return schemaService.getSubschemaEntryCloned();
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
Tue Mar 23 18:32:10 2010
@@ -303,7 +303,7 @@ public class EventInterceptor extends Ba
         {
             NotificationCriteria criteria = registration.getCriteria();
             
-            if ( evaluator.evaluate( criteria.getFilter(), criteria.getBase().toNormName(),
entry ) )
+            if ( evaluator.evaluate( criteria.getFilter(), criteria.getBase().getNormName(),
entry ) )
             {
                 selecting.add( registration );
             }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
Tue Mar 23 18:32:10 2010
@@ -523,7 +523,7 @@ public class ExceptionInterceptor extend
             
             if ( ! cursor.next() )
             {
-                if ( !base.isEmpty() && !( subschemSubentryDn.toNormName() ).equalsIgnoreCase(
base.toNormName() ) )
+                if ( !base.isEmpty() && !( subschemSubentryDn.getNormName() ).equalsIgnoreCase(
base.getNormName() ) )
                 {
                     // We just check that the entry exists only if we didn't found any entry
                     assertHasEntry( nextInterceptor, opContext, "Attempt to search under
non-existant entry:" , base );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Tue Mar 23 18:32:10 2010
@@ -692,7 +692,7 @@ public class SchemaInterceptor extends B
         // We also have to check the H/R flag for the filter attributes
         checkFilter( filter );
 
-        String baseNormForm = ( base.isNormalized() ? base.getNormName() : base.toNormName()
);
+        String baseNormForm = ( base.isNormalized() ? base.getNormName() : base.getNormName()
);
 
         // Deal with the normal case : searching for a normal value (not subSchemaSubEntry)
         if ( !subschemaSubentryDnNorm.equals( baseNormForm ) )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
Tue Mar 23 18:32:10 2010
@@ -594,7 +594,7 @@ public class SubentryInterceptor extends
 
         if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
         {
-            SubtreeSpecification ss = subentryCache.removeSubentry( name.toNormName() ).getSubtreeSpecification();
+            SubtreeSpecification ss = subentryCache.removeSubentry( name.getNormName() ).getSubtreeSpecification();
             next.delete( opContext );
 
             /* ----------------------------------------------------------------
@@ -762,7 +762,7 @@ public class SubentryInterceptor extends
         if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
         {
             // @Todo To be reviewed !!!
-            Subentry subentry = subentryCache.getSubentry( name.toNormName() );
+            Subentry subentry = subentryCache.getSubentry( name.getNormName() );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
             DN apName = ( DN ) name.clone();
             apName.remove( apName.size() - 1 );
@@ -773,7 +773,7 @@ public class SubentryInterceptor extends
 
             newName.add( opContext.getNewRdn() );
 
-            String newNormName = newName.toNormName();
+            String newNormName = newName.getNormName();
             subentryCache.setSubentry( newNormName, ss, subentry.getTypes() );
             next.rename( opContext );
 
@@ -840,7 +840,7 @@ public class SubentryInterceptor extends
 
         if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
         {
-            Subentry subentry = subentryCache.getSubentry( oriChildName.toNormName() );
+            Subentry subentry = subentryCache.getSubentry( oriChildName.getNormName() );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
             DN apName = ( DN ) oriChildName.clone();
             apName.remove( apName.size() - 1 );
@@ -851,7 +851,7 @@ public class SubentryInterceptor extends
 
             newName.add( opContext.getNewRdn() );
 
-            String newNormName = newName.toNormName();
+            String newNormName = newName.getNormName();
             subentryCache.setSubentry( newNormName, ss, subentry.getTypes() );
             next.moveAndRename( opContext );
 
@@ -929,7 +929,7 @@ public class SubentryInterceptor extends
             newName.remove( newName.size() - 1 );
             newName.add( newParentName.get( newParentName.size() - 1 ) );
 
-            String newNormName = newName.toNormName();
+            String newNormName = newName.getNormName();
             subentryCache.setSubentry( newNormName, ss, subentry.getTypes() );
             next.move( opContext );
 
@@ -1065,7 +1065,7 @@ public class SubentryInterceptor extends
                 throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
msg );
             }
 
-            subentryCache.setSubentry( name.toNormName(), ssNew, getSubentryTypes( entry,
mods ) );
+            subentryCache.setSubentry( name.getNormName(), ssNew, getSubentryTypes( entry,
mods ) );
             next.modify( opContext );
 
             // search for all entries selected by the old SS and remove references to subentry
@@ -1099,7 +1099,7 @@ public class SubentryInterceptor extends
             }
 
             // search for all selected entries by the new SS and add references to subentry
-            Subentry subentry = subentryCache.getSubentry( name.toNormName() );
+            Subentry subentry = subentryCache.getSubentry( name.getNormName() );
             ServerEntry operational = getSubentryOperatationalAttributes( name, subentry
);
             DN newBaseDn = ( DN ) apName.clone();
             newBaseDn.addAll( ssNew.getBase() );
@@ -1311,7 +1311,7 @@ public class SubentryInterceptor extends
         throws Exception
     {
         List<Modification> modList = new ArrayList<Modification>();
-        String dn = subentryDn.toNormName();
+        String dn = subentryDn.getNormName();
 
         for ( String opAttrId : SUBENTRY_OPATTRS )
         {
@@ -1437,7 +1437,7 @@ public class SubentryInterceptor extends
 
             DN ndn = new DN( dn );
             ndn.normalize( schemaManager.getNormalizerMapping() );
-            return subentryCache.hasSubentry( ndn.toNormName() );
+            return subentryCache.hasSubentry( ndn.getNormName() );
         }
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
Tue Mar 23 18:32:10 2010
@@ -192,7 +192,7 @@ public class SubtreeEvaluator
          */
         if ( subtree.getRefinement() != null )
         {
-            return evaluator.evaluate( subtree.getRefinement(), dnEntryDn.toNormName(), entry
);
+            return evaluator.evaluate( subtree.getRefinement(), dnEntryDn.getNormName(),
entry );
         }
 
         /*

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
Tue Mar 23 18:32:10 2010
@@ -344,7 +344,7 @@ public class RelatedProtectedItemFilterT
         Collection<ACITuple> tuples = getTuples( new ProtectedItem.SelfValue( attrTypes
) );
 
         ServerEntry entry = new DefaultServerEntry( schemaManager, USER_NAME );
-        entry.put( "cn", USER_NAME.toNormName() );
+        entry.put( "cn", USER_NAME.getNormName() );
 
         // Test wrong scope
         assertEquals( 0, filterA.filter( null, tuples, OperationScope.ENTRY, null, null,
USER_NAME, null, null, null,

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
Tue Mar 23 18:32:10 2010
@@ -1014,7 +1014,7 @@ public class JdbmStore<E> implements Sto
 
         DN ancestorDn = ( DN ) aliasDN.clone();
         ancestorDn.remove( aliasDN.size() - 1 );
-        Long ancestorId = getEntryId( ancestorDn.toNormName() );
+        Long ancestorId = getEntryId( ancestorDn.getNormName() );
 
         /*
          * We cannot just drop all tuples in the one level and subtree userIndices
@@ -1033,7 +1033,7 @@ public class JdbmStore<E> implements Sto
         while ( !ancestorDn.equals( normSuffix ) && ancestorDn.size() > normSuffix.size()
)
         {
             ancestorDn = ( DN ) ancestorDn.getPrefix( ancestorDn.size() - 1 );
-            ancestorId = getEntryId( ancestorDn.toNormName() );
+            ancestorId = getEntryId( ancestorDn.getNormName() );
 
             subAliasIdx.drop( ancestorId, targetId );
         }
@@ -1108,7 +1108,7 @@ public class JdbmStore<E> implements Sto
         }
 
         // L O O K U P   T A R G E T   I D
-        targetId = ndnIdx.forwardLookup( normalizedAliasTargetDn.toNormName() );
+        targetId = ndnIdx.forwardLookup( normalizedAliasTargetDn.getNormName() );
 
         /*
          * Check For Target Existence
@@ -1155,7 +1155,7 @@ public class JdbmStore<E> implements Sto
          */
         ancestorDn = ( DN ) aliasDn.clone();
         ancestorDn.remove( aliasDn.size() - 1 );
-        ancestorId = getEntryId( ancestorDn.toNormName() );
+        ancestorId = getEntryId( ancestorDn.getNormName() );
 
         // check if alias parent and aliased entry are the same
         DN normalizedAliasTargetParentDn = ( DN ) normalizedAliasTargetDn.clone();
@@ -1183,7 +1183,7 @@ public class JdbmStore<E> implements Sto
             }
 
             ancestorDn.remove( ancestorDn.size() - 1 );
-            ancestorId = getEntryId( ancestorDn.toNormName() );
+            ancestorId = getEntryId( ancestorDn.getNormName() );
         }
     }
 
@@ -1255,12 +1255,12 @@ public class JdbmStore<E> implements Sto
             addAliasIndices( id, entryDn, aliasAttr.getString() );
         }
 
-        if ( !Character.isDigit( entryDn.toNormName().charAt( 0 ) ) )
+        if ( !Character.isDigit( entryDn.getNormName().charAt( 0 ) ) )
         {
-            throw new IllegalStateException( I18n.err( I18n.ERR_218, entryDn.toNormName()
) );
+            throw new IllegalStateException( I18n.err( I18n.ERR_218, entryDn.getNormName()
) );
         }
 
-        ndnIdx.add( entryDn.toNormName(), id );
+        ndnIdx.add( entryDn.getNormName(), id );
         updnIdx.add( entryDn.getName(), id );
         oneLevelIdx.add( parentId, id );
 
@@ -1941,7 +1941,7 @@ public class JdbmStore<E> implements Sto
             updn.normalize( schemaManager.getNormalizerMapping() );
         }
 
-        ndnIdx.add( updn.toNormName(), id );
+        ndnIdx.add( updn.getNormName(), id );
 
         // update user provided DN index
         updnIdx.drop( id );

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
Tue Mar 23 18:32:10 2010
@@ -434,14 +434,14 @@ public class JdbmStoreTest
     {
         DN dn = new DN( "o=Good Times Co." );
         dn.normalize( schemaManager.getNormalizerMapping() );
-        assertEquals( 1L, ( long ) store.getEntryId( dn.toNormName() ) );
+        assertEquals( 1L, ( long ) store.getEntryId( dn.getNormName() ) );
         assertEquals( 11, store.count() );
-        assertEquals( "o=Good Times Co.", store.getEntryUpdn( dn.toNormName() ) );
-        assertEquals( dn.toNormName(), store.getEntryDn( 1L ) );
+        assertEquals( "o=Good Times Co.", store.getEntryUpdn( dn.getNormName() ) );
+        assertEquals( dn.getNormName(), store.getEntryDn( 1L ) );
         assertEquals( dn.getName(), store.getEntryUpdn( 1L ) );
 
         // note that the suffix entry returns 0 for it's parent which does not exist
-        assertEquals( 0L, ( long ) store.getParentId( dn.toNormName() ) );
+        assertEquals( 0L, ( long ) store.getParentId( dn.getNormName() ) );
         assertNull( store.getParentId( 0L ) );
 
         // should NOW be allowed
@@ -748,7 +748,7 @@ public class JdbmStoreTest
         Modification add = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attrib
);
         mods.add( add );
 
-        ServerEntry lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
+        ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
 
         store.modify( dn, mods );
         assertTrue( lookedup.get( "sn" ).contains( attribVal ) );
@@ -759,7 +759,7 @@ public class JdbmStoreTest
         entry.add( "telephoneNumber", attribVal );
 
         store.modify( dn, ModificationOperation.ADD_ATTRIBUTE, entry );
-        lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
+        lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
         assertTrue( lookedup.get( "telephoneNumber" ).contains( attribVal ) );
     }
 
@@ -780,7 +780,7 @@ public class JdbmStoreTest
         Modification add = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE,
attrib );
         mods.add( add );
 
-        ServerEntry lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
+        ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
 
         assertEquals( "WAlkeR", lookedup.get( "sn" ).get().getString() ); // before replacing
 
@@ -810,7 +810,7 @@ public class JdbmStoreTest
         Modification add = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE,
attrib );
         mods.add( add );
 
-        ServerEntry lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
+        ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
 
         assertNotNull( lookedup.get( "sn" ).get() );
 
@@ -853,7 +853,7 @@ public class JdbmStoreTest
         Modification add = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE,
attrib );
         mods.add( add );
 
-        ServerEntry lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
+        ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
 
         assertNull( lookedup.get( "ou" ) ); // before replacing
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
Tue Mar 23 18:32:10 2010
@@ -1261,7 +1261,7 @@ public class SearchHandler extends Refer
     private static boolean isSubSchemaSubEntrySearch( LdapSession session, InternalSearchRequest
req ) throws Exception
     {
         DN base = req.getBase();
-        String baseNormForm = ( base.isNormalized() ? base.getNormName() : base.toNormName()
);
+        String baseNormForm = ( base.isNormalized() ? base.getNormName() : base.getNormName()
);
 
         DirectoryService ds = session.getCoreSession().getDirectoryService();
         PartitionNexus nexus = ds.getPartitionNexus();

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
(original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
Tue Mar 23 18:32:10 2010
@@ -144,7 +144,7 @@ public class DefaultSearchEngine<ID> imp
             ID effectiveBaseId = baseId;
             if ( effectiveBase != base )
             {
-                effectiveBaseId = db.getEntryId( effectiveBase.toNormName() );
+                effectiveBaseId = db.getEntryId( effectiveBase.getNormName() );
             }
 
             IndexEntry<ID, ServerEntry, ID> indexEntry = new ForwardIndexEntry<ID,
ServerEntry, ID>();

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
(original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
Tue Mar 23 18:32:10 2010
@@ -885,7 +885,7 @@ public class PartitionFrame extends JFra
         // boolean doFiltered = false;
         nodes = new HashMap<Long, EntryNode>();
 
-        ServerEntry suffix = partition.lookup( partition.getEntryId( partition.getSuffixDn().toNormName()
) );
+        ServerEntry suffix = partition.lookup( partition.getEntryId( partition.getSuffixDn().getNormName()
) );
         Long id = partition.getEntryId( partition.getSuffixDn().getName() );
         root = new EntryNode( id, null, partition, suffix, nodes );
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java?rev=926709&r1=926708&r2=926709&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
Tue Mar 23 18:32:10 2010
@@ -120,7 +120,7 @@ public class DN implements Cloneable, Se
     public DN()
     {
         upName = "";
-        normName = "";
+        normName = null;
         normalized = true;
     }
 
@@ -143,7 +143,6 @@ public class DN implements Cloneable, Se
         }
 
         normalized = false;
-
     }
 
 
@@ -310,7 +309,7 @@ public class DN implements Cloneable, Se
      *
      * @return A String representing the normalized DN
      */
-    public String toNormName()
+    private String toNormName()
     {
         if ( rdns.size() == 0 )
         {
@@ -541,13 +540,18 @@ public class DN implements Cloneable, Se
 
 
     /**
-     * Get the initial DN (without normalization)
+     * Get the normalized DN
      *
      * @return The DN as a String
      */
     public String getNormName()
     {
-        return ( normName == null ? "" : normName );
+        if ( normName == null )
+        {
+            normName = toNormName();
+        }
+        
+        return normName;
     }
 
 



Mime
View raw message