Package org.glite.authz.pap.papmanagement

Examples of org.glite.authz.pap.papmanagement.PapContainer


        return new HasRemotePolicySetOperation(ps, policySetId);
    }

    @Override
    protected Boolean doExecute() {
        PapContainer localPAP = new PapContainer(ps);
        return localPAP.hasPolicySet(policySetId);
    }
View Full Code Here


    }

    @Override
    protected PolicyType doExecute() {

        PapContainer papContainer = new PapContainer(ps);

        if (!papContainer.hasPolicy(policyId)) {
            throw new NotFoundException("Policy '" + policyId + "' not found.");
        }

        PolicyType policy = papContainer.getPolicy(policyId);

        return policy;
    }
View Full Code Here

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

        PapContainer papContainer = new PapContainer(pap);

        try {
            papContainer.deletePolicy(policyId);
        } catch (NotFoundException e) {
            return false;
        }

        return true;
View Full Code Here

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

        PapContainer papContainer = new PapContainer(pap);

        if (papContainer.hasPolicySet(id)) {

            movePolicySet(papContainer);

        } else if (papContainer.hasPolicy(id)) {

            movePolicy(papContainer);

        } else {
            moveRule(papContainer);
View Full Code Here

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

        PapContainer papContainer = new PapContainer(pap);

        if (!(papContainer.hasPolicy(policy.getPolicyId()))) {
            return false;
        }

        papContainer.updatePolicy(version, policy);

        return true;
    }
View Full Code Here

        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;
        }
View Full Code Here

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

        PapContainer papContainer = new PapContainer(pap);

        String policyId = WizardUtils.generateId(idPrefix);
        policy.setPolicyId(policyId);

        papContainer.storePolicy(policy);

        TypeStringUtils.releaseUnneededMemory(policy);

        return policyId;
View Full Code Here

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

        PapContainer papContainer = new PapContainer(pap);

        if (!papContainer.hasPolicySet(policySetId)) {
            log.warn(String.format("Policy not added because PolicySetId \"%s\" does not exists.", policySetId));
            return null;
        }

        String policyId = WizardUtils.generateId(policyIdPrefix);

        policy.setPolicyId(policyId);

        papContainer.addPolicy(index, policySetId, policy);

        TypeStringUtils.releaseUnneededMemory(policy);

        log.info(String.format("Added policy (policyId=\"%s\")", policyId));
View Full Code Here

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

        PapContainer papContainer = new PapContainer(pap);

        if (!papContainer.hasPolicySet(policySetId)) {
            log.warn(String.format("Policies not added because PolicySetId \"%s\" does not exists.", policySetId));
            return null;
        }

        String[] policyIdArray = new String[policyArray.length];

        for (int i = 0; i < policyArray.length; i++) {

            policyIdArray[i] = WizardUtils.generateId(policyIdPrefix[i]);
           
            policyArray[i].setPolicyId(policyIdArray[i]);

            if (index == -1) {
                papContainer.addPolicy(index, policySetId, policyArray[i]);
            } else {
                papContainer.addPolicy(index + i, policySetId, policyArray[i]);
            }
            TypeStringUtils.releaseUnneededMemory(policyArray[i]);

            log.info(String.format("Added policy (policyId=\"%s\")", policyIdArray[i]));
        }
View Full Code Here

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

        PapContainer papContainer = new PapContainer(pap);

        String policySetId = WizardUtils.generateId(idPrefix);
      policySet.setPolicySetId(policySetId);

        papContainer.storePolicySet(policySet);

        TypeStringUtils.releaseUnneededMemory(policySet);

        return policySetId;
    }
View Full Code Here

TOP

Related Classes of org.glite.authz.pap.papmanagement.PapContainer

Copyright © 2018 www.massapicom. 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.