X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-interactions%2Fmodel-actors%2Factor.so%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontrolloop%2Factor%2Fso%2FVfModuleDelete.java;h=9adb62c83b86135719d00187b9a34023a365a160;hb=19ef8b24a98c09a349e6ae7309f535a0135463f6;hp=f35cdb4e1b8446cf530343885b0ce7da3f8d16ea;hpb=6b29d2c19e288148171db0c0e446e18dcd46effd;p=policy%2Fmodels.git diff --git a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java index f35cdb4e1..9adb62c83 100644 --- a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java +++ b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java @@ -42,8 +42,6 @@ import org.onap.aai.domain.yang.CloudRegion; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.ServiceInstance; import org.onap.aai.domain.yang.Tenant; -import org.onap.policy.aai.AaiConstants; -import org.onap.policy.aai.AaiCqResponse; import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.common.endpoints.http.client.HttpClient; import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType; @@ -59,10 +57,8 @@ import org.onap.policy.so.SoRequestDetails; import org.onap.policy.so.SoResponse; /** - * Operation to delete a VF Module. This gets the VF count from the A&AI Custom Query - * response and stores it in the context. It also passes the count-1 to the guard. Once - * the "delete" completes successfully, it decrements the VF count that's stored in the - * context. + * Operation to delete a VF Module. When this completes successfully, it decrements its VF + * Count property. */ public class VfModuleDelete extends SoOperation { public static final String NAME = "VF Module Delete"; @@ -93,38 +89,6 @@ public class VfModuleDelete extends SoOperation { validateTarget(); } - /** - * Ensures that A&AI custom query has been performed, and then runs the guard. - */ - @Override - @SuppressWarnings("unchecked") - protected CompletableFuture startPreprocessorAsync() { - if (params.isPreprocessed()) { - return null; - } - - // need the VF count - ControlLoopOperationParams cqParams = params.toBuilder().actor(AaiConstants.ACTOR_NAME) - .operation(AaiCqResponse.OPERATION).payload(null).retry(null).timeoutSec(null).build(); - - // run Custom Query, extract the VF count, and then run the Guard - - // @formatter:off - return sequence(() -> params.getContext().obtain(AaiCqResponse.CONTEXT_KEY, cqParams), - this::obtainVfCount, this::startGuardAsync); - // @formatter:on - } - - @Override - protected Map makeGuardPayload() { - Map payload = super.makeGuardPayload(); - - // run guard with the proposed vf count - payload.put(PAYLOAD_KEY_VF_COUNT, getVfCount() - 1); - - return payload; - } - @Override protected CompletableFuture startOperationAsync(int attempt, OperationOutcome outcome) { @@ -261,7 +225,7 @@ public class VfModuleDelete extends SoOperation { details.setConfigurationParameters(null); // cloudConfiguration - details.setCloudConfiguration(constructCloudConfigurationCq(tenantItem, cloudRegionItem)); + details.setCloudConfiguration(constructCloudConfiguration(tenantItem, cloudRegionItem)); // modelInfo details.setModelInfo(soModelInfo);