Author: trustin
Date: Sun Mar 20 07:54:39 2005
New Revision: 158333
URL: http://svn.apache.org/viewcvs?view=rev&rev=158333
Log:
All test cases except ShutdownTest now pass.
Added:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/Authenticator.java
- copied, changed from r158315,
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/Authenticator.java
Removed:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/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/org/apache/ldap/server/jndi/ProviderNexusAspect.aj
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/AbstractServerTest.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/db/DefaultOptimizer.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/db/gui/IndexDialog.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/db/jdbm/JdbmDatabase.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ServerContext.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/LookupWithAttrIds.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/Modify.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/Authorizer.java
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/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.properties
URL:
http://svn.apache.org/viewcvs/directory/apacheds/branches/interceptor_revamp/core/project.properties?view=diff&r1=158332&r2=158333
==============================================================================
--- 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=on
maven.compile.deprecation=on
-maven.junit.fork=yes
+#maven.junit.fork=yes
maven.xdoc.includeProjectDocumentation=yes
#maven.javadoc.private=true
Modified:
directory/apacheds/branches/interceptor_revamp/core/src/main/aspects/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/ProviderNexusAspect.aj?view=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/aspects/org/apache/ldap/server/jndi/ProviderNexusAspect.aj
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/aspects/org/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(..) );
// ------------------------------------------------------------------------
@@ -193,7 +193,7 @@
jndiNexusCalls( caller )
{
JndiProvider.push( ( LdapContext ) caller );
- //System.out.println( "\npushed " + a_caller + " for join point "
+ //System.out.println( "\npushed " + caller + " for join point "
// + thisJoinPoint );
}
@@ -202,7 +202,7 @@
jndiNexusCalls( caller )
{
LdapContext head = JndiProvider.pop();
- //System.out.println( "\npopped " + a_caller + " for join point "
+ //System.out.println( "\npopped " + caller + " for join point "
// + thisJoinPoint );
}
@@ -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?view=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/AbstractServerTest.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/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
+ 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();
}
}
@@ -173,7 +170,6 @@
protected void tearDown() throws Exception
{
super.tearDown();
-
Hashtable env = new Hashtable();
env.put( Context.PROVIDER_URL, "ou=system" );
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?view=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/db/DefaultOptimizer.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/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 if a
* scan count is not specified by the implementation.
*/
- ;
}
else if ( node.isLeaf() )
{
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?view=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/db/gui/IndexDialog.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/db/gui/IndexDialog.java
Sun Mar 20 07:54:39 2005
@@ -336,7 +336,7 @@
l_row[1] = l_rec.getEntryId() ;
l_model.addRow( l_row ) ;
l_count++ ;
- } ;
+ }
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=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/db/jdbm/JdbmDatabase.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/db/jdbm/JdbmDatabase.java
Sun Mar 20 07:54:39 2005
@@ -864,6 +864,7 @@
}
catch ( Throwable t )
{
+ t.printStackTrace();
if ( null == rootCause )
{
rootCause = new MultiException();
@@ -880,6 +881,7 @@
}
catch ( Throwable t )
{
+ t.printStackTrace();
if ( null == rootCause )
{
rootCause = new MultiException();
@@ -887,7 +889,6 @@
rootCause.addThrowable( t );
}
-
if ( null != rootCause )
{
Copied:
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/Authenticator.java
(from r158315,
directory/apacheds/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?view=diff&rev=158333&p1=directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/Authenticator.java&r1=158315&p2=directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/Authenticator.java&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/Authenticator.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/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;
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;
/**
* A service used to for authenticating users.
@@ -131,6 +131,7 @@
}
nextProcessor.process(call);
+ return;
}
String authList = ( 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.java?view=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/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 = !initialEnv.containsKey(
EnvKeys.DISABLE_ANONYMOUS );
- org.apache.ldap.server.jndi.call.interceptor.Authenticator
authenticationService =
- new
org.apache.ldap.server.jndi.call.interceptor.Authenticator();
+ Authenticator authenticationService = new Authenticator();
// create authenticator context
AuthenticatorContext authenticatorContext = new AuthenticatorContext();
@@ -538,7 +536,7 @@
authenticatorConfig.setAuthenticatorName( "none" );
authenticatorConfig.setAuthenticatorContext( authenticatorContext
);
- Authenticator authenticator = new AnonymousAuthenticator();
+ org.apache.ldap.server.auth.Authenticator authenticator = new
AnonymousAuthenticator();
authenticator.init( authenticatorConfig );
authenticationService.register( authenticator );
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?view=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ServerContext.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ServerContext.java
Sun Mar 20 07:54:39 2005
@@ -59,9 +59,6 @@
/** The Principal associated with this context */
private LdapPrincipal principal;
-
- private boolean principalSetOnce;
-
// ------------------------------------------------------------------------
// 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();
- }
-
this.principal = principal;
- principalSetOnce = true;
}
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=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
Sun Mar 20 07:54:39 2005
@@ -22,18 +22,18 @@
import java.util.Hashtable;
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;
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 = 389;
+
+ private static final ServiceRegistry DEFAULT_MINA_REGISTRY;
+
+ static
+ {
+ ServiceRegistry tmp = null;
+ try
+ {
+ tmp = new SimpleServiceRegistry();
+ }
+ catch( IOException e )
+ {
+ e.printStackTrace();
+ }
+
+ DEFAULT_MINA_REGISTRY = tmp;
+ }
// ------------------------------------------------------------------------
// Members
// ------------------------------------------------------------------------
private Service minaService;
-
private ServiceRegistry minaRegistry;
-
/**
* Default constructor that sets the provider of this ServerContextFactory.
*/
public ServerContextFactory()
{
- super();
}
@@ -92,9 +106,15 @@
this.minaRegistry.unbind( minaService );
}
}
- catch ( Throwable t )
+ catch( NamingException ne )
{
- t.printStackTrace();
+ throw ne;
+ }
+ catch( Throwable t )
+ {
+ NamingException ne = new NamingException( "Failed to
shutdown." );
+ ne.setRootCause( t );
+ throw ne;
}
finally
{
@@ -145,26 +165,28 @@
try
{
+ if( DEFAULT_MINA_REGISTRY == null )
+ {
+ throw new NamingException( "Default MINA service registry is
not available." );
+ }
+
if( registry == null )
{
- registry = new SimpleServiceRegistry();
+ registry = DEFAULT_MINA_REGISTRY;
}
registry.bind( service, new LdapProtocolProvider( ( Hashtable )
initialEnv.clone() ) );
minaService = service;
-
minaRegistry = registry;
}
catch ( IOException e )
{
- e.printStackTrace();
-
String msg = "Failed to bind the service to the service registry:
" + service;
- LdapConfigurationException e2 = new LdapConfigurationException(
msg );
-
- e2.setRootCause( e );
+ LdapConfigurationException lce = new LdapConfigurationException(
msg );
+ lce.setRootCause( e );
+ throw lce;
}
}
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/LookupWithAttrIds.java?view=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/LookupWithAttrIds.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/LookupWithAttrIds.java
Sun Mar 20 07:54:39 2005
@@ -16,11 +16,6 @@
{
throw new NullPointerException( "name" );
}
- if( attributeIds == null )
- {
- throw new NullPointerException( "attributeIds" );
- }
-
this.name = name;
this.attributeIds = 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=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/Modify.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/Modify.java
Sun Mar 20 07:54:39 2005
@@ -18,10 +18,6 @@
{
throw new NullPointerException( "name" );
}
- if( attributes == null )
- {
- throw new NullPointerException( "attributes" );
- }
this.name = name;
this.modOp = 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/Authorizer.java?view=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/Authorizer.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/Authorizer.java
Sun Mar 20 07:54:39 2005
@@ -86,12 +86,17 @@
public void destroy()
{
}
+
+ public void process( NextInterceptor nextInterceptor, Call call ) throws
NamingException
+ {
+ super.process( nextInterceptor, call );
+ }
// Note:
// Lookup, search and list operations need to be handled using a filter
// and so we need access to the filter service.
- protected void process( NextInterceptor nextProcessor, Delete call )
throws NamingException
+ protected void process( NextInterceptor nextInterceptor, Delete call )
throws NamingException
{
Name name = call.getName();
Name principalDn = getPrincipal( call ).getDn();
@@ -128,7 +133,7 @@
throw new LdapNoPermissionException( msg );
}
- nextProcessor.process( call );
+ nextInterceptor.process( call );
}
@@ -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 );
}
@@ -159,10 +164,10 @@
*
* @see BaseInterceptor#modify(Name, int, Attributes)
*/
- protected void process( NextInterceptor nextProcessor, Modify call )
throws NamingException
+ protected void process( NextInterceptor nextInterceptor, Modify call )
throws NamingException
{
protectModifyAlterations( call, call.getName() );
- nextProcessor.process( call );
+ nextInterceptor.process( call );
}
@@ -174,10 +179,10 @@
*
* @see BaseInterceptor#modify(Name, ModificationItem[])
*/
- protected void process( NextInterceptor nextProcessor, ModifyMany call )
throws NamingException
+ protected void process( NextInterceptor nextInterceptor, ModifyMany call )
throws NamingException
{
protectModifyAlterations( call, call.getName() );
- nextProcessor.process( call );
+ nextInterceptor.process( call );
}
@@ -231,24 +236,24 @@
// ------------------------------------------------------------------------
- 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 );
}
- protected void process( NextInterceptor nextProcessor, Move call ) throws
NamingException
+ protected void process( NextInterceptor nextInterceptor, Move call )
throws NamingException
{
protectDnAlterations( call, call.getName() );
- nextProcessor.process( call );
+ nextInterceptor.process( call );
}
- protected void process( NextInterceptor nextProcessor, MoveAndModifyRN
call ) throws NamingException
+ protected void process( NextInterceptor nextInterceptor, MoveAndModifyRN
call ) throws NamingException
{
protectDnAlterations( call, call.getName() );
- nextProcessor.process( call );
+ nextInterceptor.process( call );
}
@@ -289,8 +294,8 @@
}
}
- protected void process(NextInterceptor nextProcessor, Lookup call) throws
NamingException {
- super.process(nextProcessor, call);
+ protected void process(NextInterceptor nextInterceptor, Lookup call)
throws NamingException {
+ super.process(nextInterceptor, call);
Attributes attributes = ( Attributes ) call.getResponse();
if( attributes == null )
@@ -304,8 +309,8 @@
call.setResponse( retval );
}
- protected void process(NextInterceptor nextProcessor, LookupWithAttrIds
call) throws NamingException {
- super.process(nextProcessor, call);
+ protected void process(NextInterceptor nextInterceptor, LookupWithAttrIds
call) throws NamingException {
+ super.process(nextInterceptor, call);
Attributes attributes = ( Attributes ) call.getResponse();
if( attributes == null )
@@ -369,8 +374,8 @@
}
}
- protected void process(NextInterceptor nextProcessor, Search call) throws
NamingException {
- super.process(nextProcessor, call);
+ protected void process(NextInterceptor nextInterceptor, Search call)
throws NamingException {
+ super.process(nextInterceptor, call);
SearchControls searchControls = call.getControls();
if ( searchControls.getReturningAttributes() != 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/InterceptorChain.java?view=diff&r1=158332&r2=158333
==============================================================================
---
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/ldap/server/jndi/call/interceptor/InterceptorChain.java
(original)
+++
directory/apacheds/branches/interceptor_revamp/core/src/main/java/org/apache/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 = new Interceptor()
+ private final Interceptor FINAL_INTERCEPTOR = new Interceptor()
{
public void init(Properties config) throws NamingException
{
@@ -44,7 +44,7 @@
private final BackingStore store;
private final Map name2entry = new HashMap();
- private Entry head = new Entry( null, null, "", FINAL_PROCESSOR );
+ private Entry head = new Entry( null, null, "end", FINAL_INTERCEPTOR );
private final Entry tail = head;
/**
@@ -88,6 +88,8 @@
Entry newEntry = new Entry( null, head, name, interceptor );
head.prevEntry = newEntry;
head = newEntry;
+
+ name2entry.put( name, newEntry );
}
/**
@@ -100,8 +102,17 @@
checkNewName( name );
Entry newEntry = new Entry( tail.prevEntry, tail, name, interceptor );
- tail.prevEntry.nextEntry = newEntry;
+ if( tail.prevEntry != null )
+ {
+ tail.prevEntry.nextEntry = newEntry;
+ }
+ else
+ {
+ head = newEntry;
+ }
tail.prevEntry = newEntry;
+
+ name2entry.put( name, newEntry );
}
/**
@@ -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;
@@ -284,7 +295,7 @@
this.prevEntry = prevEntry;
this.nextEntry = nextEntry;
- //this.name = name;
+ this.name = name;
this.interceptor = interceptor;
this.nextInterceptor = 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?view=diff&r1=158332&r2=158333
==============================================================================
---
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 = sysRoot.createSubcontext( "ou=testing00", 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=diff&r1=158332&r2=158333
==============================================================================
---
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;
+import javax.naming.ldap.LdapContext;
+
import org.apache.ldap.server.AbstractServerTest;
@@ -43,6 +45,7 @@
*/
public void testShutdownNonNullContext() throws Exception
{
+ System.out.println("A");
overrides.put( EnvKeys.SHUTDOWN, "true" );
try
@@ -65,6 +68,7 @@
*/
public void testShutdownRestart() throws Exception
{
+ System.out.println("B");
overrides.put( EnvKeys.SHUTDOWN, "true" );
try
@@ -78,7 +82,9 @@
assertNotNull( sysRoot );
+ System.out.println("C");
// restart the system now
setSysRoot( "uid=admin,ou=system", "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.java?view=diff&r1=158332&r2=158333
==============================================================================
---
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 @@
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
*/
- public SimpleAuthenticationTest()
+ public SimpleAuthenticationTest() throws IOException
{
doDelete( new File( "target" + File.separator + "eve" ) );
}