Add SON Handler monitoring policy type
[policy/xacml-pdp.git] / applications / monitoring / src / main / java / org / onap / policy / xacml / pdp / application / monitoring / MonitoringPdpApplication.java
index bcdfd98..1591b91 100644 (file)
@@ -30,8 +30,6 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifi
 import org.onap.policy.pdp.xacml.application.common.ToscaPolicyTranslator;
 import org.onap.policy.pdp.xacml.application.common.std.StdCombinedPolicyResultsTranslator;
 import org.onap.policy.pdp.xacml.application.common.std.StdXacmlApplicationServiceProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * This is the engine class that manages the instance of the XACML PDP engine.
@@ -44,9 +42,13 @@ import org.slf4j.LoggerFactory;
  */
 public class MonitoringPdpApplication extends StdXacmlApplicationServiceProvider {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(MonitoringPdpApplication.class);
     private static final String ONAP_MONITORING_BASE_POLICY_TYPE = "onap.Monitoring";
+    private static final String ONAP_MONITORING_CDAP = "onap.policies.monitoring.cdap.tca.hi.lo.app";
+    private static final String ONAP_MONITORING_APPSERVER =
+            "onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server";
+    private static final String ONAP_MONITORING_SONHANDLER = "onap.policies.monitoring.docker.sonhandler.app";
     private static final String ONAP_MONITORING_DERIVED_POLICY_TYPE = "onap.policies.monitoring";
+    private static final String VERSION_100 = "1.0.0";
 
     private StdCombinedPolicyResultsTranslator translator = new StdCombinedPolicyResultsTranslator();
     private List<ToscaPolicyTypeIdentifier> supportedPolicyTypes = new ArrayList<>();
@@ -58,7 +60,10 @@ public class MonitoringPdpApplication extends StdXacmlApplicationServiceProvider
         //
         // By default this supports just Monitoring policy types
         //
-        supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(ONAP_MONITORING_BASE_POLICY_TYPE, "1.0.0"));
+        supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(ONAP_MONITORING_BASE_POLICY_TYPE, VERSION_100));
+        supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(ONAP_MONITORING_CDAP, VERSION_100));
+        supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(ONAP_MONITORING_APPSERVER, VERSION_100));
+        supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(ONAP_MONITORING_SONHANDLER, VERSION_100));
     }
 
     @Override
@@ -84,6 +89,9 @@ public class MonitoringPdpApplication extends StdXacmlApplicationServiceProvider
         // back with a JSON payload of the property contents.
         //
         return (policyTypeId.getName().equals(ONAP_MONITORING_BASE_POLICY_TYPE)
+                || policyTypeId.getName().equals(ONAP_MONITORING_CDAP)
+                || policyTypeId.getName().equals(ONAP_MONITORING_APPSERVER)
+                || policyTypeId.getName().equals(ONAP_MONITORING_SONHANDLER)
                 || policyTypeId.getName().startsWith(ONAP_MONITORING_DERIVED_POLICY_TYPE));
     }