[
https://issues.apache.org/jira/browse/DIRSERVER-1266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633059#action_12633059
]
Emmanuel Lecharny commented on DIRSERVER-1266:
----------------------------------------------
After a convo we had yesturday with Alex, here are some addition we have to
make to the serve r:
- create a ReferralManager interface. this interface will contain those methods
:
* isReferral( LdapDN ) which will tell if the DN is a referral
* isParentReferral( LdapDN ) which will tell if one of the DN's parent is a
referral
* addReferral( DN ) which will add a referral's DN into the manager
* removeReferral( LdapDN ) which will remove a referral's DN from the manager
* loadReferral( DirectoryService ) which will initialize the manager with all
the existing referrals at startup
- create a ReferralManagerImpl implementing this interface
- implement a cache to allow quick access to referral's DN. this will be the
very same mechanism than the one for managing Partitions DN : a tree of DNs
where each branch is a RDN and the leaves are the RDN of a referral.
That should be easy to implement (let say 4 hours) and will aleviate the need
of a lookup().
> The new referal handling generate 2 lookup instead of one for every search
> request
> ----------------------------------------------------------------------------------
>
> Key: DIRSERVER-1266
> URL: https://issues.apache.org/jira/browse/DIRSERVER-1266
> Project: Directory ApacheDS
> Issue Type: Bug
> Affects Versions: 1.5.4
> Reporter: Emmanuel Lecharny
> Priority: Blocker
> Fix For: 1.5.5
>
>
> The new implementation for referrals generate a double lookup for search
> requests, and generally speaking, an initial lookup for every operation.
> Here is the portion of code in the ReferralAwareRequest.handle() method :
> ...
> if ( req.getControls().containsKey( ManageDsaITControl.CONTROL_OID ) )
> {
> handleIgnoringReferrals( session, reqTargetDn, null, req );
> }
> else
> {
> handleWithReferrals( session, reqTargetDn, req );
> }
> ...
> private void handleWithReferrals( LdapSession session, LdapDN
> reqTargetDn, T req )
> ...
> if ( ! ( req instanceof AddRequest ) )
> {
> try
> {
> entry = session.getCoreSession().lookup( reqTargetDn );
> ...
> then the specific handler is called, where a second lookup is done.
> We should at least store the first lookup result into the context so that we
> eliminate the need for a seconf lookup, but even then, I don't think it's a
> good idea. It would rather be much more efficient to deal with referrals the
> way it was done before (with a specific interceptor) instead of managing it
> at the protocol handling layer.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.