aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java43
1 files changed, 4 insertions, 39 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java
index 59a9ac971..3e2cd5a94 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ import java.util.Properties;
import org.onap.policy.apex.service.engine.event.ApexEventConsumer;
import org.onap.policy.apex.service.engine.event.ApexEventException;
-import org.onap.policy.apex.service.engine.event.ApexEventProducer;
+import org.onap.policy.apex.service.engine.event.ApexPluginsEventProducer;
import org.onap.policy.apex.service.engine.event.ApexEventRuntimeException;
import org.onap.policy.apex.service.engine.event.PeeredReference;
import org.onap.policy.apex.service.engine.event.SynchronousEventCache;
@@ -42,18 +42,12 @@ import org.slf4j.LoggerFactory;
* @author Liam Fallon (liam.fallon@ericsson.com)
*
*/
-public class ApexRestRequestorProducer implements ApexEventProducer {
+public class ApexRestRequestorProducer extends ApexPluginsEventProducer {
private static final Logger LOGGER = LoggerFactory.getLogger(ApexRestRequestorProducer.class);
// The REST carrier properties
private RestRequestorCarrierTechnologyParameters restProducerProperties;
- // The name for this producer
- private String name = null;
-
- // The peer references for this event handler
- private Map<EventHandlerPeeredMode, PeeredReference> peerReferenceMap = new EnumMap<>(EventHandlerPeeredMode.class);
-
// The number of events sent
private int eventsSent = 0;
@@ -101,14 +95,6 @@ public class ApexRestRequestorProducer implements ApexEventProducer {
}
/**
- * {@inheritDoc}.
- */
- @Override
- public String getName() {
- return name;
- }
-
- /**
* Get the number of events sent to date.
*
* @return the number of events received
@@ -121,30 +107,9 @@ public class ApexRestRequestorProducer implements ApexEventProducer {
* {@inheritDoc}.
*/
@Override
- public PeeredReference getPeeredReference(final EventHandlerPeeredMode peeredMode) {
- return peerReferenceMap.get(peeredMode);
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
- public void setPeeredReference(final EventHandlerPeeredMode peeredMode, final PeeredReference peeredReference) {
- peerReferenceMap.put(peeredMode, peeredReference);
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
public void sendEvent(final long executionId, final Properties executionProperties, final String eventName,
final Object event) {
- // Check if this is a synchronized event, if so we have received a reply
- final SynchronousEventCache synchronousEventCache =
- (SynchronousEventCache) peerReferenceMap.get(EventHandlerPeeredMode.SYNCHRONOUS);
- if (synchronousEventCache != null) {
- synchronousEventCache.removeCachedEventToApexIfExists(executionId);
- }
+ super.sendEvent(executionId, executionProperties, eventName, event);
// Find the peered consumer for this producer
final PeeredReference peeredRequestorReference = peerReferenceMap.get(EventHandlerPeeredMode.REQUESTOR);