Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 73954 invoked from network); 11 Oct 2007 10:18:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Oct 2007 10:18:57 -0000 Received: (qmail 46790 invoked by uid 500); 11 Oct 2007 10:18:42 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 46771 invoked by uid 500); 11 Oct 2007 10:18:42 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 46759 invoked by uid 99); 11 Oct 2007 10:18:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2007 03:18:42 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of smallsmallorgan@gmail.com designates 64.233.166.181 as permitted sender) Received: from [64.233.166.181] (HELO py-out-1112.google.com) (64.233.166.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2007 10:18:46 +0000 Received: by py-out-1112.google.com with SMTP id u77so978487pyb for ; Thu, 11 Oct 2007 03:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=PkXSu9PALE/X21izs9lkJ8O8hpzo3DDMBrUekdvdtUA=; b=V6yr1qMiEsO5G3FHm3TcunmwrxFJjuRQ/28JbzSC2ive+TIe1QHneZt6H35boPJ7DAm7IBnWv2ZmgWFYQbicmRLPYKQch3Dfd42A3HsWzKUWLtmFNRePJLATd3EsR4wEHb3cRjObr5dRRDxJRbsKtd8YdR7thg9BLzCb21LO5MY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=p/o6h0vdaJIFa8yg7JTAKLC7C9dQM7aXnoJTCDEjZyhxY70rt8nMXieMuOsSoqni7y+uPYV1TimXTMxppZzZAXI0KJv4IT6bzxsgImsPsFsax/Vy+PNiJpcZ2XpQkVXRLdNJDVl3+8ZdlfAVGtxX9GaXEBUkkidC+napSxkt0/8= Received: by 10.65.20.18 with SMTP id x18mr3649456qbi.1192097903823; Thu, 11 Oct 2007 03:18:23 -0700 (PDT) Received: by 10.65.61.12 with HTTP; Thu, 11 Oct 2007 03:18:23 -0700 (PDT) Message-ID: <473c46620710110318s7c01abb3vb71cad82ca80e39@mail.gmail.com> Date: Thu, 11 Oct 2007 18:18:23 +0800 From: "Spark Shen" To: dev@harmony.apache.org Subject: [classlib][jndi] Bind operation has now been added to ldap service provider MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5417_7516795.1192097903790" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_5417_7516795.1192097903790 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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(), , 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 ------=_Part_5417_7516795.1192097903790--