directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r503378 - in /directory/apacheds/trunk: core-unit/src/test/java/org/apache/directory/server/core/schema/ core/src/main/java/org/apache/directory/server/core/exception/ core/src/main/java/org/apache/directory/server/core/operational/ core/sr...
Date Sun, 04 Feb 2007 09:40:32 GMT
Author: akarasulu
Date: Sun Feb  4 01:40:31 2007
New Revision: 503378

URL: http://svn.apache.org/viewvc?view=rev&rev=503378
Log:
schema changes ...

 o enabled updates to occur on subschemaSubentry with tweaks to interceptors
 o created in SchemaSubentryModifier class to handle updates via a nexus
   proxy with appropriate bypasses: this guy stores the entry for the schema
   entity under ou=schema
 o added new test case to make sure the plumbing works for at least 
   AttributeType additions


Added:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/subentry/
Modified:
    directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
    directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryITest.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeImpl.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/MetaDitContentRuleHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.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/SchemaManager.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
(original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
Sun Feb  4 01:40:31 2007
@@ -241,6 +241,7 @@
         // We should have 14 attributes in the result :
         // - attributeTypes
         // - cn
+        // - subtreeSpecification
         // - creatorsName
         // - createTimestamp
         // - dITContentRules
@@ -253,7 +254,7 @@
         // - nameForms
         // - objectClass
         // - objectClasses
-        assertEquals( 14, attrs.size() );
+        assertEquals( 15, attrs.size() );
         
         assertNotNull( attrs.get( "attributeTypes" ) );
         assertNotNull( attrs.get( "cn" ) );
@@ -269,6 +270,7 @@
         assertNotNull( attrs.get( "nameForms" ) );
         assertNotNull( attrs.get( "objectClass" ) );
         assertNotNull( attrs.get( "objectClasses" ) );
+        assertNotNull( attrs.get( "subtreeSpecification" ) );
     }
 
     public void testSearchForSubSchemaSubEntrySingleAttributeSelected() throws NamingException
@@ -358,10 +360,11 @@
         
         // We should have 14 attribute in the result :
         // - nameForms
-        assertEquals( 14, attrs.size() );
+        assertEquals( 15, attrs.size() );
         
         assertNotNull( attrs.get( "attributeTypes" ) );
         assertNotNull( attrs.get( "cn" ) );
+        assertNotNull( attrs.get( "subtreeSpecification" ) );
         assertNotNull( attrs.get( "creatorsName" ) );
         assertNotNull( attrs.get( "createTimestamp" ) );
         assertNotNull( attrs.get( "dITContentRules" ) );
@@ -401,10 +404,11 @@
         
         // We should have 14 attribute in the result :
         // - nameForms
-        assertEquals( 14, attrs.size() );
+        assertEquals( 15, attrs.size() );
         
         assertNotNull( attrs.get( "attributeTypes" ) );
         assertNotNull( attrs.get( "cn" ) );
