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;
}
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;
}
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);
}
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;
}
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);
}
Aggregations