You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/03/13 10:32:16 UTC
svn commit: r1300024 - 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/src/te...
Author: elecharny
Date: Tue Mar 13 09:32:15 2012
New Revision: 1300024
URL: http://svn.apache.org/viewvc?rev=1300024&view=rev
Log:
o Created a MutableMatchingRule class
o Removed the modifiers from the MatchingRule 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/MutableMatchingRule.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/model/src/main/antlr/schema.g
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.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/MatchingRuleHelper.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/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/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/XMLSchemaFileImporter.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=1300024&r1=1300023&r2=1300024&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 Tue Mar 13 09:32:15 2012
@@ -30,6 +30,7 @@ import org.apache.directory.shared.ldap.
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.MutableMatchingRule;
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;
@@ -61,7 +62,7 @@ public class TestServerEntryUtils
public static MatchingRule matchingRuleFactory( String oid )
{
- MatchingRule matchingRule = new MatchingRule( oid );
+ MatchingRule matchingRule = new MutableMatchingRule( oid );
return matchingRule;
}
@@ -132,7 +133,7 @@ public class TestServerEntryUtils
}
} );
- MatchingRule matchingRule = new MatchingRule( "1.1.2.1" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.2.1" );
matchingRule.setSyntax( syntax );
matchingRule.setLdapComparator( new LdapComparator<String>( matchingRule.getOid() )
@@ -206,7 +207,7 @@ public class TestServerEntryUtils
}
} );
- MatchingRule matchingRule = new MatchingRule( "1.1.2" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.2" );
matchingRule.setSyntax( syntax );
matchingRule.setLdapComparator( new LdapComparator<String>( matchingRule.getOid() )
@@ -241,7 +242,7 @@ public class TestServerEntryUtils
}
} );
- MatchingRule matchingRule = new MatchingRule( "1.2.2" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.2.2" );
matchingRule.setSyntax( syntax );
matchingRule.setLdapComparator( new ByteArrayComparator( "1.2.2" ) );
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=1300024&r1=1300023&r2=1300024&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 Tue Mar 13 09:32:15 2012
@@ -28,8 +28,8 @@ 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.MatchingRule;
import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRule;
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;
@@ -61,7 +61,7 @@ public class DummyAttributeTypeRegistry
{
Normalizer normalizer = new DeepTrimToLowerNormalizer( "1.1.1" );
- MatchingRule equality = new MatchingRule( "1.1.1" );
+ MutableMatchingRule equality = new MutableMatchingRule( "1.1.1" );
equality.setNormalizer( normalizer );
MutableAttributeType attributeType = new MutableAttributeType( id );
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=1300024&r1=1300023&r2=1300024&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 Tue Mar 13 09:32:15 2012
@@ -52,8 +52,8 @@ import org.apache.directory.shared.ldap.
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.MatchingRule;
import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRule;
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;
@@ -716,7 +716,7 @@ public class GreaterEqTest
public void testEvaluatorAttributeOrderingMatchingRule() throws Exception
{
LdapSyntax syntax = new BogusSyntax( 1 );
- MatchingRule mr = new MatchingRule( "1.1" );
+ MutableMatchingRule mr = new MutableMatchingRule( "1.1" );
mr.setSyntax( syntax );
mr.setLdapComparator( new StringComparator( "1.1" ) );
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=1300024&r1=1300023&r2=1300024&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 Tue Mar 13 09:32:15 2012
@@ -52,8 +52,8 @@ import org.apache.directory.shared.ldap.
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.MatchingRule;
import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRule;
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;
@@ -746,7 +746,7 @@ public class LessEqTest
{
LdapSyntax syntax = new BogusSyntax( 2 );
- MatchingRule mr = new MatchingRule( "1.1" );
+ MutableMatchingRule mr = new MutableMatchingRule( "1.1" );
mr.setSyntax( syntax );
mr.setLdapComparator( new StringComparator( "1.1" ) );
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=1300024&r1=1300023&r2=1300024&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 Tue Mar 13 09:32:15 2012
@@ -29,6 +29,7 @@ import org.apache.directory.shared.ldap.
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.MutableMatchingRule;
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;
@@ -131,7 +132,7 @@ public class TestEntryUtils
}
} );
- MatchingRule matchingRule = new MatchingRule( "1.1.2.1" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.2.1" );
matchingRule.setSyntax( syntax );
matchingRule.setLdapComparator( new LdapComparator<String>( matchingRule.getOid() )
@@ -205,7 +206,7 @@ public class TestEntryUtils
}
} );
- MatchingRule matchingRule = new MatchingRule( "1.1.2" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.2" );
matchingRule.setSyntax( syntax );
matchingRule.setLdapComparator( new LdapComparator<String>( matchingRule.getOid() )
@@ -240,7 +241,7 @@ public class TestEntryUtils
}
} );
- MatchingRule matchingRule = new MatchingRule( "1.2.2" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.2.2" );
matchingRule.setSyntax( syntax );
matchingRule.setLdapComparator( new ByteArrayComparator( "1.2.2" ) );
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=1300024&r1=1300023&r2=1300024&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/antlr/schema.g (original)
+++ directory/shared/trunk/ldap/model/src/main/antlr/schema.g Tue Mar 13 09:32:15 2012
@@ -31,6 +31,7 @@ import org.apache.directory.shared.ldap.
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.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRule;
import org.apache.directory.shared.ldap.model.schema.MatchingRuleUse;
import org.apache.directory.shared.ldap.model.schema.NameForm;
import org.apache.directory.shared.ldap.model.schema.parsers.NormalizerDescription;
@@ -513,13 +514,13 @@ ldapSyntaxDescription returns [LdapSynta
* extensions WSP RPAREN ; extensions
* </pre>
*/
-matchingRuleDescription returns [MatchingRule matchingRule]
+matchingRuleDescription returns [MutableMatchingRule matchingRule]
{
matchedProduction( "matchingRuleDescription()" );
ElementTracker et = new ElementTracker();
}
:
- ( oid:STARTNUMERICOID { matchingRule = new MatchingRule(numericoid(oid.getText())); } )
+ ( oid:STARTNUMERICOID { matchingRule = new MutableMatchingRule(numericoid(oid.getText())); } )
(
( name:NAME { et.track("NAME", name); matchingRule.setNames(qdescrs(name.getText())); } )
|
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java?rev=1300024&r1=1300023&r2=1300024&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java Tue Mar 13 09:32:15 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;
@@ -92,7 +91,7 @@ public class MatchingRule extends Abstra
protected LdapSyntax ldapSyntax;
/** The associated LdapSyntax OID */
- private String ldapSyntaxOid;
+ protected String ldapSyntaxOid;
/**
@@ -129,62 +128,6 @@ public class MatchingRule extends Abstra
/**
- * Sets the Syntax's OID
- *
- * @param oid The Syntax's OID
- */
- public void setSyntaxOid( String oid )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( !isReadOnly )
- {
- this.ldapSyntaxOid = oid;
- }
- }
-
-
- /**
- * Sets the Syntax
- *
- * @param ldapSyntax The Syntax
- */
- public void setSyntax( LdapSyntax ldapSyntax )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( !isReadOnly )
- {
- this.ldapSyntax = ldapSyntax;
- this.ldapSyntaxOid = ldapSyntax.getOid();
- }
- }
-
-
- /**
- * Update the associated Syntax, even if the SchemaObject is readOnly
- *
- * @param ldapSyntax The Syntax
- */
- public void updateSyntax( LdapSyntax ldapSyntax )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- this.ldapSyntax = ldapSyntax;
- this.ldapSyntaxOid = ldapSyntax.getOid();
- }
-
-
- /**
* Gets the LdapComparator enabling the use of this MatchingRule for ORDERING
* and sorted indexing.
*
@@ -197,43 +140,6 @@ public class MatchingRule extends Abstra
/**
- * Sets the LdapComparator
- *
- * @param ldapComparator The LdapComparator
- */
- @SuppressWarnings("unchecked")
- public void setLdapComparator( LdapComparator<?> ldapComparator )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( !isReadOnly )
- {
- this.ldapComparator = ( LdapComparator<? super Object> ) ldapComparator;
- }
- }
-
-
- /**
- * Update the associated Comparator, even if the SchemaObject is readOnly
- *
- * @param ldapComparator The LdapComparator
- */
- @SuppressWarnings("unchecked")
- public void updateLdapComparator( LdapComparator<?> ldapComparator )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- this.ldapComparator = ( LdapComparator<? super Object> ) ldapComparator;
- }
-
-
- /**
* Gets the Normalizer enabling the use of this MatchingRule for EQUALITY
* matching and indexing.
*
@@ -246,41 +152,6 @@ public class MatchingRule extends Abstra
/**
- * Sets the Normalizer
- *
- * @param normalizer The Normalizer
- */
- public void setNormalizer( Normalizer normalizer )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( !isReadOnly )
- {
- this.normalizer = normalizer;
- }
- }
-
-
- /**
- * Update the associated Normalizer, even if the SchemaObject is readOnly
- *
- * @param normalizer The Normalizer
- */
- public void updateNormalizer( Normalizer normalizer )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- this.normalizer = normalizer;
- }
-
-
- /**
* @see Object#toString()
*/
public String toString()
@@ -294,7 +165,7 @@ public class MatchingRule extends Abstra
*/
public MatchingRule copy()
{
- MatchingRule copy = new MatchingRule( oid );
+ MatchingRule copy = new MutableMatchingRule( oid );
// Copy the SchemaObject common data
copy.copy( this );
@@ -385,19 +256,4 @@ public class MatchingRule extends Abstra
return true;
}
-
-
- /**
- * {@inheritDoc}
- */
- public void clear()
- {
- // Clear the common elements
- super.clear();
-
- // Clear the references
- ldapComparator = null;
- ldapSyntax = null;
- normalizer = null;
- }
}
Added: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRule.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRule.java?rev=1300024&view=auto
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRule.java (added)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRule.java Tue Mar 13 09:32:15 2012
@@ -0,0 +1,246 @@
+/*
+ * 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;
+
+
+/**
+ * A matchingRule definition. MatchingRules associate a comparator and a
+ * normalizer, forming the basic tools necessary to assert actions against
+ * attribute values. MatchingRules are associated with a specific Syntax for the
+ * purpose of resolving a normalized form and for comparisons.
+ * <p>
+ * According to ldapbis [MODELS]:
+ * </p>
+ *
+ * <pre>
+ * 4.1.3. Matching Rules
+ *
+ * Matching rules are used by servers to compare attribute values against
+ * assertion values when performing Search and Compare operations. They
+ * are also used to identify the value to be added or deleted when
+ * modifying entries, and are used when comparing a purported
+ * distinguished name with the name of an entry.
+ *
+ * A matching rule specifies the syntax of the assertion value.
+ *
+ * Each matching rule is identified by an object identifier (OID) and,
+ * optionally, one or more short names (descriptors).
+ *
+ * Matching rule definitions are written according to the ABNF:
+ *
+ * MatchingRuleDescription = LPAREN WSP
+ * numericoid ; object identifier
+ * [ SP "NAME" SP qdescrs ] ; short names (descriptors)
+ * [ SP "DESC" SP qdstring ] ; description
+ * [ SP "OBSOLETE" ] ; not active
+ * SP "SYNTAX" SP numericoid ; assertion syntax
+ * extensions WSP RPAREN ; extensions
+ *
+ * where:
+ * [numericoid] is object identifier assigned to this matching rule;
+ * NAME [qdescrs] are short names (descriptors) identifying this
+ * matching rule;
+ * DESC [qdstring] is a short descriptive string;
+ * OBSOLETE indicates this matching rule is not active;
+ * SYNTAX identifies the assertion syntax by object identifier; and
+ * [extensions] describe extensions.
+ * </pre>
+ *
+ * @see <a href="http://www.faqs.org/rfcs/rfc2252.html">RFC 2252 Section 4.5</a>
+ * @see <a
+ * href="http://www.ietf.org/internet-drafts/draft-ietf-ldapbis-models-11.txt">ldapbis
+ * [MODELS]</a>
+ * @see DescriptionUtils#getDescription(MutableMatchingRule)
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+// super.hashCode is final
+@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
+public class MutableMatchingRule extends MatchingRule
+{
+ /** A logger for this class */
+ private static final Logger LOG = LoggerFactory.getLogger( MutableMatchingRule.class );
+
+ /**
+ * Creates a new instance of MatchingRule.
+ *
+ * @param oid The MatchingRule OID
+ */
+ public MutableMatchingRule( String oid )
+ {
+ super( oid );
+ }
+
+
+ /**
+ * Sets the Syntax's OID
+ *
+ * @param oid The Syntax's OID
+ */
+ public void setSyntaxOid( String oid )
+ {
+ if ( locked )
+ {
+ throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+ }
+
+ if ( !isReadOnly )
+ {
+ this.ldapSyntaxOid = oid;
+ }
+ }
+
+
+ /**
+ * Sets the Syntax
+ *
+ * @param ldapSyntax The Syntax
+ */
+ public void setSyntax( LdapSyntax ldapSyntax )
+ {
+ if ( locked )
+ {
+ throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+ }
+
+ if ( !isReadOnly )
+ {
+ this.ldapSyntax = ldapSyntax;
+ this.ldapSyntaxOid = ldapSyntax.getOid();
+ }
+ }
+
+
+ /**
+ * Update the associated Syntax, even if the SchemaObject is readOnly
+ *
+ * @param ldapSyntax The Syntax
+ */
+ public void updateSyntax( LdapSyntax ldapSyntax )
+ {
+ if ( locked )
+ {
+ throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+ }
+
+ this.ldapSyntax = ldapSyntax;
+ this.ldapSyntaxOid = ldapSyntax.getOid();
+ }
+
+
+ /**
+ * Sets the LdapComparator
+ *
+ * @param ldapComparator The LdapComparator
+ */
+ @SuppressWarnings("unchecked")
+ public void setLdapComparator( LdapComparator<?> ldapComparator )
+ {
+ if ( locked )
+ {
+ throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+ }
+
+ if ( !isReadOnly )
+ {
+ this.ldapComparator = ( LdapComparator<? super Object> ) ldapComparator;
+ }
+ }
+
+
+ /**
+ * Update the associated Comparator, even if the SchemaObject is readOnly
+ *
+ * @param ldapComparator The LdapComparator
+ */
+ @SuppressWarnings("unchecked")
+ public void updateLdapComparator( LdapComparator<?> ldapComparator )
+ {
+ if ( locked )
+ {
+ throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+ }
+
+ this.ldapComparator = ( LdapComparator<? super Object> ) ldapComparator;
+ }
+
+
+ /**
+ * Sets the Normalizer
+ *
+ * @param normalizer The Normalizer
+ */
+ public void setNormalizer( Normalizer normalizer )
+ {
+ if ( locked )
+ {
+ throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+ }
+
+ if ( !isReadOnly )
+ {
+ this.normalizer = normalizer;
+ }
+ }
+
+
+ /**
+ * Update the associated Normalizer, even if the SchemaObject is readOnly
+ *
+ * @param normalizer The Normalizer
+ */
+ public void updateNormalizer( Normalizer normalizer )
+ {
+ if ( locked )
+ {
+ throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
+ }
+
+ this.normalizer = normalizer;
+ }
+
+
+ /**
+ * @see Object#toString()
+ */
+ public String toString()
+ {
+ return objectType + " " + DescriptionUtils.getDescription( this );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void clear()
+ {
+ // Clear the common elements
+ super.clear();
+
+ // Clear the references
+ ldapComparator = null;
+ ldapSyntax = null;
+ normalizer = null;
+ }
+}
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=1300024&r1=1300023&r2=1300024&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 Tue Mar 13 09:32:15 2012
@@ -46,6 +46,7 @@ import org.apache.directory.shared.ldap.
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.MutableMatchingRule;
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;
@@ -683,7 +684,7 @@ public class Registries implements Schem
break;
case MATCHING_RULE :
- MatchingRuleHelper.addToRegistries( (MatchingRule)schemaObject, errors, this );
+ MatchingRuleHelper.addToRegistries( (MutableMatchingRule)schemaObject, errors, this );
break;
case MATCHING_RULE_USE :
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/helper/MatchingRuleHelper.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/helper/MatchingRuleHelper.java?rev=1300024&r1=1300023&r2=1300024&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/helper/MatchingRuleHelper.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/helper/MatchingRuleHelper.java Tue Mar 13 09:32:15 2012
@@ -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.MutableMatchingRule;
import org.apache.directory.shared.ldap.model.schema.Normalizer;
import org.apache.directory.shared.ldap.model.schema.comparators.ComparableComparator;
import org.apache.directory.shared.ldap.model.schema.normalizers.NoOpNormalizer;
@@ -55,7 +56,7 @@ public class MatchingRuleHelper
* @param registries The Registries
* @exception If the addition failed
*/
- public static void addToRegistries( MatchingRule matchingRule, List<Throwable> errors, Registries registries ) throws LdapException
+ public static void addToRegistries( MutableMatchingRule matchingRule, List<Throwable> errors, Registries registries ) throws LdapException
{
if ( registries != null )
{
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=1300024&r1=1300023&r2=1300024&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 Tue Mar 13 09:32:15 2012
@@ -40,6 +40,7 @@ import org.apache.directory.shared.ldap.
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.MutableMatchingRule;
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;
@@ -71,7 +72,7 @@ public class BinaryValueAttributeTypeTes
{
private LdapSyntax s;
private MutableAttributeType at;
- private MatchingRule mr;
+ private MutableMatchingRule mr;
private static final byte[] BYTES1 = new byte[]
{ 0x01, 0x02, 0x03, 0x04 };
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=1300024&r1=1300023&r2=1300024&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 Tue Mar 13 09:32:15 2012
@@ -36,8 +36,8 @@ 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.MatchingRule;
import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRule;
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;
@@ -72,7 +72,7 @@ public class BinaryValueTest
{ 0x11, 0x02, 0x03, 0x04 };
private LdapSyntax s;
private MutableAttributeType at;
- private MatchingRule mr;
+ private MutableMatchingRule 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=1300024&r1=1300023&r2=1300024&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 Tue Mar 13 09:32:15 2012
@@ -25,8 +25,8 @@ 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.MatchingRule;
import org.apache.directory.shared.ldap.model.schema.MutableAttributeType;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRule;
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;
@@ -56,9 +56,9 @@ public class EntryUtils
}
- public static MatchingRule matchingRuleFactory( String oid )
+ public static MutableMatchingRule matchingRuleFactory( String oid )
{
- MatchingRule matchingRule = new MatchingRule( oid );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( oid );
return matchingRule;
}
@@ -66,7 +66,7 @@ public class EntryUtils
/**
* A local MatchingRule class for tests
*/
- static class MR extends MatchingRule
+ static class MR extends MutableMatchingRule
{
protected MR( String oid )
{
@@ -129,7 +129,7 @@ public class EntryUtils
}
} );
- MatchingRule matchingRule = new MatchingRule( "1.1.2.1" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.2.1" );
matchingRule.setSyntax( syntax );
matchingRule.setLdapComparator( new LdapComparator<String>( matchingRule.getOid() )
@@ -184,7 +184,7 @@ public class EntryUtils
}
} );
- MatchingRule matchingRule = new MatchingRule( "1.1.2" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.2" );
matchingRule.setSyntax( syntax );
matchingRule.setLdapComparator( new LdapComparator<String>( matchingRule.getOid() )
@@ -219,7 +219,7 @@ public class EntryUtils
}
} );
- MatchingRule matchingRule = new MatchingRule( "1.2.2" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.2.2" );
matchingRule.setSyntax( syntax );
matchingRule.setLdapComparator( new ByteArrayComparator( "1.2.2" ) );
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=1300024&r1=1300023&r2=1300024&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 Tue Mar 13 09:32:15 2012
@@ -57,19 +57,19 @@ public class SchemaUtilsTest
public static MatchingRule[] getMatchingRules()
{
- MatchingRule[] mrs = new MatchingRule[3];
+ MutableMatchingRule[] mrs = new MutableMatchingRule[3];
- mrs[0] = new MatchingRule( "2.5.13.2" );
+ mrs[0] = new MutableMatchingRule( "2.5.13.2" );
mrs[0].setSyntax( getSyntaxes()[1] );
mrs[0].addName( "caseIgnoreMatch" );
mrs[0].setDescription( "Ignores case in strings" );
- mrs[1] = new MatchingRule( "2.5.13.4" );
+ mrs[1] = new MutableMatchingRule( "2.5.13.4" );
mrs[0].setSyntax( getSyntaxes()[2] );
mrs[1].addName( "caseIgnoreSubstringsMatch" );
mrs[1].setDescription( "Ignores case in substrings" );
- mrs[2] = new MatchingRule( "2.5.13.1" );
+ mrs[2] = new MutableMatchingRule( "2.5.13.1" );
mrs[0].setSyntax( getSyntaxes()[0] );
mrs[2].addName( "distinguishedNameMatch" );
mrs[2].setDescription( "distinguishedNameMatch" );
Modified: directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemaloader/SchemaEntityFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemaloader/SchemaEntityFactory.java?rev=1300024&r1=1300023&r2=1300024&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemaloader/SchemaEntityFactory.java (original)
+++ directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemaloader/SchemaEntityFactory.java Tue Mar 13 09:32:15 2012
@@ -44,6 +44,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.MutableAttributeType;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRule;
import org.apache.directory.shared.ldap.model.schema.MutableObjectClass;
import org.apache.directory.shared.ldap.model.schema.Normalizer;
import org.apache.directory.shared.ldap.model.schema.ObjectClass;
@@ -743,7 +744,7 @@ public class SchemaEntityFactory impleme
schema = schemaManager.getLoadedSchema( schemaName );
}
- MatchingRule matchingRule = new MatchingRule( oid );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( oid );
// The syntax field
Attribute mSyntax = entry.get( MetaSchemaConstants.M_SYNTAX_AT );
Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerAddTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerAddTest.java?rev=1300024&r1=1300023&r2=1300024&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerAddTest.java (original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerAddTest.java Tue Mar 13 09:32:15 2012
@@ -42,6 +42,7 @@ import org.apache.directory.shared.ldap.
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.MutableMatchingRule;
import org.apache.directory.shared.ldap.model.schema.MutableObjectClass;
import org.apache.directory.shared.ldap.model.schema.Normalizer;
import org.apache.directory.shared.ldap.model.schema.ObjectClass;
@@ -947,7 +948,7 @@ public class SchemaManagerAddTest
int mrrSize = schemaManager.getMatchingRuleRegistry().size();
int goidSize = schemaManager.getGlobalOidRegistry().size();
- MatchingRule matchingRule = new MatchingRule( "1.1.0" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.0" );
matchingRule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
// It should not fail
@@ -1004,7 +1005,7 @@ public class SchemaManagerAddTest
int mrrSize = schemaManager.getMatchingRuleRegistry().size();
int goidSize = schemaManager.getGlobalOidRegistry().size();
- MatchingRule matchingRule = new MatchingRule( "2.5.13.0" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "2.5.13.0" );
matchingRule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
// It should fail (oid already registered)
@@ -1037,7 +1038,7 @@ public class SchemaManagerAddTest
int mrrSize = schemaManager.getMatchingRuleRegistry().size();
int goidSize = schemaManager.getGlobalOidRegistry().size();
- MatchingRule matchingRule = new MatchingRule( "1.1.0" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.0" );
matchingRule.setNames( "Test", "objectIdentifierMatch" );
matchingRule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
@@ -1065,7 +1066,7 @@ public class SchemaManagerAddTest
int mrrSize = schemaManager.getMatchingRuleRegistry().size();
int goidSize = schemaManager.getGlobalOidRegistry().size();
- MatchingRule matchingRule = new MatchingRule( "1.1.0" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.0" );
matchingRule.setNames( "Test", "cn" );
matchingRule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
@@ -1098,7 +1099,7 @@ public class SchemaManagerAddTest
int mrrSize = schemaManager.getMatchingRuleRegistry().size();
int goidSize = schemaManager.getGlobalOidRegistry().size();
- MatchingRule matchingRule = new MatchingRule( "1.1.0" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.0" );
matchingRule.setNames( "Test" );
matchingRule.setSyntaxOid( "1.1.1" );
@@ -1127,7 +1128,7 @@ public class SchemaManagerAddTest
int mrrSize = schemaManager.getMatchingRuleRegistry().size();
int goidSize = schemaManager.getGlobalOidRegistry().size();
- MatchingRule matchingRule = new MatchingRule( "1.1.0" );
+ MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.0" );
matchingRule.setNames( "Test" );
matchingRule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
matchingRule.setSchemaName( "bad" );
Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java?rev=1300024&r1=1300023&r2=1300024&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java (original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java Tue Mar 13 09:32:15 2012
@@ -35,6 +35,7 @@ import org.apache.directory.shared.ldap.
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.MutableMatchingRule;
import org.apache.directory.shared.ldap.model.schema.MutableObjectClass;
import org.apache.directory.shared.ldap.model.schema.ObjectClassTypeEnum;
import org.apache.directory.shared.ldap.model.schema.UsageEnum;
@@ -356,7 +357,7 @@ public class ApacheDsSchemaConnector ext
*/
private static MatchingRule createMatchingRule( SearchResult sr ) throws NamingException
{
- MatchingRule mr = new MatchingRule( getOid( sr ) );
+ MutableMatchingRule mr = new MutableMatchingRule( getOid( sr ) );
mr.setNames( getNames( sr ) );
mr.setDescription( getDescription( sr ) );
mr.setObsolete( isObsolete( sr ) );
Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/GenericSchemaConnector.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/GenericSchemaConnector.java?rev=1300024&r1=1300023&r2=1300024&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/GenericSchemaConnector.java (original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/GenericSchemaConnector.java Tue Mar 13 09:32:15 2012
@@ -35,6 +35,7 @@ import org.apache.directory.shared.ldap.
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.MutableMatchingRule;
import org.apache.directory.shared.ldap.model.schema.MutableObjectClass;
import org.apache.directory.shared.ldap.model.schema.ObjectClass;
import org.apache.directory.shared.ldap.model.schema.parsers.AttributeTypeDescriptionSchemaParser;
@@ -348,7 +349,7 @@ public class GenericSchemaConnector exte
parser.setQuirksMode( true );
MatchingRule mrd = parser.parseMatchingRuleDescription( value );
- MatchingRule impl = new MatchingRule( mrd.getOid() );
+ MutableMatchingRule impl = new MutableMatchingRule( mrd.getOid() );
impl.setDescription( mrd.getDescription() );
impl.setNames( mrd.getNames().toArray( new String[0] ) );
impl.setObsolete( mrd.isObsolete() );
Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/XMLSchemaFileImporter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/XMLSchemaFileImporter.java?rev=1300024&r1=1300023&r2=1300024&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/XMLSchemaFileImporter.java (original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/XMLSchemaFileImporter.java Tue Mar 13 09:32:15 2012
@@ -27,8 +27,8 @@ import java.util.Iterator;
import java.util.List;
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.MutableMatchingRule;
import org.apache.directory.shared.ldap.model.schema.MutableObjectClass;
import org.apache.directory.shared.ldap.model.schema.ObjectClassTypeEnum;
import org.apache.directory.shared.ldap.model.schema.UsageEnum;
@@ -621,13 +621,13 @@ public class XMLSchemaFileImporter
*/
private static void readMatchingRule( Element element, Schema schema ) throws XMLSchemaFileImportException
{
- MatchingRule mr = null;
+ MutableMatchingRule mr = null;
// OID
Attribute oidAttribute = element.attribute( OID_TAG );
if ( ( oidAttribute != null ) && ( !oidAttribute.getValue().equals( "" ) ) ) //$NON-NLS-1$
{
- mr = new MatchingRule( oidAttribute.getValue() );
+ mr = new MutableMatchingRule( oidAttribute.getValue() );
}
else
{