directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r892824 - in /directory: apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/ apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/ shared/branches/shared-...
Date Mon, 21 Dec 2009 13:56:56 GMT
Author: elecharny
Date: Mon Dec 21 13:56:55 2009
New Revision: 892824

URL: http://svn.apache.org/viewvc?rev=892824&view=rev
Log:
Removed the DOA object which has been replaced by the SchemaManager

Modified:
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java?rev=892824&r1=892823&r2=892824&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
Mon Dec 21 13:56:55 2009
@@ -68,50 +68,56 @@
  */
 public class DescriptionParsers
 {
-    private static final LdapComparatorDescription[] EMPTY_COMPARATORS = new LdapComparatorDescription[0];
-    private static final NormalizerDescription[] EMPTY_NORMALIZERS = new NormalizerDescription[0];
-    private static final SyntaxCheckerDescription[] EMPTY_SYNTAX_CHECKERS = new SyntaxCheckerDescription[0];
-    private static final LdapSyntax[] EMPTY_SYNTAXES = new LdapSyntax[0];
-    private static final MatchingRule[] EMPTY_MATCHING_RULES = new MatchingRule[0];
-    private static final AttributeType[] EMPTY_ATTRIBUTE_TYPES = new AttributeType[0];
-    private static final ObjectClass[] EMPTY_OBJECT_CLASSES = new ObjectClass[0];
-    private static final MatchingRuleUse[] EMPTY_MATCHING_RULE_USES = new MatchingRuleUse[0];
-    private static final DITStructureRule[] EMPTY_DIT_STRUCTURE_RULES = new DITStructureRule[0];
-    private static final DITContentRule[] EMPTY_DIT_CONTENT_RULES = new DITContentRule[0];
-    private static final NameForm[] EMPTY_NAME_FORMS = new NameForm[0];
-
-    private final SchemaManager schemaManager;
-
-    private final LdapComparatorDescriptionSchemaParser comparatorParser = new LdapComparatorDescriptionSchemaParser();
-    private final NormalizerDescriptionSchemaParser normalizerParser = new NormalizerDescriptionSchemaParser();
-    private final SyntaxCheckerDescriptionSchemaParser syntaxCheckerParser = new SyntaxCheckerDescriptionSchemaParser();
-    private final LdapSyntaxDescriptionSchemaParser syntaxParser = new LdapSyntaxDescriptionSchemaParser();
-    private final MatchingRuleDescriptionSchemaParser matchingRuleParser = new MatchingRuleDescriptionSchemaParser();
-    private final AttributeTypeDescriptionSchemaParser attributeTypeParser = new AttributeTypeDescriptionSchemaParser();
-    private final ObjectClassDescriptionSchemaParser objectClassParser = new ObjectClassDescriptionSchemaParser();
-    private final MatchingRuleUseDescriptionSchemaParser matchingRuleUseParser = new MatchingRuleUseDescriptionSchemaParser();
+    /** Empty arrays of SchemaOjects */
+    private static final LdapComparatorDescription[] EMPTY_COMPARATORS         = new LdapComparatorDescription[0];
+    private static final NormalizerDescription[]     EMPTY_NORMALIZERS         = new NormalizerDescription[0];
+    private static final SyntaxCheckerDescription[]  EMPTY_SYNTAX_CHECKERS     = new SyntaxCheckerDescription[0];
+    private static final LdapSyntax[]                EMPTY_SYNTAXES            = new LdapSyntax[0];
+    private static final MatchingRule[]              EMPTY_MATCHING_RULES      = new MatchingRule[0];
+    private static final AttributeType[]             EMPTY_ATTRIBUTE_TYPES     = new AttributeType[0];
+    private static final ObjectClass[]               EMPTY_OBJECT_CLASSES      = new ObjectClass[0];
+    private static final MatchingRuleUse[]           EMPTY_MATCHING_RULE_USES  = new MatchingRuleUse[0];
+    private static final DITStructureRule[]          EMPTY_DIT_STRUCTURE_RULES = new DITStructureRule[0];
+    private static final DITContentRule[]            EMPTY_DIT_CONTENT_RULES   = new DITContentRule[0];
+    private static final NameForm[]                  EMPTY_NAME_FORMS          = new NameForm[0];
+
+    /** The SchemaObject description's parsers */
+    private final LdapComparatorDescriptionSchemaParser   comparatorParser      = new LdapComparatorDescriptionSchemaParser();
+    private final NormalizerDescriptionSchemaParser       normalizerParser       = new NormalizerDescriptionSchemaParser();
+    private final SyntaxCheckerDescriptionSchemaParser    syntaxCheckerParser    = new SyntaxCheckerDescriptionSchemaParser();
+    private final LdapSyntaxDescriptionSchemaParser       syntaxParser           = new LdapSyntaxDescriptionSchemaParser();
+    private final MatchingRuleDescriptionSchemaParser     matchingRuleParser     = new MatchingRuleDescriptionSchemaParser();
+    private final AttributeTypeDescriptionSchemaParser    attributeTypeParser    = new AttributeTypeDescriptionSchemaParser();
+    private final ObjectClassDescriptionSchemaParser      objectClassParser      = new ObjectClassDescriptionSchemaParser();
+    private final MatchingRuleUseDescriptionSchemaParser  matchingRuleUseParser  = new MatchingRuleUseDescriptionSchemaParser();
     private final DITStructureRuleDescriptionSchemaParser ditStructureRuleParser = new DITStructureRuleDescriptionSchemaParser();
-    private final DITContentRuleDescriptionSchemaParser ditContentRuleParser = new DITContentRuleDescriptionSchemaParser();
-    private final NameFormDescriptionSchemaParser nameFormParser = new NameFormDescriptionSchemaParser();
-
-    private final SchemaPartitionDao dao;
+    private final DITContentRuleDescriptionSchemaParser   ditContentRuleParser   = new DITContentRuleDescriptionSchemaParser();
+    private final NameFormDescriptionSchemaParser         nameFormParser         = new NameFormDescriptionSchemaParser();
 
+    /** The SchemaManager instance */
+    private final SchemaManager schemaManager;
 
     /**
      * Creates a description parser.
      * 
      * @param globalRegistries the registries to use while creating new schema entities
      */
-    public DescriptionParsers( SchemaManager schemaManager, SchemaPartitionDao dao )
+    public DescriptionParsers( SchemaManager schemaManager )
     {
         this.schemaManager = schemaManager;
-        this.dao = dao;
     }
 
 
+    /**
+     * Parse the SyntaxCheckers description
+     *
+     * @param attr The attribute containing the SC description
+     * @return The array of SyntaxCheckerDescription instances
+     * @throws NamingException If something went wrong
+     */
     public SyntaxCheckerDescription[] parseSyntaxCheckers( EntryAttribute attr ) throws NamingException
     {
-        if ( attr == null || attr.size() == 0 )
+        if ( ( attr == null ) || ( attr.size() == 0 ) )
         {
             return EMPTY_SYNTAX_CHECKERS;
         }
@@ -240,7 +246,7 @@
             }
 
             // if the supertype is provided make sure it exists in some schema
-            if ( attributeType.getSuperiorOid() != null && !dao.hasAttributeType(
attributeType.getSuperiorOid() ) )
+            if ( ( attributeType.getSuperiorOid() != null ) && !schemaManager.getAttributeTypeRegistry().contains(
attributeType.getSuperiorOid() ) )
             {
                 throw new LdapOperationNotSupportedException(
                     "Cannot permit the addition of an attributeType with an invalid super
type: "
@@ -248,7 +254,7 @@
             }
 
             // if the syntax is provided by the description make sure it exists in some schema
-            if ( attributeType.getSyntaxOid() != null && !dao.hasSyntax( attributeType.getSyntaxOid()
) )
+            if ( attributeType.getSyntaxOid() != null && !schemaManager.getLdapSyntaxRegistry().contains(
attributeType.getSyntaxOid() ) )
             {
                 throw new LdapOperationNotSupportedException(
                     "Cannot permit the addition of an attributeType with an invalid syntax:
"
@@ -256,7 +262,7 @@
             }
 
             // if the matchingRule is provided make sure it exists in some schema
-            if ( attributeType.getEqualityOid() != null && !dao.hasMatchingRule(
attributeType.getEqualityOid() ) )
+            if ( attributeType.getEqualityOid() != null && !schemaManager.getMatchingRuleRegistry().contains(
attributeType.getEqualityOid() ) )
             {
                 throw new LdapOperationNotSupportedException(
                     "Cannot permit the addition of an attributeType with an invalid EQUALITY
matchingRule: "
@@ -264,7 +270,7 @@
             }
 
             // if the matchingRule is provided make sure it exists in some schema
-            if ( attributeType.getOrderingOid() != null && !dao.hasMatchingRule(
attributeType.getOrderingOid() ) )
+            if ( attributeType.getOrderingOid() != null && !schemaManager.getMatchingRuleRegistry().contains(
attributeType.getOrderingOid() ) )
             {
                 throw new LdapOperationNotSupportedException(
                     "Cannot permit the addition of an attributeType with an invalid ORDERING
matchingRule: "
@@ -272,7 +278,7 @@
             }
 
             // if the matchingRule is provided make sure it exists in some schema
-            if ( attributeType.getSubstringOid() != null && !dao.hasMatchingRule(
attributeType.getSubstringOid() ) )
+            if ( attributeType.getSubstringOid() != null && !schemaManager.getMatchingRuleRegistry().contains(
attributeType.getSubstringOid() ) )
             {
                 throw new LdapOperationNotSupportedException(
                     "Cannot permit the addition of an attributeType with an invalid SUBSTRINGS
matchingRule: "
@@ -378,19 +384,19 @@
             // if the super objectClasses are provided make sure it exists in some schema
             if ( objectClass.getSuperiorOids() != null && objectClass.getSuperiorOids().size()
> 0 )
             {
-                for ( String superior : objectClass.getSuperiorOids() )
+                for ( String superiorOid : objectClass.getSuperiorOids() )
                 {
-                    if ( superior.equals( SchemaConstants.TOP_OC_OID )
-                        || superior.equalsIgnoreCase( SchemaConstants.TOP_OC ) )
+                    if ( superiorOid.equals( SchemaConstants.TOP_OC_OID )
+                        || superiorOid.equalsIgnoreCase( SchemaConstants.TOP_OC ) )
                     {
                         continue;
                     }
 
-                    if ( !dao.hasObjectClass( superior ) )
+                    if ( !schemaManager.getObjectClassRegistry().contains( superiorOid )
)
                     {
                         throw new LdapOperationNotSupportedException(
                             "Cannot permit the addition of an objectClass with an invalid
superior objectClass: "
-                                + superior, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                                + superiorOid, ResultCodeEnum.UNWILLING_TO_PERFORM );
                     }
                 }
             }
@@ -398,13 +404,13 @@
             // if the may list is provided make sure attributes exists in some schema
             if ( objectClass.getMayAttributeTypeOids() != null && objectClass.getMayAttributeTypeOids().size()
> 0 )
             {
-                for ( String mayAttr : objectClass.getMayAttributeTypeOids() )
+                for ( String mayAttrOid : objectClass.getMayAttributeTypeOids() )
                 {
-                    if ( !dao.hasAttributeType( mayAttr ) )
+                    if ( !schemaManager.getAttributeTypeRegistry().contains( mayAttrOid )
)
                     {
                         throw new LdapOperationNotSupportedException(
                             "Cannot permit the addition of an objectClass with an invalid
"
-                                + "attributeType in the mayList: " + mayAttr, ResultCodeEnum.UNWILLING_TO_PERFORM
);
+                                + "attributeType in the mayList: " + mayAttrOid, ResultCodeEnum.UNWILLING_TO_PERFORM
);
                     }
                 }
             }
@@ -412,13 +418,13 @@
             // if the must list is provided make sure attributes exists in some schema
             if ( objectClass.getMustAttributeTypeOids() != null && objectClass.getMustAttributeTypeOids().size()
> 0 )
             {
-                for ( String mustAttr : objectClass.getMustAttributeTypeOids() )
+                for ( String mustAttrOid : objectClass.getMustAttributeTypeOids() )
                 {
-                    if ( !dao.hasAttributeType( mustAttr ) )
+                    if ( !schemaManager.getAttributeTypeRegistry().contains( mustAttrOid
) )
                     {
                         throw new LdapOperationNotSupportedException(
                             "Cannot permit the addition of an objectClass with an invalid
"
-                                + "attributeType in the mustList: " + mustAttr, ResultCodeEnum.UNWILLING_TO_PERFORM
);
+                                + "attributeType in the mustList: " + mustAttrOid, ResultCodeEnum.UNWILLING_TO_PERFORM
);
                     }
                 }
             }
@@ -515,7 +521,7 @@
                 throw iave;
             }
 
-            if ( !dao.hasSyntaxChecker( ldapSyntax.getOid() ) )
+            if ( !schemaManager.getSyntaxCheckerRegistry().contains( ldapSyntax.getOid()
) )
             {
                 throw new LdapOperationNotSupportedException(
                     "Cannot permit the addition of a syntax without the prior creation of
a "
@@ -568,7 +574,7 @@
                 throw iave;
             }
 
-            if ( !dao.hasSyntax( matchingRule.getSyntaxOid() ) )
+            if ( !schemaManager.getLdapSyntaxRegistry().contains( matchingRule.getSyntaxOid()
) )
             {
                 throw new LdapOperationNotSupportedException(
                     "Cannot create a matchingRule that depends on non-existant syntax: "
+ matchingRule.getSyntaxOid(),

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=892824&r1=892823&r2=892824&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
Mon Dec 21 13:56:55 2009
@@ -221,8 +221,7 @@
         
         // Initialize the schema manager
         SchemaLoader loader = schemaService.getSchemaPartition().getSchemaManager().getLoader();
-        SchemaPartitionDao dao = (SchemaPartitionDao)loader.getDao();
-        schemaSubEntryManager = new SchemaSubentryManager( schemaManager, loader, dao );
+        schemaSubEntryManager = new SchemaSubentryManager( schemaManager, loader );
 
         MODIFIERS_NAME_ATTRIBUTE_TYPE = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.MODIFIERS_NAME_AT
);
         MODIFY_TIMESTAMP_ATTRIBUTE_TYPE = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.MODIFY_TIMESTAMP_AT
);

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java?rev=892824&r1=892823&r2=892824&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
Mon Dec 21 13:56:55 2009
@@ -111,12 +111,12 @@
     }
 
 
-    public SchemaSubentryManager( SchemaManager schemaManager, SchemaLoader loader, SchemaPartitionDao
dao )
+    public SchemaSubentryManager( SchemaManager schemaManager, SchemaLoader loader )
         throws Exception
     {
         this.schemaManager = schemaManager;
-        this.subentryModifier = new SchemaSubentryModifier( schemaManager, dao );
-        this.parsers = new DescriptionParsers( schemaManager, dao );
+        this.subentryModifier = new SchemaSubentryModifier( schemaManager );
+        this.parsers = new DescriptionParsers( schemaManager );
         
         String comparatorsOid = schemaManager.getAttributeTypeRegistry().getOidByName( SchemaConstants.COMPARATORS_AT
);
         opAttr2handlerIndex.put( comparatorsOid, COMPARATOR_INDEX );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?rev=892824&r1=892823&r2=892824&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
Mon Dec 21 13:56:55 2009
@@ -79,7 +79,6 @@
     }
     
     private AttributesFactory factory = new AttributesFactory();
-    private final SchemaPartitionDao dao;
     
     /** The server schemaManager */
     private SchemaManager schemaManager; 
@@ -92,10 +91,9 @@
      * @param schemaManager The server schemaManager
      * @param dao
      */
-    public SchemaSubentryModifier( SchemaManager schemaManager, SchemaPartitionDao dao )
+    public SchemaSubentryModifier( SchemaManager schemaManager )
     {
         this.schemaManager = schemaManager;
-        this.dao = dao;
     }
     
     
@@ -188,7 +186,7 @@
     
     public void addSchemaObject( OperationContext opContext, SchemaObject obj ) throws Exception
     {
-        Schema schema = dao.getSchema( obj.getSchemaName() );
+        Schema schema = schemaManager.getLoadedSchema( obj.getSchemaName() );
         LdapDN dn = getDn( obj );
         ServerEntry entry = factory.getAttributes( obj, schema, schemaManager );
         entry.setDn( dn );

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java?rev=892824&r1=892823&r2=892824&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
Mon Dec 21 13:56:55 2009
@@ -330,11 +330,4 @@
      * Remove a schema from the schema's list
      */
     public void removeSchema( Schema schema );
-
-    
-    /**
-     * TODO : get rid of this here !
-     * @dao the DAO
-     */
-    Object getDao();
 }



Mime
View raw message