directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 56479 - in incubator/directory: eve/trunk/jndi-provider/src/java/org/apache/eve/jndi eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/ibs eve/trunk/protocol/src/java/org/apache/eve/protocol ldap/trunk/common/src/java/org/apache/ldap/common/exception ldap/trunk/common/src/java/org/apache/ldap/common/schema
Date Wed, 03 Nov 2004 06:32:51 GMT
Author: akarasulu
Date: Tue Nov  2 22:32:50 2004
New Revision: 56479

Added:
   incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/exception/LdapInvalidNameException.java
Modified:
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/AuthenticationService.java
   incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/ibs/AuthorizationService.java
   incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/AddHandler.java
   incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/DnNormalizer.java
Log:
cleanups and adding new exception

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/AuthenticationService.java
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/AuthenticationService.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/AuthenticationService.java
Tue Nov  2 22:32:50 2004
@@ -18,7 +18,6 @@
 
 
 import java.util.Hashtable;
-import java.io.IOException;
 import javax.naming.Context;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
@@ -62,20 +61,11 @@
      * @param nexus the root nexus to access all database partitions
      */
     public AuthenticationService( RootNexus nexus, NameComponentNormalizer normalizer,
-                                  boolean allowAnonymous ) throws LdapNamingException
+                                  boolean allowAnonymous ) throws NamingException
     {
         this.nexus = nexus;
         this.allowAnonymous = allowAnonymous;
-        try
-        {
-            this.parser = new DnParser( normalizer );
-        }
-        catch ( IOException e )
-        {
-            LdapNamingException ene = new LdapNamingException( ResultCodeEnum.OTHER );
-            ene.setRootCause( e );
-            throw ene;
-        }
+        this.parser = new DnParser( normalizer );
     }
 
 

Modified: incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/ibs/AuthorizationService.java
==============================================================================
--- incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/ibs/AuthorizationService.java
(original)
+++ incubator/directory/eve/trunk/jndi-provider/src/java/org/apache/eve/jndi/ibs/AuthorizationService.java
Tue Nov  2 22:32:50 2004
@@ -17,7 +17,6 @@
 package org.apache.eve.jndi.ibs;
 
 
-import java.io.IOException;
 import javax.naming.Name;
 import javax.naming.NamingException;
 import javax.naming.ldap.LdapContext;
@@ -63,17 +62,7 @@
                                  FilterService filterService )
             throws NamingException
     {
-        try
-        {
-            this.dnParser = new DnParser( normalizer );
-        }
-        catch ( IOException e )
-        {
-            NamingException ne = new NamingException();
-            ne.setRootCause( e );
-            throw ne;
-        }
-
+        this.dnParser = new DnParser( normalizer );
         AuthorizationFilter filter = new AuthorizationFilter();
         filterService.addLookupFilter( filter );
         filterService.addSearchResultFilter( filter );

Modified: incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/AddHandler.java
==============================================================================
--- incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/AddHandler.java
(original)
+++ incubator/directory/eve/trunk/protocol/src/java/org/apache/eve/protocol/AddHandler.java
Tue Nov  2 22:32:50 2004
@@ -23,7 +23,6 @@
 import org.apache.seda.listener.ClientKey;
 import org.apache.seda.protocol.AbstractSingleReplyHandler;
 
-import org.apache.ldap.common.NotImplementedException;
 import org.apache.ldap.common.name.LdapName;
 import org.apache.ldap.common.message.*;
 

Added: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/exception/LdapInvalidNameException.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/exception/LdapInvalidNameException.java
Tue Nov  2 22:32:50 2004
@@ -0,0 +1,71 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.ldap.common.exception;
+
+
+import javax.naming.InvalidNameException;
+
+import org.apache.ldap.common.message.ResultCodeEnum;
+
+
+/**
+ * A subclass of InvalidNameException designed to hold an unequivocal LDAP
+ * result code.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class LdapInvalidNameException extends InvalidNameException implements LdapException
+{
+    /** the LDAP resultCode this exception is associated with */
+    private final ResultCodeEnum resultCode;
+
+
+    /**
+     * Creates an Eve NamingException.
+     *
+     * @param resultCode the LDAP resultCode this exception is associated with
+     */
+    public LdapInvalidNameException( ResultCodeEnum resultCode )
+    {
+        this.resultCode = resultCode;
+    }
+
+
+    /**
+     * Creates an Eve NamingException.
+     *
+     * @param explanation an explanation for the failure
+     * @param resultCode the LDAP resultCode this exception is associated with
+     */
+    public LdapInvalidNameException( String explanation, ResultCodeEnum resultCode )
+    {
+        super( explanation );
+        this.resultCode = resultCode;
+    }
+
+
+    /**
+     * Gets the LDAP resultCode this exception is associated with.
+     *
+     * @return the LDAP resultCode this exception is associated with
+     */
+    public ResultCodeEnum getResultCode()
+    {
+        return resultCode;
+    }
+}

Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/DnNormalizer.java
==============================================================================
--- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/DnNormalizer.java
(original)
+++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/DnNormalizer.java
Tue Nov  2 22:32:50 2004
@@ -17,8 +17,6 @@
 package org.apache.ldap.common.schema;
 
 
-import java.io.IOException ;
-
 import javax.naming.Name ;
 import javax.naming.NameParser ;
 import javax.naming.NamingException ;
@@ -52,8 +50,7 @@
      */
     public DnNormalizer() throws NamingException
     {
-        this ( new SimpleNameComponentNormalizer(
-                new DeepTrimToLowerNormalizer() ) ) ;
+        this ( new SimpleNameComponentNormalizer( new DeepTrimToLowerNormalizer() ) ) ;
     }
 
 
@@ -77,20 +74,9 @@
      *
      * @param normalizer the name component normalizer to use
      */
-    public DnNormalizer( NameComponentNormalizer normalizer )
-        throws NamingException
+    public DnNormalizer( NameComponentNormalizer normalizer ) throws NamingException
     {
-        try
-        {
-            parser = new DnParser( normalizer ) ;
-        }
-        catch ( IOException ioe )
-        {
-            NamingException ne = new NamingException(
-                "Problem creating DnNormalizer's NameParser" ) ;
-            ne.setRootCause( ioe ) ;
-            throw ne ;
-        }
+        parser = new DnParser( normalizer ) ;
     }
 
 

Mime
View raw message