You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2010/03/16 14:08:56 UTC

svn commit: r923721 [1/2] - in /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core: event/ interceptor/context/ partition/ schema/ schema/registries/synchronizers/

Author: kayyagari
Date: Tue Mar 16 13:08:55 2010
New Revision: 923721

URL: http://svn.apache.org/viewvc?rev=923721&view=rev
Log:
replaced jndi exceptions with ADS specific exceptions

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/Evaluator.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/NullPartition.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/Partition.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/Evaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/Evaluator.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/Evaluator.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/Evaluator.java Tue Mar 16 13:08:55 2010
@@ -20,9 +20,8 @@
 package org.apache.directory.server.core.event;
 
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 
 
@@ -43,7 +42,7 @@ public interface Evaluator
      * @param dn the normalized distinguished name of the entry being tested
      * @param entry the entry to evaluate
      * @return true if the filter selects the candidate false otherwise
-     * @throws javax.naming.NamingException if there is a database fault during evaluation
+     * @throws LdapException if there is a database fault during evaluation
      */
-    boolean evaluate( ExprNode node, String dn, ServerEntry entry ) throws NamingException;
+    boolean evaluate( ExprNode node, String dn, ServerEntry entry ) throws LdapException;
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java Tue Mar 16 13:08:55 2010
@@ -27,11 +27,11 @@ import java.util.HashSet;
 import java.util.Set;
 
 import javax.naming.NamingException;
-import javax.naming.directory.NoSuchAttributeException;
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.name.DN;
@@ -165,7 +165,7 @@ public abstract class SearchingOperation
                    
                     returningAttributes.add( attrOptions );
                 }
-                catch ( NoSuchAttributeException nsae )
+                catch ( LdapNoSuchAttributeException nsae )
                 {
                     LOG.warn( "Requested attribute {} does not exist in the schema, it will be ignored", returnAttribute );
                     // Unknown attributes should be silently ignored, as RFC 2251 states

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/NullPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/NullPartition.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/NullPartition.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/NullPartition.java Tue Mar 16 13:08:55 2010
@@ -24,8 +24,6 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.InvalidNameException;
-
 import org.apache.commons.collections.iterators.EmptyIterator;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilter;
@@ -42,6 +40,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.SearchingOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.cursor.ClosureMonitor;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
@@ -305,7 +304,7 @@ public class NullPartition extends Abstr
     /**
      * {@inheritDoc}
      */
-    public void setSuffix( String suffix ) throws InvalidNameException
+    public void setSuffix( String suffix ) throws LdapInvalidDnException
     {
         this.suffix = new DN( suffix );
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/Partition.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/Partition.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/Partition.java Tue Mar 16 13:08:55 2010
@@ -20,8 +20,6 @@
 package org.apache.directory.server.core.partition;
 
 
-import javax.naming.InvalidNameException;
-
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
@@ -37,6 +35,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 
@@ -81,9 +80,9 @@ public interface Partition
      * Sets the user provided suffix for this Partition as a String.
      *
      * @param suffix the suffix String for this Partition.
-     * @throws InvalidNameException if the suffix does not conform to LDAP DN syntax
+     * @throws LdapInvalidDnException if the suffix does not conform to LDAP DN syntax
      */
-    void setSuffix( String suffix ) throws InvalidNameException;
+    void setSuffix( String suffix ) throws LdapInvalidDnException;
 
 
     /**

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java Tue Mar 16 13:08:55 2010
@@ -24,13 +24,12 @@ import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -114,9 +113,9 @@ public class DescriptionParsers
      *
      * @param attr The attribute containing the SC description
      * @return The array of SyntaxCheckerDescription instances
-     * @throws NamingException If something went wrong
+     * @throws LdapInvalidAttributeValueException If something went wrong
      */
-    public SyntaxCheckerDescription[] parseSyntaxCheckers( EntryAttribute attr ) throws NamingException
+    public SyntaxCheckerDescription[] parseSyntaxCheckers( EntryAttribute attr ) throws LdapInvalidAttributeValueException
     {
         if ( ( attr == null ) || ( attr.size() == 0 ) )
         {
@@ -136,9 +135,9 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_405, 
-                    value ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_405, 
+                        value ) );
+                iave.initCause( e );
                 throw iave;
             }
         }
@@ -147,7 +146,7 @@ public class DescriptionParsers
     }
 
 
-    public NormalizerDescription[] parseNormalizers( EntryAttribute attr ) throws NamingException
+    public NormalizerDescription[] parseNormalizers( EntryAttribute attr ) throws LdapInvalidAttributeValueException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -166,9 +165,9 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_406, 
-                    value.getString() ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_406, 
+                        value.getString() ) );
+                iave.initCause( e );
                 throw iave;
             }
         }
@@ -177,7 +176,7 @@ public class DescriptionParsers
     }
 
 
-    public LdapComparatorDescription[] parseComparators( EntryAttribute attr ) throws NamingException
+    public LdapComparatorDescription[] parseComparators( EntryAttribute attr ) throws LdapInvalidAttributeValueException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -196,9 +195,9 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_407,
-                    value.getString() ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_407,
+                        value.getString() ) );
+                iave.initCause( e );
                 throw iave;
             }
         }
