summaryrefslogtreecommitdiffstats
path: root/services/services-engine/src
diff options
context:
space:
mode:
Diffstat (limited to 'services/services-engine/src')
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexEvent.java2
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/enevent/ApexEvent2EnEventConverter.java10
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/eventrequestor/EventRequestorConsumer.java3
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/ApexFileEventConsumer.java3
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java7
5 files changed, 15 insertions, 10 deletions
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexEvent.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexEvent.java
index b820ee3fd..7828960b4 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexEvent.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexEvent.java
@@ -124,7 +124,7 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
private long executionId = ApexEvent.getNextExecutionId();
// Event related properties used during processing of this event
- private Properties executionProperties;
+ private Properties executionProperties = new Properties();
// A string holding a message that indicates why processing of this event threw an exception
private String exceptionMessage;
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/enevent/ApexEvent2EnEventConverter.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/enevent/ApexEvent2EnEventConverter.java
index bd0753d02..14486614c 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/enevent/ApexEvent2EnEventConverter.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/enevent/ApexEvent2EnEventConverter.java
@@ -5,15 +5,15 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -84,8 +84,8 @@ public final class ApexEvent2EnEventConverter implements ApexEventConverter {
final ApexEvent apexEvent = new ApexEvent(axEvent.getKey().getName(), axEvent.getKey().getVersion(),
axEvent.getNameSpace(), axEvent.getSource(), axEvent.getTarget());
- // Copy the ExecutionID from the EnEvent into the ApexEvent
apexEvent.setExecutionId(enEvent.getExecutionId());
+ apexEvent.setExecutionProperties(enEvent.getExecutionProperties());
// Copy he exception message to the Apex event if it is set
if (enEvent.getExceptionMessage() != null) {
@@ -126,8 +126,8 @@ public final class ApexEvent2EnEventConverter implements ApexEventConverter {
// Set the data on the engine event
enEvent.putAll(apexEvent);
- // copy the ExecutionID from the ApexEvent into the EnEvent
enEvent.setExecutionId(apexEvent.getExecutionId());
+ enEvent.setExecutionProperties(apexEvent.getExecutionProperties());
return enEvent;
}
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/eventrequestor/EventRequestorConsumer.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/eventrequestor/EventRequestorConsumer.java
index da945209b..4581b179c 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/eventrequestor/EventRequestorConsumer.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/eventrequestor/EventRequestorConsumer.java
@@ -22,6 +22,7 @@ package org.onap.policy.apex.service.engine.event.impl.eventrequestor;
import java.util.EnumMap;
import java.util.Map;
+import java.util.Properties;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
@@ -177,7 +178,7 @@ public class EventRequestorConsumer implements ApexEventConsumer, Runnable {
}
// Send the event into Apex
- eventReceiver.receiveEvent(null, eventObject);
+ eventReceiver.receiveEvent(new Properties(), eventObject);
eventsReceived++;
} catch (final InterruptedException e) {
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/ApexFileEventConsumer.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/ApexFileEventConsumer.java
index e99663c9e..7366528c7 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/ApexFileEventConsumer.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/ApexFileEventConsumer.java
@@ -25,6 +25,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.EnumMap;
import java.util.Map;
+import java.util.Properties;
import java.util.concurrent.atomic.AtomicLong;
import org.onap.policy.apex.core.infrastructure.threading.ApplicationThreadFactory;
@@ -195,7 +196,7 @@ public class ApexFileEventConsumer implements ApexEventConsumer, Runnable {
// Process the event from the text block if there is one there
if (textBlock.getText() != null) {
- eventReceiver.receiveEvent(getNextExecutionId(), null, textBlock.getText());
+ eventReceiver.receiveEvent(getNextExecutionId(), new Properties(), textBlock.getText());
}
}
while (!textBlock.isEndOfText());
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java
index f03b58ca2..8708e97e6 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java
@@ -27,6 +27,8 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
+import lombok.NonNull;
+
import org.onap.policy.apex.core.infrastructure.threading.ApplicationThreadFactory;
import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
@@ -182,7 +184,8 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
* {@inheritDoc}.
*/
@Override
- public void receiveEvent(final Properties executionProperties, final Object event) throws ApexEventException {
+ public void receiveEvent(@NonNull final Properties executionProperties, final Object event)
+ throws ApexEventException {
receiveEvent(0, executionProperties, event, true);
}
@@ -190,7 +193,7 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
* {@inheritDoc}.
*/
@Override
- public void receiveEvent(final long executionId, final Properties executionProperties, final Object event)
+ public void receiveEvent(final long executionId, @NonNull final Properties executionProperties, final Object event)
throws ApexEventException {
receiveEvent(executionId, executionProperties, event, false);
}