[ https://issues.apache.org/jira/browse/HARMONY-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Leo Li resolved HARMONY-4928.
-----------------------------
Resolution: Fixed
Hi, Spark:
Patch applied at r584029. Thank you for your improvement. Please verify whether
the problem is resolved as you expected.
Good luck!
Leo.
> [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
> Assignee: Leo Li
> 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.
|