diff options
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver')
3 files changed, 21 insertions, 12 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); diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/java/org/onap/policy/apex/plugins/event/carrier/restserver/SupportApexEventReceiver.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/java/org/onap/policy/apex/plugins/event/carrier/restserver/SupportApexEventReceiver.java index aaba4c262..8f6e72b14 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/java/org/onap/policy/apex/plugins/event/carrier/restserver/SupportApexEventReceiver.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/java/org/onap/policy/apex/plugins/event/carrier/restserver/SupportApexEventReceiver.java @@ -5,21 +5,23 @@ * 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========================================================= */ package org.onap.policy.apex.plugins.event.carrier.restserver; +import java.util.Properties; + import org.onap.policy.apex.service.engine.event.ApexEventException; import org.onap.policy.apex.service.engine.event.ApexEventReceiver; @@ -32,21 +34,26 @@ public class SupportApexEventReceiver implements ApexEventReceiver { private Object lastEvent; private int eventCount; - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.onap.policy.apex.service.engine.event.ApexEventReceiver#receiveEvent(long, java.lang.Object) */ @Override - public void receiveEvent(long executionId, Object event) throws ApexEventException { + public void receiveEvent(final long executionId, final Properties executionProperties, final Object event) + throws ApexEventException { this.lastExecutionId = executionId; this.lastEvent = event; this.eventCount++; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.onap.policy.apex.service.engine.event.ApexEventReceiver#receiveEvent(java.lang.Object) */ @Override - public void receiveEvent(Object event) throws ApexEventException { + public void receiveEvent(final Properties executionProperties, final Object event) throws ApexEventException { this.lastEvent = event; this.eventCount++; } @@ -61,7 +68,7 @@ public class SupportApexEventReceiver implements ApexEventReceiver { /** * Get the number of events received. - * + * * @return the number of events received */ public int getEventCount() { |