directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r923448 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap: exception/ message/ name/ schema/ schema/normalizers/
Date Mon, 15 Mar 2010 21:33:42 GMT
Author: kayyagari
Date: Mon Mar 15 21:33:42 2010
New Revision: 923448

URL: http://svn.apache.org/viewvc?rev=923448&view=rev
Log:
o updated with the new exceptions
o made the TooComplexException subclass of LdapInvalidDnException
o added a protected constructor to LdapInvalidDnException class to be used by TooComplexException
o removed the references to NameParser form the FastDnParser and DnParser classes

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidDnException.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/ComplexDnParser.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/FastDnParser.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/NameComponentNormalizer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/SimpleNameComponentNormalizer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/TooComplexException.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/BooleanNormalizer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ConcreteNameComponentNormalizer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidDnException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidDnException.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidDnException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidDnException.java Mon Mar 15 21:33:42 2010
@@ -35,6 +35,16 @@ public class LdapInvalidDnException exte
     /** The serial version UUID */
     static final long serialVersionUID = 1L;
 
+    
+    /**
+     * to be used by some special exceptions like TooComplexException
+     */
+    protected LdapInvalidDnException( String message )
+    {
+        super( message );
+    }
+    
+    
     /**
      * Creates a new instance of LdapInvalidDnException.
      *

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java Mon Mar 15 21:33:42 2010
@@ -55,6 +55,7 @@ public class LdapReferralException exten
      */
     public LdapReferralException( Collection<String> refs )
     {
+        super( null );
         this.refs = new ArrayList<String>( refs );
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java Mon Mar 15 21:33:42 2010
@@ -47,7 +47,7 @@ import javax.naming.directory.NoSuchAttr
 import javax.naming.directory.SchemaViolationException;
 
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapOperationException;
 
 
 /**
@@ -2364,9 +2364,9 @@ public enum ResultCodeEnum
      */
     public static ResultCodeEnum getResultCode( Throwable t )
     {
-        if ( t instanceof LdapException )
+        if ( t instanceof LdapOperationException )
         {
-            return ( ( LdapException ) t ).getResultCode();
+            return ( ( LdapOperationException ) t ).getResultCode();
         }
 
         if ( t instanceof CommunicationException )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java Mon Mar 15 21:33:42 2010
@@ -26,12 +26,12 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.Arrays;
 
-import javax.naming.InvalidNameException;
-
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -123,7 +123,7 @@ public class AVA implements Cloneable, C
      * @param upValue The User Provided value
      * @param normValue The normalized value
      */
-    public AVA( String upType, String normType, String upValue, String normValue ) throws InvalidNameException
+    public AVA( String upType, String normType, String upValue, String normValue ) throws LdapInvalidDnException
     {
         this( upType, normType, new ClientStringValue( upValue ), new ClientStringValue( normValue ) );
     }
@@ -144,7 +144,7 @@ public class AVA implements Cloneable, C
      * @param upValue The User Provided value
      * @param normValue The normalized value
      */
-    public AVA( String upType, String normType, byte[] upValue, byte[] normValue ) throws InvalidNameException
+    public AVA( String upType, String normType, byte[] upValue, byte[] normValue ) throws LdapInvalidDnException
     {
         this( upType, normType, new ClientBinaryValue( upValue ), new ClientBinaryValue( normValue ) );
     }
@@ -163,7 +163,7 @@ public class AVA implements Cloneable, C
      * @param upValue The User Provided value
      * @param normValue The normalized value
      */
-    public AVA( String upType, String normType, Value<?> upValue, Value<?> normValue ) throws InvalidNameException
+    public AVA( String upType, String normType, Value<?> upValue, Value<?> normValue ) throws LdapInvalidDnException
     {
         String upTypeTrimmed = StringTools.trim( upType );
         String normTypeTrimmed = StringTools.trim( normType );
@@ -174,7 +174,7 @@ public class AVA implements Cloneable, C
             {
                 String message =  I18n.err( I18n.ERR_04188 );
                 LOG.error( message );
-                throw new InvalidNameException( message );
+                throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message );
             }
             else
             {
@@ -220,7 +220,7 @@ public class AVA implements Cloneable, C
      * @param upName The User Provided name (may be escaped)
      */
     public AVA( String upType, String normType, Value<?> upValue, Value<?> normValue, String upName )
-        throws InvalidNameException
+        throws LdapInvalidDnException
     {
         String upTypeTrimmed = StringTools.trim( upType );
         String normTypeTrimmed = StringTools.trim( normType );
@@ -231,7 +231,7 @@ public class AVA implements Cloneable, C
             {
                 String message = I18n.err( I18n.ERR_04188 );
                 LOG.error( message );
-                throw new InvalidNameException( message );
+                throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message );
             }
             else
             {
@@ -289,23 +289,23 @@ public class AVA implements Cloneable, C
      * @param upType The AVA User Provided type
      * @param type The AVA type
      * 
-     * @throws InvalidNameException if the type or upType are empty or null.
+     * @throws LdapInvalidDnException if the type or upType are empty or null.
      * If the upName is invalid.
      */
-    public void setType( String upType, String type ) throws InvalidNameException
+    public void setType( String upType, String type ) throws LdapInvalidDnException
     {
         if ( StringTools.isEmpty( type ) || StringTools.isEmpty( type.trim() ) )
         {
             String message = I18n.err( I18n.ERR_04188 );
             LOG.error( message );
-            throw new InvalidNameException( message );
+            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message );
         }
         
         if ( StringTools.isEmpty( upType ) || StringTools.isEmpty( upType.trim() ) )
         {
             String message = I18n.err( I18n.ERR_04189 );
             LOG.error( message );
-            throw new InvalidNameException( message );
+            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message );
         }
         
         int equalPosition = upName.indexOf( '=' );
@@ -314,7 +314,7 @@ public class AVA implements Cloneable, C
         {
             String message = I18n.err( I18n.ERR_04190 ); 
             LOG.error( message );
-            throw new InvalidNameException( message );
+            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message );
         }
 
         normType = type.trim().toLowerCase();
@@ -330,12 +330,12 @@ public class AVA implements Cloneable, C
      *
      * @param type The AVA type
      */
-    public void setTypeNormalized( String type ) throws InvalidNameException
+    public void setTypeNormalized( String type ) throws LdapInvalidDnException
     {
         if ( StringTools.isEmpty( type ) || StringTools.isEmpty( type.trim() ) )
         {
             LOG.error( I18n.err( I18n.ERR_04191 ) );
-            throw new InvalidNameException( I18n.err( I18n.ERR_04191 ) );
+            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04191 ) );
         }
 
         normType = type.trim().toLowerCase();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java Mon Mar 15 21:33:42 2010
@@ -23,11 +23,10 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 
-import javax.naming.InvalidNameException;
-
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -191,7 +190,7 @@ public class AVASerializer
                 return atav;
             }
         }
