Make Actors event-agnostic
[policy/models.git] / models-interactions / model-actors / actor.sdnr / src / main / java / org / onap / policy / controlloop / actor / sdnr / SdnrOperation.java
index 308ddd9..14f77a6 100644 (file)
@@ -21,7 +21,6 @@
 package org.onap.policy.controlloop.actor.sdnr;
 
 import java.util.List;
-import java.util.concurrent.CompletableFuture;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
 import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
 import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
@@ -70,11 +69,6 @@ public class SdnrOperation extends BidirectionalTopicOperation<PciMessage, PciMe
         return List.of(getSubRequestId());
     }
 
-    @Override
-    protected CompletableFuture<OperationOutcome> startPreprocessorAsync() {
-        return startGuardAsync();
-    }
-
     /*
      * NOTE: This should avoid throwing exceptions, so that a ControlLoopResponse can be
      * added to the outcome. Consequently, it returns FAILURE if a required field is
@@ -156,7 +150,7 @@ public class SdnrOperation extends BidirectionalTopicOperation<PciMessage, PciMe
         requestCommonHeader.setSubRequestId(subRequestId);
 
         sdnrRequest.setCommonHeader(requestCommonHeader);
-        sdnrRequest.setPayload(getEventPayload());
+        sdnrRequest.setPayload(getProperty(OperationProperties.EVENT_PAYLOAD));
         sdnrRequest.setAction(params.getOperation());
 
         /*
@@ -169,18 +163,4 @@ public class SdnrOperation extends BidirectionalTopicOperation<PciMessage, PciMe
         /* Return the request to be sent through dmaap. */
         return dmaapRequest;
     }
-
-    /**
-     * Gets the event payload, first checking for it in the properties and then in the
-     * event.
-     *
-     * @return the event payload
-     */
-    protected String getEventPayload() {
-        if (containsProperty(OperationProperties.EVENT_PAYLOAD)) {
-            return getProperty(OperationProperties.EVENT_PAYLOAD);
-        }
-
-        return params.getContext().getEvent().getPayload();
-    }
 }