Package org.jboss.security.xacml.jaxb

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


    private JBossPDP createPDPForInterop() {
        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());
        final LocatorsType locators = new LocatorsType();
        locators.getLocator().add(locator);
View Full Code Here


                getClass().getResourceAsStream(
                        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();
        locators.getLocator().add(locator);
View Full Code Here

      return response;
   }

   private void bootstrap(PDP pdp) throws Exception
   {
      PoliciesType policiesType = pdp.getPolicies();
      List<PolicySetType> pset = policiesType.getPolicySet();

      this.addPolicySets(pset, true);

      //Take care of additional policies
      List<XACMLPolicy> policyList = this.addPolicies(policiesType.getPolicy());
      policies.addAll(policyList);

      //Take care of the locators
      LocatorsType locatorsType = pdp.getLocators();
      List<LocatorType> locs = locatorsType.getLocator();
View Full Code Here

   private void bootstrap(PDP pdp) throws Exception
   {
      boolean justLocators = false;
     
      PoliciesType policiesType = pdp.getPolicies();
      //SECURITY-407: Just allow Locators
      if(policiesType != null)
      {
         List<PolicySetType> pset = policiesType.getPolicySet();

         this.addPolicySets(pset, true);

         //Take care of additional policies
         List<XACMLPolicy> policyList = this.addPolicies(policiesType.getPolicy());
         policies.addAll(policyList)
      }
      else
      {
         justLocators = true;
View Full Code Here

      assertNotNull("JAXBElement is !null", j);
      PDP pdp = (PDP) j.getValue();
      assertNotNull("PDP is not null", pdp);

      //Validate Policies
      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();
      assertNotNull("LocatorsType != null", lts);
      List<LocatorType> lt = lts.getLocator();
View Full Code Here

   private void bootstrap(PDP pdp) throws Exception
   {
      boolean justLocators = false;
     
      PoliciesType policiesType = pdp.getPolicies();
      //SECURITY-407: Just allow Locators
      if(policiesType != null)
      {
         List<PolicySetType> pset = policiesType.getPolicySet();

         this.addPolicySets(pset, true);

         //Take care of additional policies
         List<XACMLPolicy> policyList = this.addPolicies(policiesType.getPolicy());
         policies.addAll(policyList)
      }
      else
      {
         justLocators = true;
View Full Code Here

      return response;
   }
  
   private void bootstrap(PDP pdp) throws Exception
   {  
      PoliciesType policiesType = pdp.getPolicies();
      List<PolicySetType> pset = policiesType.getPolicySet();
      for(PolicySetType pst: pset)
      {
         String loc = pst.getLocation();
         XACMLPolicy policySet = PolicyFactory.createPolicySet(getInputStream(loc),policyFinder);
         List<PolicyType> policyTypeList =  pst.getPolicy();
        
         List<XACMLPolicy> policyList = new ArrayList<XACMLPolicy>();
         for(PolicyType pt:policyTypeList)
         {
            policyList.add(PolicyFactory.createPolicy(getInputStream(pt.getLocation())));
         }
         policySet.setEnclosingPolicies(policyList);
        
         policies.add(policySet);
      }
      //Take care of additional policies
      List<PolicyType> policyList = policiesType.getPolicy();
      for(PolicyType pt:policyList)
      {
         policies.add(PolicyFactory.createPolicy(getInputStream(pt.getLocation())));
      }
     
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.jaxb.PoliciesType

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.