harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "spark shen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-4928) [classlib][jndi] Implements Ldap bind operation request and response messages
Date Thu, 11 Oct 2007 09:35:50 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

spark shen updated HARMONY-4928:
--------------------------------

    Attachment: HY-4928.diff

This patch includes implementation for Ldap Bind operation and related test cases. Would any
committer take a look?

> [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
>         Attachments: HY-4928.diff
>
>
> 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(),
>                     <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());
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message