LdapTemplate
has a setDefaultTimeLimit
which "Set the default time limit be used in searches if not explicitly specified."
1
ms but we are not getting the expected TimeLimitExceededException
...
javax.naming.directory.SearchControls
but it seems not to work
This seems to work:
final Map<String, Object> baseEnv = new Hashtable<>();
baseEnv.put("com.sun.jndi.ldap.connect.timeout", "5000");
baseEnv.put("com.sun.jndi.ldap.read.timeout", "5000");
final LdapContextSource ldapContextSource = new LdapContextSource();
ldapContextSource.setBaseEnvironmentProperties(baseEnv);
if I pass this to the LdapTemplate
I get connect/read timeouts eventually. LdapTemplate#setDefaultTimeLimit
does not seem to do anything.
Hey guys, I don't know if you already have a problem looking on the LDAP server, an attribute called 'memberOf', I can't get any results by doing this type of filter:
(& (objectClass = user) (MemberOf ~ = GS_Customer_Registration_CO))
This user has this specification:
cn = GS_Customer_Registration_CO, OU = Groups, OU = Informatica - ICT, OU = Central Workshop, DC = co, DC = example, DC = com
''
LdapQuery ldapQuery = query()
.searchScope(SearchScope.SUBTREE)
.where("objectClass").is("user")
.and("memberOf").like("GS_Customer_Re*"); ''
I'm using the spring criteria above:
But I can't bring any results, does anyone know about it or have you had any problems of this kind?
Hello, did someone use this method with ldap?? or how to use the tree method in spring-ldap project? how to print everything with objectclass person in tree form to consol/? ``` public class TreeNode {
final String name;
final List<TreeNode> children;
public TreeNode(String name, List<TreeNode> children) {
this.name = name;
this.children = children;
}
public String toString() {
StringBuilder buffer = new StringBuilder(50);
print(buffer, "", "");
return buffer.toString();
}
private void print(StringBuilder buffer, String prefix, String childrenPrefix) {
buffer.append(prefix);
buffer.append(name);
buffer.append('\n');
for (Iterator<TreeNode> it = children.iterator(); it.hasNext();) {
TreeNode next = it.next();
if (it.hasNext()) {
next.print(buffer, childrenPrefix + "├── ", childrenPrefix + "│ ");
} else {
next.print(buffer, childrenPrefix + "└── ", childrenPrefix + " ");
}
}
}
} ```