+        assertNotNull( attrs.get( "subtreeSpecification" ) );
         assertNotNull( attrs.get( "creatorsName" ) );
         assertNotNull( attrs.get( "createTimestamp" ) );
         assertNotNull( attrs.get( "dITContentRules" ) );

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryITest.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryITest.java
(original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryITest.java
Sun Feb  4 01:40:31 2007
@@ -24,13 +24,20 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.unit.AbstractAdminTestCase;
 import org.apache.directory.shared.ldap.exception.LdapNameAlreadyBoundException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
+import org.apache.directory.shared.ldap.schema.syntax.parser.AttributeTypeDescriptionSchemaParser;
 
 
 /**
@@ -44,6 +51,8 @@
 {
     private static final String GLOBAL_SUBSCHEMA_DN = "cn=schema";
     private static final String SUBSCHEMA_SUBENTRY = "subschemaSubentry";
+    private static final AttributeTypeDescriptionSchemaParser attributeTypeDescriptionSchemaParser
= 
+        new AttributeTypeDescriptionSchemaParser();
 
     
     /**
@@ -76,7 +85,7 @@
     {
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-        controls.setReturningAttributes( new String[]{ "+" } );
+        controls.setReturningAttributes( new String[]{ "+", "*" } );
         
         NamingEnumeration<SearchResult> results = rootDSE.search( getSubschemaSubentryDN(),

             "(objectClass=*)", controls );
@@ -172,5 +181,127 @@
         {
             assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getResultCode() );
         }
+    }
+    
+
+    private void enableSchema( String schemaName ) throws NamingException
+    {
+        // now enable the test schema
+        ModificationItemImpl[] mods = new ModificationItemImpl[1];
+        Attribute attr = new AttributeImpl( "m-disabled", "FALSE" );
+        mods[0] = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
+        super.schemaRoot.modifyAttributes( "cn=" + schemaName, mods );
+    }
+    
+    
+    private void disableSchema( String schemaName ) throws NamingException
+    {
+        // now enable the test schema
+        ModificationItemImpl[] mods = new ModificationItemImpl[1];
+        Attribute attr = new AttributeImpl( "m-disabled", "TRUE" );
+        mods[0] = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
+        super.schemaRoot.modifyAttributes( "cn=" + schemaName, mods );
+    }
+    
+    
+    /**
+     * Tests the addition of a new attributeType via a modify ADD on the SSSE to disabled
schema.
+     */
+    public void testAddAttributeTypeOnDisabledSchema() throws Exception
+    {
+        disableSchema( "nis" );
+        LdapDN dn = new LdapDN( getSubschemaSubentryDN() );
+        String substrate = "( 1.3.6.1.4.1.18060.0.4.0.2.10000 NAME ( 'bogus' 'bogusName'
) " +
+            "DESC 'bogus description' SUP name SINGLE-VALUE X-SCHEMA 'nis' )";
+        ModificationItemImpl[] mods = new ModificationItemImpl[1];
+        mods[0] = new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, 
+            new AttributeImpl( "attributeTypes", substrate ) );
+        
+        rootDSE.modifyAttributes( dn, mods );
+        
+        Attributes attrs = getSubschemaSubentryAttributes();
+        Attribute attrTypes = attrs.get( "attributeTypes" );
+        AttributeTypeDescription attributeTypeDescription = null; 
+        for ( int ii = 0; ii < attrTypes.size(); ii++ )
+        {
+            String desc = ( String ) attrTypes.get( ii );
+            if ( desc.indexOf( "1.3.6.1.4.1.18060.0.4.0.2.10000" ) != -1 )
+            {
+                attributeTypeDescription = attributeTypeDescriptionSchemaParser.parseAttributeTypeDescription(
desc );
+                break;
+            }
+        }
+        
+        assertNull( attributeTypeDescription );
+
+        attrs = null;
+        attrs = schemaRoot.getAttributes( "oid=1.3.6.1.4.1.18060.0.4.0.2.10000,ou=attributeTypes,cn=nis"
);
+        assertNotNull( attrs );
+        SchemaEntityFactory factory = new SchemaEntityFactory( registries );
+        AttributeType at = factory.getAttributeType( attrs, registries, "nis" );
+        assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", at.getOid() );
+        assertEquals( "name", at.getSuperior().getName() );
+        assertEquals( "bogus description", at.getDescription() );
+        assertEquals( "bogus", at.getNames()[0] );
+        assertEquals( "bogusName", at.getNames()[1] );
+        assertEquals( true, at.isCanUserModify() );
+        assertEquals( false, at.isCollective() );
+        assertEquals( false, at.isObsolete() );
+        assertEquals( true, at.isSingleValue() );
+    }
+
+    
+    /**
+     * Tests the addition of a new attributeType via a modify ADD on the SSSE to enabled
schema.
+     */
+    public void testAddAttributeTypeOnEnabledSchema() throws Exception
+    {
+        enableSchema( "nis" );
+        LdapDN dn = new LdapDN( getSubschemaSubentryDN() );
+        String substrate = "( 1.3.6.1.4.1.18060.0.4.0.2.10000 NAME ( 'bogus' 'bogusName'
) " +
+            "DESC 'bogus description' SUP name SINGLE-VALUE X-SCHEMA 'nis' )";
+        ModificationItemImpl[] mods = new ModificationItemImpl[1];
+        mods[0] = new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, 
+            new AttributeImpl( "attributeTypes", substrate ) );
+        
+        rootDSE.modifyAttributes( dn, mods );
+        
+        Attributes attrs = getSubschemaSubentryAttributes();
+        Attribute attrTypes = attrs.get( "attributeTypes" );
+        AttributeTypeDescription attributeTypeDescription = null; 
+        for ( int ii = 0; ii < attrTypes.size(); ii++ )
+        {
+            String desc = ( String ) attrTypes.get( ii );
+            if ( desc.indexOf( "1.3.6.1.4.1.18060.0.4.0.2.10000" ) != -1 )
+            {
+                attributeTypeDescription = attributeTypeDescriptionSchemaParser.parseAttributeTypeDescription(
desc );
+                break;
+            }
+        }
+        
+        assertNotNull( attributeTypeDescription );
+        assertEquals( true, attributeTypeDescription.isSingleValued() );
+        assertEquals( false, attributeTypeDescription.isCollective() );
+        assertEquals( false, attributeTypeDescription.isObsolete() );
+        assertEquals( true, attributeTypeDescription.isUserModifiable() );
+        assertEquals( "bogus description", attributeTypeDescription.getDescription() );
+        assertEquals( "bogus", attributeTypeDescription.getNames().get( 0 ) );
+        assertEquals( "bogusName", attributeTypeDescription.getNames().get( 1 ) );
+        assertEquals( "name", attributeTypeDescription.getSuperType() );
+        
+        attrs = null;
+        attrs = schemaRoot.getAttributes( "oid=1.3.6.1.4.1.18060.0.4.0.2.10000,ou=attributeTypes,cn=nis"
);
+        assertNotNull( attrs );
+        SchemaEntityFactory factory = new SchemaEntityFactory( registries );
+        AttributeType at = factory.getAttributeType( attrs, registries, "nis" );
+        assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", at.getOid() );
+        assertEquals( "name", at.getSuperior().getName() );
+        assertEquals( "bogus description", at.getDescription() );
+        assertEquals( "bogus", at.getNames()[0] );
+        assertEquals( "bogusName", at.getNames()[1] );
+        assertEquals( true, at.isCanUserModify() );
+        assertEquals( false, at.isCollective() );
+        assertEquals( false, at.isObsolete() );
+        assertEquals( true, at.isSingleValue() );
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
Sun Feb  4 01:40:31 2007
@@ -283,6 +283,15 @@
     {
         // check if entry to modify exists
         String msg = "Attempt to modify non-existant entry: ";
+
+        // handle operations against the schema subentry in the schema service
+        // and never try to look it up in the nexus below
+        if ( name.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
+        {
+            nextInterceptor.modify( name, items );
+            return;
+        }
+        
         assertHasEntry( nextInterceptor, msg, name );
 
         Attributes entry = nexus.lookup( name );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
Sun Feb  4 01:40:31 2007
@@ -109,6 +109,10 @@
 
     private boolean isDenormalizeOpAttrsEnabled;
 
+    /**
+     * subschemaSubentry attribute's value from Root DSE
+     */
+    private LdapDN subschemaSubentryDn;
 
     /**
      * Creates the operational attribute management service interceptor.
@@ -123,6 +127,11 @@
         nexus = factoryCfg.getPartitionNexus();
         registry = factoryCfg.getRegistries().getAttributeTypeRegistry();
         isDenormalizeOpAttrsEnabled = factoryCfg.getStartupConfiguration().isDenormalizeOpAttrsEnabled();
+
+        // stuff for dealing with subentries (garbage for now)
+        String subschemaSubentry = ( String ) nexus.getRootDSE().get( "subschemaSubentry"
).get();
+        subschemaSubentryDn = new LdapDN( subschemaSubentry );
+        subschemaSubentryDn.normalize( factoryCfg.getRegistries().getAttributeTypeRegistry().getNormalizerMapping()
);
     }
 
 
@@ -174,6 +183,11 @@
     {
         nextInterceptor.modify( name, items );
 
+        if ( name.getNormName().equals( subschemaSubentryDn.getNormName() ) ) 
+        {
+            return;
+        }
+        
         // add operational attributes after call in case the operation fails
         Attributes attributes = new AttributesImpl( true );
         Attribute attribute = new AttributeImpl( "modifiersName" );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeImpl.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeImpl.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeImpl.java
Sun Feb  4 01:40:31 2007
@@ -23,6 +23,8 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.exception.LdapNamingException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.AbstractAttributeType;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
@@ -64,13 +66,36 @@
     {
         if ( equalityOid == null )
         {
-            return null;
+            return findEquality( getSuperior() );
         }
         
         return registries.getMatchingRuleRegistry().lookup( equalityOid );
     }
 
 
+    /**
+     * Recursively the equality matchingRule if one exists within the attribute heirarchy.
+     * 
+     * @param at the attribute to find a equality matchingRule for
+     * @return the equality MatchingRule or null if none exists for the attributeType
+     * @throws NamingException if there are problems accessing the attribute heirarchy
+     */
+    private MatchingRule findEquality( AttributeType at ) throws NamingException
+    {
+        if ( at == null )
+        {
+            return null;
+        }
+        
+        if ( at.getEquality() == null )
+        {
+            return findEquality( at.getSuperior() );
+        }
+        
+        return null;
+    }
+
+
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.AttributeType#getOrdering()
      */
@@ -78,13 +103,36 @@
     {
         if ( orderingOid == null )
         {
-            return null;
+            return findOrdering( getSuperior() );
         }
         
         return registries.getMatchingRuleRegistry().lookup( orderingOid );
     }
 
 
+    /**
+     * Recursively the ordering matchingRule if one exists within the attribute heirarchy.
+     * 
+     * @param at the attribute to find a ordering matchingRule for
+     * @return the ordering MatchingRule or null if none exists for the attributeType
+     * @throws NamingException if there are problems accessing the attribute heirarchy
+     */
+    private MatchingRule findOrdering( AttributeType at ) throws NamingException
+    {
+        if ( at == null )
+        {
+            return null;
+        }
+        
+        if ( at.getOrdering() == null )
+        {
+            return findOrdering( at.getSuperior() );
+        }
+        
+        return null;
+    }
+
+
     /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.schema.AttributeType#getSubstr()
      */
@@ -92,11 +140,34 @@
     {
         if ( substrOid == null )
         {
-            return null;
+            return findSubstr( getSuperior() );
         }
         
         return registries.getMatchingRuleRegistry().lookup( substrOid );
     }
+    
+
+    /**
+     * Recursively gets the substring matchingRule if one exists within the attribute heirarchy.
+     * 
+     * @param at the attribute to find a substring matchingRule for
+     * @return the substring MatchingRule or null if none exists for the attributeType
+     * @throws NamingException if there are problems accessing the attribute heirarchy
+     */
+    private MatchingRule findSubstr( AttributeType at ) throws NamingException
+    {
+        if ( at == null )
+        {
+            return null;
+        }
+        
+        if ( at.getSubstr() == null )
+        {
+            return findSubstr( at.getSuperior() );
+        }
+        
+        return null;
+    }
 
 
     /* (non-Javadoc)
@@ -120,13 +191,37 @@
     {
         if ( syntaxOid == null )
         {
-            return null;
+            return findSyntax( getSuperior() );
         }
         
         return registries.getSyntaxRegistry().lookup( syntaxOid );
     }
     
     
+    /**
+     * Recursively walks up the ancestors to find the syntax for an attributeType.
+     * 
+     * @param at the attributeType to get the syntax for
+     * @return the Syntax for the attributeType
+     * @throws NamingException if no syntax can be found for the attributeType
+     */
+    private Syntax findSyntax( AttributeType at ) throws NamingException
+    {
+        if ( at == null )
+        {
+            throw new LdapNamingException( "Cannot find syntax for attributeType " + getName()

+                + " after walking ancestors.", ResultCodeEnum.OTHER );
+        }
+        
+        if ( at.getSyntax() != null )
+        {
+            return at.getSyntax();
+        }
+        
+        return findSyntax( at.getSuperior() );
+    }
+    
+
     public void setSyntaxOid( String syntaxOid )
     {
         this.syntaxOid = syntaxOid;

Added: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java?view=auto&rev=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
(added)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
Sun Feb  4 01:40:31 2007
@@ -0,0 +1,94 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.core.schema;
+
+import java.text.ParseException;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+
+import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
+import org.apache.directory.shared.ldap.schema.syntax.parser.AttributeTypeDescriptionSchemaParser;
+
+/**
+ * Document me!
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class DescriptionParsers
+{
+    private static final String OTHER_SCHEMA = "other";
+    private static final String X_SCHEMA = "X-SCHEMA";
+    private final AttributeTypeDescriptionSchemaParser attributeTypeParser = new AttributeTypeDescriptionSchemaParser();
+    private final Registries globalRegistries;
+    
+    
+    public DescriptionParsers( Registries globalRegistries )
+    {
+        this.globalRegistries = globalRegistries;
+    }
+    
+    private static final String[] EMPTY = new String[0];
+    public AttributeType parseAttributeType( Attribute attr ) throws NamingException
+    {
+        AttributeTypeDescription desc = null;
+        
+        try
+        {
+            desc = attributeTypeParser.parseAttributeTypeDescription( ( String ) attr.get()
);
+        }
+        catch ( ParseException e )
+        {
+            throw new LdapInvalidAttributeValueException( 
+                "The following does not conform to the attributeTypeDescription syntax: "
+ attr.get(), 
+                ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+        }
+        
+        AttributeTypeImpl at = new AttributeTypeImpl( desc.getNumericOid(), globalRegistries
);
+        at.setCanUserModify( desc.isUserModifiable() );
+        at.setCollective( desc.isCollective() );
+        at.setDescription( desc.getDescription() );
+        at.setEqualityOid( desc.getEqualityMatchingRule() );
+        at.setNames( ( String [] ) desc.getNames().toArray( EMPTY ) );
+        at.setObsolete( desc.isObsolete() );
+        at.setOrderingOid( desc.getOrderingMatchingRule() );
+        at.setSingleValue( desc.isSingleValued() );
+        at.setSubstrOid( desc.getSubstringsMatchingRule() );
+        at.setSuperiorOid( desc.getSuperType() );
+        at.setSyntaxOid( desc.getSyntax() );
+        at.setUsage( desc.getUsage() );
+        
+        if ( desc.getExtensions().get( X_SCHEMA ) != null )
+        {
+            at.setSchema( desc.getExtensions().get( X_SCHEMA ).get( 0 ) );
+        }
+        else
+        {
+            at.setSchema( OTHER_SCHEMA );
+        }
+        
+        return at;
+    }
+}

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=503378&r1=503377&r2=503378
==============================================================================
--- 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
Sun Feb  4 01:40:31 2007
@@ -76,6 +76,20 @@
             attributeTypeRegistry.register( at );
         }
     }
+    
+    
+    public void add( AttributeType at ) throws NamingException
+    {
+        Schema schema = dao.getSchema( at.getSchema() );
+        if ( ! schema.isDisabled() )
+        {
+            attributeTypeRegistry.register( at );
+        }
+        else
+        {
+            registerOids( at );
+        }
+    }
 
 
     public void add( LdapDN name, Attributes entry ) throws NamingException
@@ -86,15 +100,7 @@
         
         Schema schema = getSchema( name );
         AttributeType at = factory.getAttributeType( entry, targetRegistries, schema.getSchemaName()
);
-        
-        if ( ! schema.isDisabled() )
-        {
-            attributeTypeRegistry.register( at );
-        }
-        else
-        {
-            registerOids( at );
-        }
+        add( at );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java
Sun Feb  4 01:40:31 2007
@@ -103,5 +103,4 @@
         // TODO Auto-generated method stub
 
     }
-
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
Sun Feb  4 01:40:31 2007
@@ -103,5 +103,4 @@
         // TODO Auto-generated method stub
 
     }
-
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
Sun Feb  4 01:40:31 2007
@@ -103,5 +103,4 @@
         // TODO Auto-generated method stub
 
     }
-
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java
Sun Feb  4 01:40:31 2007
@@ -103,5 +103,4 @@
         // TODO Auto-generated method stub
 
     }
-
 }

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=503378&r1=503377&r2=503378
==============================================================================
--- 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
Sun Feb  4 01:40:31 2007
@@ -240,7 +240,7 @@
             normalizerRegistry.register( newSchema.getSchemaName(), oid, normalizer );
         }
     }
-    
+
     
     private void checkNewParent( LdapDN newParent ) throws NamingException
     {

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=503378&r1=503377&r2=503378
==============================================================================
--- 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
Sun Feb  4 01:40:31 2007
@@ -221,8 +221,8 @@
             objectClassRegistry.register( oc );
         }
     }
-    
-    
+
+
     private void checkNewParent( LdapDN newParent ) throws NamingException
     {
         if ( newParent.size() != 3 )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java
Sun Feb  4 01:40:31 2007
@@ -64,6 +64,7 @@
 public class SchemaManager
 {
     private static final Set<String> VALID_OU_VALUES = new HashSet<String>();
+//    private static final Set<String> SCHEMA_OBJECT_OIDS = new HashSet<String>();
     private static final String[] opAttrs = new String[] {
         "comparators",
         "normalizers",
@@ -95,11 +96,13 @@
     private final MetaSchemaHandler metaSchemaHandler;
     private final Registries globalRegistries;
     private final AttributeType objectClassAT;
-    
+    private final SchemaSubentryModifier subentryModifier;
     private final SchemaChangeHandler[] schemaObjectHandlers = new SchemaChangeHandler[11];
+    private final String attributeTypesOid;
+    private final DescriptionParsers parsers;
     
-    private Map<String, SchemaChangeHandler> opAttr2handlerMap = new HashMap<String,
SchemaChangeHandler>();
-    private Map<String, SchemaChangeHandler> objectClass2handlerMap = new HashMap<String,
SchemaChangeHandler>();
+    private final Map<String, SchemaChangeHandler> opAttr2handlerMap = new HashMap<String,
SchemaChangeHandler>();
+    private final Map<String, SchemaChangeHandler> objectClass2handlerMap = new HashMap<String,
SchemaChangeHandler>();
     
     static 
     {
@@ -137,6 +140,20 @@
         this.schemaObjectHandlers[8] =  new MetaDitStructureRuleHandler( globalRegistries,
loader ); 
         this.schemaObjectHandlers[9] =  new MetaDitContentRuleHandler( globalRegistries,
loader ); 
         this.schemaObjectHandlers[10] = new MetaNameFormHandler( globalRegistries, loader
); 
+
+        this.subentryModifier = new SchemaSubentryModifier( dao );
+        this.parsers = new DescriptionParsers( globalRegistries );
+        
+//        this.SCHEMA_OBJECT_OIDS.add( globalRegistries.getOidRegistry().getOid( "ldapSyntaxes"
) );
+//        this.SCHEMA_OBJECT_OIDS.add( globalRegistries.getOidRegistry().getOid( "matchingRules"
) );
+//        this.SCHEMA_OBJECT_OIDS.add( globalRegistries.getOidRegistry().getOid( "matchingRuleUse"
) );
+//        this.SCHEMA_OBJECT_OIDS.add( globalRegistries.getOidRegistry().getOid( "attributeTypes"
) );
+//        this.SCHEMA_OBJECT_OIDS.add( globalRegistries.getOidRegistry().getOid( "objectClasses"
) );
+//        this.SCHEMA_OBJECT_OIDS.add( globalRegistries.getOidRegistry().getOid( "ditContentRules"
) );
+//        this.SCHEMA_OBJECT_OIDS.add( globalRegistries.getOidRegistry().getOid( "ditStructureRules"
) );
+//        this.SCHEMA_OBJECT_OIDS.add( globalRegistries.getOidRegistry().getOid( "nameForms"
) );
+        
+        attributeTypesOid = globalRegistries.getOidRegistry().getOid( "attributeTypes" );
         
         initHandlerMaps();
     }
@@ -405,9 +422,14 @@
     {
         for ( ModificationItemImpl mod : mods )
         {
+            String opAttrOid = globalRegistries.getOidRegistry().getOid( mod.getAttribute().getID()
);
             switch ( mod.getModificationOp() )
             {
                 case( DirContext.ADD_ATTRIBUTE ):
+                    if ( opAttrOid.equals( attributeTypesOid ) )
+                    {
+                        addAttributeType( mod );
+                    }
                     break;
                 case( DirContext.REMOVE_ATTRIBUTE ):
                     break; 
@@ -418,7 +440,17 @@
             }
         }
     }
-
+    
+    
+    private void addAttributeType( ModificationItemImpl mod ) throws NamingException
+    {
+        String opAttrOid = globalRegistries.getOidRegistry().getOid( mod.getAttribute().getID()
);
+        AttributeType at = parsers.parseAttributeType( mod.getAttribute() );
+        subentryModifier.addSchemaObject( at );
+        MetaAttributeTypeHandler handler = ( MetaAttributeTypeHandler ) opAttr2handlerMap.get(
opAttrOid );
+        handler.add( at );
+    }
+    
 
     /**
      * Translates modify operations on schema subentries into one or more operations 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Sun Feb  4 01:40:31 2007
@@ -652,6 +652,12 @@
             attrs.put( attr );
         }
 
+        if ( returnAllOperationalAttributes || set.contains( "subtreespecification" ) )
+        {
+            attr = new AttributeImpl( "subtreeSpecification", "{}" );
+            attrs.put( attr );
+        }
+
         // timeestamps are hacks for now until the schema is actually updateable these
         // use the servers startup time stamp for both modify and create timestamps
 
@@ -706,6 +712,7 @@
             attr = new AttributeImpl( "objectClass" );
             attr.add( "top" );
             attr.add( "subschema" );
+            attr.add( "subentry" );
             attrs.put( attr );
         }
 
@@ -967,7 +974,7 @@
 
             AttributeType[] types = oc.getMayList();
 
-            // For each objectClass, loop on all MUST attributeTypes, if any
+            // For each objectClass, loop on all MAY attributeTypes, if any
             if ( ( types != null ) && ( types.length > 0 ) )
             {
                 for ( AttributeType type:types )
@@ -1065,8 +1072,19 @@
      */
     public void modify( NextInterceptor next, LdapDN name, int modOp, Attributes mods ) throws
NamingException
     {
-        // First, we get the entry from the backend. If it does not exist, then we throw
an exception
-        Attributes entry = nexus.lookup( name );
+        Attributes entry = null; 
+
+        // handle operations against the schema subentry in the schema service
+        // and never try to look it up in the nexus below
+        if ( name.getNormName().equalsIgnoreCase( subschemaSubentryDn.getNormName() ) )
+        {
+            entry = getSubschemaEntry( schemaSubentryReturnAttributes );
+        }
+        else
+        {
+            entry = nexus.lookup( name );
+        }
+
         Attributes targetEntry = SchemaUtils.getTargetEntry( modOp, mods, entry );
         
         if ( entry == null )
@@ -1247,11 +1265,24 @@
         next.modifyRn( name, newRn, deleteOldRn );
     }
 
-
+    private final static String[] schemaSubentryReturnAttributes = new String[] { "+", "*"
};
+    
     public void modify( NextInterceptor next, LdapDN name, ModificationItemImpl[] mods )
throws NamingException
     {
+        Attributes entry = null; 
+
+        // handle operations against the schema subentry in the schema service
+        // and never try to look it up in the nexus below
+        if ( name.getNormName().equalsIgnoreCase( subschemaSubentryDn.getNormName() ) )
+        {
+            entry = getSubschemaEntry( schemaSubentryReturnAttributes );
+        }
+        else
+        {
+            entry = nexus.lookup( name );
+        }
+        
         // First, we get the entry from the backend. If it does not exist, then we throw
an exception
-        Attributes entry = nexus.lookup( name );
         Attributes targetEntry = SchemaUtils.getTargetEntry( mods, entry );
 
         if ( entry == null )
@@ -1740,7 +1771,6 @@
             return;
         }
 
-
         NamingEnumeration attrs = attributes.getAll();
 
         while ( attrs.hasMoreElements() )
@@ -1825,7 +1855,7 @@
         if ( must.size() != 0 )
         {
             throw new LdapSchemaViolationException( "Required attributes " +
-                must.toArray() + " not found within entry " + dn.getUpName(),
+                must + " not found within entry " + dn.getUpName(),
                 ResultCodeEnum.OBJECT_CLASS_VIOLATION );
         }
     }

Added: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?view=auto&rev=503378
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
(added)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
Sun Feb  4 01:40:31 2007
@@ -0,0 +1,131 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.core.schema;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+
+import org.apache.directory.server.core.invocation.InvocationStack;
+import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.bootstrap.Schema;
+import org.apache.directory.server.utils.AttributesFactory;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.DITContentRule;
+import org.apache.directory.shared.ldap.schema.DITStructureRule;
+import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
+import org.apache.directory.shared.ldap.schema.NameForm;
+import org.apache.directory.shared.ldap.schema.ObjectClass;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
+import org.apache.directory.shared.ldap.schema.Syntax;
+
+
+/**
+ * Responsible for translating modify operations on the subschemaSubentry into 
+ * operations against entries within the schema partition.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class SchemaSubentryModifier
+{
+    private static final Collection<String> BYPASS;
+    
+    static
+    {
+        Set<String> bypass = new HashSet<String>();
+        bypass.add( "authenticationService" );
+        bypass.add( "referralService" );
+        bypass.add( "authorizationService" );
+        bypass.add( "defaultAuthorizationService" );
+        bypass.add( "exceptionService" );
+        bypass.add( "schemaService" );
+        BYPASS = Collections.unmodifiableCollection( bypass );
+    }
+    
+    private AttributesFactory factory = new AttributesFactory();
+    private final SchemaPartitionDao dao;
+
+    
+    public SchemaSubentryModifier( SchemaPartitionDao dao )
+    {
+        this.dao = dao;
+    }
+    
+    
+    private LdapDN getDn( SchemaObject obj ) throws NamingException
+    {
+        StringBuffer buf = new StringBuffer();
+        buf.append( "oid=" ).append( obj.getOid() ).append( ",ou=" );
+
+        if ( obj instanceof Syntax )
+        {
+            buf.append( "syntaxes" );
+        }
+        else if ( obj instanceof MatchingRule )
+        {
+            buf.append( "matchingRules" );
+        }
+        else if ( obj instanceof AttributeType )
+        {
+            buf.append( "attributeTypes" );
+        }
+        else if ( obj instanceof ObjectClass )
+        {
+            buf.append( "objectClasses" );
+        }
+        else if ( obj instanceof MatchingRuleUse )
+        {
+            buf.append( "matchingRuleUses" );
+        }
+        else if ( obj instanceof DITStructureRule )
+        {
+            buf.append( "ditStructureRules" );
+        }
+        else if ( obj instanceof DITContentRule )
+        {
+            buf.append( "ditContentRules" );
+        }
+        else if ( obj instanceof NameForm )
+        {
+            buf.append( "nameForms" );
+        }
+
+        buf.append( ",cn=" ).append( obj.getSchema() ).append( ",ou=schema" );
+        return new LdapDN( buf.toString() );
+    }
+    
+
+    public LdapDN addSchemaObject( SchemaObject obj ) throws NamingException
+    {
+        PartitionNexusProxy proxy = InvocationStack.getInstance().peek().getProxy();
+        Schema schema = dao.getSchema( obj.getSchema() );
+        LdapDN dn = getDn( obj );
+        Attributes attrs = factory.getAttributes( obj, schema );
+        proxy.add( dn, attrs, BYPASS );
+        return dn;
+    }
+}

Modified: directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java?view=diff&rev=503378&r1=503377&r2=503378
==============================================================================
--- directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java
(original)
+++ directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java
Sun Feb  4 01:40:31 2007
@@ -54,6 +54,45 @@
  */
 public class AttributesFactory
 {
+    public Attributes getAttributes( SchemaObject obj, Schema schema ) throws NamingException
+    {
+        if ( obj instanceof Syntax )
+        {
+            return getAttributes( ( Syntax ) obj, schema );
+        }
+        else if ( obj instanceof MatchingRule )
+        {
+            return getAttributes( ( MatchingRule ) obj, schema );
+        }
+        else if ( obj instanceof AttributeType )
+        {
+            return getAttributes( ( AttributeType ) obj, schema );
+        }
+        else if ( obj instanceof ObjectClass )
+        {
+            return getAttributes( ( ObjectClass ) obj, schema );
+        }
+        else if ( obj instanceof MatchingRuleUse )
+        {
+            return getAttributes( ( MatchingRuleUse ) obj, schema );
+        }
+        else if ( obj instanceof DITStructureRule )
+        {
+            return getAttributes( ( DITStructureRule ) obj, schema );
+        }
+        else if ( obj instanceof DITContentRule )
+        {
+            return getAttributes( ( DITContentRule ) obj, schema );
+        }
+        else if ( obj instanceof NameForm )
+        {
+            return getAttributes( ( NameForm ) obj, schema );
+        }
+        
+        throw new IllegalArgumentException( "Unknown SchemaObject type: " + obj.getClass()
);
+    }
+    
+    
     public Attributes getAttributes( Schema schema )
     {
         Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top",
true );



Mime
View raw message