Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 56606 invoked from network); 11 Oct 2007 08:59:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Oct 2007 08:59:42 -0000 Received: (qmail 53862 invoked by uid 500); 11 Oct 2007 08:59:30 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 53773 invoked by uid 500); 11 Oct 2007 08:59:30 -0000 Mailing-List: contact commits-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 commits@harmony.apache.org Received: (qmail 53764 invoked by uid 99); 11 Oct 2007 08:59:30 -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 01:59:30 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2007 08:59:41 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A0A1A71420A for ; Thu, 11 Oct 2007 01:58:50 -0700 (PDT) Message-ID: <12131152.1192093130626.JavaMail.jira@brutus> Date: Thu, 11 Oct 2007 01:58:50 -0700 (PDT) From: "spark shen (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-4928) [classlib][jndi] Implements Ldap bind operation request and response messages In-Reply-To: <28108847.1192093010590.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] spark shen updated HARMONY-4928: -------------------------------- Description: This patch implements Ldap bind request and response, encodes and decodes them using Harmony ASN.1 framework. The following code snippet verifies the implementation: 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()); } } was: This patch implements Ldap bind request and response, encode and decode them according to Harmony ASN.1 framework. The following main function can test the implementation: 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 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()); } } > [classlib][jndi] Implements Ldap bind operation request and response messages > ----------------------------------------------------------------------------- > > Key: HARMONY-4928 > URL: https://issues.apache.org/jira/browse/HARMONY-4928 > Project: Harmony > Issue Type: New Feature > Components: Classlib > Reporter: spark shen > > This patch implements Ldap bind request and response, encodes and decodes them using Harmony > ASN.1 framework. > The following code snippet verifies the implementation: > 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()); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.