Spring Ldap存储库和层次结构组织单位

时间:2018-07-12 10:35:23

标签: spring ldap repository hierarchical organizational-unit

这是一个ldap结构,将动态创建并删除这些tanant中的租户和组:

dc=example, ds=com
  ou=Tenants
    ou=TenantA
      cn=GroupA
      cn=GroupB
    ou=TenantB
    ou=TenantC

如何使用spring LdapRepository访问这些结构?

@Entry(
  base = "ou=Tenants",
  objectClasses = { "organizationalUnit", "top" })
public class Tenant implements Persistable<Name> {

  @Id
  private Name id;

  // was TenantA, TenantB ... and so on
  @Attribute(name = "on") 
  private String organizationalUnit;

  //  example: if its TenantA => GroupA, GroupB
  @[#ANNOTATION](name = "[#NAME]")
  private Set<Group> groups;

  ...
}

[#ANNOTATION]和[#NAME]在哪里?

还是不可能用LdapRepository做到这一点?

0 个答案:

没有答案