PolicySetType[] policySetArray;
policySetArray = xacmlPolicyMgmtClient.listPolicySets(papAlias);
if (policySetArray.length == 0) {
throw new CLIException(
"Error: the repository seems to be corrupted, no policy sets have been found");
}
PolicyType[] policyArray;
policyArray = xacmlPolicyMgmtClient.listPolicies(papAlias);
List<PolicyWizard> policyWizardList = new ArrayList<PolicyWizard>(policyArray.length);
for (PolicyType policy : policyArray) {
// Filtering by action
// TODO: how to handle wildcards? Should we use regexp match?
String actionValue = PolicyWizard.getActionValue(policy);
if (actionFilter != null && !actionValue.equals(actionFilter))
continue;
PolicyWizard policyWizard = new PolicyWizard(policy);
policyWizardList.add(policyWizard);
policyWizard.releaseChildrenDOM();
policyWizard.releaseDOM();
}
policyArray = null;
PolicySetType localRootPolicySet = policySetArray[0];
for (String policySetId : PolicySetHelper
.getPolicySetIdReferencesValues(localRootPolicySet)) {
PolicySetType policySet = null;
for (PolicySetType policySetElem : policySetArray) {
if (policySetId.equals(policySetElem.getPolicySetId())) {
policySet = policySetElem;
break;
}
}
if (policySet == null) {
throw new CLIException(
"Error: the repository seems to be corrupted, policy set not found: "
+ policySetId);
}
try {