-        catch ( InvalidNameException ine )
+        catch ( LdapInvalidDnException ine )
         {
             throw new IOException( ine.getMessage() );
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/ComplexDnParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/ComplexDnParser.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/ComplexDnParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/ComplexDnParser.java Mon Mar 15 21:33:42 2010
@@ -23,7 +23,8 @@ package org.apache.directory.shared.ldap
 import java.io.StringReader;
 import java.util.List;
 
-import javax.naming.InvalidNameException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 
 
 /**
@@ -41,9 +42,9 @@ public class ComplexDnParser
      * @param name the string representation of the distinguished name
      * @param rdns the (empty) list where parsed RDNs are put to
      * 
-     * @throws InvalidNameException the invalid name exception
+     * @throws LdapInvalidDnException the invalid name exception
      */
-    public void parseDn( String name, List<RDN> rdns ) throws InvalidNameException
+    public void parseDn( String name, List<RDN> rdns ) throws LdapInvalidDnException
     {
         AntlrDnParser dnParser = new AntlrDnParser( new AntlrDnLexer( new StringReader( name ) ) );
         
@@ -53,8 +54,8 @@ public class ComplexDnParser
         }
         catch ( Exception e )
         {
-            InvalidNameException ine = new InvalidNameException( e.getMessage() );
-            ine.setRootCause( e );
+            LdapInvalidDnException ine = new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, e.getMessage() );
+            ine.initCause( e );
             throw ine;
         }
     }
@@ -66,9 +67,9 @@ public class ComplexDnParser
      * @param name the string representationof the relative distinguished name
      * @param rdn the (empty) RDN where parsed ATAVs are put to
      * 
-     * @throws InvalidNameException the invalid name exception
+     * @throws LdapInvalidDnException the invalid name exception
      */
-    public void parseRdn( String name, RDN rdn ) throws InvalidNameException
+    public void parseRdn( String name, RDN rdn ) throws LdapInvalidDnException
     {
         AntlrDnParser dnParser = new AntlrDnParser( new AntlrDnLexer( new StringReader( name ) ) );
         try
@@ -77,8 +78,8 @@ public class ComplexDnParser
         }
         catch ( Exception e )
         {
-            InvalidNameException ine = new InvalidNameException( e.getMessage() );
-            ine.setRootCause( e );
+            LdapInvalidDnException ine = new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, e.getMessage() );
+            ine.initCause( e );
             throw ine;
         }
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java Mon Mar 15 21:33:42 2010
@@ -36,6 +36,9 @@ import javax.naming.Name;
 import javax.naming.NamingException;
 
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -154,7 +157,7 @@ public class DN implements Name, Externa
      * @param upName The String that contains the DN.
      * @throws InvalidNameException if the String does not contain a valid DN.
      */
