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;
import org.onap.policy.controlloop.actorserviceprovider.impl.BidirectionalTopicOperation;
import org.onap.policy.controlloop.actorserviceprovider.parameters.BidirectionalTopicConfig;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import org.onap.policy.controlloop.actorserviceprovider.topic.SelectorKey;
-import org.onap.policy.controlloop.policy.PolicyResult;
import org.onap.policy.sdnr.PciBody;
import org.onap.policy.sdnr.PciCommonHeader;
import org.onap.policy.sdnr.PciMessage;
*/
public static final String NAME = "any";
- private static final List<String> PROPERTY_NAMES = List.of(OperationProperties.AAI_VSERVER_LINK);
+ private static final List<String> PROPERTY_NAMES = List.of(OperationProperties.EVENT_PAYLOAD);
/**
* Keys used to match the response with the request listener. The sub request ID is a
* Sets the message to the status description, if available.
*/
@Override
- public OperationOutcome setOutcome(OperationOutcome outcome, PolicyResult result, PciMessage responseWrapper) {
+ public OperationOutcome setOutcome(OperationOutcome outcome, OperationResult result, PciMessage responseWrapper) {
outcome.setResponse(responseWrapper);
if (responseWrapper.getBody() == null || responseWrapper.getBody().getOutput() == null) {
requestCommonHeader.setSubRequestId(subRequestId);
sdnrRequest.setCommonHeader(requestCommonHeader);
- sdnrRequest.setPayload(params.getContext().getEvent().getPayload());
+ sdnrRequest.setPayload(getEventPayload());
sdnrRequest.setAction(params.getOperation());
/*
/* 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();
+ }
}