@@ -213,9 +212,9 @@ public class DescriptionParsers
      * 
      * @param attr the attribute containing attributeTypeDescriptions
      * @return the set of attributeType objects for the descriptions 
-     * @throws NamingException if there are problems parsing the descriptions
+     * @throws LdapException if there are problems parsing the descriptions
      */
-    public AttributeType[] parseAttributeTypes( EntryAttribute attr ) throws Exception
+    public AttributeType[] parseAttributeTypes( EntryAttribute attr ) throws LdapException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -236,45 +235,45 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_408,
-                    value.getString() ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_408,
+                        value.getString() ) );
+                iave.initCause( e );
                 throw iave;
             }
 
             // if the supertype is provided make sure it exists in some schema
             if ( ( attributeType.getSuperiorOid() != null ) && !schemaManager.getAttributeTypeRegistry().contains( attributeType.getSuperiorOid() ) )
             {
-                throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_409, attributeType.getSuperiorOid() ),
-                    ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                    I18n.err( I18n.ERR_409, attributeType.getSuperiorOid() ) );
             }
 
             // if the syntax is provided by the description make sure it exists in some schema
             if ( attributeType.getSyntaxOid() != null && !schemaManager.getLdapSyntaxRegistry().contains( attributeType.getSyntaxOid() ) )
             {
-                throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_410, attributeType.getSyntaxOid() ),
-                    ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                    I18n.err( I18n.ERR_410, attributeType.getSyntaxOid() ) );
             }
 
             // if the matchingRule is provided make sure it exists in some schema
             if ( attributeType.getEqualityOid() != null && !schemaManager.getMatchingRuleRegistry().contains( attributeType.getEqualityOid() ) )
             {
-                throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_411, attributeType.getEqualityOid() ),
-                    ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                    I18n.err( I18n.ERR_411, attributeType.getEqualityOid() ) );
             }
 
             // if the matchingRule is provided make sure it exists in some schema
             if ( attributeType.getOrderingOid() != null && !schemaManager.getMatchingRuleRegistry().contains( attributeType.getOrderingOid() ) )
             {
-                throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_412, attributeType.getOrderingOid() ),
-                    ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                    I18n.err( I18n.ERR_412, attributeType.getOrderingOid() ) );
             }
 
             // if the matchingRule is provided make sure it exists in some schema
             if ( attributeType.getSubstringOid() != null && !schemaManager.getMatchingRuleRegistry().contains( attributeType.getSubstringOid() ) )
             {
-                throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_413, attributeType.getSubstringOid() ),
-                    ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                    I18n.err( I18n.ERR_413, attributeType.getSubstringOid() ) );
             }
 
             // if the equality matching rule is null and no super type is specified then there is
@@ -284,7 +283,7 @@ public class DescriptionParsers
             {
                 if ( attributeType.getSuperiorOid() == null )
                 {
-                    throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_414 ), ResultCodeEnum.UNWILLING_TO_PERFORM );
+                    throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_414 ) );
                 }
                 else
                 {
@@ -293,7 +292,7 @@ public class DescriptionParsers
 
                     if ( superType == null )
                     {
-                        throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_415 ), ResultCodeEnum.UNWILLING_TO_PERFORM );
+                        throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_415 ) );
                     }
                 }
             }
@@ -304,7 +303,7 @@ public class DescriptionParsers
             // if a supertype exists then it must resolve a proper syntax somewhere in the hierarchy.
             if ( attributeType.getSyntaxOid() == null && attributeType.getSuperiorOid() == null )
             {
-                throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_416 ), ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_416 ) );
             }
 
             List<Throwable> errors = new ArrayList<Throwable>();
@@ -339,9 +338,9 @@ public class DescriptionParsers
      * 
      * @param attr the attribute containing objectClassDescriptions
      * @return the set of objectClass objects for the descriptions 
-     * @throws NamingException if there are problems parsing the descriptions
+     * @throws LdapException if there are problems parsing the descriptions
      */
-    public ObjectClass[] parseObjectClasses( EntryAttribute attr ) throws Exception
+    public ObjectClass[] parseObjectClasses( EntryAttribute attr ) throws LdapException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -362,9 +361,9 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_417, 
-                    value.getString() ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_417, 
+                        value.getString() ) );
+                iave.initCause( e );
                 throw iave;
             }
 
@@ -381,8 +380,8 @@ public class DescriptionParsers
 
                     if ( !schemaManager.getObjectClassRegistry().contains( superiorOid ) )
                     {
-                        throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_418, superiorOid ),
-                            ResultCodeEnum.UNWILLING_TO_PERFORM );
+                        throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                            I18n.err( I18n.ERR_418, superiorOid ) );
                     }
                 }
             }