-    public DN( String upName ) throws InvalidNameException
+    public DN( String upName ) throws LdapInvalidDnException
     {
         if ( upName != null )
         {
@@ -188,9 +191,9 @@ public class DN implements Name, Externa
      * </pre>
      *
      * @param upNames
-     * @throws InvalidNameException
+     * @throws LdapInvalidDnException
      */
-    public DN( String... upRdns ) throws InvalidNameException
+    public DN( String... upRdns ) throws LdapInvalidDnException
     {
         StringBuilder sb = new StringBuilder();
         boolean valueExpected = false;
@@ -226,7 +229,7 @@ public class DN implements Name, Externa
         
         if ( valueExpected )
         {
-            throw new InvalidNameException( I18n.err( I18n.ERR_04202 ) );
+            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04202 ) );
         }
 
         // Stores the representations of a DN : internal (as a string and as a
@@ -263,39 +266,31 @@ public class DN implements Name, Externa
      * @throws InvalidNameException If the DN is invalid.
      * @throws NamingException If something went wrong.
      */
-    public static Name normalize( String name, Map<String, OidNormalizer> oidsMap ) throws InvalidNameException,
-        NamingException
+    public static Name normalize( String name, Map<String, OidNormalizer> oidsMap ) throws LdapInvalidDnException
     {
         if ( ( name == null ) || ( name.length() == 0 ) || ( oidsMap == null ) || ( oidsMap.size() == 0 ) )
         {
             return DN.EMPTY_DN;
         }
 
-        try
-        {
-            DN newDn = new DN( name );
-
-            Enumeration<RDN> rdns = newDn.getAllRdn();
-
-            // Loop on all RDNs
-            while ( rdns.hasMoreElements() )
-            {
-                RDN rdn = rdns.nextElement();
-                String upName = rdn.getUpName();
-                rdnOidToName( rdn, oidsMap );
-                rdn.normalize();
-                rdn.setUpName( upName );
-            }
-
-            newDn.normalizeInternal();
-            newDn.normalized = true;
-
-            return newDn;
-        }
-        catch ( NamingException ne )
+        DN newDn = new DN( name );
+        
+        Enumeration<RDN> rdns = newDn.getAllRdn();
+        
+        // Loop on all RDNs
+        while ( rdns.hasMoreElements() )
         {
-            throw new InvalidNameException( ne.getMessage() );
+            RDN rdn = rdns.nextElement();
+            String upName = rdn.getUpName();
+            rdnOidToName( rdn, oidsMap );
+            rdn.normalize();
+            rdn.setUpName( upName );
         }
+        
+        newDn.normalizeInternal();
+        newDn.normalized = true;
+        
+        return newDn;
     }
 
 
@@ -654,7 +649,7 @@ public class DN implements Name, Externa
                 {
                     nameRdn = new RDN( name.get( name.size() - i - 1 ) );
                 }
-                catch ( InvalidNameException e )
+                catch ( LdapInvalidDnException e )
                 {
                     LOG.error( I18n.err( I18n.ERR_04204, name.toString() ), e );
                     return false;
@@ -748,7 +743,7 @@ public class DN implements Name, Externa
                 {
                     nameRdn = new RDN( name.get( i ) );
                 }
-                catch ( InvalidNameException e )
+                catch ( LdapInvalidDnException e )
                 {
                     LOG.error( I18n.err( I18n.ERR_04204, name.toString() ), e );
                     return false;
@@ -1011,11 +1006,11 @@ public class DN implements Name, Externa
      * @return the updated name (not a new one)
      * @throws ArrayIndexOutOfBoundsException
      *             if posn is outside the specified range
-     * @throws InvalidNameException
+     * @throws LdapInvalidDnException
      *             if <tt>n</tt> is not a valid name, or if the addition of
      *             the components would violate the syntax rules of this name
      */
-    public Name addAllNormalized( int posn, Name name ) throws InvalidNameException
+    public Name addAllNormalized( int posn, Name name ) throws LdapInvalidDnException
     {
         if ( name instanceof DN )
         {
@@ -1117,8 +1112,17 @@ public class DN implements Name, Externa
 
             for ( int i = name.size() - 1; i >= 0; i-- )
             {
-                RDN rdn = new RDN( name.get( i ) );
-                rdns.add( size() - posn, rdn );
+                //FIXME this try-catch block is for the time being, during removal of
+                // java.naming.Name we have to remove this
+                try
+                {
+                    RDN rdn = new RDN( name.get( i ) );
+                    rdns.add( size() - posn, rdn );
+                }
+                catch( LdapInvalidDnException le )
+                {
+                    throw new InvalidNameException( le.getMessage() );
+                }
             }
 
             normalizeInternal();
@@ -1139,10 +1143,20 @@ public class DN implements Name, Externa
             return this;
         }
 
-        // We have to parse the nameComponent which is given as an argument
-        RDN newRdn = new RDN( comp );
-
-        rdns.add( 0, newRdn );
+        //FIXME this try-catch block is for the time being, during removal of
+        // java.naming.Name we have to remove this
+        try
+        {
+            // We have to parse the nameComponent which is given as an argument
+            RDN newRdn = new RDN( comp );
+            
+            rdns.add( 0, newRdn );
+        }
+        catch( LdapInvalidDnException le )
+        {
+            throw new InvalidNameException( le.getMessage() );
+        }
+        
         normalizeInternal();
         toUpName();
 
@@ -1228,11 +1242,20 @@ public class DN implements Name, Externa
             throw new ArrayIndexOutOfBoundsException( message );
         }
 
-        // We have to parse the nameComponent which is given as an argument
-        RDN newRdn = new RDN( comp );
-
-        int realPos = size() - posn;
-        rdns.add( realPos, newRdn );
+        //FIXME this try-catch block is for the time being, during removal of
+        // java.naming.Name we have to remove this
+        try
+        {
+            // We have to parse the nameComponent which is given as an argument
+            RDN newRdn = new RDN( comp );
+            
+            int realPos = size() - posn;
+            rdns.add( realPos, newRdn );
+        }
+        catch( LdapInvalidDnException le )
+        {
+            throw new InvalidNameException( le.getMessage() );
+        }
 
         normalizeInternal();
         toUpName();
@@ -1366,7 +1389,7 @@ public class DN implements Name, Externa
 
 
     private static AVA atavOidToName( AVA atav, Map<String, OidNormalizer> oidsMap )
-        throws InvalidNameException, NamingException
+        throws LdapInvalidDnException
     {
         String type = StringTools.trim( atav.getNormType() );
 
@@ -1405,7 +1428,7 @@ public class DN implements Name, Externa
         {
             // The type is empty : this is not possible...
             LOG.error( I18n.err( I18n.ERR_04209 ) );
-            throw new InvalidNameException( I18n.err( I18n.ERR_04209 ) );
+            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04209 ) );
         }
     }
 
@@ -1416,11 +1439,9 @@ public class DN implements Name, Externa
      *
      * @param rdn The RDN to modify.
      * @param oidsMap The map of all existing oids and normalizer.
-     * @throws InvalidNameException If the RDN is invalid.
-     * @throws NamingException If something went wrong.
+     * @throws LdapInvalidDnException If the RDN is invalid.
      */
-    /** No qualifier */ static void rdnOidToName( RDN rdn, Map<String, OidNormalizer> oidsMap ) throws InvalidNameException,
-        NamingException
+    /** No qualifier */ static void rdnOidToName( RDN rdn, Map<String, OidNormalizer> oidsMap ) throws LdapInvalidDnException
     {
         if ( rdn.getNbAtavs() > 1 )
         {
@@ -1460,9 +1481,9 @@ public class DN implements Name, Externa
      * @param dn The DN to transform.
      * @param oidsMap The mapping between names and oids.
      * @return A normalized form of the DN.
-     * @throws NamingException If something went wrong.
+     * @throws LdapInvalidDnException If something went wrong.
      */
-    public static DN normalize( DN dn, Map<String, OidNormalizer> oidsMap ) throws NamingException
+    public static DN normalize( DN dn, Map<String, OidNormalizer> oidsMap ) throws LdapInvalidDnException
     {
         if ( ( dn == null ) || ( dn.size() == 0 ) || ( oidsMap == null ) || ( oidsMap.size() == 0 ) )
         {
@@ -1501,10 +1522,10 @@ public class DN implements Name, Externa
      * 'commonname' share the same OID.
      *
      * @param oidsMap The mapping between names and oids.
-     * @throws NamingException If something went wrong.
+     * @throws LdapInvalidDnException If something went wrong.
      * @return The normalized DN
      */
-    public DN normalize( Map<String, OidNormalizer> oidsMap ) throws NamingException
+    public DN normalize( Map<String, OidNormalizer> oidsMap ) throws LdapInvalidDnException
     {
         if ( ( oidsMap == null ) || ( oidsMap.size() == 0 ) )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java Mon Mar 15 21:33:42 2010
@@ -24,7 +24,8 @@ import java.util.List;
 
 import javax.naming.InvalidNameException;
 import javax.naming.Name;
-import javax.naming.NameParser;
+
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 
 
 /**
@@ -62,7 +63,7 @@ import javax.naming.NameParser;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public enum DnParser implements NameParser
+public enum DnParser
 {
     INSTANCE;
 
@@ -72,7 +73,7 @@ public enum DnParser implements NamePars
      *
      * @return An instance of the NameParser
      */
-    public static NameParser getNameParser()
+    public static DnParser getNameParser()
     {
         return INSTANCE;
     }
@@ -83,9 +84,9 @@ public enum DnParser implements NamePars
      *
      * @param dn The DN to be parsed
      * @param rdns The list that will contain the RDNs
-     * @throws InvalidNameException If the DN is invalid
+     * @throws LdapInvalidDnException If the DN is invalid
      */
-    public static void parseInternal( String name, List<RDN> rdns ) throws InvalidNameException
+    public static void parseInternal( String name, List<RDN> rdns ) throws LdapInvalidDnException
     {
         try
         {
@@ -114,7 +115,7 @@ public enum DnParser implements NamePars
             parseInternal( name, dn.rdns );
             return true;
         }
-        catch ( InvalidNameException e )
+        catch ( LdapInvalidDnException e )
         {
             return false;
         }
@@ -130,7 +131,7 @@ public enum DnParser implements NamePars
      * @throws InvalidNameException
      *             If the String is not a valid DN
      */
-    public Name parse( String dn ) throws InvalidNameException
+    public Name parse( String dn ) throws LdapInvalidDnException
     {
         return new DN( dn );
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/FastDnParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/FastDnParser.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/FastDnParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/FastDnParser.java Mon Mar 15 21:33:42 2010
@@ -22,13 +22,12 @@ package org.apache.directory.shared.ldap
 
 import java.util.List;
 
-import javax.naming.InvalidNameException;
 import javax.naming.Name;
-import javax.naming.NameParser;
-import javax.naming.NamingException;
 
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.Position;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -40,7 +39,7 @@ import org.apache.directory.shared.ldap.
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 664290 $, $Date: 2008-06-07 08:28:06 +0200 (Sa, 07 Jun 2008) $
  */
-public enum FastDnParser implements NameParser
+public enum FastDnParser
 {
     INSTANCE;
 
@@ -49,7 +48,7 @@ public enum FastDnParser implements Name
      * 
      * @return the name parser
      */
-    public static NameParser getNameParser()
+    public static FastDnParser getNameParser()
     {
         return INSTANCE;
     }
@@ -58,7 +57,7 @@ public enum FastDnParser implements Name
     /* (non-Javadoc)
      * @see javax.naming.NameParser#parse(java.lang.String)
      */
-    public Name parse( String name ) throws NamingException
+    public Name parse( String name ) throws LdapInvalidDnException
     {
         DN dn = new DN();
         parseDn( name, dn );
@@ -72,16 +71,16 @@ public enum FastDnParser implements Name
      * @param name the name to parse
      * @param dn the DN to fill
      * 
-     * @throws InvalidNameException the invalid name exception
+     * @throws LdapInvalidDnException the invalid name exception
      */
-    public void parseDn( String name, DN dn ) throws InvalidNameException
+    public void parseDn( String name, DN dn ) throws LdapInvalidDnException
     {
         parseDn(name, dn.rdns);
         dn.setUpName( name );
         dn.normalizeInternal();
     }
     
-    void parseDn( String name, List<RDN> rdns ) throws InvalidNameException
+    void parseDn( String name, List<RDN> rdns ) throws LdapInvalidDnException
     {
         if ( ( name == null ) || ( name.trim().length() == 0 ) )
         {
@@ -113,7 +112,7 @@ public enum FastDnParser implements Name
                     break;
 
                 default:
-                    throw new InvalidNameException( I18n.err( I18n.ERR_04192, c, pos.start) );
+                    throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04192, c, pos.start) );
             }
         }
     }
@@ -125,17 +124,17 @@ public enum FastDnParser implements Name
      * @param name the name to parse
      * @param rdn the RDN to fill
      * 
-     * @throws InvalidNameException the invalid name exception
+     * @throws LdapInvalidDnException the invalid name exception
      */
-    public void parseRdn( String name, RDN rdn ) throws InvalidNameException
+    public void parseRdn( String name, RDN rdn ) throws LdapInvalidDnException
     {
         if ( name == null || name.length() == 0 )
         {
-            throw new InvalidNameException( I18n.err( I18n.ERR_04193 ) );
+            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04193 ) );
         }
         if( rdn == null )
         {
-            throw new InvalidNameException( I18n.err( I18n.ERR_04194 ) );
+            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04194 ) );
         }
 
         Position pos = new Position();
@@ -146,7 +145,7 @@ public enum FastDnParser implements Name
     }
 
 
-    private void parseRdnInternal( String name, Position pos, RDN rdn ) throws InvalidNameException
+    private void parseRdnInternal( String name, Position pos, RDN rdn ) throws LdapInvalidDnException
     {
         int rdnStart = pos.start;
 
@@ -190,9 +189,9 @@ public enum FastDnParser implements Name
      * 
      * @param name the name
      * @param pos the pos
-     * @throws InvalidNameException 
+     * @throws LdapInvalidDnException 
      */
-    private void matchSpaces( String name, Position pos ) throws InvalidNameException
+    private void matchSpaces( String name, Position pos ) throws LdapInvalidDnException
     {
         while ( hasMoreChars( pos ) )
         {
@@ -214,9 +213,9 @@ public enum FastDnParser implements Name
      * 
      * @return the matched attribute type
      * 
-     * @throws InvalidNameException the invalid name exception
+     * @throws LdapInvalidDnException the invalid name exception
      */
-    private String matchAttributeType( String name, Position pos ) throws InvalidNameException
+    private String matchAttributeType( String name, Position pos ) throws LdapInvalidDnException
     {
         char c = nextChar( name, pos, false );
         switch ( c )
@@ -291,7 +290,7 @@ public enum FastDnParser implements Name
 
             default:
                 // error
-                throw new InvalidNameException( I18n.err( I18n.ERR_04195, c, pos.start) );
+                throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04195, c, pos.start) );
         }
     }
 
@@ -304,9 +303,9 @@ public enum FastDnParser implements Name
      * 
      * @return the attribute type descr
      * 
-     * @throws InvalidNameException the invalid name exception
+     * @throws LdapInvalidDnException the invalid name exception
      */
-    private String matchAttributeTypeDescr( String name, Position pos ) throws InvalidNameException
+    private String matchAttributeTypeDescr( String name, Position pos ) throws LdapInvalidDnException
     {
         StringBuilder descr = new StringBuilder();
         while ( hasMoreChars( pos ) )
@@ -391,7 +390,7 @@ public enum FastDnParser implements Name
 
                 default:
                     // error
-                    throw new InvalidNameException( I18n.err( I18n.ERR_04196, c, pos.start ) );
+                    throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04196, c, pos.start ) );
             }
         }
         return descr.toString();
