use of org.xdi.model.DisplayNameEntry in project oxTrust by GluuFederation.
the class UpdateResourceSetAction method addScope.
public void addScope(ScopeDescription scope) {
DisplayNameEntry oneScope = new DisplayNameEntry(scope.getDn(), scope.getId(), scope.getDisplayName());
this.scopes.add(oneScope);
}
use of org.xdi.model.DisplayNameEntry in project oxTrust by GluuFederation.
the class UpdateResourceSetAction method add.
private String add() {
this.resourceSet = new ResourceSet();
this.scopes = new ArrayList<DisplayNameEntry>();
this.clients = new ArrayList<DisplayNameEntry>();
this.resources = new ArrayList<String>();
return OxTrustConstants.RESULT_SUCCESS;
}
use of org.xdi.model.DisplayNameEntry in project oxTrust by GluuFederation.
the class UpdateResourceSetAction method updateScopes.
private void updateScopes() {
if ((this.scopes == null) || (this.scopes.size() == 0)) {
this.resourceSet.setScopes(null);
return;
}
List<String> tmpScopes = new ArrayList<String>();
for (DisplayNameEntry scope : this.scopes) {
tmpScopes.add(scope.getDn());
}
this.resourceSet.setScopes(tmpScopes);
}
use of org.xdi.model.DisplayNameEntry in project oxTrust by GluuFederation.
the class UpdateScopeAction method add.
public String add() throws Exception {
if (this.scope != null) {
return OxTrustConstants.RESULT_SUCCESS;
}
this.update = false;
this.scope = new OxAuthScope();
try {
if (this.scope.getOxAuthClaims() != null && this.scope.getOxAuthClaims().size() > 0) {
this.claims = getClaimDisplayNameEntiries();
} else {
this.claims = new ArrayList<DisplayNameEntry>();
}
} catch (LdapMappingException ex) {
log.error("Failed to load scopes", ex);
return OxTrustConstants.RESULT_FAILURE;
}
this.dynamicScripts = getInitialDynamicScripts();
return OxTrustConstants.RESULT_SUCCESS;
}
use of org.xdi.model.DisplayNameEntry in project oxTrust by GluuFederation.
the class UpdateScopeAction method updateClaims.
private void updateClaims() {
if ((org.xdi.oxauth.model.common.ScopeType.DYNAMIC == this.scope.getScopeType()) || (this.claims == null) || (this.claims.size() == 0)) {
this.scope.setOxAuthClaims(null);
return;
}
List<String> resultClaims = new ArrayList<String>();
this.scope.setOxAuthClaims(resultClaims);
for (DisplayNameEntry claim : this.claims) {
resultClaims.add(claim.getDn());
}
this.scope.setOxAuthClaims(resultClaims);
}
Aggregations