directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject lookup operation handling
Date Tue, 11 Jan 2011 14:24:33 GMT
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 );
     }

wdyt ?

-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com


Mime
View raw message