@@ -406,9 +405,9 @@ public enum FastDnParser implements Name
      * 
      * @return the attribute type OID
      * 
-     * @throws InvalidNameException the invalid name exception
+     * @throws LdapInvalidDnException the invalid name exception
      */
-    private String matchAttributeTypeNumericOid( String name, Position pos ) throws InvalidNameException
+    private String matchAttributeTypeNumericOid( String name, Position pos ) throws LdapInvalidDnException
     {
         StringBuilder numericOid = new StringBuilder();
         int dotCount = 0;
@@ -432,7 +431,7 @@ public enum FastDnParser implements Name
                             pos.start--;
                             break;
                         default:
-                            throw new InvalidNameException( I18n.err( I18n.ERR_04197, c, pos.start ) );
+                            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04197, c, pos.start ) );
                     }
                     break;
 
@@ -474,7 +473,7 @@ public enum FastDnParser implements Name
                                 numericOid.append( c );
                                 break;
                             default:
-                                throw new InvalidNameException( I18n.err( I18n.ERR_04197, c, pos.start ) );
+                                throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04197, c, pos.start ) );
                         }
                     }
                     break;
@@ -487,10 +486,10 @@ public enum FastDnParser implements Name
                     }
                     else
                     {
-                        throw new InvalidNameException( I18n.err( I18n.ERR_04198 ) );
+                        throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04198 ) );
                     }
                 default:
