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-4949) [classlib][ldap] Add ldap delete request sending and delete response parsing function
Date Tue, 16 Oct 2007 08:24:50 GMT

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

spark shen updated HARMONY-4949:
--------------------------------

    Attachment: HY-4949.diff

This patch provides the implementation for ldap delete operation and associated test case.

> [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
>         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.


Mime
View raw message