You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Spark Shen <sm...@gmail.com> on 2007/10/11 12:18:23 UTC

[classlib][jndi] Bind operation has now been added to ldap service provider

Hi all

I have implemented Ldap bind operation, and file it at
http://issues.apache.org/jira/browse/HARMONY-4928.
It now targets at version 3 ldap protocol, and only supports simple(clear
text) authentication.

The implementation for add operation is added through
http://issues.apache.org/jira/browse/HARMONY-4910.
Currently, the decode function for add operation is not yet implemented.

I will add more features for ldap service provider in the future.

Any one who is interested can verify this functionality using the following
code:

import java.io.IOException;
import java.net.UnknownHostException;

import javax.net.SocketFactory;

import org.apache.harmony.jndi.provider.ldap.BindOp;
import org.apache.harmony.jndi.provider.ldap.LdapClient;
import org.apache.harmony.jndi.provider.ldap.LdapMessage;
import org.apache.harmony.jndi.provider.ldap.LdapResult;

/**
 * This class demonstrate how to connect to and send BindRequest to Ldap
server.
 */
public class Sample {
    @SuppressWarnings("unused")
    public static void main(String[] args) throws UnknownHostException,
            IOException {
            // anonymous binds
            BindOp bind = new BindOp("cn=Coder,dc=InitialDN", "secret");

            // Initialize to your ldap server address
            LdapClient client = new LdapClient(SocketFactory.getDefault(),
                    <ldap server ip addr>, 389);

            LdapMessage response = client.doOperation(bind, null);

            System.out.println(response.getMessageId());
            LdapResult re = bind.getResult();
            System.out.println(re.getErrorMessage());
            System.out.println(re.getMachedDN());
            System.out.println(re.getResultCode());
            System.out.println(re.getReferrals());
    }
}

-- 
Spark Shen
China Software Development Lab, IBM

Re: [classlib][jndi] Bind operation has now been added to ldap service provider

Posted by Spark Shen <sm...@gmail.com>.
Sorry for the shout ;-). When I shout out, the patch is not yet applied.

2007/10/12, Tim Ellison <t....@gmail.com>:
>
> Spark Shen wrote:
> > I am feeling upset that my patch draws no one's interest. :-(
> > Would any committer take a look at my contribution? It's for ldap bind
> > operation, which is used to say hello to ldap server.
>
> Sorry to hear that, but I don't think you have great cause to be upset
> Spark, your patch was applied within 24hrs of you uploading it!  There
> are many more waiting in JIRA much longer than that.
>
> You did the right think to raise it on the dev list, but please be
> realistic about the timescales we can work to over e-mail.
>
> Regards,
> Tim
>
>
> > 2007/10/11, Spark Shen <sm...@gmail.com>:
> >> Hi all
> >>
> >> I have implemented Ldap bind operation, and file it at
> >> http://issues.apache.org/jira/browse/HARMONY-4928.
> >> It now targets at version 3 ldap protocol, and only supports
> simple(clear
> >> text) authentication.
> >>
> >> The implementation for add operation is added through
> >> http://issues.apache.org/jira/browse/HARMONY-4910.
> >> Currently, the decode function for add operation is not yet
> implemented.
> >>
> >> I will add more features for ldap service provider in the future.
> >>
> >> Any one who is interested can verify this functionality using the
> >> following code:
> >>
> >> import java.io.IOException;
> >> import java.net.UnknownHostException;
> >>
> >> import javax.net.SocketFactory;
> >>
> >> import org.apache.harmony.jndi.provider.ldap.BindOp;
> >> import org.apache.harmony.jndi.provider.ldap.LdapClient;
> >> import org.apache.harmony.jndi.provider.ldap.LdapMessage;
> >> import org.apache.harmony.jndi.provider.ldap.LdapResult;
> >>
> >> /**
> >>  * This class demonstrate how to connect to and send BindRequest to
> Ldap
> >> server.
> >>  */
> >> public class Sample {
> >>     @SuppressWarnings("unused")
> >>     public static void main(String[] args) throws UnknownHostException,
> >>             IOException {
> >>             // anonymous binds
> >>             BindOp bind = new BindOp("cn=Coder,dc=InitialDN",
> "secret");
> >>
> >>             // Initialize to your ldap server address
> >>             LdapClient client = new LdapClient(SocketFactory.getDefault
> (),
> >>
> >>                     <ldap server ip addr>, 389);
> >>
> >>             LdapMessage response = client.doOperation(bind, null);
> >>
> >>             System.out.println(response.getMessageId());
> >>             LdapResult re = bind.getResult();
> >>             System.out.println(re.getErrorMessage());
> >>             System.out.println(re.getMachedDN());
> >>             System.out.println(re.getResultCode());
> >>             System.out.println(re.getReferrals());
> >>     }
> >> }
> >>
> >> --
> >> Spark Shen
> >> China Software Development Lab, IBM
> >
> >
> >
> >
>



-- 
Spark Shen
China Software Development Lab, IBM