@@ -394,8 +393,8 @@ public class DescriptionParsers
                 {
                     if ( !schemaManager.getAttributeTypeRegistry().contains( mayAttrOid ) )
                     {
-                        throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_419, mayAttrOid ),
-                            ResultCodeEnum.UNWILLING_TO_PERFORM );
+                        throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                            I18n.err( I18n.ERR_419, mayAttrOid ) );
                     }
                 }
             }
@@ -407,8 +406,8 @@ public class DescriptionParsers
                 {
                     if ( !schemaManager.getAttributeTypeRegistry().contains( mustAttrOid ) )
                     {
-                        throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_420, mustAttrOid ),
-                            ResultCodeEnum.UNWILLING_TO_PERFORM );
+                        throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                            I18n.err( I18n.ERR_420, mustAttrOid ) );
                     }
                 }
             }
@@ -429,9 +428,9 @@ public class DescriptionParsers
      * 
      * @param attr the attribute containing matchingRuleUseDescriptions
      * @return the set of matchingRuleUse objects for the descriptions 
-     * @throws NamingException if there are problems parsing the descriptions
+     * @throws LdapException if there are problems parsing the descriptions
      */
-    public MatchingRuleUse[] parseMatchingRuleUses( EntryAttribute attr ) throws NamingException
+    public MatchingRuleUse[] parseMatchingRuleUses( EntryAttribute attr ) throws LdapException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -453,9 +452,9 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_421, 
-                    value.getString() ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_421, 
+                        value.getString() ) );
+                iave.initCause( e );
                 throw iave;
             }
 
@@ -472,9 +471,9 @@ public class DescriptionParsers
      * 
      * @param attr the attribute containing ldapSyntaxes
      * @return the set of Syntax objects for the descriptions 
-     * @throws NamingException if there are problems parsing the descriptions
+     * @throws LdapException if there are problems parsing the descriptions
      */
-    public LdapSyntax[] parseLdapSyntaxes( EntryAttribute attr ) throws Exception
+    public LdapSyntax[] parseLdapSyntaxes( EntryAttribute attr ) throws LdapException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -496,15 +495,15 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_422, 
-                    value.getString() ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_422, 
+                        value.getString() ) );
+                iave.initCause( e );
                 throw iave;
             }
 
             if ( !schemaManager.getSyntaxCheckerRegistry().contains( ldapSyntax.getOid() ) )
             {
-                throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_423 ), ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_423 ) );
             }
 
             ldapSyntax.setHumanReadable( isHumanReadable( ldapSyntax ) );
@@ -521,9 +520,9 @@ public class DescriptionParsers
      * 
      * @param attr the attribute containing matchingRuleDescriptions
      * @return the set of matchingRule objects for the descriptions 
-     * @throws NamingException if there are problems parsing the descriptions
+     * @throws LdapException if there are problems parsing the descriptions
      */
-    public MatchingRule[] parseMatchingRules( EntryAttribute attr ) throws Exception
+    public MatchingRule[] parseMatchingRules( EntryAttribute attr ) throws LdapException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -545,16 +544,16 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_424, 
-                    value.getString() ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_424, 
+                        value.getString() ) );
+                iave.initCause( e );
                 throw iave;
             }
 
             if ( !schemaManager.getLdapSyntaxRegistry().contains( matchingRule.getSyntaxOid() ) )
             {
-                throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_425, matchingRule.getSyntaxOid() ),
-                    ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                    I18n.err( I18n.ERR_425, matchingRule.getSyntaxOid() ) );
             }
 
             matchingRules[pos++] = matchingRule;
@@ -570,9 +569,9 @@ public class DescriptionParsers
      * 
      * @param attr the attribute containing dITStructureRuleDescriptions
      * @return the set of DITStructureRule objects for the descriptions 
-     * @throws NamingException if there are problems parsing the descriptions
+     * @throws LdapException if there are problems parsing the descriptions
      */
-    public DITStructureRule[] parseDitStructureRules( EntryAttribute attr ) throws NamingException
+    public DITStructureRule[] parseDitStructureRules( EntryAttribute attr ) throws LdapException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -594,9 +593,9 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_426, 
-                    value.getString() ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_426, 
+                        value.getString() ) );
+                iave.initCause( e );
                 throw iave;
             }
 
@@ -613,9 +612,9 @@ public class DescriptionParsers
      * 
      * @param attr the attribute containing dITContentRuleDescriptions
      * @return the set of DITContentRule objects for the descriptions 
-     * @throws NamingException if there are problems parsing the descriptions
+     * @throws LdapException if there are problems parsing the descriptions
      */
-    public DITContentRule[] parseDitContentRules( EntryAttribute attr ) throws NamingException
+    public DITContentRule[] parseDitContentRules( EntryAttribute attr ) throws LdapException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -637,9 +636,9 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_427, 
-                    value.getString() ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_427, 
+                        value.getString() ) );
+                iave.initCause( e );
                 throw iave;
             }
 
@@ -656,9 +655,9 @@ public class DescriptionParsers
      * 
      * @param attr the attribute containing nameFormDescriptions
      * @return the set of NameFormRule objects for the descriptions 
