You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Spark Shen <sm...@gmail.com> on 2007/09/04 10:51:30 UTC

[OT] Is studio using Sun's ldap service provider?

Hi, dears

I investigated those jars in studio used to connect to ldap server. Seems
they uses Sun's service provider.

>From JndiConnectionContext:

public void connect( String host, int port, boolean useLdaps, boolean
useStartTLS, Control[] connCtls,
        ExtendedProgressMonitor monitor ) throws NamingException
    {

        this.environment = new Hashtable<String, String>();
        this.environment.put( Context.INITIAL_CONTEXT_FACTORY, "
com.sun.jndi.ldap.LdapCtxFactory" ); //$NON-NLS-1$
        this.environment.put( "java.naming.ldap.version", "3" );
//$NON-NLS-1$ //$NON-NLS-2$

       // more logic here......
    }

The problem is, harmony as a JDK, is the provider for such things like
com.sun.jndi.ldap.LdapCtxFactory. We aims to provide our compatible
implementation. Such as org.apache.harmony.jndi.ldap.LdapCtxFactory.
So, may be we could not used studio code directly.

But, at least, test cases for the studio will be invaluable asset for us.

-- 
Spark Shen
China Software Development Lab, IBM

Re: [OT] Is studio using Sun's ldap service provider?

Posted by Spark Shen <sm...@gmail.com>.
2007/9/5, Stefan Seelmann <se...@apache.org>:
>
> Spark Shen schrieb:
> >
> >
> > 2007/9/4, Leo Li <liyilei1979@gmail.com <ma...@gmail.com>>:
> >
> >     On 9/4/07, Stefan Seelmann <seelmann@apache.org
> >     <ma...@apache.org>> wrote:
> >     > Hi Spark,
> >     >
> >     > I agree with Emmanuel, the Sun provider is hardcoded in Studio.
> >     >
> >     > However from my expirience, there are a lot of applications out
> there
> >     > using "com.sun.jndi.ldap.LdapCtxFactory" hardcoded in the code, so
> >     they
> >     > won't run with Harmony.
> >
> >
> > I think we can have an improvement here - we factor those hard-coded
> > name out into a property file. Can we?
>
> Sure, in Studio we can do this, that is not a big deal. I think the
> jndi.properties file is the right place for this. We could also add a
> prefernce dialog to enter the right provider. Could you please create a
> Jira about that?
>   https://issues.apache.org/jira/browse/DIRSTUDIO


JIRA created at https://issues.apache.org/jira/browse/DIRSTUDIO-182

>
> > Take into account that we are all apache developers, leave a place for
> > harmony would be very touching. Just joking. :-)
>
> I would love to create a Studio distribution with a bundled Harmony as
> its JRE :-)
>
> >
> >     >
> >     > Is it possible to add this class into harmony, maybe only as a
> >     delegate
> >     > to the real implemention? The JDKs of IBM and BEA include this
> class
> >     > too, but I don't know if they just relicensed it from Sun.
> >     >
> >
> >        The problem is here, to some degree a little interesting :)
> >        Harmony is trying to implement its own LdapCtxFactory, whose main
> >     focus is a ldap client.
> >        So we are exploring whether there is some feature in ldap server
> >     can be reused in implementing ldap client.
> >        Is it all right, Spark?
> >
> >
> > Yes, exactly.
>
> As mentioned before we have a LDAP client implementation, see here:
>
> http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/
>
> It includes all request and response messages of the LDAP protocol
> (bind, search, modify, ...) as well as an filter parser, DN parser and
> URL parser.
>
>
> Regards,
> Stefan Seelmann
>
>


-- 
Spark Shen
China Software Development Lab, IBM

Re: [OT] Is studio using Sun's ldap service provider?

Posted by Stefan Seelmann <se...@apache.org>.
Spark Shen schrieb:
> 
> 
> 2007/9/4, Leo Li <liyilei1979@gmail.com <ma...@gmail.com>>:
> 
>     On 9/4/07, Stefan Seelmann <seelmann@apache.org
>     <ma...@apache.org>> wrote:
>     > Hi Spark,
>     >
>     > I agree with Emmanuel, the Sun provider is hardcoded in Studio.
>     >
>     > However from my expirience, there are a lot of applications out there
>     > using "com.sun.jndi.ldap.LdapCtxFactory" hardcoded in the code, so
>     they
>     > won't run with Harmony.
> 
> 
> I think we can have an improvement here - we factor those hard-coded
> name out into a property file. Can we?

Sure, in Studio we can do this, that is not a big deal. I think the
jndi.properties file is the right place for this. We could also add a
prefernce dialog to enter the right provider. Could you please create a
Jira about that?
  https://issues.apache.org/jira/browse/DIRSTUDIO

> 
> Take into account that we are all apache developers, leave a place for
> harmony would be very touching. Just joking. :-)

I would love to create a Studio distribution with a bundled Harmony as
its JRE :-)

