m_policyFinder = policyFinder; m_target = new Target(new TargetSection(null, TargetMatch.SUBJECT, PolicyMetaData.XACML_VERSION_2_0), new TargetSection(null, TargetMatch.RESOURCE, PolicyMetaData.XACML_VERSION_2_0), new TargetSection(null, TargetMatch.ACTION, PolicyMetaData.XACML_VERSION_2_0), new TargetSection(null, TargetMatch.ENVIRONMENT, PolicyMetaData.XACML_VERSION_2_0));
/** * Constructor that creates an XACML 1.x <code>Target</code> from * components. Each of the sections must be non-null, but they may match * any request. Because this is only used for 1.x Targets, there is no * Environments section. * * @param subjectsSection a <code>TargetSection</code> representing * the Subjects section of this target * @param resourcesSection a <code>TargetSection</code> representing * the Resources section of this target * @param actionsSection a <code>TargetSection</code> representing * the Actions section of this target */ public Target(TargetSection subjectsSection, TargetSection resourcesSection, TargetSection actionsSection) { if ((subjectsSection == null) || (resourcesSection == null) || (actionsSection == null)) throw new ProcessingException("All sections of a Target must " + "be non-null"); this.subjectsSection = subjectsSection; this.resourcesSection = resourcesSection; this.actionsSection = actionsSection; this.environmentsSection = new TargetSection(null, TargetMatch.ENVIRONMENT, PolicyMetaData.XACML_VERSION_1_0); this.xacmlVersion = PolicyMetaData.XACML_VERSION_1_0; }
return new TargetSection(groups, matchType, metaData.getXACMLVersion());
subjects = new TargetSection(null, TargetMatch.SUBJECT, version); if (resources == null) resources = new TargetSection(null, TargetMatch.RESOURCE, version); if (actions == null) actions = new TargetSection(null, TargetMatch.ACTION, version); environments = new TargetSection(null, TargetMatch.ENVIRONMENT, version); return new Target(subjects, resources, actions, environments);