summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.vfc/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-08-21 13:43:08 -0400
committerJim Hahn <jrh3@att.com>2020-10-27 14:55:15 -0400
commit19ef8b24a98c09a349e6ae7309f535a0135463f6 (patch)
treed988e5a58865ae6f3a38dcb31e4f195f18e59946 /models-interactions/model-actors/actor.vfc/src/main
parent6b29d2c19e288148171db0c0e446e18dcd46effd (diff)
Make Actors event-agnostic
Removed event and event-context code from the Actor code. Also removed the preprocessing steps from the Actor code, giving the application complete control over any preprocessing. Also fixed a bug wherein the APPC actor was treating the AAI_RESOURCE_VNF property as a String instead of as a GenericVnf. Issue-ID: POLICY-2746-actor Change-Id: Ibc05fe39ffedc0bc461abf10e6a960861ac70119 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.vfc/src/main')
-rw-r--r--models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcOperation.java37
1 files changed, 5 insertions, 32 deletions
diff --git a/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcOperation.java b/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcOperation.java
index 0a1136d2f..65c7318ff 100644
--- a/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcOperation.java
+++ b/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcOperation.java
@@ -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);
- }
}