-                    throw new InvalidNameException( I18n.err( I18n.ERR_04199, c, pos.start ) );
+                    throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04199, c, pos.start ) );
             }
         }
     }
@@ -502,14 +501,14 @@ public enum FastDnParser implements Name
      * @param name the name
      * @param pos the pos
      * 
-     * @throws InvalidNameException the invalid name exception
+     * @throws LdapInvalidDnException the invalid name exception
      */
-    private void matchEquals( String name, Position pos ) throws InvalidNameException
+    private void matchEquals( String name, Position pos ) throws LdapInvalidDnException
     {
         char c = nextChar( name, pos, true );
         if ( c != '=' )
         {
-            throw new InvalidNameException( I18n.err( I18n.ERR_04200, c, pos.start ) );
+            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04200, c, pos.start ) );
         }
     }
 
@@ -524,9 +523,9 @@ public enum FastDnParser implements Name
      * 
      * @return the string
      * 
-     * @throws InvalidNameException the invalid name exception
+     * @throws LdapInvalidDnException the invalid name exception
      */
-    private String matchValue( String name, Position pos ) throws InvalidNameException
+    private String matchValue( String name, Position pos ) throws LdapInvalidDnException
     {
         StringBuilder value = new StringBuilder();
         int numTrailingSpaces = 0;
@@ -570,13 +569,13 @@ public enum FastDnParser implements Name
      * @param increment true to increment the position
      * 
      * @return the character
-     * @throws InvalidNameException If no more characters are available
+     * @throws LdapInvalidDnException If no more characters are available
      */
-    private char nextChar( String name, Position pos, boolean increment ) throws InvalidNameException
+    private char nextChar( String name, Position pos, boolean increment ) throws LdapInvalidDnException
     {
         if ( !hasMoreChars( pos ) )
         {
-            throw new InvalidNameException( I18n.err( I18n.ERR_04201, pos.start ) );
+            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04201, pos.start ) );
         }
         char c = name.charAt( pos.start );
         if ( increment )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/NameComponentNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/NameComponentNormalizer.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/NameComponentNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/NameComponentNormalizer.java Mon Mar 15 21:33:42 2010
