directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r519987 - in /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core: ./ authn/ partition/ schema/ subtree/
Date Mon, 19 Mar 2007 16:09:51 GMT
Author: elecharny
Date: Mon Mar 19 09:09:50 2007
New Revision: 519987

URL: http://svn.apache.org/viewvc?view=rev&rev=519987
Log:
Some more constant migration from code to ShemaConstants

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.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=519987&r1=519986&r2=519987
==============================================================================
--- 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
Mon Mar 19 09:09:50 2007
@@ -458,19 +458,19 @@
             Attributes attributes = new AttributesImpl();
             Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
             objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( "person" );
-            objectClass.add( "organizationalPerson" );
-            objectClass.add( "inetOrgPerson" );
+            objectClass.add( SchemaConstants.PERSON_OC );
+            objectClass.add( SchemaConstants.ORGANIZATIONAL_PERSON_OC );
+            objectClass.add( SchemaConstants.INET_ORG_PERSON_OC );
             attributes.put( objectClass );
 
-            attributes.put( "uid", PartitionNexus.ADMIN_UID );
-            attributes.put( "userPassword", PartitionNexus.ADMIN_PASSWORD );
-            attributes.put( "displayName", "Directory Superuser" );
+            attributes.put( SchemaConstants.UID_AT, PartitionNexus.ADMIN_UID );
+            attributes.put( SchemaConstants.USER_PASSWORD_AT, PartitionNexus.ADMIN_PASSWORD
);
+            attributes.put( SchemaConstants.DISPLAY_NAME_AT, "Directory Superuser" );
             attributes.put( SchemaConstants.CN_AT, "system administrator" );
-            attributes.put( "sn", "administrator" );
+            attributes.put( SchemaConstants.SN_AT, "administrator" );
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
             attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
-            attributes.put( "displayName", "Directory Superuser" );
+            attributes.put( SchemaConstants.DISPLAY_NAME_AT, "Directory Superuser" );
 
             partitionNexus.add(PartitionNexus.getAdminName(),
                 attributes );
@@ -707,7 +707,7 @@
         adminDn.normalize( configuration.getRegistries().getAttributeTypeRegistry().getNormalizerMapping()
);
         
         Attributes adminEntry = partitionNexus.lookup( adminDn );