> 
>     >
>     > Is it possible to add this class into harmony, maybe only as a
>     delegate
>     > to the real implemention? The JDKs of IBM and BEA include this class
>     > too, but I don't know if they just relicensed it from Sun.
>     >
> 
>        The problem is here, to some degree a little interesting :)
>        Harmony is trying to implement its own LdapCtxFactory, whose main
>     focus is a ldap client.
>        So we are exploring whether there is some feature in ldap server
>     can be reused in implementing ldap client.
>        Is it all right, Spark?
> 
> 
> Yes, exactly.

As mentioned before we have a LDAP client implementation, see here:
http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/

It includes all request and response messages of the LDAP protocol
(bind, search, modify, ...) as well as an filter parser, DN parser and
URL parser.


Regards,
Stefan Seelmann


Re: [OT] Is studio using Sun's ldap service provider?

Posted by Spark Shen <sm...@gmail.com>.
2007/9/4, Leo Li <li...@gmail.com>:
>
> On 9/4/07, Stefan Seelmann <se...@apache.org> wrote:
> > Hi Spark,
> >
> > I agree with Emmanuel, the Sun provider is hardcoded in Studio.
> >
> > However from my expirience, there are a lot of applications out there
> > using "com.sun.jndi.ldap.LdapCtxFactory" hardcoded in the code, so they
> > won't run with Harmony.


I think we can have an improvement here - we factor those hard-coded name
out into a property file. Can we?

Take into account that we are all apache developers, leave a place for
harmony would be very touching. Just joking. :-)

>
> > Is it possible to add this class into harmony, maybe only as a delegate
> > to the real implemention? The JDKs of IBM and BEA include this class
> > too, but I don't know if they just relicensed it from Sun.
> >
>
>    The problem is here, to some degree a little interesting :)
>    Harmony is trying to implement its own LdapCtxFactory, whose main
> focus is a ldap client.
>    So we are exploring whether there is some feature in ldap server
> can be reused in implementing ldap client.
>    Is it all right, Spark?


Yes, exactly.

> Kind Regards,
> > Stefan Seelmann
> >
> >
> > Emmanuel Lecharny schrieb:
> > > Hi,
> > >
> > > studio is based on JNDI to communicate with any ldap server. Studio is
> > > just a tool.
> > >
> > > If you want to reuse the connect() method, then you just have to
> change
> > > the SUN provider by the Harmony provider in the code.
> > >
> > > Emmanuel
> > >
> > > Spark Shen a écrit :
> > >
> > >> Hi, dears
> > >>
> > >> I investigated those jars in studio used to connect to ldap server.
> Seems
> > >> they uses Sun's service provider.
> > >>
> > >>> From JndiConnectionContext:
> > >>
> > >> public void connect( String host, int port, boolean useLdaps, boolean
> > >> useStartTLS, Control[] connCtls,
> > >>        ExtendedProgressMonitor monitor ) throws NamingException
> > >>    {
> > >>
> > >>        this.environment = new Hashtable<String, String>();
> > >>        this.environment.put( Context.INITIAL_CONTEXT_FACTORY, "
> > >> com.sun.jndi.ldap.LdapCtxFactory" ); //$NON-NLS-1$
> > >>        this.environment.put( "java.naming.ldap.version", "3" );
> > >> //$NON-NLS-1$ //$NON-NLS-2$
> > >>
> > >>       // more logic here......
> > >>    }
> > >>
> > >> The problem is, harmony as a JDK, is the provider for such things
> like
> > >> com.sun.jndi.ldap.LdapCtxFactory. We aims to provide our compatible
> > >> implementation. Such as org.apache.harmony.jndi.ldap.LdapCtxFactory.
> > >> So, may be we could not used studio code directly.
> > >>
> > >> But, at least, test cases for the studio will be invaluable asset for
> us.
> > >>
> > >>
> > >>
> > >
> >
> >
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>



-- 
Spark Shen
China Software Development Lab, IBM

Re: [OT] Is studio using Sun's ldap service provider?

Posted by Leo Li <li...@gmail.com>.
On 9/4/07, Stefan Seelmann <se...@apache.org> wrote:
> Hi Spark,
>
> I agree with Emmanuel, the Sun provider is hardcoded in Studio.
>
> However from my expirience, there are a lot of applications out there
> using "com.sun.jndi.ldap.LdapCtxFactory" hardcoded in the code, so they
> won't run with Harmony.
>
> Is it possible to add this class into harmony, maybe only as a delegate
> to the real implemention? The JDKs of IBM and BEA include this class
> too, but I don't know if they just relicensed it from Sun.
>

   The problem is here, to some degree a little interesting :)
   Harmony is trying to implement its own LdapCtxFactory, whose main
focus is a ldap client.
   So we are exploring whether there is some feature in ldap server
can be reused in implementing ldap client.
   Is it all right, Spark?

