return new XAttr(Constants.POLICY_SETS, qnames);
}
public void resolvePolicies(Object subject, ModelResolver resolver, ProcessorContext context) {
if ( subject instanceof PolicySubject ) {
PolicySubject policySetAttachPoint = (PolicySubject)subject;
List<Intent> requiredIntents = new ArrayList<Intent>();
Intent resolvedIntent = null;
if ( policySetAttachPoint.getRequiredIntents() != null && policySetAttachPoint.getRequiredIntents().size() > 0 ) {
for ( Intent intent : policySetAttachPoint.getRequiredIntents() ) {
resolvedIntent = resolver.resolveModel(Intent.class, intent, context);
requiredIntents.add(resolvedIntent);
}
policySetAttachPoint.getRequiredIntents().clear();
policySetAttachPoint.getRequiredIntents().addAll(requiredIntents);
}
if ( policySetAttachPoint.getPolicySets() != null && policySetAttachPoint.getPolicySets().size() > 0 ) {
List<PolicySet> resolvedPolicySets = new ArrayList<PolicySet>();
PolicySet resolvedPolicySet = null;
for ( PolicySet policySet : policySetAttachPoint.getPolicySets() ) {
resolvedPolicySet = resolver.resolveModel(PolicySet.class, policySet, context);
resolvedPolicySets.add(resolvedPolicySet);
}
policySetAttachPoint.getPolicySets().clear();
policySetAttachPoint.getPolicySets().addAll(resolvedPolicySets);
}
}
}