boolean result = true;
for (XACMLWizard xacmlWizard : xacmlWizardList) {
PolicySetWizard policySetWizard = (PolicySetWizard) xacmlWizard;
PolicySetType policySet = policySetWizard.getXACML();
policySet.getPolicyIdReferences().clear();
policySetWizard.releaseDOM();
String policySetId = xacmlPolicyMgmtClient.addPolicySet(alias, position, policySet);
if (position != -1) {
position++;
}
if (policySetId == null) {
System.out.println(String.format("Error policy set not added: %s (id=%s). Skipping all the policies defined inside.",
policySetWizard.getTagAndValue(),
policySetWizard.getPolicySetId()));
result = false;
continue;
}
if (verboseMode) {
System.out.println(String.format("Added policy set: %s (id=%s)",
policySetWizard.getTagAndValue(),
policySetId));
}
int size = policySetWizard.getPolicyWizardList().size();
PolicyType[] policyArray = new PolicyType[size];
String[] idPrefixArray = new String[size];
String[] tagAndValueArray = new String[size];
for (int i = 0; i < size; i++) {
PolicyWizard policyWizard = policySetWizard.getPolicyWizardList().get(i);
policyArray[i] = policyWizard.getXACML();
TypeStringUtils.releaseUnneededMemory(policyArray[i]);
idPrefixArray[i] = policyWizard.getPolicyIdPrefix();
tagAndValueArray[i] = policyWizard.getTagAndValue();
TypeStringUtils.releaseUnneededMemory(policyWizard);