Search in sources :

Example 11 with DisplayNameEntry

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);
}
Also used : DisplayNameEntry(org.xdi.model.DisplayNameEntry)

Example 12 with DisplayNameEntry

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;
}
Also used : ResourceSet(org.xdi.oxauth.model.uma.persistence.ResourceSet) DisplayNameEntry(org.xdi.model.DisplayNameEntry)

Example 13 with DisplayNameEntry

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);
}
Also used : ArrayList(java.util.ArrayList) DisplayNameEntry(org.xdi.model.DisplayNameEntry)

Example 14 with DisplayNameEntry

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;
}
Also used : OxAuthScope(org.gluu.oxtrust.model.OxAuthScope) LdapMappingException(org.gluu.site.ldap.persistence.exception.LdapMappingException) DisplayNameEntry(org.xdi.model.DisplayNameEntry)

Example 15 with DisplayNameEntry

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);
}
Also used : ArrayList(java.util.ArrayList) 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