-     * @throws NamingException if there are problems parsing the descriptions
+     * @throws LdapException if there are problems parsing the descriptions
      */
-    public NameForm[] parseNameForms( EntryAttribute attr ) throws NamingException
+    public NameForm[] parseNameForms( EntryAttribute attr ) throws LdapException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -680,9 +679,9 @@ public class DescriptionParsers
             }
             catch ( ParseException e )
             {
-                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_428, 
-                    value.getString() ), ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                iave.setRootCause( e );
+                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_428, 
+                        value.getString() ) );
+                iave.initCause( e );
                 throw iave;
             }
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java Tue Mar 16 13:08:55 2010
@@ -27,8 +27,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
@@ -41,6 +39,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -164,7 +163,7 @@ public class PartitionSchemaLoader exten
     /**
      * Helper class used to update the static DNs for each kind of Schema Object
      */
-    private DN updateDNs( Map<String, DN> staticDNs, String path, Schema schema ) throws NamingException
+    private DN updateDNs( Map<String, DN> staticDNs, String path, Schema schema ) throws LdapInvalidDnException
     {
         DN dn = staticDNs.get( schema.getSchemaName() );
 
@@ -185,7 +184,7 @@ public class PartitionSchemaLoader exten
      * 
      * @param schemaName the name of the schema to find dependents for
      * @return a set of schemas (String names) that depend on the schema
-     * @throws NamingException if there are problems searching the schema partition
+     * @throws Exception if there are problems searching the schema partition
      */
     public Set<String> listDependentSchemaNames( String schemaName ) throws Exception
     {
@@ -213,7 +212,7 @@ public class PartitionSchemaLoader exten
      * 
      * @param schemaName the name of the schema to find dependents for
      * @return a set of enabled schemas (String names) that depend on the schema
-     * @throws NamingException if there are problems searching the schema partition
+     * @throws Exception if there are problems searching the schema partition
      */
     public Set<String> listEnabledDependentSchemaNames( String schemaName ) throws Exception
     {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java Tue Mar 16 13:08:55 2010
@@ -33,10 +33,11 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
-import org.apache.directory.shared.ldap.exception.LdapNamingException;
-import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
+import org.apache.directory.shared.ldap.exception.LdapOtherException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
@@ -167,8 +168,7 @@ public abstract class AbstractRegistrySy
 
         if ( schemaManager.getGlobalOidRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( I18n.err( I18n.ERR_335, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapOtherException( I18n.err( I18n.ERR_335, oid ) );
         }
     }
 
@@ -187,8 +187,8 @@ public abstract class AbstractRegistrySy
         }
         else
         {
-            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_336, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_336, oid ) );
         }
     }
 
@@ -196,25 +196,25 @@ public abstract class AbstractRegistrySy
     /**
      * Checks that the parent DN is a valid DN
      */
-    protected void checkParent( DN newParent, SchemaManager schemaManager, String objectType ) throws NamingException
+    protected void checkParent( DN newParent, SchemaManager schemaManager, String objectType ) throws LdapException
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_337 ), ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_337 ) );
         }
         
         RDN rdn = newParent.getRdn();
         
         if ( ! schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_338, objectType ), 
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, 
+                I18n.err( I18n.ERR_338, objectType ) );
         }
         
         if ( ! ( ( String ) rdn.getNormValue() ).equalsIgnoreCase( OBJECT_TYPE_TO_PATH.get( objectType ) ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_339, objectType,  OBJECT_TYPE_TO_PATH.get( objectType ) ), 
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, 
+                I18n.err( I18n.ERR_339, objectType,  OBJECT_TYPE_TO_PATH.get( objectType ) ) );
         }
     }
 
@@ -224,8 +224,8 @@ public abstract class AbstractRegistrySy
 
         if ( schemaManager.getGlobalOidRegistry().contains( oid ) )
         {
-            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_335, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_335, oid ) );
         }
     }
 
@@ -234,8 +234,8 @@ public abstract class AbstractRegistrySy
     {
         if ( schemaManager.getGlobalOidRegistry().contains( oid ) )
         {
-            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_335, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_335, oid ) );
         }
     }
 
@@ -264,7 +264,7 @@ public abstract class AbstractRegistrySy
                 String msg = I18n.err( I18n.ERR_341, schemaObject.getName(), schemaName );
                 LOG.warn( msg );
             
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
             
             schemaObjects.add( schemaObjectWrapper );
@@ -275,7 +275,7 @@ public abstract class AbstractRegistrySy
             String msg = I18n.err( I18n.ERR_342, schemaObject.getName(), schemaName );
             LOG.warn( msg );
         
-            throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
         }
     }
 
@@ -299,7 +299,7 @@ public abstract class AbstractRegistrySy
                 String msg = I18n.err( I18n.ERR_343, schemaObject.getName(), schemaName );
                 LOG.warn( msg );
             
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
             
             schemaObjects.remove( schemaObjectWrapper );
@@ -310,7 +310,7 @@ public abstract class AbstractRegistrySy
             String msg = I18n.err( I18n.ERR_342, schemaObject.getName(), schemaName );
             LOG.warn( msg );
         
