use of org.gluu.search.filter.Filter in project oxTrust by GluuFederation.
the class TrustedIDPService method getTrustedIDPByRemoteIdpHost.
public OxTrustedIdp getTrustedIDPByRemoteIdpHost(String remoteIdpHost, String... returnAttributes) {
log.debug("Getting user information from DB: TrustedIDP = {}", remoteIdpHost);
OxTrustedIdp oxTrustedIdp = null;
if (StringHelper.isEmpty(remoteIdpHost)) {
return null;
}
String gluuPassportConfigDn = getDnForTrustedIDP(null);
Filter gluuPassportConfigIdpHostFilter;
if (dataSourceTypeService.isSpanner(gluuPassportConfigDn)) {
gluuPassportConfigIdpHostFilter = Filter.createEqualityFilter("remoteIdpHost", StringHelper.toLowerCase(remoteIdpHost));
} else {
gluuPassportConfigIdpHostFilter = Filter.createEqualityFilter(Filter.createLowercaseFilter("remoteIdpHost"), StringHelper.toLowerCase(remoteIdpHost));
}
List<OxTrustedIdp> entries = persistenceEntryManager.findEntries(gluuPassportConfigDn, OxTrustedIdp.class, gluuPassportConfigIdpHostFilter, returnAttributes);
log.debug("Found {} entries for TrustedIDP = {}", entries.size(), remoteIdpHost);
if (entries.size() > 0) {
oxTrustedIdp = entries.get(0);
}
return oxTrustedIdp;
}
use of org.gluu.search.filter.Filter in project oxTrust by GluuFederation.
the class PersonService method searchPersons.
/*
* (non-Javadoc)
*
* @see
* org.gluu.oxtrust.ldap.service.IPersonService#searchPersons(java.lang.String)
*/
@Override
public List<GluuCustomPerson> searchPersons(String pattern) {
Filter searchFilter = buildFilter(pattern);
String[] attributes = { "inum", "uid", "displayName", "mail", "gluuStatus" };
return persistenceEntryManager.findEntries(getDnForPerson(null), GluuCustomPerson.class, searchFilter, attributes);
}
use of org.gluu.search.filter.Filter in project oxTrust by GluuFederation.
the class Fido2DeviceService method getGluuCustomFidoDeviceById.
public GluuFido2Device getGluuCustomFidoDeviceById(String id, String userId) {
GluuFido2Device gluuCustomFidoDevice = null;
try {
String dn = getDnForFido2Device(id, userId);
if (StringUtils.isNotEmpty(userId))
gluuCustomFidoDevice = ldapEntryManager.find(GluuFido2Device.class, dn);
else {
Filter filter = Filter.createEqualityFilter("oxId", id);
gluuCustomFidoDevice = ldapEntryManager.findEntries(dn, GluuFido2Device.class, filter).get(0);
}
} catch (Exception e) {
log.error("Failed to find device by id " + id, e);
}
return gluuCustomFidoDevice;
}
use of org.gluu.search.filter.Filter in project oxTrust by GluuFederation.
the class Fido2DeviceService method findAllFido2Devices.
public List<GluuFido2Device> findAllFido2Devices(GluuCustomPerson person) {
try {
String baseDnForU2fDevices = getDnForFido2Device(null, person.getInum());
Filter inumFilter = Filter.createEqualityFilter(OxTrustConstants.PERSON_INUM, person.getInum());
return ldapEntryManager.findEntries(baseDnForU2fDevices, GluuFido2Device.class, inumFilter);
} catch (EntryPersistenceException e) {
log.warn("No fido2 devices enrolled for " + person.getDisplayName());
return new ArrayList<>();
}
}
use of org.gluu.search.filter.Filter in project oxTrust by GluuFederation.
the class AttributeService method attributeWithSameNameDontExist.
public boolean attributeWithSameNameDontExist(String name) {
Filter nameFilter = Filter.createEqualityFilter("name", name);
List<GluuAttribute> result = persistenceEntryManager.findEntries(getDnForAttribute(null), GluuAttribute.class, nameFilter, null);
return (result != null && !result.isEmpty()) ? false : true;
}
Aggregations