directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1299774 [1/2] - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/ apacheds/trunk/interceptors/authz/src/test/java/org/apache/directory/server/core/authz/support/ apacheds/trunk/xdbm-partition/...
Date Mon, 12 Mar 2012 18:29:50 GMT
Author: elecharny
Date: Mon Mar 12 18:29:48 2012
New Revision: 1299774

URL: http://svn.apache.org/viewvc?rev=1299774&view=rev
Log:
o Created a MutableAttributeType class
o Removed the modifiers from the AttributeType class
o Modified the impacted code in the api and Studio

Added:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableAttributeType.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/TestServerEntryUtils.java
    directory/apacheds/trunk/interceptors/authz/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/TestEntryUtils.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
    directory/shared/trunk/ldap/model/src/main/antlr/schema.g
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/OpenLdapSchemaParser.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/helper/AttributeTypeHelper.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueTest.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/SchemaUtilsTest.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/parsers/OpenLdapSchemaParserTest.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/registries/AttributeTypeRegistryTest.java
    directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemaloader/SchemaEntityFactory.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerAddTest.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerDelTest.java
    directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PluginUtils.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/SchemaHandler.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/RenameSchemaElementAction.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/GenericSchemaConnector.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/OpenLdapSchemaFileImporter.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/XMLSchemaFileImporter.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AbstractAttributeTypeEditorPage.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditor.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorSourceCodePage.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/MergeSchemasWizard.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeWizard.java
    directory/studio/trunk/plugins/schemaeditor/src/test/java/org/apache/directory/studio/schemaeditor/model/difference/DifferenceEngineTest.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/TestServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/TestServerEntryUtils.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/TestServerEntryUtils.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/TestServerEntryUtils.java Mon Mar 12 18:29:48 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.core.api.entry;
 
@@ -29,6 +29,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.LdapComparator;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator;
@@ -106,7 +107,7 @@ public class TestServerEntryUtils
     @SuppressWarnings("PMD.AvoidUsingHardCodedIP")
     static AttributeType getCaseIgnoringAttributeNoNumbersType()
     {
-        AttributeType attributeType = new AttributeType( "1.1.3.1" );
+        MutableAttributeType attributeType = new MutableAttributeType( "1.1.3.1" );
         LdapSyntax syntax = new LdapSyntax( "1.1.1.1", "", true );
 
         syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2.1" )
@@ -193,7 +194,7 @@ public class TestServerEntryUtils
 
     /* no protection*/static AttributeType getIA5StringAttributeType()
     {
-        AttributeType attributeType = new AttributeType( "1.1" );
+        MutableAttributeType attributeType = new MutableAttributeType( "1.1" );
         attributeType.addName( "1.1" );
         LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true );
 
@@ -229,7 +230,7 @@ public class TestServerEntryUtils
 
     /* No protection */static AttributeType getBytesAttributeType()
     {
-        AttributeType attributeType = new AttributeType( "1.2" );
+        MutableAttributeType attributeType = new MutableAttributeType( "1.2" );
         LdapSyntax syntax = new LdapSyntax( "1.2.1", "", true );
 
         syntax.setSyntaxChecker( new SyntaxChecker( "1.2.1" )

Modified: directory/apacheds/trunk/interceptors/authz/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java (original)
+++ directory/apacheds/trunk/interceptors/authz/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java Mon Mar 12 18:29:48 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.core.authz.support;
 
@@ -29,6 +29,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.SchemaObjectType;
 import org.apache.directory.shared.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer;
@@ -63,7 +64,7 @@ public class DummyAttributeTypeRegistry 
         MatchingRule equality = new MatchingRule( "1.1.1" );
         equality.setNormalizer( normalizer );
 
-        AttributeType attributeType = new AttributeType( id );
+        MutableAttributeType attributeType = new MutableAttributeType( id );
         attributeType.setEquality( equality );
         attributeType.setSingleValued( false );
         attributeType.setCollective( false );

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java Mon Mar 12 18:29:48 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.xdbm.search.impl;
 
@@ -53,6 +53,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.comparators.StringComparator;
 import org.apache.directory.shared.ldap.model.schema.parsers.SyntaxCheckerDescription;
@@ -690,7 +691,7 @@ public class GreaterEqTest
     public void testEvaluatorAttributeNoMatchingRule() throws Exception
     {
         LdapSyntax syntax = new BogusSyntax( 1 );
-        AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".2000" );
+        MutableAttributeType at = new MutableAttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".2000" );
         at.addName( "bogus" );
         at.setSchemaName( "other" );
         at.setSyntax( syntax );
@@ -719,7 +720,7 @@ public class GreaterEqTest
         mr.setSyntax( syntax );
         mr.setLdapComparator( new StringComparator( "1.1" ) );
 
-        AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".5000" );
+        MutableAttributeType at = new MutableAttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".5000" );
         at.addName( "bogus" );
         at.setSchemaName( "other" );
         at.setSyntax( syntax );

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java Mon Mar 12 18:29:48 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.xdbm.search.impl;
 
@@ -53,6 +53,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.comparators.StringComparator;
 import org.apache.directory.shared.ldap.model.schema.parsers.SyntaxCheckerDescription;
@@ -718,7 +719,7 @@ public class LessEqTest
     public void testEvaluatorAttributeNoMatchingRule() throws Exception
     {
         LdapSyntax syntax = new BogusSyntax( 1 );
-        AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".2000" );
+        MutableAttributeType at = new MutableAttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".2000" );
         at.addName( "bogus" );
         at.setSchemaName( "other" );
         at.setSyntax( syntax );
@@ -749,7 +750,7 @@ public class LessEqTest
         mr.setSyntax( syntax );
         mr.setLdapComparator( new StringComparator( "1.1" ) );
 
-        AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".3000" );
+        MutableAttributeType at = new MutableAttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".3000" );
         at.addName( "bogus" );
         at.setSchemaName( "other" );
         at.setSyntax( syntax );

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/TestEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/TestEntryUtils.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/TestEntryUtils.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/TestEntryUtils.java Mon Mar 12 18:29:48 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.shared.ldap.entry;
 
