- @SuppressWarnings("deprecation")
- public static ArrayList<String> getConfig(PolicyEngine policyEngine,
- String onapComponentName, String configName,
- Map<String, String> configAttributes) {
- ArrayList<String> resultReceived = new ArrayList<>();
- try {
- UUID requestID = UUID.randomUUID();
- Collection<PolicyConfig> policyConfigs;
- if (configName == null) {
- policyConfigs = policyEngine.getConfig(onapComponentName, requestID);
- } else {
- if (configAttributes == null) {
- policyConfigs = policyEngine.getConfig(onapComponentName,
- configName, requestID);
- } else {
-
- policyConfigs = policyEngine.getConfig(onapComponentName,
- configName, configAttributes, requestID);
- }
- }
- if (policyConfigs != null && !policyConfigs.isEmpty()) {
- for (PolicyConfig policyConfig : policyConfigs) {
- resultReceived.add("Policy Name: "
- + policyConfig.getPolicyName()
- + " Policy version: "
- + policyConfig.getPolicyVersion() + " - "
- + policyConfig.getPolicyConfigStatus());
- }
- }
- } catch (PolicyConfigException e) {
-// logger.error("Exception Occured"+e);
- resultReceived.add(""+e);
- }
- return resultReceived;
- }
+ policyConfigs = policyEngine.getConfig(onapComponentName, configName, configAttributes, requestID);
+ }
+ }
+ if (policyConfigs != null && !policyConfigs.isEmpty()) {
+ for (PolicyConfig policyConfig : policyConfigs) {
+ resultReceived.add("Policy Name: " + policyConfig.getPolicyName() + " Policy version: "
+ + policyConfig.getPolicyVersion() + " - " + policyConfig.getPolicyConfigStatus());
+ }
+ }
+ } catch (PolicyConfigException e) {
+ // logger.error("Exception Occured"+e);
+ resultReceived.add("" + e);
+ }
+ return resultReceived;
+ }