directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r552159 - in /directory/sandbox/szoerner/groovyldap: ./ src/main/groovy/demoAdd.groovy src/main/groovy/demoDelete.groovy src/main/java/org/apache/directory/groovyldap/LDAP.java
Date Sat, 30 Jun 2007 15:15:16 GMT
Author: szoerner
Date: Sat Jun 30 08:15:16 2007
New Revision: 552159

URL: http://svn.apache.org/viewvc?view=rev&rev=552159
Log:
Examples and error handling modified

Modified:
    directory/sandbox/szoerner/groovyldap/   (props changed)
    directory/sandbox/szoerner/groovyldap/src/main/groovy/demoAdd.groovy
    directory/sandbox/szoerner/groovyldap/src/main/groovy/demoDelete.groovy
    directory/sandbox/szoerner/groovyldap/src/main/java/org/apache/directory/groovyldap/LDAP.java

Propchange: directory/sandbox/szoerner/groovyldap/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Jun 30 08:15:16 2007
@@ -0,0 +1,2 @@
+dist
+bin-groovy

Modified: directory/sandbox/szoerner/groovyldap/src/main/groovy/demoAdd.groovy
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/groovyldap/src/main/groovy/demoAdd.groovy?view=diff&rev=552159&r1=552158&r2=552159
==============================================================================
--- directory/sandbox/szoerner/groovyldap/src/main/groovy/demoAdd.groovy (original)
+++ directory/sandbox/szoerner/groovyldap/src/main/groovy/demoAdd.groovy Sat Jun 30 08:15:16
2007
@@ -2,11 +2,14 @@
 
 ldap = LDAP.newInstance('ldap://zanzibar:10389', 'uid=admin,ou=system' ,'secret')
 
-heather = [
+assert ! ldap.exists('cn=Heather Nova,dc=example,dc=com')
+
+// define the attributes as a map
+attrs = [
   objectclass: ['top', 'person'],              
   sn: 'Nova',
   cn: 'Heather Nova'
 ]
-ldap.add('cn=Heather Nova,dc=example,dc=com', heather)
+ldap.add('cn=Heather Nova,dc=example,dc=com', attrs)
 
-assert ldap.exists('cn=Heather Nova,dc=example,dc=com');
\ No newline at end of file
+assert ldap.exists('cn=Heather Nova,dc=example,dc=com')
\ No newline at end of file

Modified: directory/sandbox/szoerner/groovyldap/src/main/groovy/demoDelete.groovy
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/groovyldap/src/main/groovy/demoDelete.groovy?view=diff&rev=552159&r1=552158&r2=552159
==============================================================================
--- directory/sandbox/szoerner/groovyldap/src/main/groovy/demoDelete.groovy (original)
+++ directory/sandbox/szoerner/groovyldap/src/main/groovy/demoDelete.groovy Sat Jun 30 08:15:16
2007
@@ -2,7 +2,9 @@
 
 ldap = LDAP.newInstance('ldap://zanzibar:10389', 'uid=admin,ou=system' ,'secret')
 
-assert ldap.exists('cn=Heather Nova,dc=example,dc=com')
+// assert ldap.exists('cn=Heather Nova,dc=example,dc=com')
 
+// delete the entry with the given DN
 ldap.delete('cn=Heather Nova,dc=example,dc=com')
 
+assert !ldap.exists('cn=Heather Nova,dc=example,dc=com')
\ No newline at end of file

Modified: directory/sandbox/szoerner/groovyldap/src/main/java/org/apache/directory/groovyldap/LDAP.java
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/groovyldap/src/main/java/org/apache/directory/groovyldap/LDAP.java?view=diff&rev=552159&r1=552158&r2=552159
==============================================================================
--- directory/sandbox/szoerner/groovyldap/src/main/java/org/apache/directory/groovyldap/LDAP.java
(original)
+++ directory/sandbox/szoerner/groovyldap/src/main/java/org/apache/directory/groovyldap/LDAP.java
Sat Jun 30 08:15:16 2007
@@ -153,7 +153,11 @@
         }
         finally
         {
-            ctx.close();
+            try {
+                ctx.close();
+            } catch (Exception e) {
+                // Ignored
+            }
         }
     }
 



Mime
View raw message