I’m trying to fetch the schema of an LDAP entity. I’ve been advised to use Novell’s open sourced LDAP library, which seems to be quite good. I found an example called GetAttributeSchema, which sounds really good, but I think I’ve got a parameter set incorrectly or something.
The results I’m getting are:
ou ( 126.96.36.199 NAME ( 'ou' 'organizationalUnitName' ) DESC 'Standard LDAP attribute type' SUP 'name' SYNTAX 188.8.131.52.4.1.14184.108.40.206.15 X-ORIGIN 'RFC 2256' ) objectClass ( 220.127.116.11 NAME 'objectClass' DESC 'Standard LDAP attribute type' EQUALITY 'objectIdentifierMatch' SYNTAX 18.104.22.168.4.1.1422.214.171.124.15 X-ORIGIN 'RFC 2256 (XXX: syntax should be ...38)' )
The results I’m expecting are something to the effect of:
cn affiliations streetaddress phone fax etc
Just wondering if it’s obvious to an LDAP expert what I’m missing or what I should be asking for.
ServiceableLDAPConnection lc = takeConnection(); LDAPSchema schema = lc.fetchSchema(lc.getSchemaDN()); Enumeration<?> enumeration = schema.getAttributeNames();
I found this site particularly useful: http://www.go4expert.com/forums/showthread.php?t=4814
You are getting the full schema definitions. Usually in LDAP queries for cn=schema, you get the entire schema as one object you will need to parse.