Cheetsheat JLDAP vs python-ldap API connection is JLDAP: com.novell.ldap.LDAPConnection() python-ldap: ldap import JLDAP: import com.novell.ldap.*; python-ldap: import ldap connect JLDAP: c.connect ("www.nldap.com", 389); python-ldap: ldap.initialize("ldap://www.nldap.com:389") bind (spec) JLDAP: c.bind ("cn=admin, ou=subldap, ou=user, o=novell", "secret"); python-ldap: c.simple_bind_s("cn=admin, ou=subldap, ou=user, o=novell", "secret") bind (gen) JLDAP: c.bind (dn,passwd) python-ldap: c.simple_bind_s (dn, passwd) disconnect: JLDAP: c.disconnect() python-ldap: c.unbind_s() error: JLDAP: LDAPException e: e.getLDAPErrorMessage() search JLDAP: c.search("ou=200201, ou=courses, ou=zoology, ou=subldap, ou=user, o=novell", LDAPConnection.SCOPE_ONE, null, null,false); python-ldap: c.search_s("ou=200201, ou=courses, ou=zoology, ou=subldap, ou=user, o=novell", ldap.SCOPE_ONELEVEL, "objectclass=*") get searched DN JLDAP: getDN() on first element LDAPSearchResults, then .hasMore() to car python-ldap: access first element of tuples in list get searched attributes JLDAP: List l = new ArrayList(); LDAPEntry entry = c.read( dn, attrs ); LDAPAttributeSet attributeSet = entry.getAttributeSet(); Iterator it = attributeSet.getAttributes(); LDAPAttribute attribute; String s; while(it.hasNext()) { attribute = (LDAPAttribute)it.next(); Enumeration allValues = attribute.getStringValues(); while (allValues.hasMoreElements()) { l.add (attribute.getName()); python-ldap: res = c.search (dn, ldap.SCOPE_ONELEVEL,"objectclass=*") l = [] attrs = res[1] for a in attr: l.append (attrs[a]) compare (spec) JLDAP: c.compare ("cn=" + args[0] + ", ou=students, ou=zoology, ou=subldap, ou=user, o=novell", attr) python-ldap: c.compare ("cn=" + sys.argv[0] + ", ou=students, ou=zoology, ou=subldap, ou=user, o=novell", "userPassword", sys.argv[1]) compare (gen) JLDAP: LDAPAttribute attr = new LDAPAttribute(name, value); c.compare (cn, attr); python-ldap: c.compare (cn, name, value) modify (spec) JLDAP: LDAPAttribute attr = new LDAPAttribute ("member", "cn=" + args[1] + "," + "ou=students, ou=zoology, ou=subldap, ou=user, o=novell"); c.modify ("cn=" + args[0] + ", " + "ou=200201, ou=courses, ou=zoology, ou=subldap , ou=user, o=novell", new LDAPModification (LDAPModification.ADD, attr)); python-ldap: c.modify_s (dn, [(ldap.MOD_ADD, "member", "cn=" + sys.argv[2] + "," + "ou=students, ou=zoology, ou=subldap, ou=user, o=novell")]) modify (gen) JLDAP: LDAPAttribute attr = new LDAPAttribute (name, value) c.modify (dn, new LDAPModification (LDAPModification.ADD, attr)); DELETE for delete python-ldap: c.modify_s (dn, [(ldap.MOD_ADD, name, value)]) MOD_DEL for delete add objects JLDAP: c.add (new LDAPEntry (cn, attrSet)) python-ldap: c.add (dn, attrSet) del objects JLDAP: c.delete (dn) python-ldap: c.delete (dn)