-            throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
         }
     }
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java Tue Mar 16 13:08:55 2010
@@ -99,7 +99,7 @@ public class AttributeTypeSynchronizer e
                 // We have some error : reject the addition and get out
                 String msg = I18n.err( I18n.ERR_345, entry.getDn().getName(), StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
         else
@@ -180,7 +180,7 @@ public class AttributeTypeSynchronizer e
                 String msg = I18n.err( I18n.ERR_346, entry.getDn().getName(), 
                     StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
         else
@@ -221,7 +221,7 @@ public class AttributeTypeSynchronizer e
             {
                 String msg = I18n.err( I18n.ERR_347, entry.getDn().getName(), newDn );
 
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
 
             schemaManager.unregisterAttributeType( oldAt.getOid() );
@@ -254,14 +254,14 @@ public class AttributeTypeSynchronizer e
         {
             String msg = I18n.err( I18n.ERR_348, oldSchemaName );
             LOG.warn( msg );
-            throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
         }
 
         if ( !isSchemaLoaded( newSchemaName ) )
         {
             String msg = I18n.err( I18n.ERR_349, newSchemaName );
             LOG.warn( msg );
-            throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
         }
 
         deleteFromSchema( oldAt, oldSchemaName );
@@ -301,14 +301,14 @@ public class AttributeTypeSynchronizer e
         {
             String msg = "Cannot move a schemaObject from a not loaded schema " + oldSchemaName;
             LOG.warn( msg );
-            throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
         }
 
         if ( !isSchemaLoaded( newSchemaName ) )
         {
             String msg = I18n.err( I18n.ERR_349, newSchemaName );
             LOG.warn( msg );
-            throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
         }
 
         deleteFromSchema( oldAt, oldSchemaName );

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java Tue Mar 16 13:08:55 2010
@@ -23,17 +23,15 @@ package org.apache.directory.server.core
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
-import org.apache.directory.shared.ldap.exception.LdapNamingException;
-import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
@@ -135,7 +133,7 @@ public class ComparatorSynchronizer exte
                 String msg = I18n.err( I18n.ERR_350, entry.getDn().getName(), StringTools.listToString( 
                     schemaManager.getErrors() ) );
                 LOG.info( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
         else
@@ -196,7 +194,7 @@ public class ComparatorSynchronizer exte
                 // Ok, definitively an error
                 String msg = I18n.err( I18n.ERR_351, entry.getDn().getName() );
                 LOG.info( msg );
-                throw new LdapSchemaViolationException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapSchemaViolationException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
 
@@ -213,7 +211,7 @@ public class ComparatorSynchronizer exte
                 String msg = I18n.err( I18n.ERR_352, entry.getDn().getName(), StringTools.listToString( 
                     errors ) );
                 LOG.info( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
         else
@@ -232,8 +230,8 @@ public class ComparatorSynchronizer exte
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_353, oldOid ),
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                I18n.err( I18n.ERR_353, oldOid ) );
         }
 
         String oid = ( String ) newRdn.getNormValue();
@@ -272,8 +270,8 @@ public class ComparatorSynchronizer exte
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_353, oldOid ),
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                I18n.err( I18n.ERR_353, oldOid ) );
         }
 
         String oid = ( String ) newRdn.getNormValue();
@@ -305,8 +303,8 @@ public class ComparatorSynchronizer exte
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oid ) )
         {
-            throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_354, oid ),
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                I18n.err( I18n.ERR_354, oid ) );
         }
 
         String newSchemaName = getSchemaName( newParentName );
@@ -328,12 +326,12 @@ public class ComparatorSynchronizer exte
     }
 
 
-    private void checkOidIsUniqueForComparator( String oid ) throws NamingException
+    private void checkOidIsUniqueForComparator( String oid ) throws LdapSchemaViolationException
     {
         if ( schemaManager.getComparatorRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( I18n.err( I18n.ERR_355, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_355, oid ) );
         }
     }
 
@@ -344,8 +342,8 @@ public class ComparatorSynchronizer exte
 
         if ( schemaManager.getComparatorRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( I18n.err( I18n.ERR_355, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_355, oid ) );
         }
     }
 
@@ -364,18 +362,18 @@ public class ComparatorSynchronizer exte
         }
         else
         {
-            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_336, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_336, oid ) );
         }
     }
 
 
-    private void checkNewParent( DN newParent ) throws NamingException
+    private void checkNewParent( DN newParent ) throws LdapException
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_357 ),
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
+                I18n.err( I18n.ERR_357 ) );
         }
 
         RDN rdn = newParent.getRdn();
