Hi Emmanuel,

The custom interceptor I wrote looks like:

public class ProxyInterceptor extends BaseInterceptor {

@Override
        public EntryFilteringCursor search(final SearchOperationContext 
searchContext) throws LdapException {

// call connector
}

@Override
        public void add(final AddOperationContext addContext) throws 
LdapException {
                try { logger.info("addContext.getEntry() ");
                        proxyConnector.add(addContext.getEntry());
                } catch (CursorException e) {
                        logger.info(e.getMessage());
                }
                next(addContext);
        }

@Override
public void modify(final ModifyOperationContext modifyContext) throws 
LdapException {
                
        }

}


I am calling this interceptor from my resource class. For example the rest call 
for modify does not work:
                                                                
                               Modification mod = new DefaultModification( 
ModificationOperation.REPLACE_ATTRIBUTE, "o",
                            "test123456" );
                        ModifyRequest modifyRequest = new ModifyRequestImpl();
                        modifyRequest.setName(new Dn("dc=example,dc=com"));
                        modifyRequest.addModification(mod);
                        
                        getConnection().modify(modifyRequest);
                                // connection.modify("test", );
                                logger.info("after modify");
                                releaseConnection(connection);


Hope this helps, let me know if anything else...thanks!
                

-----Original Message-----
From: Emmanuel Lécharny [mailto:elecha...@gmail.com] 
Sent: Thursday, September 22, 2016 2:48 PM
To: Apache Directory Developers List <dev@directory.apache.org>
Subject: Re: Queston on Interceptor

Le 22/09/16 à 20:32, Sathyanarayan, Harish a écrit :
> Hi:
>
> I have written a proxy interceptor that implements BaseInterceptor operations 
> like Search, add, modify etc. I have tried inserting both next to the 
> normalizationinterceptor and at the very end of the chain. I run the ApacheDS 
> as embedded service under dropwizard.

You probably want to insert your interceptor after the normalizerInterceptor : 
That wuld be the natural position
>
> I have a REST API performing CRUD operations. My question is: when I 
> call the Resource to perform add and search it calls the interceptor

Hmm. Not sure I understand this sentence : do you call the interceptor 
directly, or is the interceptor called by the uer layer ?

> that talks to the connector to perform the proxy operation.  This works as 
> intended. But if I try modify and delete, it does not even hit the 
> interceptor and there is no response. Wondering what could be the root cause 
> of this issue?

Can you show the signature for these operations ?

The information contained in this electronic mail transmission may be 
privileged and confidential, and therefore, protected from disclosure. If you 
have received this communication in error, please notify us immediately by 
replying to this message and deleting the email and its attachments from all 
computers without copying or disclosing it.

Reply via email to