@@ -21,7 +21,8 @@
 package org.apache.directory.shared.ldap.name;
 
 
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 
 
 /**
@@ -46,9 +47,9 @@ public interface NameComponentNormalizer
      * 
      * @param attributeName the name or OID of the attributeType
      * @return the OID of the attributeType if it is recognized
-     * @throws NamingException if the attributeName is not recognized as a valid alias
+     * @throws LdapInvalidDnException if the attributeName is not recognized as a valid alias
      */
-    String normalizeName( String attributeName ) throws NamingException;
+    String normalizeName( String attributeName ) throws LdapInvalidDnException;
 
     /**
      * Normalizes an attribute's value given the name of the attribute - short
@@ -59,10 +60,10 @@ public interface NameComponentNormalizer
      * @param value
      *            the value of the attribute to normalize
      * @return the normalized value
-     * @throws NamingException
+     * @throws LdapException
      *             if there is a recognition problem or a syntax issue
      */
-    Object normalizeByName( String attributeName, String value ) throws NamingException;
+    Object normalizeByName( String attributeName, String value ) throws LdapException;
 
 
     /**
@@ -74,10 +75,10 @@ public interface NameComponentNormalizer
      * @param value
      *            the value of the attribute to normalize
      * @return the normalized value
-     * @throws NamingException
+     * @throws LdapInvalidDnException
      *             if there is a recognition problem or a syntax issue
      */
-    Object normalizeByName( String attributeName, byte[] value ) throws NamingException;
+    Object normalizeByName( String attributeName, byte[] value ) throws LdapInvalidDnException;
 
 
     /**
@@ -88,10 +89,10 @@ public interface NameComponentNormalizer
      * @param value
      *            the value of the attribute to normalize
      * @return the normalized value
-     * @throws NamingException
+     * @throws LdapInvalidDnException
      *             if there is a recognition problem or a syntax issue
      */
-    Object normalizeByOid( String attributeOid, String value ) throws NamingException;
+    Object normalizeByOid( String attributeOid, String value ) throws LdapInvalidDnException;
 
 
     /**
@@ -102,8 +103,8 @@ public interface NameComponentNormalizer
      * @param value
      *            the value of the attribute to normalize
      * @return the normalized value
-     * @throws NamingException
+     * @throws LdapInvalidDnException
      *             if there is a recognition problem or a syntax issue
      */
-    Object normalizeByOid( String attributeOid, byte[] value ) throws NamingException;
+    Object normalizeByOid( String attributeOid, byte[] value ) throws LdapInvalidDnException;
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java Mon Mar 15 21:33:42 2010
@@ -30,14 +30,12 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 
-import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
-
 import org.apache.commons.collections.MultiMap;
 import org.apache.commons.collections.map.MultiValueMap;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -200,9 +198,9 @@ public class RDN implements Cloneable, C
      * A constructor that parse a String representing a RDN.
      *
      * @param rdn The String containing the RDN to parse
-     * @throws InvalidNameException If the RDN is invalid
+     * @throws LdapInvalidDnException If the RDN is invalid
      */
