Examples of PolicySetType


Examples of org.jboss.security.xacml.jaxb.PolicySetType

        final String policiesPath = getClass().getPackage().getName().replace('.', '/') + "/"
                + XACMLTestUtils.TESTOBJECTS_POLICIES;
        //create XML configuration for the JBossPDP (as a JAXBElement)
        PDP pdp = new PDP();
        final PoliciesType policies = new PoliciesType();
        final PolicySetType policySet = new PolicySetType();
        policySet.setLocation(policiesPath + "/xacml-policySet.xml");
        for (short i = 2; i <= 5; i++) {
            final PolicyType policy = new PolicyType();
            policy.setLocation(policiesPath + "/xacml-policy" + i + ".xml");
            policySet.getPolicy().add(policy);
        }
        policies.getPolicySet().add(policySet);
        pdp.setPolicies(policies);
        final LocatorType locator = new LocatorType();
        locator.setName(JBossPolicySetLocator.class.getName());
View Full Code Here

Examples of org.jboss.security.xacml.jaxb.PolicySetType

                        XACMLTestUtils.TESTOBJECTS_POLICIES + "/" + XACMLTestUtils.MED_EXAMPLE_POLICY_SET2), policySetFile2);

        //create XML configuration for the PDP
        final PDP pdp = new PDP();
        final PoliciesType policies = new PoliciesType();
        final PolicySetType policySet = new PolicySetType();
        policySet.setLocation(policyDir.toURI().getPath());
        policies.getPolicySet().add(policySet);
        pdp.setPolicies(policies);
        final LocatorType locator = new LocatorType();
        locator.setName(JBossPolicySetLocator.class.getName());
        final LocatorsType locators = new LocatorsType();
View Full Code Here

Examples of org.jboss.security.xacml.jaxb.PolicySetType

      PoliciesType pts = pdp.getPolicies();
      assertNotNull("PoliciesType is not null", pts);
      List<PolicySetType> pst = pts.getPolicySet();
      assertNotNull("PolicySetType is not null", pst);
      assertEquals("1 PolicySet", 1, pst.size());
      PolicySetType psetType = pst.get(0);
      String loc = psetType.getLocation();
      assertTrue("Location of PolicySet is >0", loc.length() > 0);
      assertEquals("PolicyType is null", 0, pts.getPolicy().size());

      //Validate Locators
      LocatorsType lts = pdp.getLocators();
View Full Code Here

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

Examples of org.opensaml.xacml.policy.PolicySetType

    }

    /** {@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

Examples of org.opensaml.xacml.policy.PolicySetType

        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

Examples of org.opensaml.xacml.policy.PolicySetType

        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

Examples of org.opensaml.xacml.policy.PolicySetType

    @Override
    protected PolicySetType doExecute() {

        PapContainer psContainer = new PapContainer(ps);

        PolicySetType policySet = psContainer.getRootPolicySet();

        return policySet;
    }
View Full Code Here

Examples of org.opensaml.xacml.policy.PolicySetType

    @Override
    protected PolicySetType doExecute() {

        PapContainer psContainer = new PapContainer(ps);

        PolicySetType policySet = psContainer.getRootPolicySet();

        return policySet;
    }
View Full Code Here

Examples of org.opensaml.xacml.policy.PolicySetType

        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
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.