You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "spark shen (JIRA)" <ji...@apache.org> on 2007/10/17 08:19:50 UTC
[jira] Closed: (HARMONY-4949) [classlib][ldap] Add ldap delete
request sending and delete response parsing function
[ https://issues.apache.org/jira/browse/HARMONY-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
spark shen closed HARMONY-4949.
-------------------------------
Verified at r585384. Thanks
> [classlib][ldap] Add ldap delete request sending and delete response parsing function
> -------------------------------------------------------------------------------------
>
> Key: HARMONY-4949
> URL: https://issues.apache.org/jira/browse/HARMONY-4949
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: spark shen
> Assignee: Tony Wu
> Attachments: HY-4949.diff
>
>
> Ldap delete operation is used to delete a designated entry in a ldap server. This patch provides the support to sending delete request and parsing delete response from ladp server.
> Here is the sample code to execute delete operation.
> 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.DeleteOp;
> 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 {
> // change to your ldap server address
> LdapClient client = new LdapClient(SocketFactory.getDefault(),
> "IP address", 389);
>
> try {
> DeleteOp del = new DeleteOp(
> "o=harmony7,c=china,dc=my-domain,dc=com");
> response = client.doOperation(del, null);
> System.out.println("************response*************");
> System.out.println(response.getMessageId());
> re = del.getResult();
> System.out.println(re.getErrorMessage());
> System.out.println(re.getMachedDN());
> System.out.println(re.getResultCode());
> System.out.println(re.getReferrals());
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.