Search in sources :

Example 6 with IDPEntry

use of org.gluu.asimba.util.ldap.idp.IDPEntry in project oxTrust by GluuFederation.

the class AsimbaService method searchIDPs.

/**
 * Search by pattern
 *
 * @param pattern Pattern
 * @param sizeLimit Maximum count of results
 * @return List of scopes
 * @throws Exception
 */
public List<IDPEntry> searchIDPs(String pattern, int sizeLimit) throws Exception {
    // filter
    String[] targetArray = new String[] { pattern };
    Filter idFilter = Filter.createSubstringFilter(OxTrustConstants.uniqueIdentifier, null, targetArray, null);
    Filter friendlyNameFilter = Filter.createSubstringFilter(OxTrustConstants.friendlyName, null, targetArray, null);
    Filter descriptionFilter = Filter.createSubstringFilter(OxTrustConstants.description, null, targetArray, null);
    Filter inameFilter = Filter.createSubstringFilter(OxTrustConstants.iname, null, targetArray, null);
    Filter searchFilter = Filter.createORFilter(idFilter, friendlyNameFilter, descriptionFilter, inameFilter);
    // search
    final List<LdapIDPEntry> entries = ldapEntryManager.findEntries(getDnForLdapIDPEntry(null), LdapIDPEntry.class, searchFilter, sizeLimit);
    // convert result
    List<IDPEntry> ret = new ArrayList<IDPEntry>();
    for (LdapIDPEntry entry : entries) {
        ret.add(entry.getEntry());
    }
    return ret;
}
Also used : Filter(org.gluu.search.filter.Filter) ArrayList(java.util.ArrayList) LdapIDPEntry(org.gluu.asimba.util.ldap.idp.LdapIDPEntry) LdapIDPEntry(org.gluu.asimba.util.ldap.idp.LdapIDPEntry) IDPEntry(org.gluu.asimba.util.ldap.idp.IDPEntry)

Aggregations

IDPEntry (org.gluu.asimba.util.ldap.idp.IDPEntry)6 ArrayList (java.util.ArrayList)2 LdapIDPEntry (org.gluu.asimba.util.ldap.idp.LdapIDPEntry)2 SelectItem (javax.faces.model.SelectItem)1 RequestorEntry (org.gluu.asimba.util.ldap.sp.RequestorEntry)1 Filter (org.gluu.search.filter.Filter)1