directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1080949 [1/2] - in /directory: apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/entry/ apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/ apacheds/branches/akarasu...
Date Sat, 12 Mar 2011 17:19:18 GMT
Author: akarasulu
Date: Sat Mar 12 17:19:15 2011
New Revision: 1080949

URL: http://svn.apache.org/viewvc?rev=1080949&view=rev
Log:
refactored ldap syntax: extracted mutable and immutable interfaces

Added:
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntax.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntaxImpl.java
      - copied, changed from r1080939, directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java
Modified:
    directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
    directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
    directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java
    directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java
    directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java
    directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
    directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/AttributesFactory.java
    directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
    directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
    directory/apacheds/branches/akarasulu/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
    directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java
    directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
    directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DescriptionUtils.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/EntityFactory.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaManager.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/ParserDescriptionUtils.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultLdapSyntaxRegistry.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/ImmutableLdapSyntaxRegistry.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/LdapSyntaxRegistry.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/RegistryUtils.java
    directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java
    directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/SchemaUtilsTest.java
    directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/LdapSyntaxDescriptionSchemaParserTest.java
    directory/shared/branches/akarasulu/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemaloader/SchemaEntityFactory.java
    directory/shared/branches/akarasulu/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
    directory/shared/branches/akarasulu/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerAddTest.java
    directory/shared/branches/akarasulu/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerDelTest.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/BinaryAttributesAndSyntaxesPreferencePage.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/preferences/ValueEditorsPreferencePage.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSchemaBrowserAction.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionDetailsPage.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionDetailsPage.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionPage.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/MatchingRuleDescriptionDetailsPage.java
    directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaBrowserNavigationLocation.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/SchemaHandler.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/DependenciesComputer.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/Schema.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/GenericSchemaConnector.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/XMLSchemaFileExporter.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/XMLSchemaFileImporter.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/schemamanager/SchemaEditorSchemaLoader.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/schemamanager/SchemaEditorSchemaLoaderUtils.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboComparator.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboContentProvider.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboLabelProvider.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
    directory/studio/branches/akarasulu/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java

Modified: directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java (original)
+++ directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java Sat Mar 12 17:19:15 2011
@@ -26,6 +26,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 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.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.MutableSyntaxCheckerImpl;
@@ -78,13 +79,13 @@ public class TestServerEntryUtils
      */
     public static LdapSyntax syntaxFactory( String oid, boolean humanReadable )
     {
-        LdapSyntax ldapSyntax = new LdapSyntax( oid );
+        MutableLdapSyntaxImpl ldapSyntax = new MutableLdapSyntaxImpl( oid );
         
         ldapSyntax.setHumanReadable( humanReadable );
         
         return ldapSyntax;
     }
