You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Van Nhu <va...@yahoo.com> on 2005/11/03 02:08:56 UTC
LDAP v3 Paged Results Control
Hi everyone,
I am trying to implement a Virtual Directory. Because
the Virtual Directory will not store any information
itself, its primary job is to split and redirect the
LDAP requests to each of the contributing data
sources, and merge the result sets when responding to
a search request, so I am leaning towards using just
MINA plus a cut down version of the LDAP Provider (as
opposed to using the full ApacheDS) to do the job.
One of the requirements is that the Virtual Directory
must support the LDAP v3 Paged Results Control (RFC
2696). But I am having problems reading this control
inside the
org.apache.ldap.server.protocol.support.SearchHandler
class.
When my LDAP client invokes the following methods on
the LDAP Context:
ctx.setRequestControls( new Control[] {new
PagedResultsControl( pageSize ) } );
ctx.search(
);
...I receive an empty Control[] array with this line
of code inside the SearchHandler:
Control[] reqCtls = ( Control[] )
req.getControls().toArray( EMPTY );
Likewise, I thought that if my LDAP client sets:
jndiEnv.put( Context.REFERRAL, "ignore");
...before connecting to the Virtual Directory with:
ctx = new InitialLdapContext(jndiEnv, null);
Then this line inside the BindHandler:
Control[] reqCtls = ( Control[] )
req.getControls().toArray( EMPTY );
...should return an array that contains the
com.sun.jndi.ldap.ManageReferralControl, but instead
it returns an empty array like the previous case.
I suspect that there is a bug in the ASN1
coder/decoder where the LDAP controls are not being
processed correctly, and would really appreciate if
someone could shed some light on this.
By the way, I am using ApacheDS with subversion
revision number 330381 checked out from the main
trunk.
Thanks and Regards,
Van
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
Re: LDAP v3 Paged Results Control
Posted by Van Nhu <va...@yahoo.com>.
Hi Alex,
Thank you for your quick response. Things are a lot
clearer now.
As I have just started to work on this VD project, I
will have to learn the Apache Directory code base
first. But I would love to contribute the code back if
it is of any use to other people.
I cant promise anything yet at this stage but I will
keep you posted if I make any progress regarding the
DAP controls support. And thanks a lot for the
fantastic work you guys have done to make ApacheDS
what it is today.
Van
--- Alex Karasulu <ao...@bellsouth.net> wrote:
> Van Nhu wrote:
>
> >Hi everyone,
> >
> >I am trying to implement a Virtual Directory.
> Because
> >the Virtual Directory will not store any
> information
> >itself, its primary job is to split and redirect
> the
> >LDAP requests to each of the contributing data
> >sources, and merge the result sets when responding
> to
> >a search request, so I am leaning towards using
> just
> >MINA plus a cut down version of the LDAP Provider
> (as
> >opposed to using the full ApacheDS) to do the job.
> >
> >
> That works.
>
> >One of the requirements is that the Virtual
> Directory
> >must suppsdort the LDAP v3 Paged Results Control
> (RFC
> >2696). But I am having problems reading this
> control
> >inside the
>
>org.apache.ldap.server.protocol.support.SearchHandler
> >class.
> >
> >
> Care to contribute this code and/or work on it here
> in the ldap protocol
> handler?
>
> >When my LDAP client invokes the following methods
> on
> >the LDAP Context:
> > ctx.setRequestControls( new Control[] {new
> >PagedResultsControl( pageSize ) } );
> > ctx.search(
);
> >
> >...I receive an empty Control[] array with this
> line
> >of code inside the SearchHandler:
> > Control[] reqCtls = ( Control[] )
> >req.getControls().toArray( EMPTY );
> >
> >
> Yeah controls are not fully functional just yet.
> Lot's of work to do in
> there.
>
> >Likewise, I thought that if my LDAP client sets:
> > jndiEnv.put( Context.REFERRAL, "ignore");
> >...before connecting to the Virtual Directory with:
> > ctx = new InitialLdapContext(jndiEnv, null);
> >
> >Then this line inside the BindHandler:
> > Control[] reqCtls = ( Control[] )
> >req.getControls().toArray( EMPTY );
> >...should return an array that contains the
> >com.sun.jndi.ldap.ManageReferralControl, but
> instead
> >it returns an empty array like the previous case.
> >
> >
> >
> Yep that's the expected behavoir at this point. We
> need to build up this
> aspect of the LDAP protocol provider.
>
> >I suspect that there is a bug in the ASN1
> >
> >
> Nope we have no controls or support for controls
> yet.
>
> >coder/decoder where the LDAP controls are not being
> >processed correctly, and would really appreciate if
> >someone could shed some light on this.
> >
> >
> We'd have to add that.
>
> >By the way, I am using ApacheDS with subversion
> >revision number 330381 checked out from the main
> >trunk.
> >
> >
> Alex
>
>
>
__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs
Re: LDAP v3 Paged Results Control
Posted by Alex Karasulu <ao...@bellsouth.net>.
Van Nhu wrote:
>Hi everyone,
>
>I am trying to implement a Virtual Directory. Because
>the Virtual Directory will not store any information
>itself, its primary job is to split and redirect the
>LDAP requests to each of the contributing data
>sources, and merge the result sets when responding to
>a search request, so I am leaning towards using just
>MINA plus a cut down version of the LDAP Provider (as
>opposed to using the full ApacheDS) to do the job.
>
>
That works.
>One of the requirements is that the Virtual Directory
>must suppsdort the LDAP v3 Paged Results Control (RFC
>2696). But I am having problems reading this control
>inside the
>org.apache.ldap.server.protocol.support.SearchHandler
>class.
>
>
Care to contribute this code and/or work on it here in the ldap protocol
handler?
>When my LDAP client invokes the following methods on
>the LDAP Context:
> ctx.setRequestControls( new Control[] {new
>PagedResultsControl( pageSize ) } );
> ctx.search( … );
>
>...I receive an empty Control[] array with this line
>of code inside the SearchHandler:
> Control[] reqCtls = ( Control[] )
>req.getControls().toArray( EMPTY );
>
>
Yeah controls are not fully functional just yet. Lot's of work to do in
there.
>Likewise, I thought that if my LDAP client sets:
> jndiEnv.put( Context.REFERRAL, "ignore");
>...before connecting to the Virtual Directory with:
> ctx = new InitialLdapContext(jndiEnv, null);
>
>Then this line inside the BindHandler:
> Control[] reqCtls = ( Control[] )
>req.getControls().toArray( EMPTY );
>...should return an array that contains the
>com.sun.jndi.ldap.ManageReferralControl, but instead
>it returns an empty array like the previous case.
>
>
>
Yep that's the expected behavoir at this point. We need to build up this
aspect of the LDAP protocol provider.
>I suspect that there is a bug in the ASN1
>
>
Nope we have no controls or support for controls yet.
>coder/decoder where the LDAP controls are not being
>processed correctly, and would really appreciate if
>someone could shed some light on this.
>
>
We'd have to add that.
>By the way, I am using ApacheDS with subversion
>revision number 330381 checked out from the main
>trunk.
>
>
Alex