aboutsummaryrefslogtreecommitdiffstats
path: root/applications/monitoring/src
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-10-02 09:13:13 -0400
committerPamela Dragosh <pdragosh@research.att.com>2020-10-02 09:13:18 -0400
commit7ae3ab19d0556a0308f0d293d4dd2e58dd3d3929 (patch)
tree16e26e30d7a6e734ec34108d24727eb8afc0c9dc /applications/monitoring/src
parent57e705469481f446aeada858c8eb411c5cccebc8 (diff)
Remove duplicated code
Initially, just moving the applicationName and actions as protected fields got rid of the sonar issue. I included also the supportedPolicyTypes also. But that triggered another sonar duplicate code, so I had to rename a few private fields to rid that. Seems like a very sensitive sonar detection that results in kludgy code. Issue-ID: POLICY-2681 Change-Id: Ie79a95786cdb80381cbce4b182e9e66a2776e0dd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/monitoring/src')
-rw-r--r--applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java22
1 files changed, 4 insertions, 18 deletions
diff --git a/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java b/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java
index ada347e2..a3456aea 100644
--- a/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java
+++ b/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java
@@ -23,9 +23,7 @@
package org.onap.policy.xacml.pdp.application.monitoring;
import com.att.research.xacml.api.Response;
-import java.util.ArrayList;
import java.util.Arrays;
-import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang3.tuple.Pair;
@@ -56,12 +54,15 @@ public class MonitoringPdpApplication extends StdXacmlApplicationServiceProvider
public static final String VERSION_100 = "1.0.0";
private StdCombinedPolicyResultsTranslator translator = new StdCombinedPolicyResultsTranslator();
- private List<ToscaPolicyTypeIdentifier> supportedPolicyTypes = new ArrayList<>();
/**
* Constructor.
*/
public MonitoringPdpApplication() {
+ super();
+
+ applicationName = "monitoring";
+ actions = Arrays.asList("configure");
//
// By default this supports just Monitoring policy types
//
@@ -69,21 +70,6 @@ public class MonitoringPdpApplication extends StdXacmlApplicationServiceProvider
}
@Override
- public String applicationName() {
- return "monitoring";
- }
-
- @Override
- public List<String> actionDecisionsSupported() {
- return Arrays.asList("configure");
- }
-
- @Override
- public synchronized List<ToscaPolicyTypeIdentifier> supportedPolicyTypes() {
- return supportedPolicyTypes;
- }
-
- @Override
public boolean canSupportPolicyType(ToscaPolicyTypeIdentifier policyTypeId) {
//
// For Monitoring, we will attempt to support all versions