@@ -383,12 +381,12 @@ public class ComparatorSynchronizer exte
         if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
             SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_358 ), ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_358 ) );
         }
 
         if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.COMPARATORS_AT ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_359 ), ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_359 ) );
         }
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java Tue Mar 16 13:08:55 2010
@@ -20,13 +20,12 @@
 package org.apache.directory.server.core.schema.registries.synchronizers;
 
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -131,7 +130,7 @@ public class MatchingRuleSynchronizer ex
                 String msg = I18n.err( I18n.ERR_360, entry.getDn().getName(), 
                     StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
         else
@@ -184,7 +183,7 @@ public class MatchingRuleSynchronizer ex
                 String msg = I18n.err( I18n.ERR_360, entry.getDn().getName(), 
                     StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
         else
@@ -288,12 +287,12 @@ public class MatchingRuleSynchronizer ex
     }
 
 
-    private void checkNewParent( DN newParent ) throws NamingException
+    private void checkNewParent( DN newParent ) throws LdapException
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_361 ),
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
+                I18n.err( I18n.ERR_361 ) );
         }
 
         RDN rdn = newParent.getRdn();
@@ -301,14 +300,14 @@ public class MatchingRuleSynchronizer ex
         if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
             SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_362 ),
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
+                I18n.err( I18n.ERR_362 ) );
         }
 
         if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.MATCHING_RULES_AT ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_363 ),
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
+                I18n.err( I18n.ERR_363 ) );
         }
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java Tue Mar 16 13:08:55 2010
@@ -23,15 +23,14 @@ package org.apache.directory.server.core
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
-import org.apache.directory.shared.ldap.exception.LdapNamingException;
+import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
@@ -132,7 +131,7 @@ public class NormalizerSynchronizer exte
                 String msg = I18n.err( I18n.ERR_364, entry.getDn().getName(), 
                     StringTools.listToString( errors ) );
                 LOG.info( msg );
-            throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
         else
@@ -145,7 +144,7 @@ public class NormalizerSynchronizer exte
                 String msg = I18n.err( I18n.ERR_365, entry.getDn().getName(),
                     StringTools.listToString( errors ) );
 
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
 
             LOG.debug( "The normalizer {} cannot be added in schema {}", dn.getName(), schemaName );
@@ -177,7 +176,7 @@ public class NormalizerSynchronizer exte
             {
                 String msg = I18n.err( I18n.ERR_366, entry.getDn().getName(), getReferenced( normalizer ) );
                 LOG.warn( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
 
             // As the normalizer has the same OID than its attached MR, it won't
@@ -207,8 +206,8 @@ public class NormalizerSynchronizer exte
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_367, oldOid ),
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                I18n.err( I18n.ERR_367, oldOid ) );
         }
 
         String newOid = ( String ) newRdn.getNormValue();
@@ -244,8 +243,8 @@ public class NormalizerSynchronizer exte
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_367, oldOid ),
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                I18n.err( I18n.ERR_367, oldOid ) );
         }
 
         String oid = ( String ) newRdn.getNormValue();
@@ -274,8 +273,8 @@ public class NormalizerSynchronizer exte
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oid ) )
         {
-            throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_368, oid ),
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                I18n.err( I18n.ERR_368, oid ) );
         }
 
         Normalizer normalizer = factory.getNormalizer( schemaManager, entry, schemaManager.getRegistries(),
@@ -293,12 +292,12 @@ public class NormalizerSynchronizer exte
     }
 
 
-    private void checkOidIsUniqueForNormalizer( String oid ) throws NamingException
+    private void checkOidIsUniqueForNormalizer( String oid ) throws Exception
     {
         if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( I18n.err( I18n.ERR_369, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_369, oid ) );
         }
     }
 
@@ -309,17 +308,17 @@ public class NormalizerSynchronizer exte
 
         if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( I18n.err( I18n.ERR_369, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_369, oid ) );
         }
     }
 
 
-    private void checkNewParent( DN newParent ) throws NamingException
+    private void checkNewParent( DN newParent ) throws LdapException
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_370 ), ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_370 ) );
         }
 
         RDN rdn = newParent.getRdn();
@@ -327,12 +326,12 @@ public class NormalizerSynchronizer exte
         if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
             SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_371 ), ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_371 ) );
         }
 
         if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.NORMALIZERS_AT ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_372 ), ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_372 ) );
         }
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java Tue Mar 16 13:08:55 2010
@@ -27,6 +27,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -127,7 +128,7 @@ public class ObjectClassSynchronizer ext
                 String msg = I18n.err( I18n.ERR_373, entry.getDn().getName(), 
                     StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
 
         }
