use of org.gluu.model.DisplayNameEntry in project oxCore by GluuFederation.
the class LookupService method getDisplayNameEntriesByEntries.
public List<DisplayNameEntry> getDisplayNameEntriesByEntries(String baseDn, List<? extends Entry> entries) throws Exception {
if (entries == null) {
return null;
}
Class objectClass = DisplayNameEntry.class;
List<String> dns = new ArrayList<String>(entries.size());
for (Entry entry : entries) {
dns.add(entry.getDn());
objectClass = objectClass.getClass();
}
return getDisplayNameEntries(baseDn, objectClass, dns);
}
use of org.gluu.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, String objectClass) throws Exception {
String key = "l_" + objectClass + "_" + dn;
DisplayNameEntry entry = (DisplayNameEntry) cacheService.get(OxConstants.CACHE_LOOKUP_NAME, key);
if (entry == null) {
// Prepare sample for search
DisplayNameEntry sample = new DisplayNameEntry();
sample.setBaseDn(dn);
sample.setCustomObjectClasses(new String[] { objectClass });
List<DisplayNameEntry> entries = persistenceEntryManager.findEntries(sample, 1);
if (entries.size() == 1) {
entry = entries.get(0);
}
cacheService.put(OxConstants.CACHE_LOOKUP_NAME, key, entry);
}
return entry;
}
use of org.gluu.model.DisplayNameEntry in project oxTrust by GluuFederation.
the class UpdateClientAction method acceptSelectClaims.
public void acceptSelectClaims() {
if (this.availableClaims == null) {
return;
}
Set<String> addedClaimInums = new HashSet<String>();
for (DisplayNameEntry claim : claims) {
addedClaimInums.add(claim.getInum());
}
for (GluuAttribute aClaim : this.availableClaims) {
if (aClaim.isSelected() && !addedClaimInums.contains(aClaim.getInum())) {
addClaim(aClaim);
}
}
this.searchAvailableClaimPattern = "";
}
use of org.gluu.model.DisplayNameEntry in project oxTrust by GluuFederation.
the class UpdateClientAction method updateClaims.
private void updateClaims() {
if (this.claims == null || this.claims.size() == 0) {
this.client.setOxAuthClaims(null);
return;
}
List<String> tmpClaims = new ArrayList<String>();
for (DisplayNameEntry claim : this.claims) {
tmpClaims.add(claim.getDn());
}
this.client.setOxAuthClaims(tmpClaims);
}
use of org.gluu.model.DisplayNameEntry in project oxTrust by GluuFederation.
the class UpdateClientAction method addClaim.
private void addClaim(GluuAttribute claim) {
DisplayNameEntry oneClaim = new DisplayNameEntry(claim.getDn(), claim.getInum(), claim.getDisplayName());
this.claims.add(oneClaim);
}
Aggregations