use of com.novell.ldapchai.util.SearchHelper in project ldapchai by ldapchai.
the class ApacheLdapProviderImpl method search.
public Map<String, Map<String, String>> search(final String baseDN, final String filter, final Set<String> attributes, final SearchScope searchScope) throws ChaiOperationException, ChaiUnavailableException, IllegalStateException {
activityPreCheck();
getInputValidator().search(baseDN, filter, attributes, searchScope);
final SearchHelper searchHelper = new SearchHelper();
searchHelper.setFilter(filter);
searchHelper.setAttributes(attributes);
searchHelper.setSearchScope(searchScope);
return search(baseDN, searchHelper);
}
use of com.novell.ldapchai.util.SearchHelper in project ldapchai by ldapchai.
the class JLDAPProviderImpl method searchMultiValues.
@ChaiProvider.LdapOperation
public Map<String, Map<String, List<String>>> searchMultiValues(final String baseDN, final String filter, final Set<String> attributes, final SearchScope searchScope) throws ChaiOperationException, ChaiUnavailableException, IllegalStateException {
activityPreCheck();
getInputValidator().searchMultiValues(baseDN, filter, attributes, searchScope);
final SearchHelper searchHelper = new SearchHelper();
searchHelper.setFilter(filter);
searchHelper.setAttributes(attributes);
searchHelper.setSearchScope(searchScope);
return searchImpl(baseDN, searchHelper, false);
}
use of com.novell.ldapchai.util.SearchHelper in project ldapchai by ldapchai.
the class JNDIProviderImpl method search.
@LdapOperation
public final Map<String, Map<String, String>> search(final String baseDN, final String filter, final Set<String> attributes, final SearchScope searchScope) throws ChaiUnavailableException, ChaiOperationException {
activityPreCheck();
getInputValidator().search(baseDN, filter, attributes, searchScope);
final SearchHelper searchHelper = new SearchHelper();
searchHelper.setFilter(filter);
searchHelper.setAttributes(attributes);
searchHelper.setSearchScope(searchScope);
return this.search(baseDN, searchHelper);
}
use of com.novell.ldapchai.util.SearchHelper in project ldapchai by ldapchai.
the class UserImpl method isAccountEnabled.
public boolean isAccountEnabled() throws ChaiOperationException, ChaiUnavailableException {
final String disabledUserSearchFilter = "(useraccountcontrol:1.2.840.113556.1.4.803:=2)";
final SearchHelper searchHelper = new SearchHelper();
searchHelper.setFilter(disabledUserSearchFilter);
searchHelper.setSearchScope(SearchScope.BASE);
final Map<String, Map<String, String>> results = this.getChaiProvider().search(this.getEntryDN(), searchHelper);
for (final String resultDN : results.keySet()) {
if (resultDN != null && resultDN.equals(this.getEntryDN())) {
return false;
}
}
return true;
}
use of com.novell.ldapchai.util.SearchHelper in project ldapchai by ldapchai.
the class AbstractChaiEntry method readCanonicalDN.
public String readCanonicalDN() throws ChaiOperationException, ChaiUnavailableException {
final SearchHelper searchHelper = new SearchHelper();
searchHelper.returnNoAttributes();
searchHelper.setSearchScope(SearchScope.BASE);
searchHelper.setFilter(SearchHelper.DEFAULT_FILTER);
final Map<String, Map<String, String>> results = this.getChaiProvider().search(this.getEntryDN(), searchHelper);
if (results.size() == 1) {
return results.keySet().iterator().next();
}
if (results.isEmpty()) {
throw new ChaiOperationException("search for canonical DN resulted in no results", ChaiError.UNKNOWN);
}
throw new ChaiOperationException("search for canonical DN resulted in multiple results", ChaiError.UNKNOWN);
}
Aggregations