-    static class S extends LdapSyntax
+    static class S extends MutableLdapSyntaxImpl
     {
         private static final long serialVersionUID = 0L;
 
@@ -98,7 +99,7 @@ public class TestServerEntryUtils
     static AttributeType getCaseIgnoringAttributeNoNumbersType()
     {
         AttributeType attributeType = new AttributeType( "1.1.3.1" );
-        LdapSyntax syntax = new LdapSyntax( "1.1.1.1", "", true );
+        MutableLdapSyntaxImpl syntax = new MutableLdapSyntaxImpl( "1.1.1.1", "", true );
 
         syntax.setSyntaxChecker( new MutableSyntaxCheckerImpl( "1.1.2.1" )
         {
@@ -197,7 +198,7 @@ public class TestServerEntryUtils
     {
         AttributeType attributeType = new AttributeType( "1.1" );
         attributeType.addName( "1.1" );
-        LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true );
+        MutableLdapSyntaxImpl syntax = new MutableLdapSyntaxImpl( "1.1.1", "", true );
 
         syntax.setSyntaxChecker( new MutableSyntaxCheckerImpl( "1.1.2" )
         {
@@ -242,7 +243,7 @@ public class TestServerEntryUtils
     /* No protection */ static AttributeType getBytesAttributeType()
     {
         AttributeType attributeType = new AttributeType( "1.2" );
-        LdapSyntax syntax = new LdapSyntax( "1.2.1", "", true );
+        MutableLdapSyntaxImpl syntax = new MutableLdapSyntaxImpl( "1.2.1", "", true );
 
         syntax.setSyntaxChecker( new MutableSyntaxCheckerImpl( "1.2.1" )
         {

Modified: directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java (original)
+++ directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java Sat Mar 12 17:19:15 2011
@@ -35,7 +35,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.DITContentRule;
 import org.apache.directory.shared.ldap.model.schema.DITStructureRule;
-import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
 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.NameForm;
@@ -70,7 +70,7 @@ public class DescriptionParsers
     private static final LdapComparatorDescription[] EMPTY_COMPARATORS         = new LdapComparatorDescription[0];
     private static final NormalizerDescription[]     EMPTY_NORMALIZERS         = new NormalizerDescription[0];
     private static final SyntaxCheckerDescription[]  EMPTY_SYNTAX_CHECKERS     = new SyntaxCheckerDescription[0];
-    private static final LdapSyntax[]                EMPTY_SYNTAXES            = new LdapSyntax[0];
+    private static final MutableLdapSyntaxImpl[]                EMPTY_SYNTAXES            = new MutableLdapSyntaxImpl[0];
     private static final MatchingRule[]              EMPTY_MATCHING_RULES      = new MatchingRule[0];
     private static final AttributeType[]             EMPTY_ATTRIBUTE_TYPES     = new AttributeType[0];
     private static final ObjectClass[]               EMPTY_OBJECT_CLASSES      = new ObjectClass[0];
@@ -422,20 +422,20 @@ public class DescriptionParsers
      * @return the set of Syntax objects for the descriptions 
      * @throws org.apache.directory.shared.ldap.model.exception.LdapException if there are problems parsing the descriptions
      */
-    public LdapSyntax[] parseLdapSyntaxes( EntryAttribute attr ) throws LdapException
+    public MutableLdapSyntaxImpl[] parseLdapSyntaxes( EntryAttribute attr ) throws LdapException
     {
         if ( attr == null || attr.size() == 0 )
         {
             return EMPTY_SYNTAXES;
         }
 
-        LdapSyntax[] syntaxes = new LdapSyntax[attr.size()];
+        MutableLdapSyntaxImpl[] syntaxes = new MutableLdapSyntaxImpl[attr.size()];
 
         int pos = 0;
 
         for ( Value<?> value : attr )
         {
-            LdapSyntax ldapSyntax = null;
+            MutableLdapSyntaxImpl ldapSyntax = null;
 
             try
             {
@@ -648,7 +648,7 @@ public class DescriptionParsers
      * @param desc the ldapSyntax 
      * @return true if the syntax is human readable, false otherwise
      */
-    private boolean isHumanReadable( LdapSyntax ldapSyntax )
+    private boolean isHumanReadable( MutableLdapSyntaxImpl ldapSyntax )
     {
         List<String> values = ldapSyntax.getExtensions().get( MetaSchemaConstants.X_IS_HUMAN_READABLE );
 

Modified: directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java (original)
+++ directory/apacheds/branches/akarasulu/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java Sat Mar 12 17:19:15 2011
@@ -35,7 +35,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.LdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.MutableSchemaObject;
@@ -79,7 +79,7 @@ public class SyntaxSynchronizer extends 
         Dn name = modifyContext.getDn();
         Entry entry = modifyContext.getEntry();
         String oid = getOid( entry );
-        LdapSyntax syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
+        MutableLdapSyntaxImpl syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
             getSchemaName( name ) );
         String schemaName = getSchemaName( entry.getDn() );
 
@@ -112,7 +112,7 @@ public class SyntaxSynchronizer extends 
         // Build the new Syntax from the given entry
         String schemaName = getSchemaName( dn );
 
-        LdapSyntax syntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(), schemaName );
+        MutableLdapSyntaxImpl syntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(), schemaName );
 
         // At this point, the constructed Syntax has not been checked against the 
         // existing Registries. It may be broken (missing SUP, or such), it will be checked
@@ -221,7 +221,7 @@ public class SyntaxSynchronizer extends 
         }
 
         // Test that the Oid exists
-        LdapSyntax syntax = ( LdapSyntax ) checkOidExists( entry );
+        MutableLdapSyntaxImpl syntax = ( MutableLdapSyntaxImpl ) checkOidExists( entry );
 
         List<Throwable> errors = new ArrayList<Throwable>();
 
@@ -269,7 +269,7 @@ public class SyntaxSynchronizer extends 
         checkOidIsUnique( newOid );
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        LdapSyntax syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
+        MutableLdapSyntaxImpl syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
             getSchemaName( entry.getDn() ) );
 
         if ( isSchemaEnabled( schemaName ) )
@@ -309,7 +309,7 @@ public class SyntaxSynchronizer extends 
         checkOidIsUnique( newOid );
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        LdapSyntax syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
+        MutableLdapSyntaxImpl syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
             getSchemaName( newParentName ) );
 
         if ( isSchemaEnabled( oldSchemaName ) )
@@ -353,7 +353,7 @@ public class SyntaxSynchronizer extends 
         //                ResultCodeEnum.UNWILLING_TO_PERFORM );
         //        }
 
-        LdapSyntax syntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(),
+        MutableLdapSyntaxImpl syntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(),
             getSchemaName( newParentName ) );
 
         if ( isSchemaEnabled( oldSchemaName ) )

Modified: directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java (original)
+++ directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java Sat Mar 12 17:19:15 2011
@@ -44,7 +44,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.model.name.Dn;
-import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.MutableSyntaxCheckerImpl;
 import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker;
@@ -649,7 +649,7 @@ public class MetaSyntaxCheckerHandlerIT 
     }
 
     
-    class DummySyntax extends LdapSyntax
+    class DummySyntax extends MutableLdapSyntaxImpl
     {
         private static final long serialVersionUID = 5090483112935298981L;
         public DummySyntax()

Modified: directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java (original)
+++ directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java Sat Mar 12 17:19:15 2011
@@ -50,7 +50,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.name.Dn;
-import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker;
 import org.apache.directory.shared.ldap.util.JndiUtils;
@@ -309,7 +309,7 @@ public class MetaSyntaxHandlerIT extends
     {
         testAddSyntaxToEnabledSchema();
 
-        LdapSyntax syntax = schemaManager.getLdapSyntaxRegistry().lookup( OID );
+        MutableLdapSyntax syntax = schemaManager.getLdapSyntaxRegistry().lookup( OID );
         assertEquals( syntax.getDescription(), DESCRIPTION0 );
 
         Dn dn = getSyntaxContainer( "apachemeta" );
@@ -337,7 +337,7 @@ public class MetaSyntaxHandlerIT extends
     {
         testAddSyntaxToEnabledSchema();
 
-        LdapSyntax syntax = schemaManager.getLdapSyntaxRegistry().lookup( OID );
+        MutableLdapSyntax syntax = schemaManager.getLdapSyntaxRegistry().lookup( OID );
         assertEquals( syntax.getDescription(), DESCRIPTION0 );
 
         Dn dn = getSyntaxContainer( "apachemeta" );

Modified: directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/apacheds/branches/akarasulu/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Sat Mar 12 17:19:15 2011
@@ -70,7 +70,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.name.Dn;
 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.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.ObjectClass;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
@@ -737,7 +737,7 @@ public class SubschemaSubentryIT extends
 
         Attributes attrs = getSubschemaSubentryAttributes();
         Attribute attrTypes = attrs.get( "ldapSyntaxes" );
-        LdapSyntax ldapSyntax = null;
+        MutableLdapSyntaxImpl ldapSyntax = null;
 
         for ( int ii = 0; ii < attrTypes.size(); ii++ )
         {

Modified: directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/AttributesFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/AttributesFactory.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/AttributesFactory.java (original)
+++ directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/AttributesFactory.java Sat Mar 12 17:19:15 2011
@@ -35,6 +35,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.DITStructureRule;
 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.MutableLdapSyntaxImpl;
 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.NameForm;
@@ -60,7 +61,7 @@ public class AttributesFactory
     {
         if ( obj instanceof LdapSyntax )
         {
-            return getAttributes( ( LdapSyntax ) obj, schema, schemaManager );
+            return getAttributes( ( MutableLdapSyntaxImpl ) obj, schema, schemaManager );
         }
         else if ( obj instanceof MatchingRule )
         {
@@ -141,7 +142,7 @@ public class AttributesFactory
     }
 
     
-    public Entry getAttributes( LdapSyntax syntax, Schema schema, SchemaManager schemaManager ) throws LdapException
+    public Entry getAttributes( MutableLdapSyntaxImpl syntax, Schema schema, SchemaManager schemaManager ) throws LdapException
     {
         Entry entry = new DefaultEntry( schemaManager );
 

Modified: directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java (original)
+++ directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java Sat Mar 12 17:19:15 2011
@@ -36,7 +36,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.DITContentRule;
 import org.apache.directory.shared.ldap.model.schema.DITStructureRule;
 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.MutableLdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
 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.NameForm;
@@ -210,7 +211,7 @@ public class DefaultSchemaService implem
         EntryAttribute attr = new DefaultEntryAttribute( 
             getSchemaManager().getAttributeType( SchemaConstants.LDAP_SYNTAXES_AT ) );
 
-        for ( LdapSyntax syntax : getSchemaManager().getLdapSyntaxRegistry() )
+        for ( MutableLdapSyntax syntax : getSchemaManager().getLdapSyntaxRegistry() )
         {
             attr.add( SchemaUtils.render( syntax ).toString() );
         }

Modified: directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java (original)
+++ directory/apacheds/branches/akarasulu/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java Sat Mar 12 17:19:15 2011
@@ -37,7 +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.DITContentRule;
 import org.apache.directory.shared.ldap.model.schema.DITStructureRule;
-import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
 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.NameForm;
@@ -236,9 +236,9 @@ public class SchemaSubentryManager
                 break;
                 
             case( SYNTAX_INDEX ):
-                LdapSyntax[] syntaxes = parsers.parseLdapSyntaxes( mods );
+                MutableLdapSyntaxImpl[] syntaxes = parsers.parseLdapSyntaxes( mods );
                 
-                for ( LdapSyntax syntax : syntaxes )
+                for ( MutableLdapSyntaxImpl syntax : syntaxes )
                 {
                     subentryModifier.deleteSchemaObject( modifyContext, syntax );
                 }
@@ -374,9 +374,9 @@ public class SchemaSubentryManager
                 break;
                 
             case( SYNTAX_INDEX ):
-                LdapSyntax[] syntaxes = parsers.parseLdapSyntaxes( mods );
+                MutableLdapSyntaxImpl[] syntaxes = parsers.parseLdapSyntaxes( mods );
                 
-                for ( LdapSyntax syntax : syntaxes )
+                for ( MutableLdapSyntaxImpl syntax : syntaxes )
                 {
                     subentryModifier.addSchemaObject( modifyContext, syntax );
                 }

Modified: directory/apacheds/branches/akarasulu/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java (original)
+++ directory/apacheds/branches/akarasulu/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java Sat Mar 12 17:19:15 2011
@@ -27,7 +27,7 @@ import java.util.Set;
 
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 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.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.SchemaObjectType;
@@ -75,7 +75,7 @@ public class DummyAttributeTypeRegistry 
         }
         else
         {
-            LdapSyntax syntax = new LdapSyntax( "1.1.1" );
+            MutableLdapSyntaxImpl syntax = new MutableLdapSyntaxImpl( "1.1.1" );
             syntax.setHumanReadable( true );
 
             attributeType.setSyntax( syntax );

Modified: directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java (original)
+++ directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java Sat Mar 12 17:19:15 2011
@@ -20,7 +20,7 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
-import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MutableSyntaxCheckerImpl;
 import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker;
 
@@ -30,7 +30,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BogusSyntax extends LdapSyntax
+public class BogusSyntax extends MutableLdapSyntaxImpl
 {
     protected BogusSyntax( int oidVal )
     {

Modified: directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java (original)
+++ directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java Sat Mar 12 17:19:15 2011
@@ -49,7 +49,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.filter.GreaterEqNode;
 import org.apache.directory.shared.ldap.model.name.Dn;
 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.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.comparators.StringComparator;
@@ -687,7 +687,7 @@ public class GreaterEqTest
     @Test(expected = IllegalStateException.class)
     public void testEvaluatorAttributeNoMatchingRule() throws Exception
     {
-        LdapSyntax syntax = new BogusSyntax( 1 );
+        MutableLdapSyntaxImpl syntax = new BogusSyntax( 1 );
         AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".2000" );
         at.addName( "bogus" );
         at.setSchemaName( "other" );
@@ -712,7 +712,7 @@ public class GreaterEqTest
     @Test
     public void testEvaluatorAttributeOrderingMatchingRule() throws Exception
     {
-        LdapSyntax syntax = new BogusSyntax( 1 );
+        MutableLdapSyntaxImpl syntax = new BogusSyntax( 1 );
         MatchingRule mr = new MatchingRule( "1.1" );
         mr.setSyntax( syntax );
         mr.setLdapComparator( new StringComparator( "1.1" ) );

Modified: directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java (original)
+++ directory/apacheds/branches/akarasulu/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java Sat Mar 12 17:19:15 2011
@@ -49,7 +49,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.filter.LessEqNode;
 import org.apache.directory.shared.ldap.model.name.Dn;
 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.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.comparators.StringComparator;
@@ -713,7 +713,7 @@ public class LessEqTest
     @Test(expected = IllegalStateException.class)
     public void testEvaluatorAttributeNoMatchingRule() throws Exception
     {
-        LdapSyntax syntax = new BogusSyntax( 1 );
+        MutableLdapSyntaxImpl syntax = new BogusSyntax( 1 );
         AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".2000" );
         at.addName( "bogus" );
         at.setSchemaName( "other" );
@@ -739,7 +739,7 @@ public class LessEqTest
     @Test
     public void testEvaluatorAttributeOrderingMatchingRule() throws Exception
     {
-        LdapSyntax syntax = new BogusSyntax( 2 );
+        MutableLdapSyntaxImpl syntax = new BogusSyntax( 2 );
 
         MatchingRule mr = new MatchingRule( "1.1" );
         mr.setSyntax( syntax );

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java Sat Mar 12 17:19:15 2011
@@ -23,7 +23,7 @@ import org.apache.directory.shared.i18n.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 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.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.MutableSyntaxCheckerImpl;
@@ -74,16 +74,16 @@ public class EntryUtils
     /**
      * A local Syntax class used for the tests
      */
-    public static LdapSyntax syntaxFactory( String oid, boolean humanReadable )
+    public static MutableLdapSyntaxImpl syntaxFactory( String oid, boolean humanReadable )
     {
-        LdapSyntax ldapSyntax = new LdapSyntax( oid );
+        MutableLdapSyntaxImpl ldapSyntax = new MutableLdapSyntaxImpl( oid );
         
         ldapSyntax.setHumanReadable( humanReadable );
         
         return ldapSyntax;
     }
 
-    static class S extends LdapSyntax
+    static class S extends MutableLdapSyntaxImpl
     {
         private static final long serialVersionUID = 1L;
 
@@ -96,7 +96,7 @@ public class EntryUtils
     /* no protection*/ static AttributeType getCaseIgnoringAttributeNoNumbersType()
     {
         AttributeType attributeType = new AttributeType( "1.1.3.1" );
-        LdapSyntax syntax = new LdapSyntax( "1.1.1.1", "", true );
+        MutableLdapSyntaxImpl syntax = new MutableLdapSyntaxImpl( "1.1.1.1", "", true );
 
         syntax.setSyntaxChecker( new MutableSyntaxCheckerImpl( "1.1.2.1" )
         {
@@ -180,7 +180,7 @@ public class EntryUtils
     {
         AttributeType attributeType = new AttributeType( "1.1" );
         attributeType.addName( "1.1" );
-        LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true );
+        MutableLdapSyntaxImpl syntax = new MutableLdapSyntaxImpl( "1.1.1", "", true );
 
         syntax.setSyntaxChecker( new MutableSyntaxCheckerImpl( "1.1.2" )
         {
@@ -227,7 +227,7 @@ public class EntryUtils
     /* No protection */ static AttributeType getBytesAttributeType()
     {
         AttributeType attributeType = new AttributeType( "1.2" );
-        LdapSyntax syntax = new LdapSyntax( "1.2.1", "", true );
+        MutableLdapSyntaxImpl syntax = new MutableLdapSyntaxImpl( "1.2.1", "", true );
 
         syntax.setSyntaxChecker( new MutableSyntaxCheckerImpl( "1.2.1" )
         {

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java Sat Mar 12 17:19:15 2011
@@ -150,7 +150,7 @@ public class AttributeType extends Abstr
     private String syntaxOid;
 
     /** The syntax associated with the syntaxID */
-    private LdapSyntax syntax;
+    private MutableLdapSyntax syntax;
 
     /** The equality OID associated with this AttributeType */
     private String equalityOid;
@@ -336,7 +336,7 @@ public class AttributeType extends Abstr
     {
         if ( syntaxOid != null )
         {
-            LdapSyntax currentSyntax = null;
+            MutableLdapSyntax currentSyntax = null;
 
             try
             {
@@ -1088,7 +1088,7 @@ public class AttributeType extends Abstr
      *
      * @return the value syntax
      */
-    public LdapSyntax getSyntax()
+    public MutableLdapSyntax getSyntax()
     {
         return syntax;
     }
@@ -1147,7 +1147,7 @@ public class AttributeType extends Abstr
      *
      * @param syntax The Syntax for this AttributeType
      */
-    public void setSyntax( LdapSyntax syntax )
+    public void setSyntax( MutableLdapSyntaxImpl syntax )
     {
         if ( locked )
         {
@@ -1167,7 +1167,7 @@ public class AttributeType extends Abstr
      *
      * @param newSyntax The Syntax for this AttributeType
      */
-    public void updateSyntax( LdapSyntax newSyntax )
+    public void updateSyntax( MutableLdapSyntaxImpl newSyntax )
     {
         if ( locked )
         {

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DescriptionUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DescriptionUtils.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DescriptionUtils.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DescriptionUtils.java Sat Mar 12 17:19:15 2011
@@ -747,7 +747,7 @@ public final class DescriptionUtils
      *            the Syntax to generate a description for
      * @return the description in the SyntaxDescription syntax
      */
-    public static String getDescription( LdapSyntax syntax )
+    public static String getDescription( MutableLdapSyntaxImpl syntax )
     {
         StringBuilder buf = new StringBuilder( "( " );
         buf.append( syntax.getOid() );

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/EntityFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/EntityFactory.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/EntityFactory.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/EntityFactory.java Sat Mar 12 17:19:15 2011
@@ -143,7 +143,7 @@ public interface EntityFactory
      * @return
      * @throws LdapException
      */
-    LdapSyntax getSyntax( SchemaManager schemaManager, Entry entry, Registries targetRegistries, String schemaName ) throws LdapException;
+    MutableLdapSyntaxImpl getSyntax( SchemaManager schemaManager, Entry entry, Registries targetRegistries, String schemaName ) throws LdapException;
     
     
     /**

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java Sat Mar 12 17:19:15 2011
@@ -20,134 +20,14 @@
 package org.apache.directory.shared.ldap.model.schema;
 
 
-import java.util.List;
-
-import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.ldap.model.schema.registries.Registries;
-import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker;
-
-
-/**
- * A syntax definition. Each attribute stored in a directory has a defined
- * syntax (i.e. data type) which constrains the structure and format of its
- * values. The description of each syntax specifies how attribute or assertion
- * values conforming to the syntax are normally represented when transferred in
- * LDAP operations. This representation is referred to as the LDAP-specific
- * encoding to distinguish it from other methods of encoding attribute values.
- * <p>
- * According to ldapbis [MODELS]:
- * </p>
- * 
- * <pre>
- *  4.1.5. LDAP Syntaxes
- *  
- *    LDAP Syntaxes of (attribute and assertion) values are described in
- *    terms of ASN.1 [X.680] and, optionally, have an octet string encoding
- *    known as the LDAP-specific encoding.  Commonly, the LDAP-specific
- *    encoding is constrained to string of Universal Character Set (UCS)
- *    [ISO10646] characters in UTF-8 [UTF-8] form.
- * 
- *    Each LDAP syntax is identified by an object identifier (OID).
- * 
- *    LDAP syntax definitions are written according to the ABNF:
- * 
- *      SyntaxDescription = LPAREN WSP
- *          numericoid                ; object identifier
- *          [ SP &quot;DESC&quot; SP qdstring ] ; description
- *          extensions WSP RPAREN     ; extensions
- * 
- *    where:
- *      [numericoid] is object identifier assigned to this LDAP syntax;
- *      DESC [qdstring] is a short descriptive string; and
- *      [extensions] describe extensions.
- * </pre>
- * 
- * @see <a href="http://www.faqs.org/rfcs/rfc2252.html"> RFC2252 Section 4.3.3</a>
- * @see <a href=
- *      "http://www.ietf.org/internet-drafts/draft-ietf-ldapbis-models-09.txt">
- *      ldapbis [MODELS]</a>
- * @see DescriptionUtils#getDescription(Syntax)
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- */
-public class LdapSyntax extends AbstractMutableSchemaObject
+public interface LdapSyntax extends SchemaObject
 {
-    private static final long serialVersionUID = 1L;
-
-    /** the human readable flag */
-    protected boolean isHumanReadable = false;
-
-    /** The associated SyntaxChecker */
-    protected MutableSyntaxChecker syntaxChecker;
-
-
-    /**
-     * Creates a Syntax object using a unique OID.
-     * 
-     * @param oid the OID for this Syntax
-     */
-    public LdapSyntax( String oid )
-    {
-        super( SchemaObjectType.LDAP_SYNTAX, oid );
-    }
-
-
-    /**
-     * Creates a Syntax object using a unique OID.
-     *
-     * @param oid the OID for this syntax
-     * @param description the description for this syntax
-     */
-    public LdapSyntax( String oid, String description )
-    {
-        super( SchemaObjectType.LDAP_SYNTAX, oid );
-        this.description = description;
-    }
-
-
-    /**
-     * Creates a Syntax object using a unique OID.
-     *
-     * @param oid the OID for this syntax
-     * @param description the description for this syntax
-     * @param isHumanReadable true if this syntax is human readable
-     */
-    public LdapSyntax( String oid, String description, boolean isHumanReadable )
-    {
-        super( SchemaObjectType.LDAP_SYNTAX, oid );
-        this.description = description;
-        this.isHumanReadable = isHumanReadable;
-    }
-
-
     /**
      * Gets whether or not the Syntax is human readable.
      * 
      * @return true if the syntax can be interpreted by humans, false otherwise
      */
-    public boolean isHumanReadable()
-    {
-        return isHumanReadable;
-    }
-
-
-    /**
-     * Sets the human readable flag value.
-     * 
-     * @param humanReadable the human readable flag value to set
-     */
-    public void setHumanReadable( boolean humanReadable )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.isHumanReadable = humanReadable;
-        }
-    }
+    boolean isHumanReadable();
 
 
     /**
@@ -156,174 +36,11 @@ public class LdapSyntax extends Abstract
      * 
      * @return the SyntaxChecker
      */
-    public MutableSyntaxChecker getSyntaxChecker()
-    {
-        return syntaxChecker;
-    }
-
-
-    /**
-     * Sets the associated SyntaxChecker
-     *
-     * @param syntaxChecker The associated SyntaxChecker
-     */
-    public void setSyntaxChecker( MutableSyntaxCheckerImpl syntaxChecker )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.syntaxChecker = syntaxChecker;
-        }
-    }
-
-
-    /**
-     * Update the associated SyntaxChecker, even if the SchemaObject is readOnly
-     *
-     * @param newSyntaxChecker The associated SyntaxChecker
-     */
-    public void updateSyntaxChecker( MutableSyntaxCheckerImpl newSyntaxChecker )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
-        }
-
-        this.syntaxChecker = newSyntaxChecker;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String toString()
-    {
-        return objectType + " " + DescriptionUtils.getDescription( this );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void addToRegistries( List<Throwable> errors, Registries registries ) throws LdapException
-    {
-        if ( registries != null )
-        {
-            try
-            {
-                // Gets the associated SyntaxChecker
-                syntaxChecker = ( MutableSyntaxChecker ) registries.getSyntaxCheckerRegistry().lookup( oid );
-            }
-            catch ( LdapException ne )
-            {
-                // No SyntaxChecker ? Associate the Syntax to a catch all SyntaxChecker
-                syntaxChecker = new OctetStringSyntaxChecker( oid );
-            }
-
-            // Add the references for S :
-            // S -> SC
-            if ( syntaxChecker != null )
-            {
-                registries.addReference( this, syntaxChecker );
-            }
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void removeFromRegistries( List<Throwable> errors, Registries registries ) throws LdapException
-    {
-        if ( registries != null )
-        {
-            /*
-             * Remove the Syntax references (using and usedBy) : 
-             * S -> SC
-             */
-            if ( syntaxChecker != null )
-            {
-                registries.delReference( this, syntaxChecker );
-            }
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public LdapSyntax copy()
-    {
-        LdapSyntax copy = new LdapSyntax( oid );
-
-        // Copy the SchemaObject common data
-        copy.copy( this );
-
-        // Copy the HR flag
-        copy.isHumanReadable = isHumanReadable;
-
-        // All the references to other Registries object are set to null.
-        copy.syntaxChecker = null;
-
-        return copy;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( !super.equals( o ) )
-        {
-            return false;
-        }
-
-        if ( !( o instanceof LdapSyntax ) )
-        {
-            return false;
-        }
-
-        LdapSyntax that = ( LdapSyntax ) o;
-
-        // IsHR
-        if ( isHumanReadable != that.isHumanReadable )
-        {
-            return false;
-        }
-
-        // Check the SyntaxChecker (not a equals)
-        if ( syntaxChecker != null )
-        {
-            if ( that.syntaxChecker == null )
-            {
-                return false;
-            }
-
-            return syntaxChecker.getOid().equals( that.syntaxChecker.getOid() );
-        }
-        else
-        {
-            return that.syntaxChecker == null;
-        }
-    }
+    MutableSyntaxChecker getSyntaxChecker();
 
 
     /**
      * {@inheritDoc}
      */
-    public void clear()
-    {
-        // Clear the common elements
-        super.clear();
-
-        // Clear the references
-        syntaxChecker = null;
-    }
-}
+    LdapSyntax copy();
+}
\ No newline at end of file

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java Sat Mar 12 17:19:15 2011
@@ -101,7 +101,7 @@ public class MatchingRule extends Abstra
     protected Normalizer normalizer;
 
     /** The associated LdapSyntax */
-    protected LdapSyntax ldapSyntax;
+    protected MutableLdapSyntax ldapSyntax;
 
     /** The associated LdapSyntax OID */
     private String ldapSyntaxOid;
@@ -238,7 +238,7 @@ public class MatchingRule extends Abstra
      * 
      * @return the LdapSyntax of this MatchingRule
      */
-    public LdapSyntax getSyntax()
+    public MutableLdapSyntax getSyntax()
     {
         return ldapSyntax;
     }
@@ -280,7 +280,7 @@ public class MatchingRule extends Abstra
      *
      * @param ldapSyntax The Syntax
      */
-    public void setSyntax( LdapSyntax ldapSyntax )
+    public void setSyntax( MutableLdapSyntaxImpl ldapSyntax )
     {
         if ( locked )
         {
@@ -300,7 +300,7 @@ public class MatchingRule extends Abstra
      *
      * @param ldapSyntax The Syntax
      */
-    public void updateSyntax( LdapSyntax ldapSyntax )
+    public void updateSyntax( MutableLdapSyntaxImpl ldapSyntax )
     {
         if ( locked )
         {

Added: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntax.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntax.java?rev=1080949&view=auto
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntax.java (added)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntax.java Sat Mar 12 17:19:15 2011
@@ -0,0 +1,56 @@
+/*
+ *  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;
+
+
+/**
+ * The mutable LdapSyntax interface.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface MutableLdapSyntax extends MutableSchemaObject, LdapSyntax
+{
+    /**
+     * Sets the human readable flag value.
+     * 
+     * @param humanReadable the human readable flag value to set
+     */
+    void setHumanReadable( boolean humanReadable );
+
+
+    /**
+     * Sets the associated SyntaxChecker
+     *
+     * @param syntaxChecker The associated SyntaxChecker
+     */
+    void setSyntaxChecker( MutableSyntaxChecker syntaxChecker );
+
+
+    /**
+     * {@inheritDoc}
+     */
+    MutableLdapSyntax copy();
+
+
+    /**
+     * {@inheritDoc}
+     */
+    void clear();
+}
\ No newline at end of file

Copied: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntaxImpl.java (from r1080939, directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java)
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntaxImpl.java?p2=directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntaxImpl.java&p1=directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java&r1=1080939&r2=1080949&rev=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntaxImpl.java Sat Mar 12 17:19:15 2011
@@ -25,7 +25,6 @@ import java.util.List;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.schema.registries.Registries;
-import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker;
 
 
 /**
@@ -70,7 +69,7 @@ import org.apache.directory.shared.ldap.
  * @see DescriptionUtils#getDescription(Syntax)
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapSyntax extends AbstractMutableSchemaObject
+public class MutableLdapSyntaxImpl extends AbstractMutableSchemaObject implements MutableLdapSyntax
 {
     private static final long serialVersionUID = 1L;
 
@@ -86,7 +85,7 @@ public class LdapSyntax extends Abstract
      * 
      * @param oid the OID for this Syntax
      */
-    public LdapSyntax( String oid )
+    public MutableLdapSyntaxImpl( String oid )
     {
         super( SchemaObjectType.LDAP_SYNTAX, oid );
     }
@@ -98,7 +97,7 @@ public class LdapSyntax extends Abstract
      * @param oid the OID for this syntax
      * @param description the description for this syntax
      */
-    public LdapSyntax( String oid, String description )
+    public MutableLdapSyntaxImpl( String oid, String description )
     {
         super( SchemaObjectType.LDAP_SYNTAX, oid );
         this.description = description;
@@ -112,7 +111,7 @@ public class LdapSyntax extends Abstract
      * @param description the description for this syntax
      * @param isHumanReadable true if this syntax is human readable
      */
-    public LdapSyntax( String oid, String description, boolean isHumanReadable )
+    public MutableLdapSyntaxImpl( String oid, String description, boolean isHumanReadable )
     {
         super( SchemaObjectType.LDAP_SYNTAX, oid );
         this.description = description;
@@ -120,10 +119,8 @@ public class LdapSyntax extends Abstract
     }
 
 
-    /**
-     * Gets whether or not the Syntax is human readable.
-     * 
-     * @return true if the syntax can be interpreted by humans, false otherwise
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.LdapSyntax#isHumanReadable()
      */
     public boolean isHumanReadable()
     {
@@ -131,10 +128,8 @@ public class LdapSyntax extends Abstract
     }
 
 
-    /**
-     * Sets the human readable flag value.
-     * 
-     * @param humanReadable the human readable flag value to set
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax#setHumanReadable(boolean)
      */
     public void setHumanReadable( boolean humanReadable )
     {
@@ -150,11 +145,8 @@ public class LdapSyntax extends Abstract
     }
 
 
-    /**
-     * Gets the SyntaxChecker used to validate values in accordance with this
-     * Syntax.
-     * 
-     * @return the SyntaxChecker
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.LdapSyntax#getSyntaxChecker()
      */
     public MutableSyntaxChecker getSyntaxChecker()
     {
@@ -162,12 +154,10 @@ public class LdapSyntax extends Abstract
     }
 
 
-    /**
-     * Sets the associated SyntaxChecker
-     *
-     * @param syntaxChecker The associated SyntaxChecker
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax#setSyntaxChecker(org.apache.directory.shared.ldap.model.schema.MutableSyntaxCheckerImpl)
      */
-    public void setSyntaxChecker( MutableSyntaxCheckerImpl syntaxChecker )
+    public void setSyntaxChecker( MutableSyntaxChecker syntaxChecker )
     {
         if ( locked )
         {
@@ -210,34 +200,6 @@ public class LdapSyntax extends Abstract
     /**
      * {@inheritDoc}
      */
-    public void addToRegistries( List<Throwable> errors, Registries registries ) throws LdapException
-    {
-        if ( registries != null )
-        {
-            try
-            {
-                // Gets the associated SyntaxChecker
-                syntaxChecker = ( MutableSyntaxChecker ) registries.getSyntaxCheckerRegistry().lookup( oid );
-            }
-            catch ( LdapException ne )
-            {
-                // No SyntaxChecker ? Associate the Syntax to a catch all SyntaxChecker
-                syntaxChecker = new OctetStringSyntaxChecker( oid );
-            }
-
-            // Add the references for S :
-            // S -> SC
-            if ( syntaxChecker != null )
-            {
-                registries.addReference( this, syntaxChecker );
-            }
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public void removeFromRegistries( List<Throwable> errors, Registries registries ) throws LdapException
     {
         if ( registries != null )
@@ -254,12 +216,15 @@ public class LdapSyntax extends Abstract
     }
 
 
-    /**
-     * {@inheritDoc}
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.LdapSyntax#copy()
      */
-    public LdapSyntax copy()
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax#copy()
+     */
+    public MutableLdapSyntaxImpl copy()
     {
-        LdapSyntax copy = new LdapSyntax( oid );
+        MutableLdapSyntaxImpl copy = new MutableLdapSyntaxImpl( oid );
 
         // Copy the SchemaObject common data
         copy.copy( this );
@@ -285,12 +250,12 @@ public class LdapSyntax extends Abstract
             return false;
         }
 
-        if ( !( o instanceof LdapSyntax ) )
+        if ( !( o instanceof MutableLdapSyntaxImpl ) )
         {
             return false;
         }
 
-        LdapSyntax that = ( LdapSyntax ) o;
+        MutableLdapSyntaxImpl that = ( MutableLdapSyntaxImpl ) o;
 
         // IsHR
         if ( isHumanReadable != that.isHumanReadable )
@@ -315,8 +280,8 @@ public class LdapSyntax extends Abstract
     }
 
 
-    /**
-     * {@inheritDoc}
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax#clear()
      */
     public void clear()
     {

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaManager.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaManager.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaManager.java Sat Mar 12 17:19:15 2011
@@ -500,7 +500,7 @@ public interface SchemaManager
      * @return The found LdapSyntax 
      * @throws LdapException if the OID is not found in the LdapSyntax registry
      */
-    LdapSyntax lookupLdapSyntaxRegistry( String oid ) throws LdapException;
+    MutableLdapSyntax lookupLdapSyntaxRegistry( String oid ) throws LdapException;
 
 
     /**
@@ -590,7 +590,7 @@ public interface SchemaManager
      * 
      * @return A reference to the LdapSyntax registry.
      */
-    LdapSyntaxRegistry getLdapSyntaxRegistry();
+    LdapSyntaxRegistry<MutableLdapSyntax> getLdapSyntaxRegistry();
 
 
     /**

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapSyntaxDescriptionSchemaParser.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapSyntaxDescriptionSchemaParser.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapSyntaxDescriptionSchemaParser.java Sat Mar 12 17:19:15 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.ldap
 import java.text.ParseException;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -64,7 +64,7 @@ public class LdapSyntaxDescriptionSchema
      * @return the parsed LdapSyntax bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized LdapSyntax parseLdapSyntaxDescription( String ldapSyntaxDescription )
+    public synchronized MutableLdapSyntaxImpl parseLdapSyntaxDescription( String ldapSyntaxDescription )
         throws ParseException
     {
         LOG.debug( "Parsing a LdapSyntax : {}", ldapSyntaxDescription );
@@ -79,7 +79,7 @@ public class LdapSyntaxDescriptionSchema
 
         try
         {
-            LdapSyntax ldapSyntax = parser.ldapSyntaxDescription();
+            MutableLdapSyntaxImpl ldapSyntax = parser.ldapSyntaxDescription();
             ldapSyntax.setSpecification( ldapSyntaxDescription );
 
             // Update the schemaName
@@ -109,7 +109,7 @@ public class LdapSyntaxDescriptionSchema
      * @return An instance of LdapSyntax
      * @throws ParseException {@inheritDoc}
      */
-    public LdapSyntax parse( String schemaDescription ) throws ParseException
+    public MutableLdapSyntaxImpl parse( String schemaDescription ) throws ParseException
     {
         return parseLdapSyntaxDescription( schemaDescription );
     }

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/ParserDescriptionUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/ParserDescriptionUtils.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/ParserDescriptionUtils.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/ParserDescriptionUtils.java Sat Mar 12 17:19:15 2011
@@ -24,6 +24,7 @@ import java.util.List;
 
 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.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.ObjectClass;
 import org.apache.directory.shared.ldap.model.schema.SchemaObject;
@@ -214,7 +215,7 @@ public final class ParserDescriptionUtil
      * @param ldapSyntax1 the second ldapSyntax to compare
      * @return true if the syntaxes match exactly, false otherwise
      */
-    public static boolean syntaxesMatch( LdapSyntax ldapSyntax0, LdapSyntax ldapSyntax1 )
+    public static boolean syntaxesMatch( MutableLdapSyntaxImpl ldapSyntax0, MutableLdapSyntaxImpl ldapSyntax1 )
     {
         return descriptionsMatch( ldapSyntax0, ldapSyntax1 );
     }

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultLdapSyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultLdapSyntaxRegistry.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultLdapSyntaxRegistry.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultLdapSyntaxRegistry.java Sat Mar 12 17:19:15 2011
@@ -20,7 +20,7 @@
 package org.apache.directory.shared.ldap.model.schema.registries;
 
 
-import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.SchemaObjectType;
 
 
@@ -29,15 +29,15 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DefaultLdapSyntaxRegistry extends DefaultSchemaObjectRegistry<LdapSyntax>
-    implements LdapSyntaxRegistry
+public class DefaultLdapSyntaxRegistry extends DefaultSchemaObjectRegistry<MutableLdapSyntax>
+    implements LdapSyntaxRegistry<MutableLdapSyntax>
 {
     /**
      * Creates a new default LdapSyntaxRegistry instance.
      */
     public DefaultLdapSyntaxRegistry()
     {
-        super( SchemaObjectType.LDAP_SYNTAX, new OidRegistry<LdapSyntax>() );
+        super( SchemaObjectType.LDAP_SYNTAX, new OidRegistry<MutableLdapSyntax>() );
     }
 
 

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/ImmutableLdapSyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/ImmutableLdapSyntaxRegistry.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/ImmutableLdapSyntaxRegistry.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/ImmutableLdapSyntaxRegistry.java Sat Mar 12 17:19:15 2011
@@ -27,6 +27,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.SchemaObjectType;
 
 
@@ -35,10 +36,10 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ImmutableLdapSyntaxRegistry implements LdapSyntaxRegistry
+public class ImmutableLdapSyntaxRegistry implements LdapSyntaxRegistry<LdapSyntax>
 {
     /** The wrapped LdapSyntax registry */
-    LdapSyntaxRegistry immutableLdapSyntaxRegistry;
+    LdapSyntaxRegistry<LdapSyntax> immutableLdapSyntaxRegistry;
 
 
     /**
@@ -154,7 +155,7 @@ public class ImmutableLdapSyntaxRegistry
     /**
      * {@inheritDoc}
      */
-    public LdapSyntax unregister( String numericOid ) throws LdapException
+    public MutableLdapSyntaxImpl unregister( String numericOid ) throws LdapException
     {
         throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04279 ) );
     }

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/LdapSyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/LdapSyntaxRegistry.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/LdapSyntaxRegistry.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/LdapSyntaxRegistry.java Sat Mar 12 17:19:15 2011
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.ldap.model.schema.registries;
 
+
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 
 
@@ -27,11 +28,10 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public interface LdapSyntaxRegistry extends SchemaObjectRegistry<LdapSyntax>,
-    Iterable<LdapSyntax>
+public interface LdapSyntaxRegistry<T extends LdapSyntax> extends SchemaObjectRegistry<T>, Iterable<T>
 {
     /**
      * Copy the LdapSyntaxRegistry
      */
-    LdapSyntaxRegistry copy();
+    LdapSyntaxRegistry<T> copy();
 }

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java Sat Mar 12 17:19:15 2011
@@ -42,6 +42,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.DITStructureRule;
 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.MutableLdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MutableLoadableSchemaObject;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.MatchingRuleUse;
@@ -109,7 +111,7 @@ public class Registries implements Schem
     protected DefaultSyntaxCheckerRegistry syntaxCheckerRegistry;
 
     /** The LdapSyntax registry */
-    protected LdapSyntaxRegistry ldapSyntaxRegistry;
+    protected DefaultLdapSyntaxRegistry ldapSyntaxRegistry;
 
     /** A map storing all the schema objects associated with a schema */
     private Map<String, Set<SchemaObjectWrapper>> schemaObjects;
@@ -273,7 +275,7 @@ public class Registries implements Schem
     /**
      * @return The LdapSyntax registry
      */
-    public LdapSyntaxRegistry getLdapSyntaxRegistry()
+    public LdapSyntaxRegistry<MutableLdapSyntax> getLdapSyntaxRegistry()
     {
         return ldapSyntaxRegistry;
     }
@@ -488,7 +490,7 @@ public class Registries implements Schem
 
         // Step 2 :
         // Check the LdapSyntaxes
-        for ( LdapSyntax ldapSyntax : ldapSyntaxRegistry )
+        for ( MutableLdapSyntax ldapSyntax : ldapSyntaxRegistry )
         {
             resolve( ldapSyntax, errors );
         }
@@ -843,7 +845,7 @@ public class Registries implements Schem
      */
     private void buildLdapSyntaxReferences( List<Throwable> errors )
     {
-        for ( LdapSyntax syntax : ldapSyntaxRegistry )
+        for ( MutableLdapSyntax syntax : ldapSyntaxRegistry )
         {
             buildReference( errors, syntax );
         }
@@ -914,13 +916,12 @@ public class Registries implements Schem
      * @param syntax the LdapSyntax to resolve the SyntaxChecker of
      * @param errors the list of errors to add exceptions to
      */
-    private void resolve( LdapSyntax syntax, List<Throwable> errors )
+    private void resolve( MutableLdapSyntax syntax, List<Throwable> errors )
     {
-        // A LdapSyntax must point to a valid SyntaxChecker
-        // or to the OctetString SyntaxChecker
+        // A LdapSyntax must point to a valid SyntaxChecker or to the default
         try
         {
-            syntax.addToRegistries( errors, this );
+            RegistryUtils.addToRegistries( errors, syntax, this );
         }
         catch ( LdapException e )
         {
@@ -1584,7 +1585,7 @@ public class Registries implements Schem
                     break;
 
                 case LDAP_SYNTAX:
-                    ldapSyntaxRegistry.register( ( LdapSyntax ) schemaObject );
+                    ldapSyntaxRegistry.register( ( MutableLdapSyntaxImpl ) schemaObject );
                     break;
 
                 case MATCHING_RULE:
@@ -1802,7 +1803,7 @@ public class Registries implements Schem
                 break;
 
             case LDAP_SYNTAX:
-                unregistered = ldapSyntaxRegistry.unregister( ( LdapSyntax ) schemaObject );
+                unregistered = ldapSyntaxRegistry.unregister( ( MutableLdapSyntax ) schemaObject );
                 break;
 
             case MATCHING_RULE:
@@ -2245,7 +2246,7 @@ public class Registries implements Schem
         // Check the Syntaxes : check for a SyntaxChecker
         LOG.debug( "Checking Syntaxes" );
 
-        for ( LdapSyntax syntax : ldapSyntaxRegistry )
+        for ( MutableLdapSyntax syntax : ldapSyntaxRegistry )
         {
             // Check that each Syntax has a SyntaxChecker
             if ( syntax.getSyntaxChecker() == null )
@@ -2580,7 +2581,7 @@ public class Registries implements Schem
             clone.globalOidRegistry.put( objectClass );
         }
 
-        for ( LdapSyntax syntax : clone.ldapSyntaxRegistry )
+        for ( MutableLdapSyntax syntax : clone.ldapSyntaxRegistry )
         {
             clone.globalOidRegistry.put( syntax );
         }

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/RegistryUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/RegistryUtils.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/RegistryUtils.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/RegistryUtils.java Sat Mar 12 17:19:15 2011
@@ -20,8 +20,13 @@
 package org.apache.directory.shared.ldap.model.schema.registries;
 
 
+import java.util.List;
+
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.MutableSchemaObject;
+import org.apache.directory.shared.ldap.model.schema.MutableSyntaxChecker;
+import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -65,4 +70,35 @@ public class RegistryUtils
             }
         }
     }
+
+
+    /**
+     * TODO MOVE ME!
+     */
+    public static void addToRegistries( List<Throwable> errors, MutableLdapSyntax syntax, Registries registries ) throws LdapException
+    {
+        if ( registries != null )
+        {
+            MutableSyntaxChecker syntaxChecker;
+            
+            try
+            {
+                // Gets the associated SyntaxChecker
+                syntaxChecker = ( MutableSyntaxChecker ) registries.getSyntaxCheckerRegistry().lookup( syntax.getOid() );
+            }
+            catch ( LdapException ne )
+            {
+                // No SyntaxChecker ? Associate the Syntax to a catch all SyntaxChecker
+                syntaxChecker = new OctetStringSyntaxChecker( syntax.getOid() );
+            }
+    
+            // Add the references for S :
+            // S -> SC
+            if ( syntaxChecker != null )
+            {
+                syntax.setSyntaxChecker( syntaxChecker );
+                registries.addReference( syntax, syntaxChecker );
+            }
+        }
+    }
 }

Modified: directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java?rev=1080949&r1=1080948&r2=1080949&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java Sat Mar 12 17:19:15 2011
@@ -36,7 +36,7 @@ import java.util.Arrays;
 
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 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.MutableLdapSyntaxImpl;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator;
@@ -67,7 +67,7 @@ import com.mycila.junit.concurrent.Concu
 @Concurrency()
 public class BinaryValueAttributeTypeTest
 {
-    private LdapSyntax s;
+    private MutableLdapSyntaxImpl s;
     private AttributeType at;
     private MatchingRule mr;
     



Mime
View raw message