> Kind Regards,
> Stefan Seelmann
>
>
> Emmanuel Lecharny schrieb:
> > Hi,
> >
> > studio is based on JNDI to communicate with any ldap server. Studio is
> > just a tool.
> >
> > If you want to reuse the connect() method, then you just have to change
> > the SUN provider by the Harmony provider in the code.
> >
> > Emmanuel
> >
> > Spark Shen a écrit :
> >
> >> Hi, dears
> >>
> >> I investigated those jars in studio used to connect to ldap server. Seems
> >> they uses Sun's service provider.
> >>
> >>> From JndiConnectionContext:
> >>
> >> public void connect( String host, int port, boolean useLdaps, boolean
> >> useStartTLS, Control[] connCtls,
> >>        ExtendedProgressMonitor monitor ) throws NamingException
> >>    {
> >>
> >>        this.environment = new Hashtable<String, String>();
> >>        this.environment.put( Context.INITIAL_CONTEXT_FACTORY, "
> >> com.sun.jndi.ldap.LdapCtxFactory" ); //$NON-NLS-1$
> >>        this.environment.put( "java.naming.ldap.version", "3" );
> >> //$NON-NLS-1$ //$NON-NLS-2$
> >>
> >>       // more logic here......
> >>    }
> >>
> >> The problem is, harmony as a JDK, is the provider for such things like
> >> com.sun.jndi.ldap.LdapCtxFactory. We aims to provide our compatible
> >> implementation. Such as org.apache.harmony.jndi.ldap.LdapCtxFactory.
> >> So, may be we could not used studio code directly.
> >>
> >> But, at least, test cases for the studio will be invaluable asset for us.
> >>
> >>
> >>
> >
>
>


-- 
Leo Li
China Software Development Lab, IBM

Re: [OT] Is studio using Sun's ldap service provider?

Posted by Stefan Seelmann <se...@apache.org>.
Hi Spark,

I agree with Emmanuel, the Sun provider is hardcoded in Studio.

However from my expirience, there are a lot of applications out there
using "com.sun.jndi.ldap.LdapCtxFactory" hardcoded in the code, so they
won't run with Harmony.

Is it possible to add this class into harmony, maybe only as a delegate
to the real implemention? The JDKs of IBM and BEA include this class
too, but I don't know if they just relicensed it from Sun.

Kind Regards,
Stefan Seelmann


Emmanuel Lecharny schrieb:
> Hi,
> 
> studio is based on JNDI to communicate with any ldap server. Studio is
> just a tool.
> 
> If you want to reuse the connect() method, then you just have to change
> the SUN provider by the Harmony provider in the code.
> 
> Emmanuel
> 
> Spark Shen a écrit :
> 
>> Hi, dears
>>
>> I investigated those jars in studio used to connect to ldap server. Seems
>> they uses Sun's service provider.
>>
>>> From JndiConnectionContext:
>>
>> public void connect( String host, int port, boolean useLdaps, boolean
>> useStartTLS, Control[] connCtls,
>>        ExtendedProgressMonitor monitor ) throws NamingException
>>    {
>>
>>        this.environment = new Hashtable<String, String>();
>>        this.environment.put( Context.INITIAL_CONTEXT_FACTORY, "
>> com.sun.jndi.ldap.LdapCtxFactory" ); //$NON-NLS-1$
>>        this.environment.put( "java.naming.ldap.version", "3" );
>> //$NON-NLS-1$ //$NON-NLS-2$
>>
>>       // more logic here......
>>    }
>>
>> The problem is, harmony as a JDK, is the provider for such things like
>> com.sun.jndi.ldap.LdapCtxFactory. We aims to provide our compatible
>> implementation. Such as org.apache.harmony.jndi.ldap.LdapCtxFactory.
>> So, may be we could not used studio code directly.
>>
>> But, at least, test cases for the studio will be invaluable asset for us.
>>
>>  
>>
> 


Re: [OT] Is studio using Sun's ldap service provider?

Posted by Emmanuel Lecharny <el...@apache.org>.
Hi,

studio is based on JNDI to communicate with any ldap server. Studio is 
just a tool.

If you want to reuse the connect() method, then you just have to change 
the SUN provider by the Harmony provider in the code.

Emmanuel

Spark Shen a écrit :

>Hi, dears
>
>I investigated those jars in studio used to connect to ldap server. Seems
>they uses Sun's service provider.
>
>>>From JndiConnectionContext:
>
>public void connect( String host, int port, boolean useLdaps, boolean
>useStartTLS, Control[] connCtls,
>        ExtendedProgressMonitor monitor ) throws NamingException
>    {
>
>        this.environment = new Hashtable<String, String>();
>        this.environment.put( Context.INITIAL_CONTEXT_FACTORY, "
>com.sun.jndi.ldap.LdapCtxFactory" ); //$NON-NLS-1$
>        this.environment.put( "java.naming.ldap.version", "3" );
>//$NON-NLS-1$ //$NON-NLS-2$
>
>       // more logic here......
>    }
>
>The problem is, harmony as a JDK, is the provider for such things like
>com.sun.jndi.ldap.LdapCtxFactory. We aims to provide our compatible
>implementation. Such as org.apache.harmony.jndi.ldap.LdapCtxFactory.
>So, may be we could not used studio code directly.
>
>But, at least, test cases for the studio will be invaluable asset for us.
>
>  
>