@@ -28,6 +28,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.LdapComparator;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator;
@@ -105,7 +106,7 @@ public class TestEntryUtils
     @SuppressWarnings("PMD.AvoidUsingHardCodedIP")
     static AttributeType getCaseIgnoringAttributeNoNumbersType()
     {
-        AttributeType attributeType = new AttributeType( "1.1.3.1" );
+        MutableAttributeType attributeType = new MutableAttributeType( "1.1.3.1" );
         LdapSyntax syntax = new LdapSyntax( "1.1.1.1", "", true );
 
         syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2.1" )
@@ -192,7 +193,7 @@ public class TestEntryUtils
 
     /* no protection*/static AttributeType getIA5StringAttributeType()
     {
-        AttributeType attributeType = new AttributeType( "1.1" );
+        MutableAttributeType attributeType = new MutableAttributeType( "1.1" );
         attributeType.addName( "1.1" );
         LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true );
 
@@ -228,7 +229,7 @@ public class TestEntryUtils
 
     /* No protection */static AttributeType getBytesAttributeType()
     {
-        AttributeType attributeType = new AttributeType( "1.2" );
+        MutableAttributeType attributeType = new MutableAttributeType( "1.2" );
         LdapSyntax syntax = new LdapSyntax( "1.2.1", "", true );
 
         syntax.setSyntaxChecker( new SyntaxChecker( "1.2.1" )

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java (original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java Mon Mar 12 18:29:48 2012
@@ -137,6 +137,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.ObjectClass;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.parsers.OpenLdapSchemaParser;
@@ -3291,7 +3292,7 @@ public class LdapNetworkConnection exten
             olsp.setQuirksMode( true );
             olsp.parse( schemaFile );
 
-            List<AttributeType> atList = olsp.getAttributeTypes();
+            List<MutableAttributeType> atList = olsp.getAttributeTypes();
             AttributeTypeRegistry atRegistry = schemaManager.getRegistries().getAttributeTypeRegistry();
 
             for ( AttributeType atType : atList )

Modified: directory/shared/trunk/ldap/model/src/main/antlr/schema.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/antlr/schema.g?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/antlr/schema.g (original)
+++ directory/shared/trunk/ldap/model/src/main/antlr/schema.g Mon Mar 12 18:29:48 2012
@@ -36,6 +36,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.parsers.NormalizerDescription;
 import org.apache.directory.shared.ldap.model.schema.parsers.ParserMonitor;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
+import org.apache.directory.shared.ldap.model.schema.ObjectClass;
 import org.apache.directory.shared.ldap.model.schema.MutableObjectClass;
 import org.apache.directory.shared.ldap.model.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.OpenLdapObjectIdentifierMacro;
@@ -244,7 +246,7 @@ options    {
 openLdapSchema returns [List<Object> list = new ArrayList<Object>()]
     {
         AttributeType attributeType = null;
-        MutableObjectClass objectClass = null;
+        ObjectClass objectClass = null;
         OpenLdapObjectIdentifierMacro oloid = null;
     }
     :
@@ -274,7 +276,7 @@ openLdapObjectIdentifier returns [OpenLd
     ;
     
 
-openLdapObjectClass returns [MutableObjectClass objectClass]
+openLdapObjectClass returns [ObjectClass objectClass]
     {
         matchedProduction( "openLdapObjectClass()" );
     }
@@ -387,13 +389,13 @@ objectClassDescription returns [MutableO
      * xstring = "X" HYPHEN 1*( ALPHA / HYPHEN / USCORE ) 
      * </pre>
     */
-attributeTypeDescription returns [AttributeType attributeType]
+attributeTypeDescription returns [MutableAttributeType attributeType]
     {
         matchedProduction( "attributeTypeDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
-    ( oid:STARTNUMERICOID { attributeType = new AttributeType(numericoid(oid.getText())); } )
+    ( oid:STARTNUMERICOID { attributeType = new MutableAttributeType(numericoid(oid.getText())); } )
     (
         ( name:NAME { et.track("NAME", name); attributeType.setNames(qdescrs(name.getText())); } )
         |

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java Mon Mar 12 18:29:48 2012
@@ -20,7 +20,6 @@
 package org.apache.directory.shared.ldap.model.schema;
 
 
-import org.apache.directory.shared.i18n.I18n;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -136,49 +135,49 @@ public class AttributeType extends Abstr
     private static final Logger LOG = LoggerFactory.getLogger( AttributeType.class );
 
     /** The syntax OID associated with this AttributeType */
-    private String syntaxOid;
+    protected String syntaxOid;
 
     /** The syntax associated with the syntaxID */
-    private LdapSyntax syntax;
+    protected LdapSyntax syntax;
 
     /** The equality OID associated with this AttributeType */
-    private String equalityOid;
+    protected String equalityOid;
 
     /** The equality MatchingRule associated with the equalityID */
-    private MatchingRule equality;
+    protected MatchingRule equality;
 
     /** The substring OID associated with this AttributeType */
-    private String substringOid;
+    protected String substringOid;
 
     /** The substring MatchingRule associated with the substringID */
-    private MatchingRule substring;
+    protected MatchingRule substring;
 
     /** The ordering OID associated with this AttributeType */
-    private String orderingOid;
+    protected String orderingOid;
 
     /** The ordering MatchingRule associated with the orderingID */
-    private MatchingRule ordering;
+    protected MatchingRule ordering;
 
     /** The superior AttributeType OID */
-    private String superiorOid;
+    protected String superiorOid;
 
     /** The superior AttributeType */
-    private AttributeType superior;
+    protected AttributeType superior;
 
     /** whether or not this type is single valued */
-    private boolean isSingleValued = false;
+    protected boolean isSingleValued = false;
 
     /** whether or not this type is a collective attribute */
-    private boolean isCollective = false;
+    protected boolean isCollective = false;
 
     /** whether or not this type can be modified by directory users */
-    private boolean canUserModify = true;
+    protected boolean canUserModify = true;
 
     /** the usage for this attributeType */
-    private UsageEnum usage = UsageEnum.USER_APPLICATIONS;
+    protected UsageEnum usage = UsageEnum.USER_APPLICATIONS;
 
     /** the length of this attribute in bytes */
-    private long syntaxLength = 0L;
+    protected long syntaxLength = 0L;
 
 
     /**
@@ -205,25 +204,6 @@ public class AttributeType extends Abstr
 
 
     /**
-     * Tells if this AttributeType is Single Valued or not
-     *
-     * @param singleValued True if the AttributeType is single-valued
-     */
-    public void setSingleValued( boolean singleValued )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.isSingleValued = singleValued;
-        }
-    }
-
-
-    /**
      * Gets whether or not this AttributeType can be modified by a user.
      *
      * @return true if users can modify it, false if only the directory can.
@@ -235,25 +215,6 @@ public class AttributeType extends Abstr
 
 
     /**
-     * Tells if this AttributeType can be modified by a user or not
-     *
-     * @param userModifiable The flag to set
-     */
-    public void setUserModifiable( boolean userModifiable )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.canUserModify = userModifiable;
-        }
-    }
-
-
-    /**
      * Gets whether or not this AttributeType is a collective attribute.
      *
      * @return true if the attribute is collective, false otherwise
@@ -265,41 +226,6 @@ public class AttributeType extends Abstr
 
 
     /**
-     * Updates the collective flag
-     *
-     * @param collective The new value to set
-     */
-    public void updateCollective( boolean collective )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        this.isCollective = collective;
-    }
-
-
-    /**
-     * Sets the collective flag
-     *
-     * @param collective The new value to set
-     */
-    public void setCollective( boolean collective )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.isCollective = collective;
-        }
-    }
-
-
-    /**
      * Determines the usage for this AttributeType.
      *
      * @return a type safe UsageEnum
@@ -311,55 +237,6 @@ public class AttributeType extends Abstr
 
 
     /**
-     * Sets the AttributeType usage, one of :
-     * <ul>
-     *   <li>USER_APPLICATIONS</li>
-     *   <li>DIRECTORY_OPERATION</li>
-     *   <li>DISTRIBUTED_OPERATION</li>
-     *   <li>DSA_OPERATION</li>
-     * </ul>
-     * 
-     * @see UsageEnum
-     * @param usage The AttributeType usage
-     */
-    public void setUsage( UsageEnum usage )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.usage = usage;
-        }
-    }
-
-
-    /**
-     * Updates the AttributeType usage, one of :
-     * <ul>
-     *   <li>USER_APPLICATIONS</li>
-     *   <li>DIRECTORY_OPERATION</li>
-     *   <li>DISTRIBUTED_OPERATION</li>
-     *   <li>DSA_OPERATION</li>
-     * </ul>
-     * 
-     * @see UsageEnum
-     * @param newUsage The AttributeType usage
-     */
-    public void updateUsage( UsageEnum newUsage )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        this.usage = newUsage;
-    }
-
-
-    /**
      * Gets a length limit for this AttributeType.
      *
      * @return the length of the attribute
@@ -371,26 +248,6 @@ public class AttributeType extends Abstr
 
 
     /**
-     * Sets the length limit of this AttributeType based on its associated
-     * syntax.
-     *
-     * @param length the new length to set
-     */
-    public void setSyntaxLength( long length )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.syntaxLength = length;
-        }
-    }
-
-
-    /**
      * Gets the the superior AttributeType of this AttributeType.
      *
      * @return the superior AttributeType for this AttributeType
@@ -431,81 +288,6 @@ public class AttributeType extends Abstr
 
 
     /**
-     * Sets the superior AttributeType OID of this AttributeType
-     *
-     * @param superiorOid The superior AttributeType OID of this AttributeType
-     */
-    public void setSuperiorOid( String superiorOid )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.superiorOid = superiorOid;
-        }
-    }
-
-
-    /**
-     * Sets the superior for this AttributeType
-     *
-     * @param superior The superior for this AttributeType
-     */
-    public void setSuperior( AttributeType superior )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.superior = superior;
-            this.superiorOid = superior.getOid();
-        }
-    }
-
-
-    /**
-     * Sets the superior oid for this AttributeType
-     *
-     * @param newSuperiorOid The superior oid for this AttributeType
-     */
-    public void setSuperior( String newSuperiorOid )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.superiorOid = newSuperiorOid;
-        }
-    }
-
-
-    /**
-     * Update the associated Superior AttributeType, even if the SchemaObject is readOnly
-     *
-     * @param newSuperior The superior for this AttributeType
-     */
-    public void updateSuperior( AttributeType newSuperior )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        this.superior = newSuperior;
-        this.superiorOid = newSuperior.getOid();
-    }
-
-
-    /**
      * Gets the Syntax for this AttributeType's values.
      *
      * @return the value syntax
@@ -546,62 +328,6 @@ public class AttributeType extends Abstr
 
 
     /**
-     * Sets the Syntax OID for this AttributeType
-     *
-     * @param syntaxOid The syntax OID for this AttributeType
-     */
-    public void setSyntaxOid( String syntaxOid )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.syntaxOid = syntaxOid;
-        }
-    }
-
-
-    /**
-     * Sets the Syntax for this AttributeType
-     *
-     * @param syntax The Syntax for this AttributeType
-     */
-    public void setSyntax( LdapSyntax syntax )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.syntax = syntax;
-            this.syntaxOid = syntax.getOid();
-        }
-    }
-
-
-    /**
-     * Update the associated Syntax, even if the SchemaObject is readOnly
-     *
-     * @param newSyntax The Syntax for this AttributeType
-     */
-    public void updateSyntax( LdapSyntax newSyntax )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        this.syntax = newSyntax;
-        this.syntaxOid = newSyntax.getOid();
-    }
-
-
-    /**
      * Gets the MatchingRule for this AttributeType used for equality matching.
      *
      * @return the equality matching rule
@@ -642,62 +368,6 @@ public class AttributeType extends Abstr
 
 
     /**
-     * Sets the Equality OID for this AttributeType
-     *
-     * @param equalityOid The Equality OID for this AttributeType
-     */
-    public void setEqualityOid( String equalityOid )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.equalityOid = equalityOid;
-        }
-    }
-
-
-    /**
-     * Sets the Equality MR for this AttributeType
-     *
-     * @param equality The Equality MR for this AttributeType
-     */
-    public void setEquality( MatchingRule equality )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.equality = equality;
-            this.equalityOid = equality.getOid();
-        }
-    }
-
-
-    /**
-     * Update the associated Equality MatchingRule, even if the SchemaObject is readOnly
-     *
-     * @param newEquality The Equality MR for this AttributeType
-     */
-    public void updateEquality( MatchingRule newEquality )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        this.equality = newEquality;
-        this.equalityOid = newEquality.getOid();
-    }
-
-
-    /**
      * Gets the MatchingRule for this AttributeType used for Ordering matching.
      *
      * @return the Ordering matching rule
@@ -738,62 +408,6 @@ public class AttributeType extends Abstr
 
 
     /**
-     * Sets the Ordering OID for this AttributeType
-     *
-     * @param orderingOid The Ordering OID for this AttributeType
-     */
-    public void setOrderingOid( String orderingOid )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.orderingOid = orderingOid;
-        }
-    }
-
-
-    /**
-     * Sets the Ordering MR for this AttributeType
-     *
-     * @param ordering The Ordering MR for this AttributeType
-     */
-    public void setOrdering( MatchingRule ordering )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.ordering = ordering;
-            this.orderingOid = ordering.getOid();
-        }
-    }
-
-
-    /**
-     * Update the associated Ordering MatchingRule, even if the SchemaObject is readOnly
-     *
-     * @param newOrdering The Ordering MR for this AttributeType
-     */
-    public void updateOrdering( MatchingRule newOrdering )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        this.ordering = newOrdering;
-        this.orderingOid = newOrdering.getOid();
-    }
-
-
-    /**
      * Gets the MatchingRule for this AttributeType used for Substr matching.
      *
      * @return the Substr matching rule
@@ -834,62 +448,6 @@ public class AttributeType extends Abstr
 
 
     /**
-     * Sets the Substr OID for this AttributeType
-     *
-     * @param substrOid The Substr OID for this AttributeType
-     */
-    public void setSubstringOid( String substrOid )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.substringOid = substrOid;
-        }
-    }
-
-
-    /**
-     * Sets the Substr MR for this AttributeType
-     *
-     * @param substring The Substr MR for this AttributeType
-     */
-    public void setSubstring( MatchingRule substring )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.substring = substring;
-            this.substringOid = substring.getOid();
-        }
-    }
-
-
-    /**
-     * Update the associated Substring MatchingRule, even if the SchemaObject is readOnly
-     *
-     * @param newSubstring The Substr MR for this AttributeType
-     */
-    public void updateSubstring( MatchingRule newSubstring )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        this.substring = newSubstring;
-        this.substringOid = newSubstring.getOid();
-    }
-
-
-    /**
      * Checks to see if this AttributeType is the ancestor of another
      * attributeType.
      *
@@ -964,7 +522,7 @@ public class AttributeType extends Abstr
      */
     public AttributeType copy()
     {
-        AttributeType copy = new AttributeType( oid );
+        MutableAttributeType copy = new MutableAttributeType( oid );
 
         // Copy the SchemaObject common data
         copy.copy( this );
@@ -1011,23 +569,6 @@ public class AttributeType extends Abstr
     /**
      * {@inheritDoc}
      */
-    public void clear()
-    {
-        // Clear the common elements
-        super.clear();
-
-        // Clear the references
-        equality = null;
-        ordering = null;
-        substring = null;
-        superior = null;
-        syntax = null;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public boolean equals( Object o )
     {
         if ( !super.equals( o ) )

Added: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableAttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableAttributeType.java?rev=1299774&view=auto
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableAttributeType.java (added)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableAttributeType.java Mon Mar 12 18:29:48 2012
@@ -0,0 +1,606 @@
+/*
+ *  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.shared.ldap.model.schema;
+
+
+import org.apache.directory.shared.i18n.I18n;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * An attributeType specification. attributeType specifications describe the
+ * nature of attributes within the directory. The attributeType specification's
+ * properties are accessible through this interface.
+ * <p>
+ * According to ldapbis [MODELS]:
+ * </p>
+ *
+ * <pre>
+ *  4.1.2. Attribute Types
+ *
+ *    Attribute Type definitions are written according to the ABNF:
+ *
+ *      AttributeTypeDescription = LPAREN WSP
+ *          numericoid                   ; object identifier
+ *          [ SP &quot;NAME&quot; SP qdescrs ]     ; short names (descriptors)
+ *          [ SP &quot;DESC&quot; SP qdstring ]    ; description
+ *          [ SP &quot;OBSOLETE&quot; ]            ; not active
+ *          [ SP &quot;SUP&quot; SP oid ]          ; supertype
+ *          [ SP &quot;EQUALITY&quot; SP oid ]     ; equality matching rule
+ *          [ SP &quot;ORDERING&quot; SP oid ]     ; ordering matching rule
+ *          [ SP &quot;SUBSTR&quot; SP oid ]       ; substrings matching rule
+ *          [ SP &quot;SYNTAX&quot; SP noidlen ]   ; value syntax
+ *          [ SP &quot;SINGLE-VALUE&quot; ]        ; single-value
+ *          [ SP &quot;COLLECTIVE&quot; ]          ; collective
+ *          [ SP &quot;NO-USER-MODIFICATION&quot; ]; not user modifiable
+ *          [ SP &quot;USAGE&quot; SP usage ]      ; usage
+ *          extensions WSP RPAREN        ; extensions
+ *
+ *      usage = &quot;userApplications&quot;     / ; user
+ *              &quot;directoryOperation&quot;   / ; directory operational
+ *              &quot;distributedOperation&quot; / ; DSA-shared operational
+ *              &quot;dSAOperation&quot;           ; DSA-specific operational
+ *
+ *    where:
+ *      [numericoid] is object identifier assigned to this attribute type;
+ *      NAME [qdescrs] are short names (descriptors) identifying this
+ *          attribute type;
+ *      DESC [qdstring] is a short descriptive string;
+ *      OBSOLETE indicates this attribute type is not active;
+ *      SUP oid specifies the direct supertype of this type;
+ *      EQUALITY, ORDERING, SUBSTRING provide the oid of the equality,
+ *          ordering, and substrings matching rules, respectively;
+ *      SYNTAX identifies value syntax by object identifier and may suggest
+ *          a minimum upper bound;
+ *      COLLECTIVE indicates this attribute type is collective [X.501];
+ *      NO-USER-MODIFICATION indicates this attribute type is not user
+ *          modifiable;
+ *      USAGE indicates the application of this attribute type; and
+ *      [extensions] describe extensions.
+ *
+ *    Each attribute type description must contain at least one of the SUP
+ *    or SYNTAX fields.
+ *
+ *    Usage of userApplications, the default, indicates that attributes of
+ *    this type represent user information.  That is, they are user
+ *    attributes.
+ *
+ *    COLLECTIVE requires usage userApplications.  Use of collective
+ *    attribute types in LDAP is not discussed in this technical
+ *    specification.
+ *
+ *    A usage of directoryOperation, distributedOperation, or dSAOperation
+ *    indicates that attributes of this type represent operational and/or
+ *    administrative information.  That is, they are operational attributes.
+ *
+ *    directoryOperation usage indicates that the attribute of this type is
+ *    a directory operational attribute.  distributedOperation usage
+ *    indicates that the attribute of this DSA-shared usage operational
+ *    attribute.  dSAOperation usage indicates that the attribute of this
+ *    type is a DSA-specific operational attribute.
+ *
+ *    NO-USER-MODIFICATION requires an operational usage.
+ *
+ *    Note that the [AttributeTypeDescription] does not list the matching
+ *    rules which can be used with that attribute type in an extensibleMatch
+ *    search filter.  This is done using the 'matchingRuleUse' attribute
+ *    described in Section 4.1.4.
+ *
+ *    This document refines the schema description of X.501 by requiring
+ *    that the SYNTAX field in an [AttributeTypeDescription] be a string
+ *    representation of an object identifier for the LDAP string syntax
+ *    definition with an optional indication of the suggested minimum bound
+ *    of a value of this attribute.
+ *
+ *    A suggested minimum upper bound on the number of characters in a value
+ *    with a string-based syntax, or the number of bytes in a value for all
+ *    other syntaxes, may be indicated by appending this bound count inside
+ *    of curly braces following the syntax's OBJECT IDENTIFIER in an
+ *
+ *    Attribute Type Description.  This bound is not part of the syntax name
+ *    itself.  For instance, &quot;1.3.6.4.1.1466.0{64}&quot; suggests that server
+ *    implementations should allow a string to be 64 characters long,
+ *    although they may allow longer strings.  Note that a single character
+ *    of the Directory String syntax may be encoded in more than one octet
+ *    since UTF-8 is a variable-length encoding.
+ * </pre>
+ *
+ * @see <a href="http://www.faqs.org/rfcs/rfc2252.html">RFC 2252 Section 4.2</a>
+ * @see <a
+ *      href="http://www.ietf.org/internet-drafts/draft-ietf-ldapbis-models-11.txt">
+ *      ldapbis [MODELS]</a>
+ * @see DescriptionUtils#getDescription(MutableAttributeType)
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class MutableAttributeType extends AttributeType
+{
+    /** A logger for this class */
+    private static final Logger LOG = LoggerFactory.getLogger( MutableAttributeType.class );
+
+
+    /**
+     * Creates a AttributeType object using a unique OID.
+     *
+     * @param oid the OID for this AttributeType
+     */
+    public MutableAttributeType( String oid )
+    {
+        super( oid );
+    }
+
+
+    /**
+     * Tells if this AttributeType is Single Valued or not
+     *
+     * @param singleValued True if the AttributeType is single-valued
+     */
+    public void setSingleValued( boolean singleValued )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.isSingleValued = singleValued;
+        }
+    }
+
+
+    /**
+     * Tells if this AttributeType can be modified by a user or not
+     *
+     * @param userModifiable The flag to set
+     */
+    public void setUserModifiable( boolean userModifiable )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.canUserModify = userModifiable;
+        }
+    }
+
+
+    /**
+     * Updates the collective flag
+     *
+     * @param collective The new value to set
+     */
+    public void updateCollective( boolean collective )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        this.isCollective = collective;
+    }
+
+
+    /**
+     * Sets the collective flag
+     *
+     * @param collective The new value to set
+     */
+    public void setCollective( boolean collective )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.isCollective = collective;
+        }
+    }
+
+
+    /**
+     * Sets the AttributeType usage, one of :
+     * <ul>
+     *   <li>USER_APPLICATIONS</li>
+     *   <li>DIRECTORY_OPERATION</li>
+     *   <li>DISTRIBUTED_OPERATION</li>
+     *   <li>DSA_OPERATION</li>
+     * </ul>
+     * 
+     * @see UsageEnum
+     * @param usage The AttributeType usage
+     */
+    public void setUsage( UsageEnum usage )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.usage = usage;
+        }
+    }
+
+
+    /**
+     * Updates the AttributeType usage, one of :
+     * <ul>
+     *   <li>USER_APPLICATIONS</li>
+     *   <li>DIRECTORY_OPERATION</li>
+     *   <li>DISTRIBUTED_OPERATION</li>
+     *   <li>DSA_OPERATION</li>
+     * </ul>
+     * 
+     * @see UsageEnum
+     * @param newUsage The AttributeType usage
+     */
+    public void updateUsage( UsageEnum newUsage )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        this.usage = newUsage;
+    }
+
+
+    /**
+     * Sets the length limit of this AttributeType based on its associated
+     * syntax.
+     *
+     * @param length the new length to set
+     */
+    public void setSyntaxLength( long length )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.syntaxLength = length;
+        }
+    }
+
+
+    /**
+     * Sets the superior AttributeType OID of this AttributeType
+     *
+     * @param superiorOid The superior AttributeType OID of this AttributeType
+     */
+    public void setSuperiorOid( String superiorOid )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.superiorOid = superiorOid;
+        }
+    }
+
+
+    /**
+     * Sets the superior for this AttributeType
+     *
+     * @param superior The superior for this AttributeType
+     */
+    public void setSuperior( MutableAttributeType superior )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.superior = superior;
+            this.superiorOid = superior.getOid();
+        }
+    }
+
+
+    /**
+     * Sets the superior oid for this AttributeType
+     *
+     * @param newSuperiorOid The superior oid for this AttributeType
+     */
+    public void setSuperior( String newSuperiorOid )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.superiorOid = newSuperiorOid;
+        }
+    }
+
+
+    /**
+     * Update the associated Superior AttributeType, even if the SchemaObject is readOnly
+     *
+     * @param newSuperior The superior for this AttributeType
+     */
+    public void updateSuperior( MutableAttributeType newSuperior )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        this.superior = newSuperior;
+        this.superiorOid = newSuperior.getOid();
+    }
+
+
+    /**
+     * Sets the Syntax OID for this AttributeType
+     *
+     * @param syntaxOid The syntax OID for this AttributeType
+     */
+    public void setSyntaxOid( String syntaxOid )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.syntaxOid = syntaxOid;
+        }
+    }
+
+
+    /**
+     * Sets the Syntax for this AttributeType
+     *
+     * @param syntax The Syntax for this AttributeType
+     */
+    public void setSyntax( LdapSyntax syntax )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.syntax = syntax;
+            this.syntaxOid = syntax.getOid();
+        }
+    }
+
+
+    /**
+     * Update the associated Syntax, even if the SchemaObject is readOnly
+     *
+     * @param newSyntax The Syntax for this AttributeType
+     */
+    public void updateSyntax( LdapSyntax newSyntax )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        this.syntax = newSyntax;
+        this.syntaxOid = newSyntax.getOid();
+    }
+
+
+    /**
+     * Sets the Equality OID for this AttributeType
+     *
+     * @param equalityOid The Equality OID for this AttributeType
+     */
+    public void setEqualityOid( String equalityOid )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.equalityOid = equalityOid;
+        }
+    }
+
+
+    /**
+     * Sets the Equality MR for this AttributeType
+     *
+     * @param equality The Equality MR for this AttributeType
+     */
+    public void setEquality( MatchingRule equality )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.equality = equality;
+            this.equalityOid = equality.getOid();
+        }
+    }
+
+
+    /**
+     * Update the associated Equality MatchingRule, even if the SchemaObject is readOnly
+     *
+     * @param newEquality The Equality MR for this AttributeType
+     */
+    public void updateEquality( MatchingRule newEquality )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        this.equality = newEquality;
+        this.equalityOid = newEquality.getOid();
+    }
+
+
+    /**
+     * Sets the Ordering OID for this AttributeType
+     *
+     * @param orderingOid The Ordering OID for this AttributeType
+     */
+    public void setOrderingOid( String orderingOid )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.orderingOid = orderingOid;
+        }
+    }
+
+
+    /**
+     * Sets the Ordering MR for this AttributeType
+     *
+     * @param ordering The Ordering MR for this AttributeType
+     */
+    public void setOrdering( MatchingRule ordering )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.ordering = ordering;
+            this.orderingOid = ordering.getOid();
+        }
+    }
+
+
+    /**
+     * Update the associated Ordering MatchingRule, even if the SchemaObject is readOnly
+     *
+     * @param newOrdering The Ordering MR for this AttributeType
+     */
+    public void updateOrdering( MatchingRule newOrdering )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        this.ordering = newOrdering;
+        this.orderingOid = newOrdering.getOid();
+    }
+
+
+    /**
+     * Sets the Substr OID for this AttributeType
+     *
+     * @param substrOid The Substr OID for this AttributeType
+     */
+    public void setSubstringOid( String substrOid )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.substringOid = substrOid;
+        }
+    }
+
+
+    /**
+     * Sets the Substr MR for this AttributeType
+     *
+     * @param substring The Substr MR for this AttributeType
+     */
+    public void setSubstring( MatchingRule substring )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        if ( !isReadOnly )
+        {
+            this.substring = substring;
+            this.substringOid = substring.getOid();
+        }
+    }
+
+
+    /**
+     * Update the associated Substring MatchingRule, even if the SchemaObject is readOnly
+     *
+     * @param newSubstring The Substr MR for this AttributeType
+     */
+    public void updateSubstring( MatchingRule newSubstring )
+    {
+        if ( locked )
+        {
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+        }
+
+        this.substring = newSubstring;
+        this.substringOid = newSubstring.getOid();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void clear()
+    {
+        // Clear the common elements
+        super.clear();
+
+        // Clear the references
+        equality = null;
+        ordering = null;
+        substring = null;
+        superior = null;
+        syntax = null;
+    }
+}

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/OpenLdapSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/OpenLdapSchemaParser.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/OpenLdapSchemaParser.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/OpenLdapSchemaParser.java Mon Mar 12 18:29:48 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.shared.ldap.model.schema.parsers;
 
