Package org.opensaml.xacml.policy

Examples of org.opensaml.xacml.policy.PolicySetType


        super(XACMLConstants.XACML20_NS, PolicySetType.DEFAULT_ELEMENT_LOCAL_NAME);
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        PolicySetType policySet = (PolicySetType) xmlObject;

        if (attribute.getLocalName().equals(PolicySetType.POLICY_SET_ID_ATTRIB_NAME)) {
            policySet.setPolicySetId(attribute.getValue());
        } else if (attribute.getLocalName().equals(PolicySetType.VERSION_ATTRIB_NAME)) {
            policySet.setVersion(attribute.getValue());
        } else if (attribute.getLocalName().equals(PolicySetType.POLICY_COMBINING_ALG_ID_ATTRIB_NAME)) {
            policySet.setPolicyCombiningAlgoId(attribute.getValue());
        } else {
            super.processAttribute(xmlObject, attribute);
        }
    }
View Full Code Here


    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        PolicySetType policySet = (PolicySetType) parentXMLObject;

        if (childXMLObject instanceof DescriptionType) {
            policySet.setDescription((DescriptionType) childXMLObject);
        } else if (childXMLObject instanceof DefaultsType) {
            policySet.setPolicySetDefaults((DefaultsType) childXMLObject);
        } else if (childXMLObject instanceof TargetType){
                policySet.setTarget((TargetType) childXMLObject);
        } else if (childXMLObject instanceof PolicySetType) {
            policySet.getPolicySets().add((PolicySetType) childXMLObject);
        } else if (childXMLObject instanceof PolicyType) {
            policySet.getPolicies().add((PolicyType) childXMLObject);
        } else if (childXMLObject.getElementQName().equals(IdReferenceType.POLICY_SET_ID_REFERENCE_ELEMENT_NAME)) {
            policySet.getPolicySetIdReferences().add((IdReferenceType) childXMLObject);
        } else if (childXMLObject.getElementQName().equals(IdReferenceType.POLICY_ID_REFERENCE_ELEMENT_NAME)) {
            policySet.getPolicyIdReferences().add((IdReferenceType) childXMLObject);
        } else if (childXMLObject.getElementQName().equals(CombinerParametersType.DEFAULT_ELEMENT_NAME)) {
            policySet.getCombinerParameters().add((CombinerParametersType) childXMLObject);
        } else if (childXMLObject.getElementQName().equals(PolicyCombinerParametersType.DEFAULT_ELEMENT_NAME)) {
            policySet.getPolicyCombinerParameters().add((PolicyCombinerParametersType) childXMLObject);
        } else if (childXMLObject.getElementQName().equals(PolicySetCombinerParametersType.DEFAULT_ELEMENT_NAME)) {
            policySet.getPolicySetCombinerParameters().add((PolicySetCombinerParametersType) childXMLObject);
        } else if (childXMLObject instanceof ObligationsType) {
            policySet.setObligations((ObligationsType) childXMLObject);
        } else {
            super.processChildElement(parentXMLObject, childXMLObject);
        }
    }
View Full Code Here

        super();
    }

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        PolicySetType policySet = (PolicySetType) xmlObject;

        if (!DatatypeHelper.isEmpty(policySet.getPolicySetId())) {
            domElement.setAttribute(PolicySetType.POLICY_SET_ID_ATTRIB_NAME, policySet.getPolicySetId());
        }
        if (!DatatypeHelper.isEmpty(policySet.getVersion())) {
            domElement.setAttribute(PolicySetType.VERSION_ATTRIB_NAME, policySet.getVersion());
        }
        if (!DatatypeHelper.isEmpty(policySet.getPolicyCombiningAlgoId())) {
            domElement.setAttribute(PolicySetType.POLICY_COMBINING_ALG_ID_ATTRIB_NAME, policySet
                    .getPolicyCombiningAlgoId());
        }
    }
View Full Code Here

        PapContainer papContainer = new PapContainer(ps);

        if (!papContainer.hasPolicySet(policySetId))
            throw new NotFoundException("PolicySet '" + policySetId + "' not found.");

        PolicySetType policySet = papContainer.getPolicySet(policySetId);

        return policySet;
    }
View Full Code Here

    @Override
    protected PolicySetType doExecute() {

        PapContainer psContainer = new PapContainer(ps);

        PolicySetType policySet = psContainer.getRootPolicySet();

        return policySet;
    }
View Full Code Here

    @Override
    protected PolicySetType doExecute() {

        PapContainer psContainer = new PapContainer(ps);

        PolicySetType policySet = psContainer.getRootPolicySet();

        return policySet;
    }
View Full Code Here

        PapContainer papContainer = new PapContainer(ps);
       
        if (!papContainer.hasPolicySet(policySetId))
            throw new NotFoundException("PolicySet '" + policySetId + "' not found.");
       
        PolicySetType policySet = papContainer.getPolicySet(policySetId);
       
        return policySet;
       
    }
View Full Code Here

                ((PolicySetType) papRoot).setPolicySetId(papContainer.getPap().getId());

                for (XACMLObject xacmlObject : papPolicies) {

                    if (xacmlObject instanceof PolicySetType) {
                        PolicySetType policySet = (PolicySetType) xacmlObject;
                        papContainer.storePolicySet(policySet);

                        log.debug(String.format("Stored PolicySet \"%s\" into pap \"%s\"",
                                                policySet.getPolicySetId(),
                                                pap.getAlias()));
                    } else if (xacmlObject instanceof PolicyType) {

                        PolicyType policy = (PolicyType) xacmlObject;
                        papContainer.storePolicy(policy);
View Full Code Here

                alias = Pap.DEFAULT_PAP_ALIAS;
            }

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

            PolicySetType policySet;

            if (ps.isLocal()) {
                policySet = GetLocalPolicySetOperation.instance(ps, policySetId).execute();
            } else {
                policySet = GetRemotePolicySetOperation.instance(ps, policySetId).execute();
View Full Code Here

        return build(policySetId, policyCombinerAlgorithmId, target, null);
    }

    public static PolicySetType build(String policySetId, String policyCombiningAlgorithmId, TargetType target,
            ObligationsType obligations) {
        PolicySetType policySet = build();
        policySet.setPolicySetId(policySetId);
        policySet.setPolicyCombiningAlgoId(policyCombiningAlgorithmId);
        if (target == null) {
            policySet.setTarget(TargetHelper.build());
        } else {
            policySet.setTarget(target);
        }
        if (obligations != null) {
            policySet.setObligations(obligations);
        }
        return policySet;
    }
View Full Code Here

TOP

Related Classes of org.opensaml.xacml.policy.PolicySetType

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.