public XACML3Policy(Policy policy) { policySets = new ArrayList<String>(); policyName = policy.getPolicyId(); ruleCombiner = policy.getRuleCombiningAlgId(); resourceSelectors = new HashSet<String>(); target = XACML3PrivilegeUtils.getTargetFunction(policy.getTarget(), resourceSelectors); definedVars = XACML3PrivilegeUtils.getVariableDefinitions(policy); rules = XACML3PrivilegeUtils.getRules(policy, this); }
public XACMLRootElement getXACMLRoot() { Policy policy = new Policy(); policy.setPolicyId(policyName); policy.setRuleCombiningAlgId(ruleCombiner); policy.setTarget((Target) target.getXACMLRoot()); List<Object> elements = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition(); for (XACML3PolicyRule r : rules) { elements.add(r.getXACMLRoot()); } return policy; }