Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 72154 invoked from network); 20 Mar 2005 15:54:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Mar 2005 15:54:46 -0000 Received: (qmail 62191 invoked by uid 500); 20 Mar 2005 15:54:46 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 62169 invoked by uid 500); 20 Mar 2005 15:54:45 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 62155 invoked by uid 99); 20 Mar 2005 15:54:45 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 20 Mar 2005 07:54:44 -0800 Received: (qmail 72136 invoked by uid 65534); 20 Mar 2005 15:54:43 -0000 Message-ID: <20050320155443.72131.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Sun, 20 Mar 2005 15:54:43 -0000 Subject: svn commit: r158333 - in directory/apacheds/branches/interceptor_revamp/core: ./ src/main/aspects/org/apache/ldap/server/jndi/ src/main/java/org/apache/ldap/server/ src/main/java/org/apache/ldap/server/db/ src/main/java/org/apache/ldap/server/db/gui/ src/main/java/org/apache/ldap/server/db/jdbm/ src/main/java/org/apache/ldap/server/jndi/ src/main/java/org/apache/ldap/server/jndi/call/ src/main/java/org/apache/ldap/server/jndi/call/interceptor/ src/test/org/apache/ldap/server/jndi/ To: commits@directory.apache.org From: trustin@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: trustin Date: Sun Mar 20 07:54:39 2005 New Revision: 158333 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D158333 Log: All test cases except ShutdownTest now pass. Added: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/Authenticator.java - copied, changed from r158315, directory/apacheds/branches/intercept= or_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/A= uthenticator.java Removed: directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/interceptor/Authenticator.java Modified: directory/apacheds/branches/interceptor_revamp/core/project.properties directory/apacheds/branches/interceptor_revamp/core/src/main/aspects/or= g/apache/ldap/server/jndi/ProviderNexusAspect.aj directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/AbstractServerTest.java directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/db/DefaultOptimizer.java directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/db/gui/IndexDialog.java directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/db/jdbm/JdbmDatabase.java directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/CoreContextFactory.java directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/ServerContext.java directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/ServerContextFactory.java directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/LookupWithAttrIds.java directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/Modify.java directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/interceptor/Authorizer.java directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/interceptor/InterceptorChain.java directory/apacheds/branches/interceptor_revamp/core/src/test/org/apache= /ldap/server/jndi/CreateContextTest.java directory/apacheds/branches/interceptor_revamp/core/src/test/org/apache= /ldap/server/jndi/ShutdownTest.java directory/apacheds/branches/interceptor_revamp/core/src/test/org/apache= /ldap/server/jndi/SimpleAuthenticationTest.java Modified: directory/apacheds/branches/interceptor_revamp/core/project.prope= rties URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/project.properties?view=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/project.properties = (original) +++ directory/apacheds/branches/interceptor_revamp/core/project.properties = Sun Mar 20 07:54:39 2005 @@ -4,7 +4,7 @@ maven.compile.optimize=3Don maven.compile.deprecation=3Don =20 -maven.junit.fork=3Dyes +#maven.junit.fork=3Dyes maven.xdoc.includeProjectDocumentation=3Dyes =20 #maven.javadoc.private=3Dtrue Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/aspe= cts/org/apache/ldap/server/jndi/ProviderNexusAspect.aj URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/aspects/org/apache/ldap/server/jndi/ProviderNexusAspec= t=2Eaj?view=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/aspects/or= g/apache/ldap/server/jndi/ProviderNexusAspect.aj (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/aspects/or= g/apache/ldap/server/jndi/ProviderNexusAspect.aj Sun Mar 20 07:54:39 2005 @@ -181,7 +181,7 @@ */ pointcut newInvocation( Call invocation ): target( invocation ) && - execution( public Call.new() ); + execution( Call.new(..) ); =20 =20 // -------------------------------------------------------------------= ----- @@ -193,7 +193,7 @@ jndiNexusCalls( caller ) { JndiProvider.push( ( LdapContext ) caller ); - //System.out.println( "\npushed " + a_caller + " for join poin= t " + //System.out.println( "\npushed " + caller + " for join point " // + thisJoinPoint ); } =20 @@ -202,7 +202,7 @@ jndiNexusCalls( caller )=20 { LdapContext head =3D JndiProvider.pop(); - //System.out.println( "\npopped " + a_caller + " for join poin= t " + //System.out.println( "\npopped " + caller + " for join point " // + thisJoinPoint ); } =20 @@ -216,4 +216,3 @@ // + thisJoinPoint ); } } - Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/AbstractServerTest.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/AbstractServerTest.java?vi= ew=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/AbstractServerTest.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/AbstractServerTest.java Sun Mar 20 07:54:39 2005 @@ -94,21 +94,18 @@ /** * Deletes the Eve working directory. */ - protected void doDelete( File wkdir ) + protected void doDelete( File wkdir ) throws IOException { - try=20 + if ( doDelete ) { - if ( doDelete ) + if ( wkdir.exists() ) { - if ( wkdir.exists() ) - { - FileUtils.deleteDirectory( wkdir ); - } + FileUtils.deleteDirectory( wkdir ); + } + if ( wkdir.exists() ) + { + throw new IOException( "Failed to delete: " + wkdir ); } - } - catch( IOException ioe ) - { - ioe.printStackTrace(); } } =20 @@ -173,7 +170,6 @@ protected void tearDown() throws Exception { super.tearDown(); - Hashtable env =3D new Hashtable(); =20 env.put( Context.PROVIDER_URL, "ou=3Dsystem" ); Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/db/DefaultOptimizer.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/db/DefaultOptimizer.java?v= iew=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/db/DefaultOptimizer.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/db/DefaultOptimizer.java Sun Mar 20 07:54:39 2005 @@ -87,7 +87,6 @@ * will cost us. Anyway it defaults to a maximum scan count i= f a * scan count is not specified by the implementation. */ - ; } else if ( node.isLeaf() )=20 { Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/db/gui/IndexDialog.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/db/gui/IndexDialog.java?vi= ew=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/db/gui/IndexDialog.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/db/gui/IndexDialog.java Sun Mar 20 07:54:39 2005 @@ -336,7 +336,7 @@ l_row[1] =3D l_rec.getEntryId() ; l_model.addRow( l_row ) ; l_count++ ; - } ; + } =20 m_resultsTbl.setModel( l_model ) ; m_resultsPnl.setBorder( Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/db/jdbm/JdbmDatabase.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/db/jdbm/JdbmDatabase.java?= view=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/db/jdbm/JdbmDatabase.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/db/jdbm/JdbmDatabase.java Sun Mar 20 07:54:39 2005 @@ -864,6 +864,7 @@ }=20 catch ( Throwable t )=20 { + t.printStackTrace(); if ( null =3D=3D rootCause )=20 { rootCause =3D new MultiException(); @@ -880,6 +881,7 @@ } catch ( Throwable t )=20 { + t.printStackTrace(); if ( null =3D=3D rootCause )=20 { rootCause =3D new MultiException(); @@ -887,7 +889,6 @@ =20 rootCause.addThrowable( t ); } - =20 if ( null !=3D rootCause ) { Copied: directory/apacheds/branches/interceptor_revamp/core/src/main/java/o= rg/apache/ldap/server/jndi/Authenticator.java (from r158315, directory/apac= heds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/= jndi/call/interceptor/Authenticator.java) URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/jndi/Authenticator.java?vi= ew=3Ddiff&rev=3D158333&p1=3Ddirectory/apacheds/branches/interceptor_revamp/= core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/Authenticat= or.java&r1=3D158315&p2=3Ddirectory/apacheds/branches/interceptor_revamp/cor= e/src/main/java/org/apache/ldap/server/jndi/Authenticator.java&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/interceptor/Authenticator.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/Authenticator.java Sun Mar 20 07:54:39 2005 @@ -14,7 +14,7 @@ * limitations under the License. * */ -package org.apache.ldap.server.jndi.call.interceptor; +package org.apache.ldap.server.jndi; =20 =20 import java.util.ArrayList; @@ -32,9 +32,9 @@ import org.apache.ldap.common.message.ResultCodeEnum; import org.apache.ldap.common.util.StringTools; import org.apache.ldap.server.auth.LdapPrincipal; -import org.apache.ldap.server.jndi.ServerContext; -import org.apache.ldap.server.jndi.ServerLdapContext; import org.apache.ldap.server.jndi.call.Call; +import org.apache.ldap.server.jndi.call.interceptor.Interceptor; +import org.apache.ldap.server.jndi.call.interceptor.NextInterceptor; =20 /** * A service used to for authenticating users. @@ -131,6 +131,7 @@ } =20 nextProcessor.process(call); + return; } =20 String authList =3D ( String ) ctx.getEnvironment().get( AUTH_TYPE= ); Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/jndi/CoreContextFactory.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.ja= va?view=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/CoreContextFactory.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/CoreContextFactory.java Sun Mar 20 07:54:39 2005 @@ -46,7 +46,6 @@ import org.apache.ldap.server.SystemPartition; import org.apache.ldap.server.auth.AbstractAuthenticator; import org.apache.ldap.server.auth.AnonymousAuthenticator; -import org.apache.ldap.server.auth.Authenticator; import org.apache.ldap.server.auth.AuthenticatorConfig; import org.apache.ldap.server.auth.AuthenticatorContext; import org.apache.ldap.server.auth.SimpleAuthenticator; @@ -523,8 +522,7 @@ * interceptor chain. */ boolean allowAnonymous =3D !initialEnv.containsKey( EnvKeys.DISABL= E_ANONYMOUS ); - org.apache.ldap.server.jndi.call.interceptor.Authenticator authent= icationService =3D - new org.apache.ldap.server.jndi.call.interceptor.Authentic= ator(); + Authenticator authenticationService =3D new Authenticator(); =20 // create authenticator context AuthenticatorContext authenticatorContext =3D new AuthenticatorCon= text(); @@ -538,7 +536,7 @@ authenticatorConfig.setAuthenticatorName( "none" ); authenticatorConfig.setAuthenticatorContext( authenticatorCont= ext ); =20 - Authenticator authenticator =3D new AnonymousAuthenticator(); + org.apache.ldap.server.auth.Authenticator authenticator =3D ne= w AnonymousAuthenticator(); authenticator.init( authenticatorConfig ); authenticationService.register( authenticator ); =20 Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/jndi/ServerContext.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/jndi/ServerContext.java?vi= ew=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/ServerContext.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/ServerContext.java Sun Mar 20 07:54:39 2005 @@ -59,9 +59,6 @@ =20 /** The Principal associated with this context */ private LdapPrincipal principal; - =20 - private boolean principalSetOnce; - =20 // -------------------------------------------------------------------= ----- // Constructors @@ -166,15 +163,9 @@ * Sets the principal of the authenticated user which also happens to = own. * This method can be invoked only once to keep this property safe. */ - public synchronized void setPrincipal( LdapPrincipal principal ) + void setPrincipal( LdapPrincipal principal ) { - if( principalSetOnce ) - { - throw new IllegalStateException(); - } - =20 this.principal =3D principal; - principalSetOnce =3D true; } =20 =20 Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/jndi/ServerContextFactory.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.= java?view=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/ServerContextFactory.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/ServerContextFactory.java Sun Mar 20 07:54:39 2005 @@ -22,18 +22,18 @@ import java.util.Hashtable; =20 import javax.naming.Context; -import javax.naming.NamingException; import javax.naming.Name; +import javax.naming.NamingException; import javax.naming.directory.Attributes; import javax.naming.ldap.LdapContext; =20 import org.apache.ldap.common.exception.LdapConfigurationException; -import org.apache.ldap.common.util.PropertiesUtils; +import org.apache.ldap.common.ldif.LdifIterator; import org.apache.ldap.common.ldif.LdifParser; import org.apache.ldap.common.ldif.LdifParserImpl; -import org.apache.ldap.common.ldif.LdifIterator; import org.apache.ldap.common.message.LockableAttributesImpl; import org.apache.ldap.common.name.LdapName; +import org.apache.ldap.common.util.PropertiesUtils; import org.apache.ldap.server.protocol.LdapProtocolProvider; import org.apache.mina.common.TransportType; import org.apache.mina.registry.Service; @@ -53,22 +53,36 @@ { /** the default LDAP port to use */ private static final int LDAP_PORT =3D 389; + =20 + private static final ServiceRegistry DEFAULT_MINA_REGISTRY; + =20 + static + { + ServiceRegistry tmp =3D null; + try + { + tmp =3D new SimpleServiceRegistry(); + } + catch( IOException e ) + { + e.printStackTrace(); + } + =20 + DEFAULT_MINA_REGISTRY =3D tmp; + } =20 // -------------------------------------------------------------------= ----- // Members // -------------------------------------------------------------------= ----- =20 private Service minaService; - private ServiceRegistry minaRegistry; =20 - /** * Default constructor that sets the provider of this ServerContextFac= tory. */ public ServerContextFactory() { - super(); } =20 =20 @@ -92,9 +106,15 @@ this.minaRegistry.unbind( minaService ); } } - catch ( Throwable t ) + catch( NamingException ne ) { - t.printStackTrace(); + throw ne; + } + catch( Throwable t ) + { + NamingException ne =3D new NamingException( "Failed to shu= tdown." ); + ne.setRootCause( t ); + throw ne; } finally { @@ -145,26 +165,28 @@ =20 try { + if( DEFAULT_MINA_REGISTRY =3D=3D null ) + { + throw new NamingException( "Default MINA service registry = is not available." ); + } + if( registry =3D=3D null ) { - registry =3D new SimpleServiceRegistry(); + registry =3D DEFAULT_MINA_REGISTRY; } =20 registry.bind( service, new LdapProtocolProvider( ( Hashtable = ) initialEnv.clone() ) ); =20 minaService =3D service; - minaRegistry =3D registry; } catch ( IOException e ) { - e.printStackTrace(); - String msg =3D "Failed to bind the service to the service regi= stry: " + service; =20 - LdapConfigurationException e2 =3D new LdapConfigurationExcepti= on( msg ); - - e2.setRootCause( e ); + LdapConfigurationException lce =3D new LdapConfigurationExcept= ion( msg ); + lce.setRootCause( e ); + throw lce; } } =20 Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/jndi/call/LookupWithAttrIds.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/jndi/call/LookupWithAttrId= s=2Ejava?view=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/LookupWithAttrIds.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/LookupWithAttrIds.java Sun Mar 20 07:54:39 2005 @@ -16,11 +16,6 @@ { throw new NullPointerException( "name" ); } - if( attributeIds =3D=3D null ) - { - throw new NullPointerException( "attributeIds" ); - } - =20 this.name =3D name; this.attributeIds =3D attributeIds; } Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/jndi/call/Modify.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/jndi/call/Modify.java?view= =3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/Modify.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/Modify.java Sun Mar 20 07:54:39 2005 @@ -18,10 +18,6 @@ { throw new NullPointerException( "name" ); } - if( attributes =3D=3D null ) - { - throw new NullPointerException( "attributes" ); - } =20 this.name =3D name; this.modOp =3D modOp; Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/jndi/call/interceptor/Authorizer.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/Auth= orizer.java?view=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/interceptor/Authorizer.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/interceptor/Authorizer.java Sun Mar 20 07:54:39= 2005 @@ -86,12 +86,17 @@ public void destroy() { } + =20 + public void process( NextInterceptor nextInterceptor, Call call ) thro= ws NamingException + { + super.process( nextInterceptor, call ); + } =20 // Note: // Lookup, search and list operations need to be handled using a fi= lter // and so we need access to the filter service. =20 - protected void process( NextInterceptor nextProcessor, Delete call ) t= hrows NamingException + protected void process( NextInterceptor nextInterceptor, Delete call )= throws NamingException { Name name =3D call.getName(); Name principalDn =3D getPrincipal( call ).getDn(); @@ -128,7 +133,7 @@ throw new LdapNoPermissionException( msg ); } =20 - nextProcessor.process( call ); + nextInterceptor.process( call ); } =20 =20 @@ -140,9 +145,9 @@ * * @see org.apache.ldap.server.jndi.BaseInterceptor#hasEntry(Name) */ - protected void process( NextInterceptor nextProcessor, HasEntry call )= throws NamingException + protected void process( NextInterceptor nextInterceptor, HasEntry call= ) throws NamingException { - super.process( nextProcessor, call ); + super.process( nextInterceptor, call ); } =20 =20 @@ -159,10 +164,10 @@ * * @see BaseInterceptor#modify(Name, int, Attributes) */ - protected void process( NextInterceptor nextProcessor, Modify call ) t= hrows NamingException + protected void process( NextInterceptor nextInterceptor, Modify call )= throws NamingException { protectModifyAlterations( call, call.getName() ); - nextProcessor.process( call ); + nextInterceptor.process( call ); } =20 =20 @@ -174,10 +179,10 @@ * * @see BaseInterceptor#modify(Name, ModificationItem[]) */ - protected void process( NextInterceptor nextProcessor, ModifyMany call= ) throws NamingException + protected void process( NextInterceptor nextInterceptor, ModifyMany ca= ll ) throws NamingException { protectModifyAlterations( call, call.getName() ); - nextProcessor.process( call ); + nextInterceptor.process( call ); } =20 =20 @@ -231,24 +236,24 @@ // -------------------------------------------------------------------= ----- =20 =20 - protected void process( NextInterceptor nextProcessor, ModifyRN call )= throws NamingException + protected void process( NextInterceptor nextInterceptor, ModifyRN call= ) throws NamingException { protectDnAlterations( call, call.getName() ); - nextProcessor.process( call ); + nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextProcessor, Move call ) thr= ows NamingException + protected void process( NextInterceptor nextInterceptor, Move call ) t= hrows NamingException { protectDnAlterations( call, call.getName() ); - nextProcessor.process( call ); + nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextProcessor, MoveAndModifyRN= call ) throws NamingException + protected void process( NextInterceptor nextInterceptor, MoveAndModify= RN call ) throws NamingException { protectDnAlterations( call, call.getName() ); - nextProcessor.process( call ); + nextInterceptor.process( call ); } =20 =20 @@ -289,8 +294,8 @@ } } =20 - protected void process(NextInterceptor nextProcessor, Lookup call) thr= ows NamingException { - super.process(nextProcessor, call); + protected void process(NextInterceptor nextInterceptor, Lookup call) t= hrows NamingException { + super.process(nextInterceptor, call); =20 Attributes attributes =3D ( Attributes ) call.getResponse(); if( attributes =3D=3D null ) @@ -304,8 +309,8 @@ call.setResponse( retval ); } =20 - protected void process(NextInterceptor nextProcessor, LookupWithAttrId= s call) throws NamingException { - super.process(nextProcessor, call); + protected void process(NextInterceptor nextInterceptor, LookupWithAttr= Ids call) throws NamingException { + super.process(nextInterceptor, call); =20 Attributes attributes =3D ( Attributes ) call.getResponse(); if( attributes =3D=3D null ) @@ -369,8 +374,8 @@ } } =20 - protected void process(NextInterceptor nextProcessor, Search call) thr= ows NamingException { - super.process(nextProcessor, call); + protected void process(NextInterceptor nextInterceptor, Search call) t= hrows NamingException { + super.process(nextInterceptor, call); =20 SearchControls searchControls =3D call.getControls(); if ( searchControls.getReturningAttributes() !=3D null ) Modified: directory/apacheds/branches/interceptor_revamp/core/src/main/java= /org/apache/ldap/server/jndi/call/interceptor/InterceptorChain.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/Inte= rceptorChain.java?view=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/interceptor/InterceptorChain.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/a= pache/ldap/server/jndi/call/interceptor/InterceptorChain.java Sun Mar 20 07= :54:39 2005 @@ -23,7 +23,7 @@ */ public class InterceptorChain { - private final Interceptor FINAL_PROCESSOR =3D new Interceptor() + private final Interceptor FINAL_INTERCEPTOR =3D new Interceptor() { public void init(Properties config) throws NamingException { @@ -44,7 +44,7 @@ =20 private final BackingStore store; private final Map name2entry =3D new HashMap(); - private Entry head =3D new Entry( null, null, "", FINAL_PROCESSOR ); + private Entry head =3D new Entry( null, null, "end", FINAL_INTERCEPTOR= ); private final Entry tail =3D head; =20 /** @@ -88,6 +88,8 @@ Entry newEntry =3D new Entry( null, head, name, interceptor ); head.prevEntry =3D newEntry; head =3D newEntry; + + name2entry.put( name, newEntry ); } =20 /** @@ -100,8 +102,17 @@ checkNewName( name ); =20 Entry newEntry =3D new Entry( tail.prevEntry, tail, name, intercep= tor ); - tail.prevEntry.nextEntry =3D newEntry; + if( tail.prevEntry !=3D null ) + { + tail.prevEntry.nextEntry =3D newEntry; + } + else + { + head =3D newEntry; + } tail.prevEntry =3D newEntry; + =20 + name2entry.put( name, newEntry ); } =20 /** @@ -266,7 +277,7 @@ { private Entry prevEntry; private Entry nextEntry; - //private final String name; + private final String name; private final Interceptor interceptor; private final NextInterceptor nextInterceptor; =20 @@ -284,7 +295,7 @@ =20 this.prevEntry =3D prevEntry; this.nextEntry =3D nextEntry; - //this.name =3D name; + this.name =3D name; this.interceptor =3D interceptor; this.nextInterceptor =3D new NextInterceptor() { Modified: directory/apacheds/branches/interceptor_revamp/core/src/test/org/= apache/ldap/server/jndi/CreateContextTest.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/test/org/apache/ldap/server/jndi/CreateContextTest.java?vie= w=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/test/org/apache= /ldap/server/jndi/CreateContextTest.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/test/org/apache= /ldap/server/jndi/CreateContextTest.java Sun Mar 20 07:54:39 2005 @@ -179,7 +179,7 @@ try { ctx =3D sysRoot.createSubcontext( "ou=3Dtesting00", attributes= ); - fail( "Attept to create exiting context should fail!" ); + fail( "Attempt to create exiting context should fail!" ); } catch ( NamingException e ) { Modified: directory/apacheds/branches/interceptor_revamp/core/src/test/org/= apache/ldap/server/jndi/ShutdownTest.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/test/org/apache/ldap/server/jndi/ShutdownTest.java?view=3Dd= iff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/test/org/apache= /ldap/server/jndi/ShutdownTest.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/test/org/apache= /ldap/server/jndi/ShutdownTest.java Sun Mar 20 07:54:39 2005 @@ -17,6 +17,8 @@ package org.apache.ldap.server.jndi; =20 =20 +import javax.naming.ldap.LdapContext; + import org.apache.ldap.server.AbstractServerTest; =20 =20 @@ -43,6 +45,7 @@ */ public void testShutdownNonNullContext() throws Exception { + System.out.println("A"); overrides.put( EnvKeys.SHUTDOWN, "true" ); =20 try @@ -65,6 +68,7 @@ */ public void testShutdownRestart() throws Exception { + System.out.println("B"); overrides.put( EnvKeys.SHUTDOWN, "true" ); =20 try @@ -78,7 +82,9 @@ =20 assertNotNull( sysRoot ); =20 + System.out.println("C"); // restart the system now setSysRoot( "uid=3Dadmin,ou=3Dsystem", "secret" ); + System.out.println("D"); } } Modified: directory/apacheds/branches/interceptor_revamp/core/src/test/org/= apache/ldap/server/jndi/SimpleAuthenticationTest.java URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_= revamp/core/src/test/org/apache/ldap/server/jndi/SimpleAuthenticationTest.j= ava?view=3Ddiff&r1=3D158332&r2=3D158333 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/apacheds/branches/interceptor_revamp/core/src/test/org/apache= /ldap/server/jndi/SimpleAuthenticationTest.java (original) +++ directory/apacheds/branches/interceptor_revamp/core/src/test/org/apache= /ldap/server/jndi/SimpleAuthenticationTest.java Sun Mar 20 07:54:39 2005 @@ -18,6 +18,7 @@ =20 =20 import java.io.File; +import java.io.IOException; import java.util.Hashtable; import javax.naming.ConfigurationException; import javax.naming.Context; @@ -46,8 +47,9 @@ { /** * Cleans up old database files on creation. + * @throws IOException=20 */ - public SimpleAuthenticationTest() + public SimpleAuthenticationTest() throws IOException { doDelete( new File( "target" + File.separator + "eve" ) ); }