@@ -34,6 +34,7 @@ import java.util.Map;
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.ObjectClass;
 import org.apache.directory.shared.ldap.model.schema.SchemaObject;
 import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.OpenLdapObjectIdentifierMacro;
@@ -54,7 +55,7 @@ public class OpenLdapSchemaParser extend
     private List<Object> schemaDescriptions;
 
     /** The list of attribute type, initialized by splitParsedSchemaDescriptions() */
-    private List<AttributeType> attributeTypes;
+    private List<MutableAttributeType> attributeTypes;
 
     /** The list of object classes, initialized by splitParsedSchemaDescriptions()*/
     private List<ObjectClass> objectClasses;
@@ -79,7 +80,7 @@ public class OpenLdapSchemaParser extend
 
 
     /**
-     * Reset the parser 
+     * Reset the parser
      */
     public void clear()
     {
@@ -91,7 +92,7 @@ public class OpenLdapSchemaParser extend
      * 
      * @return the attribute types
      */
-    public List<AttributeType> getAttributeTypes()
+    public List<MutableAttributeType> getAttributeTypes()
     {
         return attributeTypes;
     }
@@ -128,7 +129,7 @@ public class OpenLdapSchemaParser extend
     private void afterParse() throws ParseException
     {
         objectClasses = new ArrayList<ObjectClass>();
-        attributeTypes = new ArrayList<AttributeType>();
+        attributeTypes = new ArrayList<MutableAttributeType>();
         objectIdentifierMacros = new HashMap<String, OpenLdapObjectIdentifierMacro>();
 
         // split parsed schema descriptions
@@ -141,7 +142,7 @@ public class OpenLdapSchemaParser extend
             }
             else if ( obj instanceof AttributeType )
             {
-                AttributeType attributeType = ( AttributeType ) obj;
+                MutableAttributeType attributeType = ( MutableAttributeType ) obj;
 
                 attributeTypes.add( attributeType );
             }
@@ -168,7 +169,7 @@ public class OpenLdapSchemaParser extend
             }
 
             // apply object identifier macros to attribute types
