Search in sources :

Example 11 with DisplayNameEntry

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

the class UpdateGroupAction method addMember.

public void addMember(GluuCustomPerson person) {
    DisplayNameEntry member = new DisplayNameEntry(person.getDn(), person.getInum(), person.getDisplayName());
    this.members.add(member);
}
Also used : DisplayNameEntry(org.gluu.model.DisplayNameEntry)

Example 12 with DisplayNameEntry

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

the class UpdateGroupAction method updateMembers.

private void updateMembers() {
    if (this.members == null || this.members.size() == 0) {
        this.group.setMembers(null);
        return;
    }
    List<String> tmpMembers = new ArrayList<String>();
    for (DisplayNameEntry member : this.members) {
        tmpMembers.add(member.getDn());
    }
    this.group.setMembers(tmpMembers);
}
Also used : ArrayList(java.util.ArrayList) DisplayNameEntry(org.gluu.model.DisplayNameEntry)

Example 13 with DisplayNameEntry

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

the class UpdateResourceAction method updateScopes.

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

Example 14 with DisplayNameEntry

use of org.gluu.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 Scope();
    this.scope.setScopeType(ScopeType.OAUTH);
    try {
        if (this.scope.getOxAuthClaims() != null && this.scope.getOxAuthClaims().size() > 0) {
            this.claims = getClaimDisplayNameEntiries();
        } else {
            this.claims = new ArrayList<DisplayNameEntry>();
        }
    } catch (BasePersistenceException ex) {
        log.error("Failed to load scopes", ex);
        facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to add new scope");
        conversationService.endConversation();
        return OxTrustConstants.RESULT_FAILURE;
    }
    this.dynamicScripts = getInitialDynamicScripts();
    fillAvailableDynScript();
    this.oxAttributesJson = getScopeAttributesJson();
    return OxTrustConstants.RESULT_SUCCESS;
}
Also used : Scope(org.oxauth.persistence.model.Scope) BasePersistenceException(org.gluu.persist.exception.BasePersistenceException) DisplayNameEntry(org.gluu.model.DisplayNameEntry)

Example 15 with DisplayNameEntry

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

the class UpdateScopeAction method updateClaims.

private void updateClaims() {
    if ((org.gluu.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.gluu.model.DisplayNameEntry)

Aggregations

DisplayNameEntry (org.gluu.model.DisplayNameEntry)16 ArrayList (java.util.ArrayList)7 CustomScript (org.gluu.model.custom.script.model.CustomScript)2 HashSet (java.util.HashSet)1 GluuAttribute (org.gluu.model.GluuAttribute)1 UmaResource (org.gluu.oxauth.model.uma.persistence.UmaResource)1 OxAuthClient (org.gluu.oxtrust.model.OxAuthClient)1 BasePersistenceException (org.gluu.persist.exception.BasePersistenceException)1 Entry (org.gluu.persist.model.base.Entry)1 Scope (org.oxauth.persistence.model.Scope)1