Re: [classlib][jndi] Bind operation has now been added to ldap service provider

Posted by Tim Ellison <t....@gmail.com>.
Spark Shen wrote:
> I am feeling upset that my patch draws no one's interest. :-(
> Would any committer take a look at my contribution? It's for ldap bind
> operation, which is used to say hello to ldap server.

Sorry to hear that, but I don't think you have great cause to be upset
Spark, your patch was applied within 24hrs of you uploading it!  There
are many more waiting in JIRA much longer than that.

You did the right think to raise it on the dev list, but please be
realistic about the timescales we can work to over e-mail.

Regards,
Tim


> 2007/10/11, Spark Shen <sm...@gmail.com>:
>> Hi all
>>
>> I have implemented Ldap bind operation, and file it at
>> http://issues.apache.org/jira/browse/HARMONY-4928.
>> It now targets at version 3 ldap protocol, and only supports simple(clear
>> text) authentication.
>>
>> The implementation for add operation is added through
>> http://issues.apache.org/jira/browse/HARMONY-4910.
>> Currently, the decode function for add operation is not yet implemented.
>>
>> I will add more features for ldap service provider in the future.
>>
>> Any one who is interested can verify this functionality using the
>> following code:
>>
>> import java.io.IOException;
>> import java.net.UnknownHostException;
>>
>> import javax.net.SocketFactory;
>>
>> import org.apache.harmony.jndi.provider.ldap.BindOp;
>> import org.apache.harmony.jndi.provider.ldap.LdapClient;
>> import org.apache.harmony.jndi.provider.ldap.LdapMessage;
>> import org.apache.harmony.jndi.provider.ldap.LdapResult;
>>
>> /**
>>  * This class demonstrate how to connect to and send BindRequest to Ldap
>> server.
>>  */
>> public class Sample {
>>     @SuppressWarnings("unused")
>>     public static void main(String[] args) throws UnknownHostException,
>>             IOException {
>>             // anonymous binds
>>             BindOp bind = new BindOp("cn=Coder,dc=InitialDN", "secret");
>>
>>             // Initialize to your ldap server address
>>             LdapClient client = new LdapClient(SocketFactory.getDefault(),
>>
>>                     <ldap server ip addr>, 389);
>>
>>             LdapMessage response = client.doOperation(bind, null);
>>
>>             System.out.println(response.getMessageId());
>>             LdapResult re = bind.getResult();
>>             System.out.println(re.getErrorMessage());
>>             System.out.println(re.getMachedDN());
>>             System.out.println(re.getResultCode());
>>             System.out.println(re.getReferrals());
>>     }
>> }
>>
>> --
>> Spark Shen
>> China Software Development Lab, IBM
> 
> 
> 
> 

Re: [classlib][jndi] Bind operation has now been added to ldap service provider

Posted by Spark Shen <sm...@gmail.com>.
I am feeling upset that my patch draws no one's interest. :-(
Would any committer take a look at my contribution? It's for ldap bind
operation, which is used to say hello to ldap server.

2007/10/11, Spark Shen <sm...@gmail.com>:
>
> Hi all
>
> I have implemented Ldap bind operation, and file it at
> http://issues.apache.org/jira/browse/HARMONY-4928.
> It now targets at version 3 ldap protocol, and only supports simple(clear
> text) authentication.
>
> The implementation for add operation is added through
> http://issues.apache.org/jira/browse/HARMONY-4910.
> Currently, the decode function for add operation is not yet implemented.
>
> I will add more features for ldap service provider in the future.
>
> Any one who is interested can verify this functionality using the
> following code:
>
> import java.io.IOException;
> import java.net.UnknownHostException;
>
> import javax.net.SocketFactory;
>
> import org.apache.harmony.jndi.provider.ldap.BindOp;
> import org.apache.harmony.jndi.provider.ldap.LdapClient;
> import org.apache.harmony.jndi.provider.ldap.LdapMessage;
> import org.apache.harmony.jndi.provider.ldap.LdapResult;
>
> /**
>  * This class demonstrate how to connect to and send BindRequest to Ldap
> server.
>  */
> public class Sample {
>     @SuppressWarnings("unused")
>     public static void main(String[] args) throws UnknownHostException,
>             IOException {
>             // anonymous binds
>             BindOp bind = new BindOp("cn=Coder,dc=InitialDN", "secret");
>
>             // Initialize to your ldap server address
>             LdapClient client = new LdapClient(SocketFactory.getDefault(),
>
>                     <ldap server ip addr>, 389);
>
>             LdapMessage response = client.doOperation(bind, null);
>
>             System.out.println(response.getMessageId());
>             LdapResult re = bind.getResult();
>             System.out.println(re.getErrorMessage());
>             System.out.println(re.getMachedDN());
>             System.out.println(re.getResultCode());
>             System.out.println(re.getReferrals());
>     }
> }
>
> --
> Spark Shen
> China Software Development Lab, IBM




-- 
Spark Shen
China Software Development Lab, IBM