Search in sources :

Example 1 with DisplayNameEntry

use of org.xdi.model.DisplayNameEntry 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;
}
Also used : Filter(com.unboundid.ldap.sdk.Filter) ArrayList(java.util.ArrayList) List(java.util.List) DisplayNameEntry(org.xdi.model.DisplayNameEntry)

Example 2 with DisplayNameEntry

use of org.xdi.model.DisplayNameEntry in project oxCore by GluuFederation.

the class LookupService method getDisplayNameEntry.

/**
	 * Returns DisplayNameEntry based on display name
	 * 
	 * @param dn
	 *            display name
	 * @return DisplayNameEntry object
	 */
public DisplayNameEntry getDisplayNameEntry(String dn) throws Exception {
    String key = dn;
    DisplayNameEntry entry = (DisplayNameEntry) cacheService.get(OxConstants.CACHE_LOOKUP_NAME, key);
    if (entry == null) {
        entry = ldapEntryManager.find(DisplayNameEntry.class, key);
        cacheService.put(OxConstants.CACHE_LOOKUP_NAME, key, entry);
    }
    return entry;
}
Also used : DisplayNameEntry(org.xdi.model.DisplayNameEntry)

Example 3 with DisplayNameEntry

use of org.xdi.model.DisplayNameEntry in project oxTrust by GluuFederation.

the class UpdateClientAction method updateScopes.

private void updateScopes() {
    if (this.scopes == null || this.scopes.size() == 0) {
        this.client.setOxAuthScopes(null);
        return;
    }
    List<String> tmpScopes = new ArrayList<String>();
    for (DisplayNameEntry scope : this.scopes) {
        tmpScopes.add(scope.getDn());
    }
    this.client.setOxAuthScopes(tmpScopes);
}
Also used : DisplayNameEntry(org.xdi.model.DisplayNameEntry)

Example 4 with DisplayNameEntry

use of org.xdi.model.DisplayNameEntry in project oxTrust by GluuFederation.

the class UpdateScopeAction method getInitialDynamicScripts.

private List<CustomScript> getInitialDynamicScripts() {
    List<CustomScript> result = new ArrayList<CustomScript>();
    if ((this.scope.getDynamicScopeScripts() == null) || (this.scope.getDynamicScopeScripts().size() == 0)) {
        return result;
    }
    List<DisplayNameEntry> displayNameEntries = lookupService.getDisplayNameEntries(customScriptService.baseDn(), this.scope.getDynamicScopeScripts());
    if (displayNameEntries != null) {
        for (DisplayNameEntry displayNameEntry : displayNameEntries) {
            result.add(new CustomScript(displayNameEntry.getDn(), displayNameEntry.getInum(), displayNameEntry.getDisplayName()));
        }
    }
    return result;
}
Also used : CustomScript(org.xdi.model.custom.script.model.CustomScript) ArrayList(java.util.ArrayList) DisplayNameEntry(org.xdi.model.DisplayNameEntry)

Example 5 with DisplayNameEntry

use of org.xdi.model.DisplayNameEntry in project oxTrust by GluuFederation.

the class UpdateSectorIdentifierAction method addClient.

public void addClient(OxAuthClient client) {
    DisplayNameEntry displayNameEntry = new DisplayNameEntry(client.getDn(), client.getInum(), client.getDisplayName());
    this.clientDisplayNameEntries.add(displayNameEntry);
}
Also used : DisplayNameEntry(org.xdi.model.DisplayNameEntry)

Aggregations

DisplayNameEntry (org.xdi.model.DisplayNameEntry)20 ArrayList (java.util.ArrayList)8 CustomScript (org.xdi.model.custom.script.model.CustomScript)2 Filter (com.unboundid.ldap.sdk.Filter)1 List (java.util.List)1 OxAuthScope (org.gluu.oxtrust.model.OxAuthScope)1 LdapMappingException (org.gluu.site.ldap.persistence.exception.LdapMappingException)1 ResourceSet (org.xdi.oxauth.model.uma.persistence.ResourceSet)1