@@ -180,7 +181,7 @@ public class ObjectClassSynchronizer ext
                 String msg = I18n.err( I18n.ERR_374, entry.getDn().getName(),
                     StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
         else
@@ -229,7 +230,7 @@ public class ObjectClassSynchronizer ext
             {
                 String msg = I18n.err( I18n.ERR_375, entry.getDn().getName(), newDn );
 
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
 
             schemaManager.unregisterObjectClass( oldOc.getOid() );
@@ -329,13 +330,13 @@ public class ObjectClassSynchronizer ext
     }
 
 
-    private void checkNewParent( DN newParent ) throws NamingException
+    private void checkNewParent( DN newParent ) throws LdapException
     {
         if ( newParent.size() != 3 )
         {
             throw new LdapInvalidDnException(
-                "The parent dn of a objectClass should be at most 3 name components in length.",
-                ResultCodeEnum.NAMING_VIOLATION );
+                ResultCodeEnum.NAMING_VIOLATION,
+                "The parent dn of a objectClass should be at most 3 name components in length." );
         }
 
         RDN rdn = newParent.getRdn();
@@ -343,14 +344,14 @@ public class ObjectClassSynchronizer ext
         if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
             SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_376 ),
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
+                I18n.err( I18n.ERR_376 ) );
         }
 
         if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_377 ),
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
+                I18n.err( I18n.ERR_377 ) );
         }
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java Tue Mar 16 13:08:55 2010
@@ -39,7 +39,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
-import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -191,7 +190,7 @@ public class RegistrySynchronizerAdaptor
             {
                 String msg = I18n.err( I18n.ERR_81 );
                 LOG.error( msg );
-                throw new LdapInvalidDnException( msg, ResultCodeEnum.NAMING_VIOLATION );
+                throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, msg );
             }
             
             String ouValue = ( String ) opContext.getDn().getRdn().getNormValue();
@@ -201,7 +200,7 @@ public class RegistrySynchronizerAdaptor
             {
                 String msg = I18n.err( I18n.ERR_82, VALID_OU_VALUES );
                 LOG.error( msg );
-                throw new LdapInvalidDnException( msg, ResultCodeEnum.NAMING_VIOLATION );
+                throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, msg );
             }
             
             // this is a valid container.
@@ -211,7 +210,7 @@ public class RegistrySynchronizerAdaptor
         
         String msg = I18n.err( I18n.ERR_83, opContext.getDn() );
         LOG.error( msg );
-        throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+        throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
     }
     
 
@@ -247,7 +246,7 @@ public class RegistrySynchronizerAdaptor
         {
             if ( opContext.getDn().size() != 3 )
             {
-                throw new LdapNamingException( I18n.err( I18n.ERR_378 ), ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_378 ) );
             }
             
             String ouValue = ( String ) opContext.getDn().getRdn().getNormValue();
@@ -255,8 +254,8 @@ public class RegistrySynchronizerAdaptor
             
             if ( ! VALID_OU_VALUES.contains( ouValue ) )
             {
-                throw new LdapInvalidDnException( I18n.err( I18n.ERR_379, VALID_OU_VALUES ),
-                    ResultCodeEnum.NAMING_VIOLATION );
+                throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
+                    I18n.err( I18n.ERR_379, VALID_OU_VALUES ) );
             }
             
             return;

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java Tue Mar 16 13:08:55 2010
@@ -26,8 +26,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.OperationManager;
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
@@ -44,6 +42,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -168,7 +167,7 @@ public class SchemaSynchronizer implemen
     }
 
 
-    public void moveAndRename( DN oriChildName, DN newParentName, RDN newRn, boolean deleteOldRn, ServerEntry entry, boolean cascaded ) throws NamingException
+    public void moveAndRename( DN oriChildName, DN newParentName, RDN newRn, boolean deleteOldRn, ServerEntry entry, boolean cascaded ) throws LdapException
     {
 
     }
@@ -189,8 +188,8 @@ public class SchemaSynchronizer implemen
 
         if ( !parentDn.equals( ouSchemaDN ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_380, ouSchemaDN.getName(),
-                parentDn.toNormName() ), ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_380, ouSchemaDN.getName(),
+                    parentDn.toNormName() ) );
         }
 
         // check if the new schema is enabled or disabled
@@ -264,8 +263,8 @@ public class SchemaSynchronizer implemen
             String msg = I18n.err( I18n.ERR_381, dependents ); 
             LOG.warn( msg );
             throw new LdapUnwillingToPerformException(
-                msg,
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+                ResultCodeEnum.UNWILLING_TO_PERFORM,
+                msg );
         }
         
         // no need to check if schema is enabled or disabled here
@@ -291,8 +290,8 @@ public class SchemaSynchronizer implemen
 
         if ( ! rdnAttributeOid.equals( cnAT.getOid() ) )
         {
-            throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_382, rdnAttribute ),
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                I18n.err( I18n.ERR_382, rdnAttribute ) );
         }
 
         /*
@@ -367,10 +366,10 @@ public class SchemaSynchronizer implemen
      * UNWILLING_TO_PERFORM LdapException.
      */
     public void moveAndRename( DN oriChildName, DN newParentName, String newRn, boolean deleteOldRn, 
-        ServerEntry entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws LdapUnwillingToPerformException
     {
-        throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_383 ),
-            ResultCodeEnum.UNWILLING_TO_PERFORM );
+        throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+            I18n.err( I18n.ERR_383 ) );
     }
 
 
@@ -379,10 +378,10 @@ public class SchemaSynchronizer implemen
      * UNWILLING_TO_PERFORM LdapException.
      */
     public void move( DN oriChildName, DN newParentName, 
-        ServerEntry entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws LdapUnwillingToPerformException
     {
-        throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_383 ),
-            ResultCodeEnum.UNWILLING_TO_PERFORM );
+        throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+            I18n.err( I18n.ERR_383 ) );
     }
 
     