-            for ( AttributeType attributeType : attributeTypes )
+            for ( MutableAttributeType attributeType : attributeTypes )
             {
                 attributeType.setOid( getResolveOid( attributeType.getOid() ) );
                 attributeType.setSyntaxOid( getResolveOid( attributeType.getSyntaxOid() ) );
@@ -221,7 +222,7 @@ public class OpenLdapSchemaParser extend
         }
         else
         {
-            // no :suffix, 
+            // no :suffix,
             if ( objectIdentifierMacros.containsKey( rawOidOrNameSuffix ) )
             {
                 OpenLdapObjectIdentifierMacro parentMacro = objectIdentifierMacros.get( rawOidOrNameSuffix );

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java Mon Mar 12 18:29:48 2012
@@ -45,6 +45,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.LoadableSchemaObject;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.MatchingRuleUse;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.NameForm;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.ObjectClass;
@@ -670,7 +671,7 @@ public class Registries implements Schem
             switch ( schemaObject.getObjectType() )
             {
                 case ATTRIBUTE_TYPE :
-                    AttributeTypeHelper.addToRegistries( (AttributeType)schemaObject, errors, this );
+                    AttributeTypeHelper.addToRegistries( (MutableAttributeType)schemaObject, errors, this );
                     break;
                     
                 case DIT_CONTENT_RULE :

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/helper/AttributeTypeHelper.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/helper/AttributeTypeHelper.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/helper/AttributeTypeHelper.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/helper/AttributeTypeHelper.java Mon Mar 12 18:29:48 2012
@@ -30,6 +30,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.UsageEnum;
 import org.apache.directory.shared.ldap.model.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.model.schema.registries.Registries;
@@ -59,7 +60,7 @@ public class AttributeTypeHelper
      * @param registries The Registries
      * @exception If the AttributeType is not valid
      */
-    public static void addToRegistries( AttributeType attributeType, List<Throwable> errors, Registries registries ) throws LdapException
+    public static void addToRegistries( MutableAttributeType attributeType, List<Throwable> errors, Registries registries ) throws LdapException
     {
         if ( registries != null )
         {
@@ -141,9 +142,9 @@ public class AttributeTypeHelper
     /**
      * Build the Superior AttributeType reference for an AttributeType
      */
-    private static boolean buildSuperior( AttributeType attributeType, List<Throwable> errors, Registries registries )
+    private static boolean buildSuperior( MutableAttributeType attributeType, List<Throwable> errors, Registries registries )
     {
-        AttributeType currentSuperior = null;
+        MutableAttributeType currentSuperior = null;
         AttributeTypeRegistry attributeTypeRegistry = registries.getAttributeTypeRegistry();
         
         String superiorOid = attributeType.getSuperiorOid();
@@ -153,7 +154,7 @@ public class AttributeTypeHelper
             // This AT has a superior
             try
             {
-                currentSuperior = attributeTypeRegistry.lookup( superiorOid );
+                currentSuperior = (MutableAttributeType)attributeTypeRegistry.lookup( superiorOid );
             }
             catch ( Exception e )
             {
@@ -272,7 +273,7 @@ public class AttributeTypeHelper
     /**
      * Build the SYNTAX reference for an AttributeType
      */
-    private static void buildSyntax( AttributeType attributeType, List<Throwable> errors, Registries registries )
+    private static void buildSyntax( MutableAttributeType attributeType, List<Throwable> errors, Registries registries )
     {
         String syntaxOid = attributeType.getSyntaxOid();
         
@@ -346,7 +347,7 @@ public class AttributeTypeHelper
     /**
      * Build the EQUALITY MR reference for an AttributeType
      */
-    private static void buildEquality( AttributeType attributeType, List<Throwable> errors, Registries registries )
+    private static void buildEquality( MutableAttributeType attributeType, List<Throwable> errors, Registries registries )
     {
         String equalityOid = attributeType.getEqualityOid();
         
@@ -410,7 +411,7 @@ public class AttributeTypeHelper
     /**
      * Build the SUBSTR MR reference for an AttributeType
      */
-    private static void buildSubstring( AttributeType attributeType, List<Throwable> errors, Registries registries )
+    private static void buildSubstring( MutableAttributeType attributeType, List<Throwable> errors, Registries registries )
     {
         String substringOid = attributeType.getSubstringOid();
         
@@ -477,7 +478,7 @@ public class AttributeTypeHelper
     /**
      * Build the ORDERING MR reference for an AttributeType
      */
-    private static void buildOrdering( AttributeType attributeType, List<Throwable> errors, Registries registries )
+    private static void buildOrdering( MutableAttributeType attributeType, List<Throwable> errors, Registries registries )
     {
         String orderingOid = attributeType.getOrderingOid();
         
@@ -574,7 +575,7 @@ public class AttributeTypeHelper
     /**
      * Check the constraints for the Collective field.
      */
-    private static void checkCollective( AttributeType attributeType, List<Throwable> errors )
+    private static void checkCollective( MutableAttributeType attributeType, List<Throwable> errors )
     {
         AttributeType superior = attributeType.getSuperior();
 

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java Mon Mar 12 18:29:48 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.shared.ldap.model.entry;
 
@@ -39,6 +39,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator;
 import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker;
@@ -69,7 +70,7 @@ import com.mycila.junit.concurrent.Concu
 public class BinaryValueAttributeTypeTest
 {
     private LdapSyntax s;
-    private AttributeType at;
+    private MutableAttributeType at;
     private MatchingRule mr;
 
     private static final byte[] BYTES1 = new byte[]
@@ -79,7 +80,7 @@ public class BinaryValueAttributeTypeTes
 
 
     /**
-     * Initialize an AttributeType and the associated MatchingRule 
+     * Initialize an AttributeType and the associated MatchingRule
      * and Syntax
      */
     @Before
@@ -120,7 +121,7 @@ public class BinaryValueAttributeTypeTes
             }
         } );
 
-        at = new AttributeType( "1.1.3.1" );
+        at = new MutableAttributeType( "1.1.3.1" );
         at.setEquality( mr );
         at.setOrdering( mr );
         at.setSubstring( mr );
@@ -211,7 +212,7 @@ public class BinaryValueAttributeTypeTes
     public void testBadConstructor()
     {
         // create a AT without no syntax
-        AttributeType attribute = new AttributeType( "1.1.3.1" );
+        MutableAttributeType attribute = new MutableAttributeType( "1.1.3.1" );
 
         try
         {

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueTest.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueTest.java Mon Mar 12 18:29:48 2012
@@ -37,6 +37,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator;
@@ -70,12 +71,12 @@ public class BinaryValueTest
     private static final byte[] BYTES_MOD = new byte[]
         { 0x11, 0x02, 0x03, 0x04 };
     private LdapSyntax s;
-    private AttributeType at;
+    private MutableAttributeType at;
     private MatchingRule mr;
 
 
     /**
-     * Initialize an AttributeType and the associated MatchingRule 
+     * Initialize an AttributeType and the associated MatchingRule
      * and Syntax
      */
     @Before
@@ -116,7 +117,7 @@ public class BinaryValueTest
             }
         } );
 
-        at = new AttributeType( "1.1.3.1" );
+        at = new MutableAttributeType( "1.1.3.1" );
         at.setEquality( mr );
         at.setOrdering( mr );
         at.setSubstring( mr );

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java Mon Mar 12 18:29:48 2012
@@ -26,6 +26,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.LdapComparator;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator;
@@ -43,7 +44,7 @@ public class EntryUtils
     /**
      * A local Syntax class for tests
      */
-    static class AT extends AttributeType
+    static class AT extends MutableAttributeType
     {
         private static final long serialVersionUID = 0L;
 
@@ -98,7 +99,7 @@ public class EntryUtils
 
     /* no protection*/static AttributeType getCaseIgnoringAttributeNoNumbersType()
     {
-        AttributeType attributeType = new AttributeType( "1.1.3.1" );
+        MutableAttributeType attributeType = new MutableAttributeType( "1.1.3.1" );
         LdapSyntax syntax = new LdapSyntax( "1.1.1.1", "", true );
 
         syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2.1" )
@@ -171,7 +172,7 @@ public class EntryUtils
 
     /* no protection*/static AttributeType getIA5StringAttributeType()
     {
-        AttributeType attributeType = new AttributeType( "1.1" );
+        MutableAttributeType attributeType = new MutableAttributeType( "1.1" );
         attributeType.addName( "1.1" );
         LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true );
 
@@ -207,7 +208,7 @@ public class EntryUtils
 
     /* No protection */static AttributeType getBytesAttributeType()
     {
-        AttributeType attributeType = new AttributeType( "1.2" );
+        MutableAttributeType attributeType = new MutableAttributeType( "1.2" );
         LdapSyntax syntax = new LdapSyntax( "1.2.1", "", false );
 
         syntax.setSyntaxChecker( new SyntaxChecker( "1.2.1" )

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/SchemaUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/SchemaUtilsTest.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/SchemaUtilsTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/SchemaUtilsTest.java Mon Mar 12 18:29:48 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.shared.ldap.model.schema;
 
@@ -80,9 +80,9 @@ public class SchemaUtilsTest
 
     public AttributeType[] getAttributeTypes()
     {
-        AttributeType[] ats = new AttributeType[5];
+        MutableAttributeType[] ats = new MutableAttributeType[5];
 
-        ats[0] = new AttributeType( "2.5.4.41" );
+        ats[0] = new MutableAttributeType( "2.5.4.41" );
         ats[0].addName( "name" );
         ats[0].setSyntax( getSyntaxes()[1] );
         ats[0].setSyntaxLength( 32768 );
@@ -90,24 +90,24 @@ public class SchemaUtilsTest
         ats[0].setSubstring( getMatchingRules()[1] );
 
         // ( 2.5.4.3 NAME 'cn' SUP name )
-        ats[1] = new AttributeType( "2.5.4.3" );
+        ats[1] = new MutableAttributeType( "2.5.4.3" );
         ats[1].addName( "cn", "commonName" );
 
-        ats[2] = new AttributeType( "2.5.4.41" );
+        ats[2] = new MutableAttributeType( "2.5.4.41" );
         ats[2].addName( "name" );
         ats[2].setSyntax( getSyntaxes()[1] );
         ats[2].setSyntaxLength( 32768 );
         ats[2].setEquality( getMatchingRules()[0] );
         ats[2].setSubstring( getMatchingRules()[1] );
 
-        ats[3] = new AttributeType( "2.5.4.41" );
+        ats[3] = new MutableAttributeType( "2.5.4.41" );
         ats[3].addName( "name" );
         ats[3].setSyntax( getSyntaxes()[1] );
         ats[3].setSyntaxLength( 32768 );
         ats[3].setEquality( getMatchingRules()[0] );
         ats[3].setSubstring( getMatchingRules()[1] );
 
-        ats[4] = new AttributeType( "2.5.4.41" );
+        ats[4] = new MutableAttributeType( "2.5.4.41" );
         ats[4].addName( "name" );
         ats[4].setSyntax( getSyntaxes()[1] );
         ats[4].setSyntaxLength( 32768 );

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/parsers/OpenLdapSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/parsers/OpenLdapSchemaParserTest.java?rev=1299774&r1=1299773&r2=1299774&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/parsers/OpenLdapSchemaParserTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/parsers/OpenLdapSchemaParserTest.java Mon Mar 12 18:29:48 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.shared.ldap.model.schema.parsers;
 
@@ -33,6 +33,7 @@ import java.util.Map;
 import com.mycila.junit.concurrent.Concurrency;
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
+import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
 import org.apache.directory.shared.ldap.model.schema.ObjectClass;
 import org.apache.directory.shared.ldap.model.schema.ObjectClassTypeEnum;
 import org.apache.directory.shared.ldap.model.schema.parsers.ConsoleParserMonitor;
@@ -79,7 +80,7 @@ public class OpenLdapSchemaParserTest
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.25 )";
 
         parser.parse( attributeTypeData );
-        List<AttributeType> attributeTypes = parser.getAttributeTypes();
+        List<MutableAttributeType> attributeTypes = parser.getAttributeTypes();
         Map<String, AttributeType> mapAttributeTypes = mapAttributeTypes( attributeTypes );
         AttributeType attributeType = mapAttributeTypes.get( "2.5.4.14" );
 
@@ -91,7 +92,7 @@ public class OpenLdapSchemaParserTest
     }
 
 
-    private Map<String, AttributeType> mapAttributeTypes( List<AttributeType> attributeTypes )
+    private Map<String, AttributeType> mapAttributeTypes( List<MutableAttributeType> attributeTypes )
     {
         Map<String, AttributeType> m = new HashMap<String, AttributeType>();
 
@@ -113,7 +114,7 @@ public class OpenLdapSchemaParserTest
             + "        EQUALITY caseIgnoreMatch\n"
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )";
         parser.parse( attributeTypeData );
-        List<AttributeType> attributeTypeList = parser.getAttributeTypes();
+        List<MutableAttributeType> attributeTypeList = parser.getAttributeTypes();
         Map<String, AttributeType> attributeTypes = mapAttributeTypes( attributeTypeList );
         AttributeType type = attributeTypes.get( "2.5.4.2" );
 
@@ -135,7 +136,7 @@ public class OpenLdapSchemaParserTest
             + "        EQUALITY caseIgnoreMatch\n"
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )";
         parser.parse( attributeTypeData );
-        List<AttributeType> attributeTypeList = parser.getAttributeTypes();
+        List<MutableAttributeType> attributeTypeList = parser.getAttributeTypes();
         Map<String, AttributeType> attributeTypes = mapAttributeTypes( attributeTypeList );
         AttributeType type = attributeTypes.get( "2.5.4.2" );
 
@@ -161,7 +162,7 @@ public class OpenLdapSchemaParserTest
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )";
 
         parser.parse( attributeTypeData );
-        List<AttributeType> attributeTypeList = parser.getAttributeTypes();
+        List<MutableAttributeType> attributeTypeList = parser.getAttributeTypes();
         Map<String, AttributeType> attributeTypes = mapAttributeTypes( attributeTypeList );
         AttributeType type = attributeTypes.get( "2.5.4.2" );
 
@@ -183,7 +184,7 @@ public class OpenLdapSchemaParserTest
             + "        EQUALITY caseIgnoreMatch\n"
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )";
         parser.parse( attributeTypeData );
-        List<AttributeType> attributeTypeList = parser.getAttributeTypes();
+        List<MutableAttributeType> attributeTypeList = parser.getAttributeTypes();
         Map<String, AttributeType> attributeTypes = mapAttributeTypes( attributeTypeList );
         AttributeType type = attributeTypes.get( "2.5.4.2" );
 
@@ -331,7 +332,7 @@ public class OpenLdapSchemaParserTest
         InputStream input = getClass().getResourceAsStream( "core.schema" );
         parser.parse( input );
 
-        List<AttributeType> attributeTypes = parser.getAttributeTypes();
+        List<MutableAttributeType> attributeTypes = parser.getAttributeTypes();
         List<ObjectClass> objectClassTypes = parser.getObjectClassTypes();
         Map<String, OpenLdapObjectIdentifierMacro> objectIdentifierMacros = parser.getObjectIdentifierMacros();
 
@@ -347,7 +348,7 @@ public class OpenLdapSchemaParserTest
         InputStream input = getClass().getResourceAsStream( "inetorgperson.schema" );
         parser.parse( input );
 
-        List<AttributeType> attributeTypes = parser.getAttributeTypes();
+        List<MutableAttributeType> attributeTypes = parser.getAttributeTypes();
         List<ObjectClass> objectClassTypes = parser.getObjectClassTypes();
         Map<String, OpenLdapObjectIdentifierMacro> objectIdentifierMacros = parser.getObjectIdentifierMacros();
 
@@ -363,7 +364,7 @@ public class OpenLdapSchemaParserTest
         InputStream input = getClass().getResourceAsStream( "collective.schema" );
         parser.parse( input );
 
-        List<AttributeType> attributeTypes = parser.getAttributeTypes();
+        List<MutableAttributeType> attributeTypes = parser.getAttributeTypes();
         List<ObjectClass> objectClassTypes = parser.getObjectClassTypes();
         Map<String, OpenLdapObjectIdentifierMacro> objectIdentifierMacros = parser.getObjectIdentifierMacros();
 
@@ -383,7 +384,7 @@ public class OpenLdapSchemaParserTest
         InputStream input = getClass().getResourceAsStream( "dyngroup.schema" );
         parser.parse( input );
 
-        List<AttributeType> attributeTypes = parser.getAttributeTypes();
+        List<MutableAttributeType> attributeTypes = parser.getAttributeTypes();
         List<ObjectClass> objectClassTypes = parser.getObjectClassTypes();
         Map<String, OpenLdapObjectIdentifierMacro> objectIdentifierMacros = parser.getObjectIdentifierMacros();
 
@@ -445,7 +446,7 @@ public class OpenLdapSchemaParserTest
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE)";
 
         parser.parse( attributeTypeData );
-        List<AttributeType> attributeTypes = parser.getAttributeTypes();
+        List<MutableAttributeType> attributeTypes = parser.getAttributeTypes();
         Map<String, AttributeType> mapAttributeTypes = mapAttributeTypes( attributeTypes );
         AttributeType attributeType = mapAttributeTypes.get( "1.3.6.1.4.1.8104.1.1.37" );
 



Mime
View raw message