Make Actors event-agnostic
[policy/models.git] / models-interactions / model-actors / actor.vfc / src / main / java / org / onap / policy / controlloop / actor / vfc / VfcOperation.java
index 0a1136d..65c7318 100644 (file)
@@ -21,7 +21,6 @@
 package org.onap.policy.controlloop.actor.vfc;
 
 import java.util.List;
-import java.util.concurrent.CompletableFuture;
 import javax.ws.rs.core.Response;
 import org.apache.commons.lang3.StringUtils;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
@@ -82,14 +81,6 @@ public abstract class VfcOperation extends HttpOperation<VfcResponse> {
         return super.getPollingPath() + jobId;
     }
 
-    /**
-     * Starts the GUARD.
-     */
-    @Override
-    protected CompletableFuture<OperationOutcome> startPreprocessorAsync() {
-        return startGuardAsync();
-    }
-
     @Override
     protected Status detmStatus(Response rawResponse, VfcResponse response) {
         if (rawResponse.getStatus() == 200) {
@@ -170,16 +161,15 @@ public abstract class VfcOperation extends HttpOperation<VfcResponse> {
      * @return request
      */
     protected VfcRequest constructVfcRequest() {
-        final String serviceInstance = getOptProperty(OperationProperties.ENRICHMENT_SERVICE_ID,
-                        "service-instance.service-instance-id");
-        final String vmId = getOptProperty(OperationProperties.ENRICHMENT_VSERVER_ID, "vserver.vserver-id");
-        final String vmName = getOptProperty(OperationProperties.ENRICHMENT_VSERVER_NAME, "vserver.vserver-name");
-        final String vnfId = getOptProperty(OperationProperties.ENRICHMENT_GENERIC_VNF_ID, GENERIC_VNF_ID);
+        final String serviceInstance = getProperty(OperationProperties.ENRICHMENT_SERVICE_ID);
+        final String vmId = getProperty(OperationProperties.ENRICHMENT_VSERVER_ID);
+        final String vmName = getProperty(OperationProperties.ENRICHMENT_VSERVER_NAME);
+        final String vnfId = getProperty(OperationProperties.ENRICHMENT_GENERIC_VNF_ID);
 
         if (StringUtils.isBlank(serviceInstance) || StringUtils.isBlank(vmId) || StringUtils.isBlank(vmName)) {
             // original code did not check the VNF id, so we won't check it either
             throw new IllegalArgumentException(
-                            "Cannot extract enrichment data for service instance, server id, or server name.");
+                            "Missing enrichment data for service instance, server id, or server name.");
         }
 
         VfcHealActionVmInfo vmActionInfo = new VfcHealActionVmInfo();
@@ -202,21 +192,4 @@ public abstract class VfcOperation extends HttpOperation<VfcResponse> {
 
         return request;
     }
-
-    /**
-     * Gets an optional property, first checking the properties, then checking the
-     * enrichment data.
-     *
-     * @param propName property name
-     * @param enrichmentName property name within the enrichment data
-     * @return the property's value, or {@code null} if it is not found
-     */
-    protected String getOptProperty(String propName, String enrichmentName) {
-        if (containsProperty(propName)) {
-            // return the value, even if it's null
-            return getProperty(propName);
-        }
-
-        return params.getContext().getEnrichment().get(enrichmentName);
-    }
 }