@@ -506,7 +505,7 @@ public class SchemaSynchronizer implemen
     /**
      * Build the DN to access a schemaObject path for a specific schema 
      */
-    private DN buildDn( SchemaObjectType schemaObjectType, String schemaName ) throws NamingException
+    private DN buildDn( SchemaObjectType schemaObjectType, String schemaName ) throws LdapInvalidDnException
     {
         
         DN path = new DN( 
@@ -575,7 +574,7 @@ public class SchemaSynchronizer implemen
             // This is not possible. We can't enable a schema which is not loaded.
             String msg = I18n.err( I18n.ERR_85, schemaName );
             LOG.error( msg );
-            throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
         }
         
         return schemaManager.disable( schemaName );
@@ -692,8 +691,8 @@ public class SchemaSynchronizer implemen
                 if ( ! loaded.containsKey( dependency ) )
                 {
                     throw new LdapUnwillingToPerformException( 
-                        "Unwilling to perform operation on enabled schema with disabled or missing dependencies: " 
-                        + dependency, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                        ResultCodeEnum.UNWILLING_TO_PERFORM, "Unwilling to perform operation on enabled schema with disabled or missing dependencies: " 
+                        + dependency );
                 }
             }
         }
@@ -705,8 +704,8 @@ public class SchemaSynchronizer implemen
                 
                 if ( schemaManager.getLoadedSchema( StringTools.toLowerCase( dependency ) ) == null )
                 {
-                    throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_385, dependency ), 
-                        ResultCodeEnum.UNWILLING_TO_PERFORM );
+                    throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, 
+                        I18n.err( I18n.ERR_385, dependency ) );
                 }
             }
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java?rev=923721&r1=923720&r2=923721&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java Tue Mar 16 13:08:55 2010
@@ -20,17 +20,15 @@
 package org.apache.directory.server.core.schema.registries.synchronizers;
 
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
-import org.apache.directory.shared.ldap.exception.LdapNamingException;
-import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
@@ -132,7 +130,7 @@ public class SyntaxCheckerSynchronizer e
                 String msg = I18n.err( I18n.ERR_386, entry.getDn().getName(),
                     StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
         else
@@ -193,7 +191,7 @@ public class SyntaxCheckerSynchronizer e
                 // Ok, definitively an error
                 String msg = I18n.err( I18n.ERR_387, entry.getDn().getName() );
                 LOG.info( msg );
-                throw new LdapSchemaViolationException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapSchemaViolationException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
 
@@ -208,7 +206,7 @@ public class SyntaxCheckerSynchronizer e
                 String msg = I18n.err( I18n.ERR_386, entry.getDn().getName(),
                     StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
-                throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
             }
         }
         else
@@ -228,8 +226,8 @@ public class SyntaxCheckerSynchronizer e
 
         if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
         {
-            throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_389, oldOid ),
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                I18n.err( I18n.ERR_389, oldOid ) );
         }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
@@ -237,8 +235,8 @@ public class SyntaxCheckerSynchronizer e
 
         if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
         {
-            throw new LdapNamingException( I18n.err( I18n.ERR_390, newOid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_390, newOid ) );
         }
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
@@ -263,8 +261,8 @@ public class SyntaxCheckerSynchronizer e
 
         if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
         {
-            throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_391, oldOid ),
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                I18n.err( I18n.ERR_391, oldOid ) );
         }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
@@ -273,8 +271,8 @@ public class SyntaxCheckerSynchronizer e
 
         if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
         {
-            throw new LdapNamingException( I18n.err( I18n.ERR_390, newOid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_390, newOid ) );
         }
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
@@ -302,8 +300,8 @@ public class SyntaxCheckerSynchronizer e
 
         if ( schemaManager.getLdapSyntaxRegistry().contains( oid ) )
         {
-            throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_393, oid ),
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+                I18n.err( I18n.ERR_393, oid ) );
         }
 
         SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(),
@@ -327,8 +325,8 @@ public class SyntaxCheckerSynchronizer e
 
         if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( I18n.err( I18n.ERR_390, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_390, oid ) );
         }
     }
 
@@ -347,32 +345,32 @@ public class SyntaxCheckerSynchronizer e
         }
         else
         {
-            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_336, oid ),
-                ResultCodeEnum.OTHER );
+            throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
+                I18n.err( I18n.ERR_336, oid ) );
         }
     }
 
 
-    private void checkNewParent( DN newParent ) throws NamingException
+    private void checkNewParent( DN newParent ) throws LdapException
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_396 ),
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
+                I18n.err( I18n.ERR_396 ) );
         }
 
         RDN rdn = newParent.getRdn();
         if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
             SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_397 ),
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
+                I18n.err( I18n.ERR_397 ) );
         }
 
         if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.SYNTAX_CHECKERS_AT ) )
         {
-            throw new LdapInvalidDnException( I18n.err( I18n.ERR_372 ),
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
+                I18n.err( I18n.ERR_372 ) );
         }
     }
 }