-    public RDN( String rdn ) throws InvalidNameException
+    public RDN( String rdn ) throws LdapInvalidDnException
     {
         start = 0;
 
@@ -236,9 +234,9 @@ public class RDN implements Cloneable, C
      * @param upValue The user provided value of the RDN
      * @param normType The normalized provided type of the RDN
      * @param normValue The normalized provided value of the RDN
-     * @throws InvalidNameException If the RDN is invalid
+     * @throws LdapInvalidDnException If the RDN is invalid
      */
-    public RDN( String upType, String normType, String upValue, String normValue ) throws InvalidNameException
+    public RDN( String upType, String normType, String upValue, String normValue ) throws LdapInvalidDnException
     {
         addAttributeTypeAndValue( upType, normType, new ClientStringValue( upValue ), new ClientStringValue( normValue ) );
 
@@ -258,9 +256,9 @@ public class RDN implements Cloneable, C
      *
      * @param upType The user provided type of the RDN
      * @param upValue The user provided value of the RDN
-     * @throws InvalidNameException If the RDN is invalid
+     * @throws LdapInvalidDnException If the RDN is invalid
      */
-    public RDN( String upType, String upValue ) throws InvalidNameException
+    public RDN( String upType, String upValue ) throws LdapInvalidDnException
     {
         addAttributeTypeAndValue( upType, upType, new ClientStringValue( upValue ), new ClientStringValue( upValue ) );
 
@@ -393,10 +391,9 @@ public class RDN implements Cloneable, C
      *
      * @param rdn The RDN to modify.
      * @param oidsMap The map of all existing oids and normalizer.
-     * @throws InvalidNameException If the RDN is invalid.
-     * @throws NamingException If something went wrong.
+     * @throws LdapInvalidDnException If the RDN is invalid.
      */
-    public RDN normalize( Map<String, OidNormalizer> oidsMap ) throws InvalidNameException, NamingException
+    public RDN normalize( Map<String, OidNormalizer> oidsMap ) throws LdapInvalidDnException
     {
         String upName = getUpName();
         DN.rdnOidToName( this, oidsMap );
@@ -416,14 +413,14 @@ public class RDN implements Cloneable, C
      * @param type The normalized provided type of the added RDN.
      * @param upValue The user provided value of the added RDN
      * @param value The normalized provided value of the added RDN
-     * @throws InvalidNameException
+     * @throws LdapInvalidDnException
      *             If the RDN is invalid
      */
     // WARNING : The protection level is left unspecified intentionally.
     // We need this method to be visible from the DnParser class, but not
     // from outside this package.
     /* Unspecified protection */void addAttributeTypeAndValue( String upType, String type, Value<?> upValue,
-        Value<?> value ) throws InvalidNameException
+        Value<?> value ) throws LdapInvalidDnException
     {
         // First, let's normalize the type
         String normalizedType = StringTools.lowerCaseAscii( type );
@@ -540,9 +537,9 @@ public class RDN implements Cloneable, C
      * @param type
      *            The type of the NameArgument
      * @return The Value to be returned, or null if none found.
-     * @throws InvalidNameException 
+     * @throws LdapInvalidDnException 
      */
-    public Object getValue( String type ) throws InvalidNameException
+    public Object getValue( String type ) throws LdapInvalidDnException
     {
         // First, let's normalize the type
         String normalizedType = StringTools.lowerCaseAscii( StringTools.trim( type ) );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java Mon Mar 15 21:33:42 2010
@@ -20,7 +20,7 @@
 package org.apache.directory.shared.ldap.name;
 
 
-import javax.naming.InvalidNameException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 
 
 /**
@@ -94,9 +94,9 @@ public class RdnParser
      * @param dn The String to parse
      * @param rdn The RDN to fill. Beware that if the RDN is not empty, the new
      *            AttributeTypeAndValue will be added.
-     * @throws InvalidNameException If the NameComponent is invalid
+     * @throws LdapInvalidDnException If the NameComponent is invalid
      */
-    public static void parse( String dn, RDN rdn ) throws InvalidNameException
+    public static void parse( String dn, RDN rdn ) throws LdapInvalidDnException
     {
         try
         {
@@ -128,7 +128,7 @@ public class RdnParser
             parse( dn, rdn );
             return true;
         }
-        catch ( InvalidNameException e )
+        catch ( LdapInvalidDnException e )
         {
             return false;
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/SimpleNameComponentNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/SimpleNameComponentNormalizer.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/SimpleNameComponentNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/SimpleNameComponentNormalizer.java Mon Mar 15 21:33:42 2010
@@ -21,10 +21,9 @@
 package org.apache.directory.shared.ldap.name;
 
 
-import javax.naming.NamingException;
-
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 
 
@@ -55,25 +54,25 @@ public class SimpleNameComponentNormaliz
     }
 
 
-    public Object normalizeByName( String name, String val ) throws NamingException
+    public Object normalizeByName( String name, String val ) throws LdapInvalidDnException
     {
         return normalizer.normalize( val );
     }
 
 
-    public Object normalizeByName( String name, byte[] val ) throws NamingException
+    public Object normalizeByName( String name, byte[] val ) throws LdapInvalidDnException
     {
         return normalizer.normalize( new ClientBinaryValue( val ) );
     }
 
 
-    public Object normalizeByOid( String oid, String val ) throws NamingException
+    public Object normalizeByOid( String oid, String val ) throws LdapInvalidDnException
     {
         return normalizer.normalize( val );
     }
 
 
-    public Object normalizeByOid( String oid, byte[] val ) throws NamingException
+    public Object normalizeByOid( String oid, byte[] val ) throws LdapInvalidDnException
     {
         return normalizer.normalize( new ClientBinaryValue( val ) );
     }
@@ -85,7 +84,7 @@ public class SimpleNameComponentNormaliz
     }
 
 
-    public String normalizeName( String attributeName ) throws NamingException
+    public String normalizeName( String attributeName ) throws LdapInvalidDnException
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_04216 ) );
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/TooComplexException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/TooComplexException.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/TooComplexException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/TooComplexException.java Mon Mar 15 21:33:42 2010
@@ -20,7 +20,7 @@
 package org.apache.directory.shared.ldap.name;
 
 
-import javax.naming.InvalidNameException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 
 
 /**
@@ -29,13 +29,14 @@ import javax.naming.InvalidNameException
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class TooComplexException extends InvalidNameException
+public class TooComplexException extends LdapInvalidDnException
 {
     private static final long serialVersionUID = 4854240181901296414L;
 
 
     public TooComplexException()
     {
+        super( ( String ) null );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java Mon Mar 15 21:33:42 2010
@@ -20,9 +20,9 @@
 package org.apache.directory.shared.ldap.schema;
 
 
-import javax.naming.NamingException;
-
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 
 
 /**
@@ -64,9 +64,9 @@ public abstract class Normalizer extends
      * 
      * @param value the value to normalize. It must *not* be null !
      * @return the normalized form for a value
-     * @throws NamingException if an error results during normalization
+     * @throws LdapException if an error results during normalization
      */
-    public abstract Value<?> normalize( Value<?> value ) throws NamingException;
+    public abstract Value<?> normalize( Value<?> value ) throws LdapInvalidDnException;
 
 
     /**
@@ -74,9 +74,9 @@ public abstract class Normalizer extends
      * 
      * @param value the value to normalize. It must *not* be null !
      * @return the normalized form for a value
-     * @throws NamingException if an error results during normalization
+     * @throws LdapException if an error results during normalization
      */
-    public abstract String normalize( String value ) throws NamingException;
+    public abstract String normalize( String value ) throws LdapInvalidDnException;
 
 
     /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/BooleanNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/BooleanNormalizer.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/BooleanNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/BooleanNormalizer.java Mon Mar 15 21:33:42 2010
@@ -20,11 +20,10 @@
 package org.apache.directory.shared.ldap.schema.normalizers;
 
 
-import javax.naming.NamingException;
-
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 
 
@@ -52,7 +51,7 @@ public class BooleanNormalizer extends N
     /**
      * {@inheritDoc}
      */
-    public Value<?> normalize( Value<?> value ) throws NamingException
+    public Value<?> normalize( Value<?> value ) throws LdapException
     {
         if ( value == null )
         {
@@ -68,7 +67,7 @@ public class BooleanNormalizer extends N
     /**
      * {@inheritDoc}
      */
-    public String normalize( String value ) throws NamingException
+    public String normalize( String value ) throws LdapException
     {
         if ( value == null )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java Mon Mar 15 21:33:42 2010
@@ -20,9 +20,8 @@
 package org.apache.directory.shared.ldap.schema.normalizers;
 
 
-import javax.naming.NamingException;
-
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
@@ -109,7 +108,7 @@ public class CachingNormalizer extends N
     /**
      * {@inheritDoc}
      */
-    public Value<?> normalize( Value<?> value ) throws NamingException
+    public Value<?> normalize( Value<?> value ) throws LdapException
     {
         if ( value == null )
         {
@@ -132,7 +131,7 @@ public class CachingNormalizer extends N
     /**
      * {@inheritDoc}
      */
-    public String normalize( String value ) throws NamingException
+    public String normalize( String value ) throws LdapException
     {
         if ( value == null )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ConcreteNameComponentNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ConcreteNameComponentNormalizer.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ConcreteNameComponentNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ConcreteNameComponentNormalizer.java Mon Mar 15 21:33:42 2010
@@ -26,6 +26,7 @@ import javax.naming.NamingException;
 
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
@@ -109,7 +110,7 @@ public class ConcreteNameComponentNormal
     /**
      * @see NameComponentNormalizer#normalizeByName(String, String)
      */
-    public Object normalizeByName( String name, String value ) throws NamingException
+    public Object normalizeByName( String name, String value ) throws LdapException
     {
         AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( name );
         
@@ -140,7 +141,7 @@ public class ConcreteNameComponentNormal
     /**
      * @see NameComponentNormalizer#normalizeByName(String, String)
      */
-    public Object normalizeByName( String name, byte[] value ) throws NamingException
+    public Object normalizeByName( String name, byte[] value ) throws LdapException
     {
         AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( name );
         
@@ -168,7 +169,7 @@ public class ConcreteNameComponentNormal
     /**
      * @see NameComponentNormalizer#normalizeByOid(String, String)
      */
-    public Object normalizeByOid( String oid, String value ) throws NamingException
+    public Object normalizeByOid( String oid, String value ) throws LdapException
     {
         return lookup( oid ).normalize( value );
     }
@@ -177,7 +178,7 @@ public class ConcreteNameComponentNormal
     /**
      * @see NameComponentNormalizer#normalizeByOid(String, String)
      */
-    public Object normalizeByOid( String oid, byte[] value ) throws NamingException
+    public Object normalizeByOid( String oid, byte[] value ) throws LdapException
     {
         return lookup( oid ).normalize( new ClientBinaryValue( value ) );
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java?rev=923448&r1=923447&r2=923448&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java Mon Mar 15 21:33:42 2010
@@ -26,7 +26,8 @@ import org.apache.directory.shared.i18n.
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
-import org.apache.directory.shared.ldap.exception.LdapNamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapOtherException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -68,7 +69,7 @@ public class NameOrNumericIdNormalizer e
     /**
      * {@inheritDoc} 
      */
-    public Value<?> normalize( Value<?> value ) throws NamingException
+    public Value<?> normalize( Value<?> value ) throws LdapException
     {
         if ( value == null )
         {
@@ -97,14 +98,14 @@ public class NameOrNumericIdNormalizer e
         }
 
         // if all else fails
-        throw new LdapNamingException( I18n.err( I18n.ERR_04225, value ), ResultCodeEnum.OTHER );
+        throw new LdapOtherException( I18n.err( I18n.ERR_04225, value ) );
     }
 
 
     /**
      * {@inheritDoc} 
      */
-    public String normalize( String value ) throws NamingException
+    public String normalize( String value ) throws LdapException
     {
         if ( value == null )
         {
@@ -131,7 +132,7 @@ public class NameOrNumericIdNormalizer e
         }
 
         // if all else fails
-        throw new LdapNamingException( I18n.err( I18n.ERR_04226, value ), ResultCodeEnum.OTHER );
+        throw new LdapOtherException( I18n.err( I18n.ERR_04226, value ) );
     }
 
 



Mime
View raw message