Examples of UnbanResult


Examples of org.glite.authz.pap.services.highlevel_policy_management.axis_skeletons.UnbanResult

                                  actionAttributeWizard);
    }

    protected UnbanResult doExecute() {

        UnbanResult unbanResult = new UnbanResult();
        unbanResult.setConflictingPolicies(new String[0]);

        if (alias == null) {
            alias = Pap.DEFAULT_PAP_ALIAS;
        }

        Pap pap = PapManager.getInstance().getPap(alias);

        if (pap.isRemote()) {
            throw new XACMLPolicyManagementServiceException("Forbidden operation for a remote PAP");
        }

        PapContainer papContainer = new PapContainer(pap);

        List<PolicySetType> targetPolicySetList = getTargetPolicySetList(papContainer);

        if (targetPolicySetList.isEmpty()) {
            log.debug("targetPolicySet not found");
            unbanResult.setStatusCode(1);
            return unbanResult;
        }

        PolicyType targetPolicy = null;

        for (PolicySetType targetPolicySet : targetPolicySetList) {
            targetPolicy = getTargetPolicy(papContainer, targetPolicySet);
            if (targetPolicy != null) {
                break;
            }
        }

        if (targetPolicy == null) {
            log.debug("targetPolicy not found");
            unbanResult.setStatusCode(1);
            return unbanResult;
        }

        PolicyWizard policyWizard = new PolicyWizard(targetPolicy);
        TypeStringUtils.releaseUnneededMemory(targetPolicy);

        if (policyWizard.removeDenyRuleForAttribute(bannedAttributeWizard)) {
            log.debug("ban rule found, updating policy");
           
            if (policyWizard.getNumberOfRules() == 0) {
               
                papContainer.removePolicyAndReferences(policyWizard.getPolicyId());
               
            } else {

                String oldVersion = policyWizard.getVersionString();
                policyWizard.increaseVersion();
                papContainer.updatePolicy(oldVersion, policyWizard.getXACML());
            }

            unbanResult.setStatusCode(0);
            return unbanResult;
        }

        unbanResult.setStatusCode(1);
        return unbanResult;
    }
View Full Code Here

Examples of org.glite.authz.pap.services.highlevel_policy_management.axis_skeletons.UnbanResult

        if (verboseMode) {
            System.out.print("Removing ban... ");
        }

        UnbanResult unbanResult;

        unbanResult = highlevelPolicyMgmtClient.unban(alias, id, value, resource, action);

        if (unbanResult.getStatusCode() != 0) {

            System.out.println("ban policy not found.");
            return ExitStatus.FAILURE.ordinal();

        } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.