Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 30509 invoked from network); 28 Mar 2005 22:20:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Mar 2005 22:20:19 -0000 Received: (qmail 84367 invoked by uid 500); 28 Mar 2005 22:20:19 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 84320 invoked by uid 500); 28 Mar 2005 22:20:18 -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 84306 invoked by uid 99); 28 Mar 2005 22:20:18 -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; Mon, 28 Mar 2005 14:20:17 -0800 Received: (qmail 30500 invoked by uid 65534); 28 Mar 2005 22:20:16 -0000 Message-ID: <20050328222016.30499.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: Mon, 28 Mar 2005 22:20:15 -0000 Subject: svn commit: r159316 - in directory/apacheds/trunk/core/src: main/java/org/apache/ldap/server/interceptor/ main/java/org/apache/ldap/server/invocation/ main/java/org/apache/ldap/server/jndi/ main/java/org/apache/ldap/server/normalization/ test/org/apache/ldap/server/interceptor/ To: commits@directory.apache.org From: akarasulu@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Mon Mar 28 14:20:10 2005 New Revision: 159316 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D159316 Log: changes ... o added normalization service o had to add setters for names of various invocation objects so normalizer= can alter the name used to make the call - I wonder how trustin got around t= his o took care of some formating Added: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/norm= alization/ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/norm= alization/NormalizationService.java Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/BaseInterceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/Interceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorChain.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorConfigBuilder.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorContext.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorException.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/NextInterceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Add.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Delete.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/GetMatchedDN.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/GetSuffix.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/HasEntry.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/IsSuffix.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/List.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Lookup.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/LookupWithAttrIds.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Modify.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/ModifyMany.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/ModifyRN.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Move.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/MoveAndModifyRN.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Search.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi= /CoreContextFactory.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi= /EnvKeys.java directory/apacheds/trunk/core/src/test/org/apache/ldap/server/intercept= or/ConfigurationTest.java Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/interceptor/BaseInterceptor.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/interceptor/BaseInterceptor.java?view=3Ddiff&r1= =3D159315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/BaseInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/BaseInterceptor.java Mon Mar 28 14:20:10 2005 @@ -25,12 +25,13 @@ =20 =20 /** - * A easy-to-use implementation of {@link Interceptor} that demultiplexes = invocations using method signature - * overloading. + * A easy-to-use implementation of {@link Interceptor} that demultiplexes = invocations + * using method signature overloading. *

- * This {@link Interceptor} forwards received process requests to an appro= priate process(NextInterceptor, - * ConcreteInvocation) methods. Users can override any process(..) methods that - * corresponds to {@link Invocation} types that he or she wants to filter. + * This {@link Interceptor} forwards received process requests to an appro= priate + * process(NextInterceptor, ConcreteInvocation) meth= ods. Users + * can override any process(..) methods that correspond to + * {@link Invocation} types that he or she wants to filter. *

* For example, if user wants to filter {@link Add} invocation: *

@@ -43,7 +44,8 @@
  *     }
  * }
  * 
- * BaseInterceptor handles all long and tedious if-elseif blo= cks behind the scene. + * BaseInterceptor handles all long and tedious if-elseif blo= cks behind the + * scenes. * * @author Apache Directory Pr= oject * @version $Rev$, $Date$ @@ -66,6 +68,7 @@ { } =20 + // -------------------------------------------------------------------= ----- // Interceptor's Invoke Method // -------------------------------------------------------------------= ----- @@ -147,117 +150,103 @@ } } =20 + // -------------------------------------------------------------------= ----- // Invocation Analogs // -------------------------------------------------------------------= ----- =20 - protected void process( NextInterceptor nextInterceptor, Add call ) - throws NamingException + + protected void process( NextInterceptor nextInterceptor, Add call ) th= rows NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, Delete call ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, Delete call )= throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, GetMatchedDN = call ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, GetMatchedDN = call ) throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, GetSuffix cal= l ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, GetSuffix cal= l ) throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, HasEntry call= ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, HasEntry call= ) throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, IsSuffix call= ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, IsSuffix call= ) throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, List call ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, List call ) t= hrows NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, ListSuffixes = call ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, ListSuffixes = call ) throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, Lookup call ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, Lookup call )= throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, LookupWithAtt= rIds call ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, LookupWithAtt= rIds call ) throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, Modify call ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, Modify call )= throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, ModifyMany ca= ll ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, ModifyMany ca= ll ) throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, ModifyRN call= ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, ModifyRN call= ) throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, Move call ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, Move call ) t= hrows NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, MoveAndModify= RN call ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, MoveAndModify= RN call ) throws NamingException { nextInterceptor.process( call ); } =20 =20 - protected void process( NextInterceptor nextInterceptor, Search call ) - throws NamingException + protected void process( NextInterceptor nextInterceptor, Search call )= throws NamingException { nextInterceptor.process( call ); } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/interceptor/Interceptor.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/interceptor/Interceptor.java?view=3Ddiff&r1=3D15= 9315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/Interceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/Interceptor.java Mon Mar 28 14:20:10 2005 @@ -24,15 +24,15 @@ =20 =20 /** - * Filters any directory operations. You can filter any {@link Invocation= }s + * Filters any directory operations. You can filter any {@link Invocation} * performed on {@link BackingStore}s just like Servlet filters do. *

*

Interceptor Chaining

Interceptors should usually pass the cont= rol * of current invocation to the next interceptor by calling * {@link NextInterceptor#process(Invocation)}. The flow control is return= ed * when the next interceptor's {@link Interceptor#process(NextInterceptor,= Invocation)} - * returns. You can therefore implement pre-, post-, around- invocation - * handler by how you place the statement. + * returns. You can therefore implement pre-, post-, around- invocation ha= ndler + * by how you place the statement. *

*

Pre-invocation Filtering

*
@@ -74,10 +74,12 @@
  * When you create an implementation of Interceptor, you have to follow the
  * basic class naming convention to avoid others' confusion:
  * 
    - *
  • Class name must be an agent noun or end with 'Interceptor'.
  • + *
  • Class name must be an agent noun or end with Interceptor or + * Service.
  • *
- * Plus, placing your interceptor implementations to packages like - * 'interceptor' would be the best practice. + * Plus, placing your interceptor implementations into relavent packages l= ike + * interceptor or ones that reflect its purpose would be a go= od + * practice. *

*

Overriding Default Interceptor Settings

*

@@ -116,6 +118,5 @@ * @param invocation the invocation to process * @throws NamingException on failures while handling the invocation */ - void process( NextInterceptor nextInterceptor, Invocation invocation ) - throws NamingException; + void process( NextInterceptor nextInterceptor, Invocation invocation )= throws NamingException; } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/interceptor/InterceptorChain.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/interceptor/InterceptorChain.java?view=3Ddiff&r1= =3D159315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorChain.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorChain.java Mon Mar 28 14:20:10 2005 @@ -23,6 +23,7 @@ import org.apache.ldap.server.schema.SchemaService; import org.apache.ldap.server.operational.OperationalAttributeService; import org.apache.ldap.server.exception.ExceptionService; +import org.apache.ldap.server.normalization.NormalizationService; =20 import javax.naming.NamingException; import java.util.*; @@ -55,35 +56,49 @@ public static InterceptorChain newDefaultChain() { InterceptorChain chain =3D new InterceptorChain(); - chain.addBefore( NEXT_INTERCEPTOR, "authenticator", new Authentica= tionService() ); - chain.addBefore( NEXT_INTERCEPTOR, "authorizer", new Authorization= Service() ); - chain.addBefore( NEXT_INTERCEPTOR, "validator", new ExceptionServi= ce() ); - chain.addBefore( NEXT_INTERCEPTOR, "schemaManager", new SchemaServ= ice() ); - chain.addBefore( NEXT_INTERCEPTOR, "operationalAttributeIntercepto= r", new OperationalAttributeService() ); + + chain.addFirst( "normalizationService", new NormalizationService()= ); + + chain.addBefore( NEXT_INTERCEPTOR, "authenticationService", new Au= thenticationService() ); + + chain.addBefore( NEXT_INTERCEPTOR, "authorizationService", new Aut= horizationService() ); + + chain.addBefore( NEXT_INTERCEPTOR, "exceptionService", new Excepti= onService() ); + + chain.addBefore( NEXT_INTERCEPTOR, "schemaService", new SchemaServ= ice() ); + + chain.addBefore( NEXT_INTERCEPTOR, "operationalAttributeService", = new OperationalAttributeService() ); + return chain; } =20 + private final Interceptor NEXT_INTERCEPTOR0 =3D new Interceptor() { public void init( InterceptorContext context ) { } =20 + public void destroy() { } =20 + public void process( NextInterceptor nextInterceptor, Invocation i= nvocation ) throws NamingException { if( parent !=3D null ) { Entry e =3D ( Entry ) parent.interceptor2entry.get( Interc= eptorChain.this ); + e.nextInterceptor.process( invocation ); } + nextInterceptor.process( invocation ); } }; =20 + private final Interceptor FINAL_INTERCEPTOR =3D new Interceptor() { private InterceptorContext ctx; @@ -101,13 +116,12 @@ } =20 =20 - public void process( NextInterceptor nextInterceptor, Invocation c= all ) - throws NamingException + public void process( NextInterceptor nextInterceptor, Invocation c= all ) throws NamingException { if ( parent =3D=3D null ) { - // execute the actual backend operation only when this cha= in - // is root. + // execute the actual backend operation only when this cha= in is root. + call.execute( ctx.getRootNexus() ); } } @@ -130,26 +144,34 @@ public InterceptorChain() { head.nextEntry =3D tail; + tail.prevEntry =3D head; + register( NEXT_INTERCEPTOR, head ); } =20 + /** * Initializes all interceptors this chain contains. */ public synchronized void init( InterceptorContext ctx ) throws NamingE= xception { ListIterator it =3D getAll().listIterator(); + Interceptor interceptor =3D null; + try { while ( it.hasNext() ) { interceptor =3D ( Interceptor ) it.next(); + String name =3D getName( interceptor ); - InterceptorContext newCtx =3D new InterceptorContext( ctx.= getEnvironment(), ctx.getSystemPartition(), - ctx.getGlobalRegistries(), ctx.getRootNexus(), - InterceptorConfigBuilder.build( ctx.getConfig(), (= name =3D=3D null ) ? "" : name ) ); + + Map config =3D InterceptorConfigBuilder.build( ctx.getConf= ig(), ( name =3D=3D null ) ? "" : name ); + + InterceptorContext newCtx =3D new InterceptorContext( ctx.= getEnvironment(), + ctx.getSystemPartition(), ctx.getGlobalRegistries(= ), ctx.getRootNexus(), config ); =20 interceptor.init( newCtx ); } @@ -159,6 +181,7 @@ while ( it.hasPrevious() ) { Interceptor i =3D ( Interceptor ) it.previous(); + try { i.destroy(); @@ -175,8 +198,7 @@ } else { - throw new InterceptorException( interceptor, null, - "Failed to initialize interceptor chain.", t ); + throw new InterceptorException( interceptor, null, "Failed= to initialize interceptor chain.", t ); } } } @@ -188,9 +210,11 @@ public synchronized void destroy() { ListIterator it =3D getAllReversed().listIterator(); + while ( it.hasNext() ) { Interceptor interceptor =3D ( Interceptor ) it.next(); + try { interceptor.destroy(); @@ -211,10 +235,12 @@ public Interceptor get( String name ) { Entry e =3D ( Entry ) name2entry.get( name ); + if ( e =3D=3D null ) { return null; } + return e.interceptor; } =20 @@ -222,10 +248,12 @@ private String getName( Interceptor interceptor ) { Entry e =3D ( Entry ) interceptor2entry.get( interceptor ); + if ( e =3D=3D null ) { return null; } + return e.name; } =20 @@ -239,7 +267,9 @@ checkAddable( name, interceptor ); =20 Entry newEntry =3D new Entry( null, head, name, interceptor ); + head.prevEntry =3D newEntry; + head =3D newEntry; =20 register( name, newEntry ); @@ -255,6 +285,7 @@ checkAddable( name, interceptor ); =20 Entry newEntry =3D new Entry( tail.prevEntry, tail, name, intercep= tor ); + if ( tail.prevEntry !=3D null ) { tail.prevEntry.nextEntry =3D newEntry; @@ -263,6 +294,7 @@ { head =3D newEntry; } + tail.prevEntry =3D newEntry; =20 register( name, newEntry ); @@ -273,24 +305,27 @@ * Adds the specified interceptor with the specified name just before = the interceptor whose name is * baseName in this chain. */ - public synchronized void addBefore( String baseName, - String name, - Interceptor interceptor ) + public synchronized void addBefore( String baseName, String name, Inte= rceptor interceptor ) { Entry baseEntry =3D checkOldName( baseName ); + checkAddable( name, interceptor ); =20 Entry prevEntry =3D baseEntry.prevEntry; + Entry newEntry =3D new Entry( prevEntry, baseEntry, name, intercep= tor ); + if ( prevEntry =3D=3D null ) { baseEntry.prevEntry =3D newEntry; + head =3D newEntry; =20 } else { baseEntry.prevEntry =3D newEntry; + prevEntry.nextEntry =3D newEntry; } =20 @@ -302,22 +337,25 @@ * Adds the specified interceptor with the specified name just after t= he interceptor whose name is * baseName in this chain. */ - public synchronized void addAfter( String baseName, - String name, - Interceptor interceptor ) + public synchronized void addAfter( String baseName, String name, Inter= ceptor interceptor ) { Entry baseEntry =3D checkOldName( baseName ); + checkAddable( name, interceptor ); =20 Entry nextEntry =3D baseEntry.nextEntry; + Entry newEntry =3D new Entry( baseEntry, nextEntry, name, intercep= tor ); + if ( nextEntry =3D=3D null ) { throw new IllegalStateException(); } =20 nextEntry.prevEntry.nextEntry =3D newEntry; + nextEntry.prevEntry =3D newEntry; + register( name, newEntry ); } =20 @@ -328,22 +366,30 @@ public synchronized void remove( String name ) { Entry entry =3D checkOldName( name ); + Entry prevEntry =3D entry.prevEntry; + Entry nextEntry =3D entry.nextEntry; + if ( prevEntry =3D=3D null ) { nextEntry.prevEntry =3D null; + head =3D entry; } else { prevEntry.nextEntry =3D nextEntry; + nextEntry.prevEntry =3D prevEntry; } =20 name2entry.remove( name ); + Interceptor interceptor =3D entry.interceptor; + interceptor2entry.remove( interceptor ); + if ( interceptor instanceof InterceptorChain ) { ( ( InterceptorChain ) interceptor ).parent =3D null; @@ -357,6 +403,7 @@ public synchronized void clear() { Iterator it =3D new ArrayList( name2entry.keySet() ).iterator(); + while ( it.hasNext() ) { this.remove( ( String ) it.next() ); @@ -367,8 +414,11 @@ private void register( String name, Entry newEntry ) { Interceptor interceptor =3D newEntry.interceptor; + name2entry.put( name, newEntry ); + interceptor2entry.put( newEntry.interceptor, newEntry ); + if ( interceptor instanceof InterceptorChain ) { ( ( InterceptorChain ) interceptor ).parent =3D this; @@ -384,11 +434,12 @@ private Entry checkOldName( String baseName ) { Entry e =3D ( Entry ) name2entry.get( baseName ); + if ( e =3D=3D null ) { - throw new IllegalArgumentException( "Unknown interceptor name:= " + - baseName ); + throw new IllegalArgumentException( "Unknown interceptor name:= " + baseName ); } + return e; } =20 @@ -421,6 +472,7 @@ public void process( NextInterceptor nextInterceptor, Invocation invoc= ation ) throws NamingException { Entry head =3D this.head; + try { head.interceptor.process( head.nextInterceptor, invocation ); @@ -431,8 +483,7 @@ } catch ( Throwable e ) { - throw new InterceptorException( head.interceptor, invocation, - "Unexpected exception.", e ); + throw new InterceptorException( head.interceptor, invocation, = "Unexpected exception.", e ); } } =20 @@ -443,10 +494,13 @@ public List getAll() { List list =3D new ArrayList(); + Entry e =3D head; + do { list.add( e.interceptor ); + e =3D e.nextEntry; } while ( e !=3D null ); @@ -461,12 +515,16 @@ public List getAllReversed() { List list =3D new ArrayList(); + Entry e =3D tail; + do { list.add( e.interceptor ); + e =3D e.prevEntry; } + while ( e !=3D null ); =20 return list; @@ -502,15 +560,19 @@ } =20 this.prevEntry =3D prevEntry; + this.nextEntry =3D nextEntry; + this.name =3D name; + this.interceptor =3D interceptor; + this.nextInterceptor =3D new NextInterceptor() { - public void process( Invocation call ) - throws NamingException + public void process( Invocation call ) throws NamingExcept= ion { Interceptor interceptor =3D Entry.this.nextEntry.inter= ceptor; + try { interceptor.process( Entry.this.nextEntry.nextInte= rceptor, call ); @@ -521,8 +583,7 @@ } catch ( Throwable e ) { - throw new InterceptorException( interceptor, call, - "Unexpected exception.", e ); + throw new InterceptorException( interceptor, call,= "Unexpected exception.", e ); } } }; Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/interceptor/InterceptorConfigBuilder.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/interceptor/InterceptorConfigBuilder.java?view= =3Ddiff&r1=3D159315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorConfigBuilder.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorConfigBuilder.java Mon Mar 28 14:20:10 2005 @@ -18,18 +18,24 @@ public static Map build( Map map, String prefix ) { Map newMap =3D new HashMap(); + Iterator it =3D map.entrySet().iterator(); + while ( it.hasNext() ) { Map.Entry e =3D ( Map.Entry ) it.next(); + String key =3D e.getKey().toString(); + if ( key.startsWith( prefix ) && key.length() > prefix.length(= ) ) { key =3D key.substring( prefix.length() ); + if ( key.indexOf( '#' ) < 0 ) { continue; } + if ( key.charAt( 0 ) =3D=3D '.' || key.charAt( 0 ) =3D=3D = '#' ) { key =3D key.substring( 1 ); Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/interceptor/InterceptorContext.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/interceptor/InterceptorContext.java?view=3Ddiff&= r1=3D159315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorContext.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorContext.java Mon Mar 28 14:20:10 2005 @@ -49,9 +49,13 @@ Map config ) { this.environment =3D environment; + this.systemPartition =3D systemPartition; + this.globalRegistries =3D globalRegistries; + this.rootNexus =3D rootNexus; + this.config =3D config; } =20 Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/interceptor/InterceptorException.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/interceptor/InterceptorException.java?view=3Ddif= f&r1=3D159315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorException.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/InterceptorException.java Mon Mar 28 14:20:10 2005 @@ -53,7 +53,9 @@ public InterceptorException( Interceptor interceptor, Invocation invoc= ation ) { super( ResultCodeEnum.OTHER ); + this.invocation =3D invocation; + this.interceptor =3D interceptor; } =20 @@ -65,11 +67,12 @@ * @param invocation the Invocation the Interceptor failed on * @param explanation String explanation of why the Interceptor failed */ - public InterceptorException( Interceptor interceptor, - Invocation invocation, String explanation= ) + public InterceptorException( Interceptor interceptor, Invocation invoc= ation, String explanation ) { super( explanation, ResultCodeEnum.OTHER ); + this.invocation =3D invocation; + this.interceptor =3D interceptor; } =20 @@ -81,10 +84,10 @@ * @param invocation the Invocation the Interceptor failed on * @param rootCause the root cause of this exception */ - public InterceptorException( Interceptor interceptor, - Invocation invocation, Throwable rootCaus= e ) + public InterceptorException( Interceptor interceptor, Invocation invoc= ation, Throwable rootCause ) { this( interceptor, invocation ); + super.setRootCause( rootCause ); } =20 @@ -97,12 +100,11 @@ * @param explanation String explanation of why the Interceptor failed * @param rootCause the root cause of this exception */ - public InterceptorException( Interceptor interceptor, - Invocation invocation, - String explanation, + public InterceptorException( Interceptor interceptor, Invocation invoc= ation, String explanation, Throwable rootCause ) { this( interceptor, invocation, explanation ); + super.setRootCause( rootCause ); } =20 Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/interceptor/NextInterceptor.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/interceptor/NextInterceptor.java?view=3Ddiff&r1= =3D159315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/NextInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/inte= rceptor/NextInterceptor.java Mon Mar 28 14:20:10 2005 @@ -33,7 +33,8 @@ public interface NextInterceptor { /** - * Passes the control of current invocation to the next {@link org.apa= che.ldap.server.interceptor.Interceptor} in the {@link org.apache.ldap.serv= er.interceptor.InterceptorChain}. + * Passes the control of current invocation to the next {@link org.apa= che.ldap.server.interceptor.Interceptor} in + * the {@link org.apache.ldap.server.interceptor.InterceptorChain}. * * @param incovation * @throws NamingException Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/Add.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/Add.java?view=3Ddiff&r1=3D159315&r2= =3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Add.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Add.java Mon Mar 28 14:20:10 2005 @@ -35,7 +35,7 @@ =20 private final String userProvidedName; =20 - private final Name normalizedName; + private Name normalizedName; =20 private final Attributes attributes; =20 @@ -58,7 +58,9 @@ } =20 this.userProvidedName =3D userProvidedName; + this.normalizedName =3D normalizedName; + this.attributes =3D attributes; } =20 @@ -75,6 +77,12 @@ } =20 =20 + public void setNormalizedName( Name normalizedName ) + { + this.normalizedName =3D normalizedName; + } + + public String getUserProvidedName() { return userProvidedName; @@ -84,6 +92,7 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { store.add( userProvidedName, normalizedName, attributes ); + return null; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/Delete.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/Delete.java?view=3Ddiff&r1=3D159315&r= 2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Delete.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Delete.java Mon Mar 28 14:20:10 2005 @@ -32,7 +32,7 @@ public class Delete extends Invocation { =20 - private final Name name; + private Name name; =20 =20 public Delete( Name name ) @@ -55,6 +55,13 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { store.delete( name ); + return null; + } + + + public void setName( Name name ) + { + this.name =3D name; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/GetMatchedDN.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/GetMatchedDN.java?view=3Ddiff&r1=3D15= 9315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/GetMatchedDN.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/GetMatchedDN.java Mon Mar 28 14:20:10 2005 @@ -33,7 +33,7 @@ public class GetMatchedDN extends Invocation { =20 - private final Name name; + private Name name; =20 private final boolean normalized; =20 @@ -46,6 +46,7 @@ } =20 this.name =3D name; + this.normalized =3D normalized; } =20 @@ -65,5 +66,11 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { return ( ( PartitionNexus ) store ).getMatchedDn( name, normalized= ); + } + + + public void setName( Name name ) + { + this.name =3D name; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/GetSuffix.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/GetSuffix.java?view=3Ddiff&r1=3D15931= 5&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/GetSuffix.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/GetSuffix.java Mon Mar 28 14:20:10 2005 @@ -33,7 +33,7 @@ public class GetSuffix extends Invocation { =20 - private final Name name; + private Name name; =20 private final boolean normalized; =20 @@ -46,6 +46,7 @@ } =20 this.name =3D name; + this.normalized =3D normalized; } =20 @@ -65,5 +66,11 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { return ( ( ContextPartition ) store ).getSuffix( normalized ); + } + + + public void setName( Name name ) + { + this.name =3D name; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/HasEntry.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/HasEntry.java?view=3Ddiff&r1=3D159315= &r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/HasEntry.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/HasEntry.java Mon Mar 28 14:20:10 2005 @@ -32,7 +32,7 @@ public class HasEntry extends Invocation { =20 - private final Name name; + private Name name; =20 =20 public HasEntry( Name name ) @@ -55,5 +55,11 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { return store.hasEntry( name ) ? Boolean.TRUE : Boolean.FALSE; + } + + + public void setName( Name name ) + { + this.name =3D name; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/IsSuffix.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/IsSuffix.java?view=3Ddiff&r1=3D159315= &r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/IsSuffix.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/IsSuffix.java Mon Mar 28 14:20:10 2005 @@ -32,7 +32,7 @@ public class IsSuffix extends Invocation { =20 - private final Name name; + private Name name; =20 =20 public IsSuffix( Name name ) @@ -55,5 +55,11 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { return store.isSuffix( name ) ? Boolean.TRUE : Boolean.FALSE; + } + + + public void setName( Name name ) + { + this.name =3D name; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/List.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/List.java?view=3Ddiff&r1=3D159315&r2= =3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/List.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/List.java Mon Mar 28 14:20:10 2005 @@ -32,7 +32,7 @@ public class List extends Invocation { =20 - private final Name baseName; + private Name baseName; =20 =20 public List( Name baseName ) @@ -55,5 +55,11 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { return store.list( baseName ); + } + + + public void setBaseName( Name baseName ) + { + this.baseName =3D baseName; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/Lookup.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/Lookup.java?view=3Ddiff&r1=3D159315&r= 2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Lookup.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Lookup.java Mon Mar 28 14:20:10 2005 @@ -32,7 +32,7 @@ public class Lookup extends Invocation { =20 - private final Name name; + private Name name; =20 =20 public Lookup( Name name ) @@ -55,5 +55,11 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { return store.lookup( name ); + } + + + public void setName( Name name ) + { + this.name =3D name; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/LookupWithAttrIds.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/LookupWithAttrIds.java?view=3Ddiff&r1= =3D159315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/LookupWithAttrIds.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/LookupWithAttrIds.java Mon Mar 28 14:20:10 2005 @@ -32,7 +32,7 @@ public class LookupWithAttrIds extends Invocation { =20 - private final Name name; + private Name name; =20 private final String[] attributeIds; =20 @@ -44,6 +44,7 @@ throw new NullPointerException( "name" ); } this.name =3D name; + this.attributeIds =3D attributeIds; } =20 @@ -63,5 +64,11 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { return store.lookup( name, attributeIds ); + } + + + public void setName( Name name ) + { + this.name =3D name; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/Modify.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/Modify.java?view=3Ddiff&r1=3D159315&r= 2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Modify.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Modify.java Mon Mar 28 14:20:10 2005 @@ -33,7 +33,7 @@ public class Modify extends Invocation { =20 - private final Name name; + private Name name; =20 private final int modOp; =20 @@ -48,7 +48,9 @@ } =20 this.name =3D name; + this.modOp =3D modOp; + this.attributes =3D attributes; } =20 @@ -74,6 +76,13 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { store.modify( name, modOp, attributes ); + return null; + } + + + public void setName( Name name ) + { + this.name =3D name; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/ModifyMany.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/ModifyMany.java?view=3Ddiff&r1=3D1593= 15&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/ModifyMany.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/ModifyMany.java Mon Mar 28 14:20:10 2005 @@ -33,7 +33,7 @@ public class ModifyMany extends Invocation { =20 - private final Name name; + private Name name; =20 private final ModificationItem[] modificationItems; =20 @@ -50,6 +50,7 @@ } =20 this.name =3D name; + this.modificationItems =3D modificationItems; } =20 @@ -69,6 +70,13 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { store.modify( name, modificationItems ); + return null; + } + + + public void setName( Name name ) + { + this.name =3D name; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/ModifyRN.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/ModifyRN.java?view=3Ddiff&r1=3D159315= &r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/ModifyRN.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/ModifyRN.java Mon Mar 28 14:20:10 2005 @@ -32,7 +32,7 @@ public class ModifyRN extends Invocation { =20 - private final Name name; + private Name name; =20 private final String newRelativeName; =20 @@ -53,7 +53,9 @@ } =20 this.name =3D name; + this.newRelativeName =3D newRelativeName; + this.deleteOldName =3D deleteOldName; } =20 @@ -79,6 +81,13 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { store.modifyRn( name, newRelativeName, deleteOldName ); + return null; + } + + + public void setName( Name name ) + { + this.name =3D name; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/Move.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/Move.java?view=3Ddiff&r1=3D159315&r2= =3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Move.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Move.java Mon Mar 28 14:20:10 2005 @@ -32,9 +32,9 @@ public class Move extends Invocation { =20 - private final Name name; + private Name name; =20 - private final Name newParentName; + private Name newParentName; =20 =20 public Move( Name name, Name newParentName ) @@ -50,6 +50,7 @@ } =20 this.name =3D name; + this.newParentName =3D newParentName; } =20 @@ -69,6 +70,19 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { store.move( name, newParentName ); + return null; + } + + + public void setName( Name name ) + { + this.name =3D name; + } + + + public void setNewParentName( Name newParentName ) + { + this.newParentName =3D newParentName; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/MoveAndModifyRN.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/MoveAndModifyRN.java?view=3Ddiff&r1= =3D159315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/MoveAndModifyRN.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/MoveAndModifyRN.java Mon Mar 28 14:20:10 2005 @@ -32,9 +32,9 @@ public class MoveAndModifyRN extends Invocation { =20 - private final Name name; + private Name name; =20 - private final Name newParentName; + private Name newParentName; =20 private final String newRelativeName; =20 @@ -58,8 +58,11 @@ } =20 this.name =3D name; + this.newParentName =3D newParentName; + this.newRelativeName =3D newRelativeName; + this.deleteOldName =3D deleteOldName; } =20 @@ -91,6 +94,19 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { store.move( name, newParentName, newRelativeName, deleteOldName ); + return null; + } + + + public void setName( Name name ) + { + this.name =3D name; + } + + + public void setNewParentName( Name newParentName ) + { + this.newParentName =3D newParentName; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/invocation/Search.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/invocation/Search.java?view=3Ddiff&r1=3D159315&r= 2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Search.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invo= cation/Search.java Mon Mar 28 14:20:10 2005 @@ -35,7 +35,7 @@ public class Search extends Invocation { =20 - private final Name baseName; + private Name baseName; =20 private final Map environment; =20 @@ -65,8 +65,11 @@ } =20 this.baseName =3D baseName; + this.environment =3D environment; + this.filter =3D filters; + this.controls =3D controls; } =20 @@ -98,5 +101,11 @@ protected Object doExecute( BackingStore store ) throws NamingExceptio= n { return store.search( baseName, environment, filter, controls ); + } + + + public void setBaseName( Name baseName ) + { + this.baseName =3D baseName; } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/jndi/CoreContextFactory.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/jndi/CoreContextFactory.java?view=3Ddiff&r1=3D15= 9315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/jndi= /CoreContextFactory.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi= /CoreContextFactory.java Mon Mar 28 14:20:10 2005 @@ -481,15 +481,18 @@ // ---------------------------------------------------------------= ----- // Adding interceptors // ---------------------------------------------------------------= ----- - InterceptorChain interceptor =3D (InterceptorChain) initialEnv.get= ( EnvKeys.INTERCEPTORS ); - if( interceptor =3D=3D null ) { + InterceptorChain interceptor =3D ( InterceptorChain ) initialEnv.g= et( EnvKeys.INTERCEPTORS ); + + if( interceptor =3D=3D null ) + { // If custom interceptor is not specified, use defaule one. + interceptor =3D InterceptorChain.newDefaultChain(); } =20 - interceptor.init( new InterceptorContext( - initialEnv, system, globalRegistries, nexus, + interceptor.init( new InterceptorContext( initialEnv, system, glob= alRegistries, nexus, InterceptorConfigBuilder.build( initialEnv, EnvKeys.INTERC= EPTORS ) ) ); + provider.setInterceptor( interceptor ); =20 // fire up the app partitions now! Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/serve= r/jndi/EnvKeys.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/jndi/EnvKeys.java?view=3Ddiff&r1=3D159315&r2=3D1= 59316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/jndi= /EnvKeys.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi= /EnvKeys.java Mon Mar 28 14:20:10 2005 @@ -39,21 +39,30 @@ // Properties for setting working directory, schemas and allowing anon= binds // -------------------------------------------------------------------= ----- =20 + // Not enabled anywhere but in the protocol client at the time bein= g ... + // public static final String ICF_INSTANCE =3D "server.use.factory.= instance"; + /** bootstrap prop: path to eve's working directory - relative or abso= lute */ public static final String WKDIR =3D "server.wkdir"; + /** a comma separated list of schema class files to load */ public static final String SCHEMAS =3D "server.schemas"; + /** bootstrap prop: if key is present it enables anonymous users */ public static final String DISABLE_ANONYMOUS =3D "server.disable.anony= mous"; + /** a comma separated list of authenticator names */ public static final String AUTHENTICATORS =3D "server.authenticators"; + /** the envprop key base to the authenticator implementation class */ public static final String AUTHENTICATOR_CLASS =3D "server.authenticat= or.class."; + /** the envprop key base to the properties of an authenticator */ public static final String AUTHENTICATOR_PROPERTIES =3D "server.authen= ticator.properties."; =20 /** - * bootstrap property: {@link Interceptor} or {@link InterceptorChain} + * Bootstrap property: {@link org.apache.ldap.server.interceptor.Inter= ceptor} or + * {@link org.apache.ldap.server.interceptor.InterceptorChain} * that will intercept directory operations when they are invoked. You * don't need to specify this property if you want to use the default * interceptor chain. If you specify this property, you might have to Added: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/n= ormalization/NormalizationService.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/j= ava/org/apache/ldap/server/normalization/NormalizationService.java?view=3Da= uto&rev=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/main/java/org/apache/ldap/server/norm= alization/NormalizationService.java (added) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/norm= alization/NormalizationService.java Mon Mar 28 14:20:10 2005 @@ -0,0 +1,275 @@ +/* + * 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 impli= ed. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.server.normalization; + + +import org.apache.ldap.server.interceptor.BaseInterceptor; +import org.apache.ldap.server.interceptor.InterceptorContext; +import org.apache.ldap.server.interceptor.NextInterceptor; +import org.apache.ldap.server.invocation.*; +import org.apache.ldap.server.schema.AttributeTypeRegistry; +import org.apache.ldap.common.name.NameComponentNormalizer; +import org.apache.ldap.common.name.DnParser; +import org.apache.ldap.common.schema.AttributeType; + +import javax.naming.NamingException; + + +/** + * A name normalization service. This service makes sure all relative and= distinuished + * names are normalized before calls are made against the respective inter= face methods + * on the root nexus. + * + * @author Apache Di= rectory Project + * @version $Rev$ + */ +public class NormalizationService extends BaseInterceptor +{ + private DnParser parser; + + + public void init( InterceptorContext context ) throws NamingException + { + AttributeTypeRegistry attributeRegistry =3D context.getGlobalRegis= tries().getAttributeTypeRegistry(); + + parser =3D new DnParser( new PerComponentNormalizer( attributeRegi= stry ) ); + } + + + public void destroy() + { + } + + + // -------------------------------------------------------------------= ----- + // Normalize all Name based arguments for BackingStore interface opera= tions + // -------------------------------------------------------------------= ----- + + + protected void process( NextInterceptor nextInterceptor, Add call ) th= rows NamingException + { + synchronized( parser ) + { + call.setNormalizedName( parser.parse( call.getNormalizedName()= .toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, Delete call )= throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, Modify call )= throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, ModifyMany ca= ll ) throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, ModifyRN call= ) throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, Move call ) t= hrows NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + + call.setNewParentName( parser.parse( call.getNewParentName().t= oString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, MoveAndModify= RN call ) throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + + call.setNewParentName( parser.parse( call.getNewParentName().t= oString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, Search call )= throws NamingException + { + synchronized( parser ) + { + call.setBaseName( parser.parse( call.getBaseName().toString() = ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, HasEntry call= ) throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, IsSuffix call= ) throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, List call ) t= hrows NamingException + { + synchronized( parser ) + { + call.setBaseName( parser.parse( call.getBaseName().toString() = ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, Lookup call )= throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, LookupWithAtt= rIds call ) throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + // -------------------------------------------------------------------= ----- + // Normalize all Name based arguments for other interface operations + // -------------------------------------------------------------------= ----- + + + protected void process( NextInterceptor nextInterceptor, GetMatchedDN = call ) throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + protected void process( NextInterceptor nextInterceptor, GetSuffix cal= l ) throws NamingException + { + synchronized( parser ) + { + call.setName( parser.parse( call.getName().toString() ) ); + } + + super.process( nextInterceptor, call ); + } + + + + /** + * A normalizer that normalizes each name component specifically accor= ding to + * the attribute type of the name component. + */ + class PerComponentNormalizer implements NameComponentNormalizer + { + /** the attribute type registry we use to lookup component normali= zers */ + private final AttributeTypeRegistry registry; + + + /** + * Creates a name component normalizer that looks up normalizers u= sing + * an AttributeTypeRegistry. + * + * @param registry the attribute type registry to get normalizers + */ + public PerComponentNormalizer( AttributeTypeRegistry registry ) + { + this.registry =3D registry; + } + + + public String normalizeByName( String name, String value ) throws = NamingException + { + AttributeType type =3D registry.lookup( name ); + + return ( String ) type.getEquality().getNormalizer().normalize= ( value ); + } + + + public String normalizeByOid( String oid, String value ) throws Na= mingException + { + AttributeType type =3D registry.lookup( oid ); + + return ( String ) type.getEquality().getNormalizer().normalize= ( value ); + } + } +} Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/int= erceptor/ConfigurationTest.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/o= rg/apache/ldap/server/interceptor/ConfigurationTest.java?view=3Ddiff&r1=3D1= 59315&r2=3D159316 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/trunk/core/src/test/org/apache/ldap/server/intercept= or/ConfigurationTest.java (original) +++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/intercept= or/ConfigurationTest.java Mon Mar 28 14:20:10 2005 @@ -32,18 +32,29 @@ protected void setUp() throws Exception { rootChain.addLast( "A", interceptorA ); + rootChain.addLast( "child", childChain ); + childChain.addBefore( InterceptorChain.NEXT_INTERCEPTOR, "B", inte= rceptorB ); + rootChain.addLast( "default", InterceptorChain.newDefaultChain() )= ; =20 extras.put( EnvKeys.INTERCEPTORS, rootChain ); + extras.put( EnvKeys.INTERCEPTORS + "#root", "1" ); + extras.put( EnvKeys.INTERCEPTORS + ".A", "2" ); + extras.put( EnvKeys.INTERCEPTORS + ".A#A", "3" ); + extras.put( EnvKeys.INTERCEPTORS + ".A#A.A", "4" ); + extras.put( EnvKeys.INTERCEPTORS + ".child#child", "5" ); + extras.put( EnvKeys.INTERCEPTORS + ".child.B", "6" ); + extras.put( EnvKeys.INTERCEPTORS + ".child.B#B", "7" ); + extras.put( EnvKeys.INTERCEPTORS + ".child.B#B.B", "8" ); =20 super.setUp(); @@ -53,12 +64,19 @@ public void testRootChain() throws Exception { Map expected =3D new HashMap(); + expected.put( "root", "1" ); + expected.put( "A#A", "3" ); + expected.put( "A#A.A", "4" ); + expected.put( "child#child", "5" ); + expected.put( "child.B#B", "7" ); + expected.put( "child.B#B.B", "8" ); + Assert.assertEquals( expected, rootChain.config ); } =20 @@ -66,9 +84,13 @@ public void testChildChain() throws Exception { Map expected =3D new HashMap(); + expected.put( "child", "5" ); + expected.put( "B#B", "7" ); + expected.put( "B#B.B", "8" ); + Assert.assertEquals( expected, childChain.config ); } =20 @@ -76,8 +98,11 @@ public void testA() throws Exception { Map expected =3D new HashMap(); + expected.put( "A", "3" ); + expected.put( "A.A", "4" ); + Assert.assertEquals( expected, interceptorA.config ); } =20 @@ -85,8 +110,11 @@ public void testB() throws Exception { Map expected =3D new HashMap(); + expected.put( "B", "7" ); + expected.put( "B.B", "8" ); + Assert.assertEquals( expected, interceptorB.config ); } =20 @@ -99,6 +127,7 @@ public synchronized void init( InterceptorContext ctx ) throws Nam= ingException { config =3D ctx.getConfig(); + super.init( ctx ); } =20