directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1038360 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/schema/ core/src/main/java/org/apache/directory/server/core/changelog/ core/src/main/java/org/apache/directory/server/core/schema/
Date Tue, 23 Nov 2010 22:10:29 GMT
Author: seelmann
Date: Tue Nov 23 22:10:29 2010
New Revision: 1038360

URL: http://svn.apache.org/viewvc?rev=1038360&view=rev
Log:
Avoid convertion from DN to String to DN

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaService.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/schema/DefaultSchemaService.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?rev=1038360&r1=1038359&r2=1038360&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Tue Nov 23 22:10:29 2010
@@ -3,6 +3,7 @@ package org.apache.directory.server.core
 
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
 
@@ -12,11 +13,11 @@ public interface SchemaService
     /**
      * Tells if the given DN is the schemaSubentry DN
      * 
-     * @param dnString The DN we want to check
+     * @param dn The DN we want to check
      * @return <code>true</code> if the given DN is the Schema subentry DN
      * @throws LdapException If the given DN is not valid
      */
-    boolean isSchemaSubentry( String dnString ) throws LdapException;
+    boolean isSchemaSubentry( DN dn ) throws LdapException;
 
 
     /**
@@ -66,4 +67,4 @@ public interface SchemaService
      * @throws Exception if there are failures during schema info access
      */
     Entry getSubschemaEntry( String[] ids ) throws LdapException;
-}
\ No newline at end of file
+}

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=1038360&r1=1038359&r2=1038360&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 Nov 23 22:10:29 2010
@@ -198,7 +198,7 @@ public class ChangeLogInterceptor extend
         Entry serverEntry;
 
         // @todo make sure we're not putting in operational attributes that cannot be user
modified
-        if ( schemaService.isSchemaSubentry( dn.getNormName() ) )
+        if ( schemaService.isSchemaSubentry( dn ) )
         {
             return schemaService.getSubschemaEntryCloned();
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java?rev=1038360&r1=1038359&r2=1038360&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
Tue Nov 23 22:10:29 2010
@@ -79,18 +79,11 @@ public class DefaultSchemaService implem
     
     
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaService#isSchemaSubentry(java.lang.String)
+    /** 
+     * {@inheritDoc}
      */
-    public boolean isSchemaSubentry( String dnString ) throws LdapException
+    public boolean isSchemaSubentry( DN dn ) throws LdapException
     {
-        if ( ServerDNConstants.CN_SCHEMA_DN.equalsIgnoreCase( dnString ) ||
-            ServerDNConstants.CN_SCHEMA_DN_NORMALIZED.equalsIgnoreCase( dnString ) )
-        {
-            return true;
-        }
-
-        DN dn = DNFactory.create( dnString, schemaPartition.getSchemaManager() );
         return dn.getNormName().equals( ServerDNConstants.CN_SCHEMA_DN_NORMALIZED );
     }
 



Mime
View raw message