Search in sources :

Example 1 with IDPEntry

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

the class AsimbaAddIDPAction method refresh.

public void refresh() {
    log.info("refresh() IDP call");
    idp = new IDPEntry();
}
Also used : IDPEntry(org.gluu.asimba.util.ldap.idp.IDPEntry)

Example 2 with IDPEntry

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

the class UpdateAsimbaIDPAction method clearEdit.

public void clearEdit() {
    log.info("clearEdit() IDP call");
    idp = new IDPEntry();
    editEntryInum = null;
    newEntry = true;
    uploadedCertBytes = null;
}
Also used : IDPEntry(org.gluu.asimba.util.ldap.idp.IDPEntry)

Example 3 with IDPEntry

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

the class AsimbaService method loadIDPs.

public List<IDPEntry> loadIDPs() {
    List<LdapIDPEntry> entries = ldapEntryManager.findEntries(getDnForLdapIDPEntry(null), LdapIDPEntry.class, null);
    List<IDPEntry> result = new ArrayList<IDPEntry>();
    for (LdapIDPEntry entry : entries) {
        result.add(entry.getEntry());
    }
    return result;
}
Also used : 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)

Example 4 with IDPEntry

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

the class UpdateAsimbaIDPAction method moveIdpUp.

public void moveIdpUp() {
    log.info("moveIdpUp()");
    log.info("selectedIdpId: " + selectedIdpId);
    if (selectedIdpId == null || "".equals(selectedIdpId))
        return;
    IDPEntry idp = null;
    // serch entry
    for (IDPEntry entry : idpList) if (selectedIdpId.equals(entry.getId())) {
        idp = entry;
        break;
    }
    int index = idpList.lastIndexOf(idp);
    if (index > 0) {
        // move other entries to 1 step lowest
        for (int i = 0; i < idpList.size(); i++) {
            IDPEntry entry = idpList.get(i);
            if (i == index - 1) {
                // position to swap
                entry.setViewPriorityIndex(i + 1);
            } else if (i == index) {
                // target idp to up
                // move entry priority to 1 step topest
                entry.setViewPriorityIndex(i - 1);
            } else {
                // before and after new idp position
                entry.setViewPriorityIndex(i);
            }
            asimbaService.updateIDPEntry(entry);
        }
    }
    selectedIdpId = null;
}
Also used : IDPEntry(org.gluu.asimba.util.ldap.idp.IDPEntry)

Example 5 with IDPEntry

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

the class UpdateAsimbaSelectorAction method refresh.

public void refresh() {
    log.info("refresh() Selector call");
    if (searchPattern == null || "".equals(searchPattern)) {
        // list loading
        selectorList = asimbaService.loadSelectors();
    } else {
        // search mode, clear pattern
        searchPattern = null;
    }
    // Load edit lists
    idpList = new ArrayList<SelectItem>();
    List<IDPEntry> idpListEntries = asimbaService.loadIDPs();
    for (IDPEntry entry : idpListEntries) {
        idpList.add(new SelectItem(entry.getId(), entry.getId(), entry.getFriendlyName()));
    }
    spRequestorList = new ArrayList<SelectItem>();
    List<RequestorEntry> spRequestorListEntries = asimbaService.loadRequestors();
    for (RequestorEntry entry : spRequestorListEntries) {
        spRequestorList.add(new SelectItem(entry.getId(), entry.getId(), entry.getFriendlyName()));
    }
}
Also used : SelectItem(javax.faces.model.SelectItem) RequestorEntry(org.gluu.asimba.util.ldap.sp.RequestorEntry) 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