- PolicyEngine policyEngine = new PolicyEngine(
- appContext.getResource(cldsPolicyConfigFile).getFile().getAbsolutePath());
-
- try {
- Collection<PolicyConfig> response = policyEngine.getConfig(configRequestParameters);
- Iterator<PolicyConfig> itrResp = response.iterator();
-
- while (itrResp.hasNext()) {
- PolicyConfig policyConfig = itrResp.next();
- try {
- Integer version = new Integer(policyConfig.getPolicyVersion());
- versions.add(version);
- } catch (Exception e) {
- // just print warning - if n;o policies, version may be null
- logger.warn("Failed to parse due to an exception policyConfig.getPolicyVersion()="
- + policyConfig.getPolicyVersion(), e);
- }
- }
- Collections.sort(versions);
- logger.info("Policy versions.size()=" + versions.size());
- } catch (Exception e) {
- // just print warning - if no policy version found
- logger.warn("warning: policy not found...policy name - " + policyName, e);
+ Collection<PolicyConfig> response = getPolicyEngine().getConfig(configRequestParameters);
+ for (PolicyConfig policyConfig : response) {
+ Integer version = Integer.valueOf(policyConfig.getPolicyVersion());
+ versions.add(version);