use of net.sourceforge.myvd.chain.jdbcLdapImpl.EntrySetSearchResults in project OpenUnison by TremoloSecurity.
the class MyVDConnection method search.
public LDAPSearchResults search(String base, int scope, String filter, ArrayList<String> attributes) throws LDAPException {
HashMap<Object, Object> request = new HashMap<Object, Object>();
HashMap<Object, Object> session = new HashMap<Object, Object>();
session.put(SessionVariables.BOUND_INTERCEPTORS, new ArrayList<String>());
session.put("MYVD_BINDDN", new DistinguishedName("cn=TremoloAdmin"));
session.put("MYVD_BINDPASS", new Password());
ArrayList<net.sourceforge.myvd.types.Attribute> lattribs = new ArrayList<net.sourceforge.myvd.types.Attribute>();
Iterator<String> it = attributes.iterator();
while (it.hasNext()) {
lattribs.add(new net.sourceforge.myvd.types.Attribute(it.next()));
}
SearchInterceptorChain chain = new SearchInterceptorChain(new DistinguishedName("cn=TremoloAdmin"), new Password(), 0, core.getGlobalChain(), session, request, core.getRouter());
DistinguishedName baseDN = new DistinguishedName(base);
if (filter.contains("\\,")) {
filter = filter.replaceAll("[\\\\][,]", "\\\\5C,");
}
Filter searchFilter = new Filter(filter);
Results res = new Results(core.getGlobalChain(), 0);
chain.nextSearch(baseDN, new Int(scope), searchFilter, lattribs, new Bool(false), res, new LDAPSearchConstraints());
return new EntrySetSearchResults(res);
}
Aggregations