-        Object userPassword = adminEntry.get( "userPassword" ).get();
+        Object userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
         if ( userPassword instanceof byte[] )
         {
             needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD.equals( new String(

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
Mon Mar 19 09:09:50 2007
@@ -40,6 +40,7 @@
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.core.trigger.TriggerService;
 import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationException;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
@@ -263,7 +264,7 @@
         try
         {
             userEntry = proxy.lookup( principalDn, new String[]
-                { "userPassword" }, USERLOOKUP_BYPASS );
+                { SchemaConstants.USER_PASSWORD_AT }, USERLOOKUP_BYPASS );
 
             if ( userEntry == null )
             {
@@ -280,7 +281,7 @@
 
         Object userPassword;
 
-        Attribute userPasswordAttr = userEntry.get( "userPassword" );
+        Attribute userPasswordAttr = userEntry.get( SchemaConstants.USER_PASSWORD_AT );
 
         // ---- assert that credentials match
         if ( userPasswordAttr == null )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
Mon Mar 19 09:09:50 2007
@@ -69,11 +69,6 @@
     /** the base dn under which all groups reside */
     public final static String GROUPS_BASE_NAME = "ou=groups,ou=system";
 
-    /** UID attribute name and OID */
-    private static final String UID_ATTRIBUTE = "uid";
-    private static final String UID_ATTRIBUTE_ALIAS = "userid";
-    private static final String UID_ATTRIBUTE_OID = "0.9.2342.19200300.100.1.1";
-    
     /**
      * System partition suffix constant.  Should be kept down to a single Dn name 
      * component or the default constructor will have to parse it instead of 
@@ -105,9 +100,9 @@
         {
         	Map<String, OidNormalizer> oidsMap = new HashMap<String, OidNormalizer>();
         	
-        	oidsMap.put( UID_ATTRIBUTE, new OidNormalizer( UID_ATTRIBUTE_OID, new NoOpNormalizer()
) );
-        	oidsMap.put( UID_ATTRIBUTE_ALIAS, new OidNormalizer( UID_ATTRIBUTE_OID, new NoOpNormalizer()
) );
-        	oidsMap.put( UID_ATTRIBUTE_OID, new OidNormalizer( UID_ATTRIBUTE_OID, new NoOpNormalizer()
) );
+        	oidsMap.put( SchemaConstants.UID_AT, new OidNormalizer( SchemaConstants.UID_AT_OID,
new NoOpNormalizer() ) );
+        	oidsMap.put( SchemaConstants.USER_ID_AT, new OidNormalizer( SchemaConstants.UID_AT_OID,
new NoOpNormalizer() ) );
+        	oidsMap.put( SchemaConstants.UID_AT_OID, new OidNormalizer( SchemaConstants.UID_AT_OID,
new NoOpNormalizer() ) );
         	
         	oidsMap.put( SchemaConstants.OU_AT, new OidNormalizer( SchemaConstants.OU_AT_OID,
new NoOpNormalizer()  ) );
         	oidsMap.put( SchemaConstants.ORGANIZATIONAL_UNIT_NAME_AT, new OidNormalizer( SchemaConstants.OU_AT_OID,
new NoOpNormalizer()  ) );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
Mon Mar 19 09:09:50 2007
@@ -46,8 +46,6 @@
  */
 public abstract class AbstractSchemaChangeHandler implements SchemaChangeHandler
 {
-    protected static final String OU_OID = "2.5.4.11";
-
     protected final Registries targetRegistries;
     protected final PartitionSchemaLoader loader;
     protected final AttributeType m_oidAT;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
Mon Mar 19 09:09:50 2007
@@ -248,7 +248,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( OU_OID
) )
+        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID
) )
         {
             throw new LdapInvalidNameException( "The parent entry of a attributeType should
be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
Mon Mar 19 09:09:50 2007
@@ -33,6 +33,7 @@
 import org.apache.directory.server.schema.registries.ComparatorRegistry;
 import org.apache.directory.server.schema.registries.MatchingRuleRegistry;
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
@@ -55,8 +56,6 @@
  */
 public class MetaComparatorHandler implements SchemaChangeHandler
 {
-    private static final String OU_OID = "2.5.4.11";
-
     private final PartitionSchemaLoader loader;
     private final SchemaEntityFactory factory;
     private final Registries targetRegistries;
@@ -318,7 +317,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( OU_OID
) )
+        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID
) )
         {
             throw new LdapInvalidNameException( "The parent entry of a comparator should
be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
Mon Mar 19 09:09:50 2007
@@ -232,7 +232,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( OU_OID
) )
+        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID
) )
         {
             throw new LdapInvalidNameException( "The parent entry of a matchingRule should
be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
Mon Mar 19 09:09:50 2007
@@ -32,6 +32,7 @@
 import org.apache.directory.server.schema.registries.MatchingRuleRegistry;
 import org.apache.directory.server.schema.registries.NormalizerRegistry;
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
@@ -55,8 +56,6 @@
  */
 public class MetaNormalizerHandler implements SchemaChangeHandler
 {
-    private static final String OU_OID = "2.5.4.11";
-
     private final PartitionSchemaLoader loader;
     private final SchemaEntityFactory factory;
     private final Registries targetRegistries;
@@ -318,7 +317,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( OU_OID
) )
+        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID
) )
         {
             throw new LdapInvalidNameException( "The parent entry of a normalizer should
be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
Mon Mar 19 09:09:50 2007
@@ -234,7 +234,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( OU_OID
) )
+        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID
) )
         {
             throw new LdapInvalidNameException( "The parent entry of a objectClass should
be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
Mon Mar 19 09:09:50 2007
@@ -32,6 +32,7 @@
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.server.schema.registries.SyntaxCheckerRegistry;
 import org.apache.directory.server.schema.registries.SyntaxRegistry;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
@@ -56,8 +57,6 @@
  */
 public class MetaSyntaxCheckerHandler implements SchemaChangeHandler
 {
-    private static final String OU_OID = "2.5.4.11";
-
     private final PartitionSchemaLoader loader;
     private final SchemaEntityFactory factory;
     private final Registries targetRegistries;
@@ -325,7 +324,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( OU_OID
) )
+        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID
) )
         {
             throw new LdapInvalidNameException( "The parent entry of a syntaxChecker should
be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
Mon Mar 19 09:09:50 2007
@@ -30,6 +30,7 @@
 import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.server.schema.registries.SyntaxRegistry;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
@@ -244,7 +245,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( OU_OID
) )
+        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID
) )
         {
             throw new LdapInvalidNameException( "The parent entry of a syntax should be an
organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java?view=diff&rev=519987&r1=519986&r2=519987
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
Mon Mar 19 09:09:50 2007
@@ -83,8 +83,6 @@
 {
     /** the subentry control OID */
     private static final String SUBENTRY_CONTROL = SubentriesControl.CONTROL_OID;
-    /** the objectClass OID for a subentry */
-    private static final String SUBENTRY_OBJECTCLASS_OID = "2.5.17.0";
 
     public static final String AC_AREA = "accessControlSpecificArea";
     public static final String AC_INNERAREA = "accessControlInnerArea";
@@ -1396,7 +1394,7 @@
                     return false;
                 }
 
-                if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SUBENTRY_OBJECTCLASS_OID
) )
+                if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC_OID
) )
                 {
                     return false;
                 }
@@ -1457,7 +1455,7 @@
                     return true;
                 }
 
-                if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SUBENTRY_OBJECTCLASS_OID
) )
+                if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC_OID
) )
                 {
                     return true;
                 }



Mime
View raw message