directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiran Ayyagari <kayyag...@apache.org>
Subject Re: lookup operation handling
Date Tue, 11 Jan 2011 17:29:37 GMT
On Tue, Jan 11, 2011 at 7:54 PM, Emmanuel Lecharny <elecharny@gmail.com> wrote:
> Hi,
>
> trying to fix the issue I faced last night (see the associated mail), I
> found that the lookup operation does return null when we lookup for an
> absent entry. When we go through the ExceptionInterceptor, then we generate
> a LdapNoSuchObjectException, in all previous interceptor, we simplly do
> things like :
>
> Entry entry = nextInterceptor.lookup( lookupContext );
>
> if ( entry == null ) { return null; }
>
> I do think this is a hack, and it would be way better if the
> DefaultPartitionNexus.lookup() method was handling the case this way :
>
>    public ClonedServerEntry lookup( LookupOperationContext lookupContext )
> throws LdapException
>    {
>        ...
>        Partition backend = getPartition( dn );
>        Entry entry = backend.lookup( lookupContext );
>
>        if ( entry == null )
>        {
>            LdapNoSuchObjectException e = new LdapNoSuchObjectException(
> "Attempt to lookup non-existant entry: "
>                + dn.getName() );
>
>            throw e;
>        }
>        else
>        {
>            return ( ClonedServerEntry ) entry;
>        }
>    }
>
> instead of what we currently have :
>
>    public ClonedServerEntry lookup( LookupOperationContext lookupContext )
> throws LdapException
>    {
>        ...
>        Partition backend = getPartition( dn );
>        return backend.lookup( lookupContext );
>    }
>
+1, eventually if all the functionality in ExceptionInterceptor is
moved out like this then we no longer need this interceptor
> wdyt ?
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>



-- 
Kiran Ayyagari

Mime
View raw message