directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r534480 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Date Wed, 02 May 2007 14:27:59 GMT
Author: elecharny
Date: Wed May  2 07:27:58 2007
New Revision: 534480

URL: http://svn.apache.org/viewvc?view=rev&rev=534480
Log:
Using some SchemaConstants element instead of using String into the code

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?view=diff&rev=534480&r1=534479&r2=534480
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Wed May  2 07:27:58 2007
@@ -71,6 +71,7 @@
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.constants.ServerDNConstants;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationNotSupportedException;
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
@@ -537,25 +538,24 @@
         // create administrator group
         // -------------------------------------------------------------------
 
-        String upName = "cn=Administrators,ou=groups,ou=system";
-        LdapDN normName = new LdapDN( "cn=administrators,ou=groups,ou=system" );
-        normName.normalize( oidsMap );
+        LdapDN name = new LdapDN( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
+        name.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( new EntryOperationContext( normName ) ) )
+        if ( !partitionNexus.hasEntry( new EntryOperationContext( name ) ) )
         {
             firstStart = true;
 
             Attributes attributes = new AttributesImpl();
             Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
             objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( "groupOfUniqueNames" );
+            objectClass.add( SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC );
             attributes.put( objectClass );
             attributes.put( SchemaConstants.CN_AT, "Administrators" );
-            attributes.put( "uniqueMember", PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED );
+            attributes.put( SchemaConstants.UNIQUE_MEMBER_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
             attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
 
-            partitionNexus.add( new AddOperationContext( normName, attributes ) );
+            partitionNexus.add( new AddOperationContext( name, attributes ) );
             
             Interceptor authzInterceptor = interceptorChain.get( AuthorizationService.NAME
);
             
@@ -574,7 +574,7 @@
             }
 
             AuthorizationService authzSrvc = ( AuthorizationService ) authzInterceptor;
-            authzSrvc.cacheNewGroup( upName, normName, attributes );
+            authzSrvc.cacheNewGroup( name, attributes );
 
         }
 



Mime
View raw message