use of org.gluu.search.filter.Filter in project oxCore by GluuFederation.
the class BaseEntryManager method contains.
protected boolean contains(String baseDN, List<AttributeData> attributes, String[] objectClasses, String... ldapReturnAttributes) {
Filter[] attributesFilters = createAttributesFilter(attributes);
Filter attributesFilter = null;
if (attributesFilters != null) {
attributesFilter = Filter.createANDFilter(attributesFilters);
}
return contains(baseDN, attributesFilter, objectClasses, ldapReturnAttributes);
}
use of org.gluu.search.filter.Filter in project oxCore by GluuFederation.
the class LookupService method getDisplayNameEntries.
/**
* Returns list of DisplayNameEntry objects
*
* @param baseDn
* base DN
* @param dns
* list of display names to find
* @return list of DisplayNameEntry objects
*/
@SuppressWarnings("unchecked")
public List<DisplayNameEntry> getDisplayNameEntries(String baseDn, List<String> dns) {
List<String> inums = getInumsFromDns(dns);
if (inums.size() == 0) {
return null;
}
String key = getCompoundKey(inums);
List<DisplayNameEntry> entries = (List<DisplayNameEntry>) cacheService.get(OxConstants.CACHE_LOOKUP_NAME, key);
if (entries == null) {
Filter searchFilter = buildInumFilter(inums);
entries = ldapEntryManager.findEntries(baseDn, DisplayNameEntry.class, searchFilter);
cacheService.put(OxConstants.CACHE_LOOKUP_NAME, key, entries);
}
return entries;
}
use of org.gluu.search.filter.Filter in project oxCore by GluuFederation.
the class MetricService method getExpiredMetricEntries.
public List<MetricEntry> getExpiredMetricEntries(DefaultBatchOperation<MetricEntry> batchOperation, String baseDnForPeriod, Date expirationDate, int sizeLimit, int chunkSize) {
Filter expiratioFilter = Filter.createLessOrEqualFilter("oxStartDate", ldapEntryManager.encodeGeneralizedTime(expirationDate));
List<MetricEntry> metricEntries = ldapEntryManager.findEntries(baseDnForPeriod, MetricEntry.class, expiratioFilter, SearchScope.SUB, new String[] { "uniqueIdentifier" }, batchOperation, 0, sizeLimit, chunkSize);
return metricEntries;
}
use of org.gluu.search.filter.Filter in project oxCore by GluuFederation.
the class AttributeService method getAttributesByAttribute.
public List<GluuAttribute> getAttributesByAttribute(String attributeName, String attributeValue, String baseDn) {
String[] targetArray = new String[] { attributeValue };
Filter filter = Filter.createSubstringFilter(attributeName, null, targetArray, null);
List<GluuAttribute> result = ldapEntryManager.findEntries(baseDn, GluuAttribute.class, filter);
return result;
}
use of org.gluu.search.filter.Filter in project oxAuth by GluuFederation.
the class InumGenerator method contains.
public boolean contains(String inum, IdType type) {
final String baseDn = baseDn(type);
final Filter filter = Filter.createEqualityFilter("inum", inum);
final List<DummyEntry> entries = ldapEntryManager.findEntries(baseDn, DummyEntry.class, filter);
return entries != null && !entries.isEmpty();
}
Aggregations