如何使用JNDI显示LDAP模式中存在的所有属性定义

时间:2011-04-05 11:05:18

标签: ldap jndi

我想向用户显示LDAP模式中存在的所有属性定义。

DirContext schema = ctx.getSchema("");

Attributes answer = schema.getAttributes("AttributeDefinition/telephonenumber");

此代码一次提供有关一个属性的描述,用户还需要知道属性的名称。我想显示模式中存在的所有属性的列表。

有人可以提供示例代码,以使用JNDI API显示LDAP目录中的所有属性吗?

3 个答案:

答案 0 :(得分:3)

请检查此链接:How to show all objectclasses description of ldap directory using jndi。它还解释了如何显示所有属性。只需要改变

NamingEnumeration bindings = schema.listBindings("AttributeDefinition");

答案 1 :(得分:0)

DirContext.getSchemaClassDefinition()。

答案 2 :(得分:0)

查看this回答并使用entry.get(“attributeTypes”)获取所有属性类型

相关问题