我正在尝试获取 LDAP 实体的架构。有人建议我使用 Novell 的开源 LDAP 库,这似乎相当不错。我找到了一个名为GetAttributeSchema的示例,这听起来非常好,但我认为我的参数设置不正确或其他什么。
我得到的结果是:
ou ( 2.5.4.11 NAME ( 'ou' 'organizationalUnitName' ) DESC 'Standard LDAP attribute type' SUP 'name' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2256' )
objectClass ( 2.5.4.0 NAME 'objectClass' DESC 'Standard LDAP attribute type' EQUALITY 'objectIdentifierMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2256 (XXX: syntax should be ...38)' )
我期待的结果是[某些效果]:
cn
affiliations
streetaddress
phone
fax
etc
只是想知道 LDAP 专家是否清楚我缺少什么或我应该要求什么。
谢谢!
===============================
解决方案:
ServiceableLDAPConnection lc = takeConnection();
LDAPSchema schema = lc.fetchSchema(lc.getSchemaDN());
Enumeration<?> enumeration = schema.getAttributeNames();
我发现这个网站特别有用:http ://www.go4expert.com/forums/showthread.php?t=4814
===============================