Search in sources :

Example 1 with SelectableEntity

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

the class UpdateClientAction method searchAvailableResponseTypes.

public void searchAvailableResponseTypes() {
    if (this.availableResponseTypes != null) {
        selectAddedResponseTypes();
        return;
    }
    List<SelectableEntity<ResponseType>> tmpAvailableResponseTypes = new ArrayList<SelectableEntity<ResponseType>>();
    for (ResponseType responseType : ResponseType.values()) {
        tmpAvailableResponseTypes.add(new SelectableEntity<ResponseType>(responseType));
    }
    this.availableResponseTypes = tmpAvailableResponseTypes;
    selectAddedResponseTypes();
}
Also used : SelectableEntity(org.gluu.model.SelectableEntity) ArrayList(java.util.ArrayList) ResponseType(org.gluu.oxauth.model.common.ResponseType)

Example 2 with SelectableEntity

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

the class UpdateScopeAction method fillAvailableDynScript.

private void fillAvailableDynScript() {
    List<CustomScript> availableScripts = customScriptService.findCustomScripts(Arrays.asList(CustomScriptType.DYNAMIC_SCOPE));
    List<SelectableEntity<CustomScript>> tmpAvailableDynamicScripts = new ArrayList<SelectableEntity<CustomScript>>();
    for (CustomScript dynamicScript : availableScripts) {
        if (dynamicScript.isEnabled()) {
            tmpAvailableDynamicScripts.add(new SelectableEntity<CustomScript>(dynamicScript));
        }
    }
    availableDynamicScripts.addAll(tmpAvailableDynamicScripts);
}
Also used : CustomScript(org.gluu.model.custom.script.model.CustomScript) SelectableEntity(org.gluu.model.SelectableEntity) ArrayList(java.util.ArrayList)

Example 3 with SelectableEntity

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

the class UpdateScopeAction method searchAvailableDynamicScripts.

public void searchAvailableDynamicScripts() {
    if (this.availableDynamicScripts != null) {
        selectAddedDynamicScripts();
        return;
    }
    try {
        List<CustomScript> availableScripts = customScriptService.findCustomScripts(Arrays.asList(CustomScriptType.DYNAMIC_SCOPE), CUSTOM_SCRIPT_RETURN_ATTRIBUTES);
        List<SelectableEntity<CustomScript>> tmpAvailableDynamicScripts = new ArrayList<SelectableEntity<CustomScript>>();
        for (CustomScript dynamicScript : availableScripts) {
            if (dynamicScript.isEnabled()) {
                tmpAvailableDynamicScripts.add(new SelectableEntity<CustomScript>(dynamicScript));
            }
        }
        this.availableDynamicScripts = tmpAvailableDynamicScripts;
        selectAddedDynamicScripts();
    } catch (BasePersistenceException ex) {
        log.error("Failed to find available authorization policies", ex);
    }
}
Also used : CustomScript(org.gluu.model.custom.script.model.CustomScript) BasePersistenceException(org.gluu.persist.exception.BasePersistenceException) SelectableEntity(org.gluu.model.SelectableEntity) ArrayList(java.util.ArrayList)

Example 4 with SelectableEntity

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

the class UpdateGluuRadiusConfigAction method searchAvailableScopes.

public void searchAvailableScopes() {
    if (this.availableScopes != null) {
        selectAddedScopes();
        return;
    }
    List<SelectableEntity<Scope>> tmpAvailableScopes = new ArrayList<SelectableEntity<Scope>>();
    List<Scope> scopes = new ArrayList<Scope>();
    try {
        scopes = scopeService.getAllScopesList(100);
    } catch (Exception e) {
        log.warn(e.getMessage(), e);
    }
    for (Scope scope : scopes) tmpAvailableScopes.add(new SelectableEntity<Scope>(scope));
    this.availableScopes = tmpAvailableScopes;
    selectAddedScopes();
}
Also used : Scope(org.oxauth.persistence.model.Scope) SelectableEntity(org.gluu.model.SelectableEntity) ArrayList(java.util.ArrayList)

Example 5 with SelectableEntity

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

the class UpdateUmaScopeAction method searchAvailableAuthorizationPolicies.

public void searchAvailableAuthorizationPolicies() {
    if (this.availableAuthorizationPolicies != null) {
        selectAddedAuthorizationPolicies();
        return;
    }
    try {
        List<CustomScript> availableScripts = customScriptService.findCustomScripts(Arrays.asList(CustomScriptType.UMA_RPT_POLICY), CUSTOM_SCRIPT_RETURN_ATTRIBUTES);
        List<SelectableEntity<CustomScript>> tmpAvailableAuthorizationPolicies = new ArrayList<SelectableEntity<CustomScript>>();
        for (CustomScript authorizationPolicy : availableScripts) {
            tmpAvailableAuthorizationPolicies.add(new SelectableEntity<CustomScript>(authorizationPolicy));
        }
        this.availableAuthorizationPolicies = tmpAvailableAuthorizationPolicies;
        selectAddedAuthorizationPolicies();
    } catch (BasePersistenceException ex) {
        log.error("Failed to find available authorization policies", ex);
    }
}
Also used : CustomScript(org.gluu.model.custom.script.model.CustomScript) BasePersistenceException(org.gluu.persist.exception.BasePersistenceException) SelectableEntity(org.gluu.model.SelectableEntity) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)6 SelectableEntity (org.gluu.model.SelectableEntity)6 CustomScript (org.gluu.model.custom.script.model.CustomScript)3 BasePersistenceException (org.gluu.persist.exception.BasePersistenceException)3 Scope (org.oxauth.persistence.model.Scope)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 JSONException (org.codehaus.jettison.json.JSONException)1 ResponseType (org.gluu.oxauth.model.common.ResponseType)1 EncryptionException (org.gluu.util.security.StringEncrypter.EncryptionException)1