aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-06-26 15:40:41 +0000
committerliamfallon <liam.fallon@est.tech>2019-06-26 15:40:41 +0000
commitce9d82d2c0e863597d84cc8909955e398405f45a (patch)
tree8ebb853119bdf673cf6f9516d428d4cc00080aeb /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main
parent5f029543f1e673655af2d2974113069df0b6def0 (diff)
Add passthrough properties for APEX engine
APEX event receiver and sender plugins sometimes need to exchange information with tasks, especially in the case of REST communication. This change enables passthrough of Properties from the event carrier technology plugins to APEX task, task selection, and state finalizer logics. Apologies for the size of the review but this change involves passinng the properties through all the APEX components, hence the large number of small changes. Issue-ID: POLICY-1742 Change-Id: I219fd69550f06702ef64adbb165fe7baac422e96 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerConsumer.java4
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerProducer.java6
2 files changed, 6 insertions, 4 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerConsumer.java
index 35490926a..b18c658af 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerConsumer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerConsumer.java
@@ -105,7 +105,7 @@ public class ApexRestServerConsumer implements ApexEventConsumer, Runnable {
LOGGER.warn(errorMessage);
throw new ApexEventException(errorMessage);
}
-
+
// The REST parameters read from the parameter service
RestServerCarrierTechnologyParameters restConsumerProperties =
(RestServerCarrierTechnologyParameters) consumerParameters.getCarrierTechnologyParameters();
@@ -209,7 +209,7 @@ public class ApexRestServerConsumer implements ApexEventConsumer, Runnable {
try {
// Send the event into Apex
- eventReceiver.receiveEvent(executionId, event);
+ eventReceiver.receiveEvent(executionId, null, event);
} catch (final Exception e) {
final String errorMessage = "error receiving events on event consumer " + name + ", " + e.getMessage();
LOGGER.warn(errorMessage, e);
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerProducer.java
index cacdb3408..b228ccbf0 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerProducer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerProducer.java
@@ -22,6 +22,7 @@ package org.onap.policy.apex.plugins.event.carrier.restserver;
import java.util.EnumMap;
import java.util.Map;
+import java.util.Properties;
import org.onap.policy.apex.service.engine.event.ApexEventException;
import org.onap.policy.apex.service.engine.event.ApexEventProducer;
@@ -65,7 +66,7 @@ public class ApexRestServerProducer implements ApexEventProducer {
LOGGER.warn(errorMessage);
throw new ApexEventException(errorMessage);
}
-
+
// The REST carrier properties
RestServerCarrierTechnologyParameters restProducerProperties =
(RestServerCarrierTechnologyParameters) producerParameters.getCarrierTechnologyParameters();
@@ -128,7 +129,8 @@ public class ApexRestServerProducer implements ApexEventProducer {
* java.lang.Object)
*/
@Override
- public void sendEvent(final long executionId, final String eventName, final Object event) {
+ public void sendEvent(final long executionId, final Properties executionProperties, final String eventName,
+ final Object event) {
if (LOGGER.isDebugEnabled()) {
String message = name + ": event " + executionId + ':' + eventName + " recevied from Apex, event=" + event;
LOGGER.debug(message);