Merge changes I6a92bf21,Idd21a62d
authorGuillaume Lambert <guillaume.lambert@orange.com>
Mon, 30 Oct 2023 07:48:43 +0000 (07:48 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 30 Oct 2023 07:48:43 +0000 (07:48 +0000)
* changes:
  Complement B100G_end2end functional test
  Fix PCE bug to select the correct client port

52 files changed:
api/src/main/yang/nbi-notifications@2023-07-26.yang [moved from api/src/main/yang/nbi-notifications@2021-10-13.yang with 89% similarity]
dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProvider.java
dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandler.java [moved from dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImpl.java with 61% similarity]
dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/resource/EventsApi.java
dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/resource/config/PublishNotificationProcessServiceModule.java
dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/resource/config/PublishNotificationProcessServiceSerializer.java
dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/resource/config/ServiceAEndSerializer.java
dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/resource/config/ServiceZEndSerializer.java
dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProviderTest.java
dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandlerTest.java [moved from dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImplTest.java with 89% similarity]
lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java
lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java
nbinotifications/pom.xml
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsImpl.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProvider.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsHandler.java [moved from nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsListenerImpl.java with 63% similarity]
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationAlarmServiceDeserializer.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationAlarmServiceSerializer.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationServiceDeserializer.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationServiceSerializer.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/TapiNotificationDeserializer.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/TapiNotificationSerializer.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/utils/NbiNotificationsUtils.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/utils/TopicManager.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/consumer/SubscriberTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsImplTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProviderTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsHandlerTest.java [moved from nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsListenerImplTest.java with 81% similarity]
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/producer/PublisherTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationAlarmServiceDeserializerTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationAlarmServiceSerializerTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationServiceDeserializerTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationServiceSerializerTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationTapiServiceDeserializerTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationTapiServiceSerializerTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/utils/NotificationServiceDataUtils.java
nbinotifications/src/test/resources/event.json
nbinotifications/src/test/resources/expected_event.json
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/PceNotificationHandler.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/RendererNotificationHandler.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/ServiceListener.java
servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/listeners/ServiceListenerTest.java
tapi/src/main/java/org/opendaylight/transportpce/tapi/connectivity/TapiConnectivityImpl.java
tapi/src/main/java/org/opendaylight/transportpce/tapi/impl/TapiProvider.java
tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiNetworkModelNotificationHandler.java [moved from tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiNetworkModelListenerImpl.java with 97% similarity]
tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiPceNotificationHandler.java [moved from tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiPceListenerImpl.java with 99% similarity]
tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiRendererNotificationHandler.java [moved from tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiRendererListenerImpl.java with 96% similarity]
tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiServiceNotificationHandler.java [moved from tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiServiceHandlerListenerImpl.java with 61% similarity]
tapi/src/test/java/org/opendaylight/transportpce/tapi/connectivity/TapiConnectivityImplTest.java
tapi/src/test/java/org/opendaylight/transportpce/tapi/provider/TapiProviderTest.java
tests/build_karaf_for_tests.sh

similarity index 89%
rename from api/src/main/yang/nbi-notifications@2021-10-13.yang
rename to api/src/main/yang/nbi-notifications@2023-07-26.yang
index e55b7816b9135a512fda8c58fd4903bf9417ec44..666d3230a6e453e380ee75e6bcdf1ce17593700a 100644 (file)
@@ -12,6 +12,9 @@ module nbi-notifications {
   import org-openroadm-common-state-types {
     prefix org-openroadm-common-state-types;
   }
+  import org-openroadm-resource {
+    prefix org-openroadm-resource;
+  }
   import tapi-common {
     prefix tapi-common;
     revision-date 2018-12-10;
@@ -34,6 +37,11 @@ module nbi-notifications {
       "Implement new models, RPC for TAPI service notification";
   }
 
+  revision 2023-07-26 {
+      description
+        "Adding service-rpc-result data details to the publish-notification-process-service";
+  }
+
   revision 2021-08-13 {
     description
       "Rename the groupings, containers and RPCs";
@@ -90,8 +98,29 @@ module nbi-notifications {
       description
         "Operational State: Actual state of service";
     }
+    leaf is-temp-service {
+      type boolean;
+      default "false";
+      description
+        "Used to indicate if the it is a temp-service or not";
+    }
+    container aToZ {
+      when "../is-temp-service = 'true'" {
+        description
+            "a-to-z is only used for temp-service-cerate";
+        }
+        uses org-openroadm-resource:common-och-otsi-attributes;
+        uses org-openroadm-resource:path-computation-outputs;
+    }
+    container zToA {
+      when "../is-temp-service = 'true'" {
+        description
+              "a-to-z is only used for temp-service-cerate";
+        }
+      uses org-openroadm-resource:common-och-otsi-attributes;
+      uses org-openroadm-resource:path-computation-outputs;
+    }
   }
-
   grouping notification-alarm-service {
     leaf message {
       type string;
index 51742f2c82eeac1acbc93bbf947ec819cb828fd0..45b0850727bea033893f74bb478cb13c19c49138 100644 (file)
@@ -8,9 +8,8 @@
 package org.opendaylight.transportpce.dmaap.client.impl;
 
 import org.opendaylight.mdsal.binding.api.NotificationService;
-import org.opendaylight.transportpce.dmaap.client.listener.NbiNotificationsListenerImpl;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.transportpce.dmaap.client.listener.NbiNotificationsHandler;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Reference;
@@ -33,7 +32,7 @@ public class DmaapClientProvider {
     }
 
     private static final Logger LOG = LoggerFactory.getLogger(DmaapClientProvider.class);
-    private ListenerRegistration<NbiNotificationsListener> listenerRegistration;
+    private Registration listenerRegistration;
 
     @Activate
     public DmaapClientProvider(@Reference NotificationService notificationService, Configuration config) {
@@ -42,8 +41,8 @@ public class DmaapClientProvider {
 
     public DmaapClientProvider(NotificationService notificationService, String baseUrl,
             String username, String password) {
-        listenerRegistration = notificationService.registerNotificationListener(
-                new NbiNotificationsListenerImpl(baseUrl, username, password));
+        final var listener = new NbiNotificationsHandler(baseUrl, username, password);
+        listenerRegistration = notificationService.registerCompositeListener(listener.getCompositeListener());
         LOG.info("DmaapClientProvider Session Initiated");
     }
 
similarity index 61%
rename from dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImpl.java
rename to dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandler.java
index fcf0b000dd8c80e88ab4c782e025cc2b4af76c93..71edc7fb50bb0e059743f584bdae8087a6ae299c 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.transportpce.dmaap.client.listener;
 
+import java.util.Set;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.client.Client;
 import javax.ws.rs.client.ClientBuilder;
@@ -14,22 +15,24 @@ import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
 import org.glassfish.jersey.client.proxy.WebResourceFactory;
 import org.glassfish.jersey.jackson.JacksonFeature;
 import org.glassfish.jersey.logging.LoggingFeature;
+import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
 import org.opendaylight.transportpce.dmaap.client.resource.EventsApi;
 import org.opendaylight.transportpce.dmaap.client.resource.config.JsonConfigurator;
 import org.opendaylight.transportpce.dmaap.client.resource.model.CreatedEvent;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishTapiNotificationService;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class NbiNotificationsListenerImpl implements NbiNotificationsListener {
-    private static final Logger LOG = LoggerFactory.getLogger(NbiNotificationsListenerImpl.class);
+public class NbiNotificationsHandler {
+    private static final Logger LOG = LoggerFactory.getLogger(NbiNotificationsHandler.class);
     private String topic = "unauthenticated.TPCE";
     private EventsApi api;
+    private Registration reg;
 
-    public NbiNotificationsListenerImpl(String baseUrl, String username, String password) {
+    public NbiNotificationsHandler(String baseUrl, String username, String password) {
         LOG.info("Dmaap server {} for user {}", baseUrl, username);
         Client client = ClientBuilder.newClient();
         if (username != null && username.isBlank() && password != null && !password.isBlank()) {
@@ -43,8 +46,18 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener {
 
     }
 
-    @Override
-    public void onPublishNotificationProcessService(PublishNotificationProcessService notification) {
+    public CompositeListener getCompositeListener() {
+        return new CompositeListener(Set.of(
+            new CompositeListener.Component<>(
+                PublishNotificationProcessService.class, this::onPublishNotificationProcessService),
+            new CompositeListener.Component<>(
+                PublishNotificationAlarmService.class, this::onPublishNotificationAlarmService),
+            new CompositeListener.Component<>(
+                PublishTapiNotificationService.class, this::onPublishTapiNotificationService)
+        ));
+    }
+
+    void onPublishNotificationProcessService(PublishNotificationProcessService notification) {
         try {
             CreatedEvent response = api.sendEvent(topic, notification);
             LOG.info("Response received {}", response);
@@ -54,11 +67,9 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener {
 
     }
 
-    @Override
-    public void onPublishNotificationAlarmService(PublishNotificationAlarmService notification) {
+    private void onPublishNotificationAlarmService(PublishNotificationAlarmService notification) {
     }
 
-    @Override
-    public void onPublishTapiNotificationService(PublishTapiNotificationService notification) {
+    private void onPublishTapiNotificationService(PublishTapiNotificationService notification) {
     }
 }
index 4284f8656dcd40659e7f17f77ea8be230a86a3e1..03454f1f6ac5269249d3c4d3a98bf33c464851f7 100644 (file)
@@ -14,7 +14,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import org.opendaylight.transportpce.dmaap.client.resource.model.CreatedEvent;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessService;
 
 @Path("/events")
 public interface EventsApi {
index 45b62e5f218b9c34a802c9f7f472327df7c16759..1f322355978c8f7a0165840c6c572cbd22427de8 100644 (file)
@@ -13,9 +13,9 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev2
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service.endpoint.TxDirection;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service.lgx.Lgx;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service.port.Port;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceAEnd;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceZEnd;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceAEnd;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceZEnd;
 
 //This class is a temporary workaround while waiting jackson
 //support in yang tools https://git.opendaylight.org/gerrit/c/yangtools/+/94852
index 5361e3fa00fec5b16588ca83c2d5792cadbc0fa3..d7bda27c8b74863c1e10d43079af4198ea1e646a 100644 (file)
@@ -11,7 +11,7 @@ import com.fasterxml.jackson.core.JsonGenerator;
 import com.fasterxml.jackson.databind.SerializerProvider;
 import com.fasterxml.jackson.databind.ser.std.StdSerializer;
 import java.io.IOException;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessService;
 
 // This class is a temporary workaround while waiting jackson
 // support in yang tools https://git.opendaylight.org/gerrit/c/yangtools/+/94852
index 3d48bf57e2466fac24d5ece0c4c1c3789d112189..9f0e2d13bc15f218695446a0f7d278b0d2ea30cb 100644 (file)
@@ -11,7 +11,7 @@ import com.fasterxml.jackson.core.JsonGenerator;
 import com.fasterxml.jackson.databind.SerializerProvider;
 import com.fasterxml.jackson.databind.ser.std.StdSerializer;
 import java.io.IOException;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceAEnd;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceAEnd;
 
 // This class is a temporary workaround while waiting jackson
 // support in yang tools https://git.opendaylight.org/gerrit/c/yangtools/+/94852
index b31bf5db62fbfd03e71351212828093f078a3c65..20dd9052bbc5623ebba695fc920409e070dd653e 100644 (file)
@@ -11,7 +11,7 @@ import com.fasterxml.jackson.core.JsonGenerator;
 import com.fasterxml.jackson.databind.SerializerProvider;
 import com.fasterxml.jackson.databind.ser.std.StdSerializer;
 import java.io.IOException;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceZEnd;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceZEnd;
 
 // This class is a temporary workaround while waiting jackson
 // support in yang tools https://git.opendaylight.org/gerrit/c/yangtools/+/94852
index 79f7edcf3ee0b9a4164dd08a73e7e9295c041652..93c7940fa080ccb754b1be3135d3ee0bf7a6d835 100644 (file)
@@ -16,7 +16,6 @@ import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.mdsal.binding.api.NotificationService;
-import org.opendaylight.transportpce.dmaap.client.listener.NbiNotificationsListenerImpl;
 
 
 public class DmaapClientProviderTest {
@@ -33,7 +32,7 @@ public class DmaapClientProviderTest {
     void testInitRegisterNbiNotificationsToRpcRegistry() {
         new DmaapClientProvider(notificationService, "http://localhost", "username", "password");
         verify(notificationService, times(1))
-            .registerNotificationListener(Mockito.any(NbiNotificationsListenerImpl.class));
+            .registerCompositeListener(Mockito.any(NotificationService.CompositeListener.class));
     }
 
 }
@@ -29,16 +29,15 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev2
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service.endpoint.TxDirectionKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev191129.ServiceFormat;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceZEndBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
 import org.slf4j.LoggerFactory;
 
-public class NbiNotificationsListenerImplTest extends JerseyTest {
+public class NbiNotificationsHandlerTest extends JerseyTest {
     @Override
     protected Application configure() {
         enable(TestProperties.LOG_TRAFFIC);
@@ -48,11 +47,11 @@ public class NbiNotificationsListenerImplTest extends JerseyTest {
 
     @Test
     void onPublishNotificationServiceTest() {
-        Logger logger = (Logger) LoggerFactory.getLogger(NbiNotificationsListenerImpl.class);
+        Logger logger = (Logger) LoggerFactory.getLogger(NbiNotificationsHandler.class);
         ListAppender<ILoggingEvent> listAppender = new ListAppender<>();
         listAppender.start();
         logger.addAppender(listAppender);
-        NbiNotificationsListener listener = new NbiNotificationsListenerImpl("http://localhost:9998", null, null);
+        NbiNotificationsHandler listener = new NbiNotificationsHandler("http://localhost:9998", null, null);
         PublishNotificationProcessService notification = new PublishNotificationProcessServiceBuilder()
                 .setCommonId("CommonId")
                 .setMessage("Service implemented")
index d6506204a144d78244b5b3c8a1f9260a38f08c9b..d6e44ad9a80c9e26135e5101e5ef44e0a049791f 100644 (file)
@@ -67,7 +67,7 @@ import org.opendaylight.transportpce.servicehandler.listeners.ServiceListener;
 import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
 import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperationsImpl;
 import org.opendaylight.transportpce.tapi.impl.TapiProvider;
-import org.opendaylight.transportpce.tapi.listeners.TapiNetworkModelListenerImpl;
+import org.opendaylight.transportpce.tapi.listeners.TapiNetworkModelNotificationHandler;
 import org.opendaylight.transportpce.tapi.topology.TapiNetworkModelService;
 import org.opendaylight.transportpce.tapi.topology.TapiNetworkModelServiceImpl;
 import org.opendaylight.transportpce.tapi.topology.TapiNetworkUtilsImpl;
@@ -194,7 +194,7 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
             new TapiNetworkUtilsImpl(lgServRPS, networkTransaction, tapiLink);
             tapiProvider = initTapi(
                     lightyServices, servicehandler, networkTransaction, serviceDataStoreOperations,
-                    new TapiNetworkModelListenerImpl(
+                    new TapiNetworkModelNotificationHandler(
                         networkTransaction, lgServBNPS),
                     tapiLink,
                     new TapiNetworkModelServiceImpl(
@@ -249,13 +249,13 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
     private TapiProvider initTapi(
             LightyServices lightyServices, OrgOpenroadmServiceService servicehandler,
             NetworkTransactionService networkTransactionService, ServiceDataStoreOperations serviceDataStoreOperations,
-            TapiNetworkModelListenerImpl tapiNetworkModelListenerImpl, TapiLink tapiLink,
+            TapiNetworkModelNotificationHandler tapiNetworkModelNotificationHandler, TapiLink tapiLink,
             TapiNetworkModelService tapiNetworkModelService) {
         return new TapiProvider(
             lightyServices.getBindingDataBroker(), lightyServices.getRpcProviderService(),
             lightyServices.getNotificationService(), lightyServices.getBindingNotificationPublishService(),
             networkTransactionService, servicehandler, serviceDataStoreOperations,
-            tapiNetworkModelListenerImpl, tapiNetworkModelService);
+            tapiNetworkModelNotificationHandler, tapiNetworkModelService);
     }
 
     private void initRenderer(
index dae7ab542c58d3070f0d92edb6fce0c8d3bab057..d7d3ce4c3daca0fbfdec72a97c79394b87d3bbd3 100644 (file)
@@ -337,7 +337,7 @@ public final class TPCEUtils {
                      .$YangModuleInfoImpl.getInstance(),
             org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.tapi.rev180928.$YangModuleInfoImpl
                     .getInstance(),
-            org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.$YangModuleInfoImpl
+            org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.$YangModuleInfoImpl
                     .getInstance());
 
     private static final Set<YangModuleInfo> TPCE_YANG_MODEL = Stream.concat(
index 650ba41d10287da6b54398395e29904ff7f92e41..fb3b39a042cbfb7cf8ad8838f86604bb2d97d98c 100644 (file)
       <artifactId>jackson-databind</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.skyscreamer</groupId>
+      <artifactId>jsonassert</artifactId>
+      <version>1.5.1</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
index 824ea89a64175f22bebf9f1b99ae4fbe61aba4bb..f17a183399ac8427fe98c937af0d8114e71f9bef 100644 (file)
@@ -28,20 +28,20 @@ import org.opendaylight.transportpce.nbinotifications.serialization.Notification
 import org.opendaylight.transportpce.nbinotifications.serialization.NotificationServiceDeserializer;
 import org.opendaylight.transportpce.nbinotifications.serialization.TapiNotificationDeserializer;
 import org.opendaylight.transportpce.nbinotifications.utils.TopicManager;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsAlarmServiceInput;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsAlarmServiceOutput;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsAlarmServiceOutputBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsProcessServiceInput;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsProcessServiceOutput;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsProcessServiceOutputBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.alarm.service.output.NotificationsAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.process.service.output.NotificationsProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsAlarmServiceInput;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsAlarmServiceOutput;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsAlarmServiceOutputBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsProcessServiceInput;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsProcessServiceOutput;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsProcessServiceOutputBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NbiNotificationsService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.alarm.service.output.NotificationsAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.process.service.output.NotificationsProcessService;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Context;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Uuid;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.Context1;
index f1caef3f55cc21abe96823118d8873ecd4af576d..cb6de72589ce76e0b880b291c601abf60c6af172 100644 (file)
@@ -15,14 +15,12 @@ import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.mdsal.binding.dom.codec.spi.BindingDOMCodecServices;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
-import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsListenerImpl;
+import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsHandler;
 import org.opendaylight.transportpce.nbinotifications.producer.Publisher;
 import org.opendaylight.transportpce.nbinotifications.utils.TopicManager;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
@@ -47,7 +45,7 @@ public class NbiNotificationsProvider {
     private static final Logger LOG = LoggerFactory.getLogger(NbiNotificationsProvider.class);
     private static Map<String, Publisher<NotificationProcessService>> publishersServiceMap =  new HashMap<>();
     private static Map<String, Publisher<NotificationAlarmService>> publishersAlarmMap =  new HashMap<>();
-    private ListenerRegistration<NbiNotificationsListener> listenerRegistration;
+    private Registration listenerRegistration;
     private Registration rpcRegistration;
 
     @Activate
@@ -90,10 +88,11 @@ public class NbiNotificationsProvider {
         NbiNotificationsImpl nbiImpl = new NbiNotificationsImpl(converterService, converterAlarmService,
             converterTapiService, subscriberServer, networkTransactionService, topicManager);
         rpcRegistration = rpcProviderService.registerRpcImplementations(nbiImpl.registerRPCs());
-        NbiNotificationsListenerImpl nbiNotificationsListener = new NbiNotificationsListenerImpl(
-                topicManager.getProcessTopicMap(), topicManager.getAlarmTopicMap(), topicManager.getTapiTopicMap());
-        listenerRegistration = notificationService.registerNotificationListener(nbiNotificationsListener);
-        topicManager.setNbiNotificationsListener(nbiNotificationsListener);
+        NbiNotificationsHandler notificationsListener = new NbiNotificationsHandler(
+            topicManager.getProcessTopicMap(), topicManager.getAlarmTopicMap(), topicManager.getTapiTopicMap());
+        listenerRegistration = notificationService.registerCompositeListener(
+            notificationsListener.getCompositeListener());
+        topicManager.setNbiNotificationsListener(notificationsListener);
         LOG.info("NbiNotificationsProvider Session Initiated");
     }
 
@@ -8,28 +8,31 @@
 package org.opendaylight.transportpce.nbinotifications.listener;
 
 import java.util.Map;
+import java.util.Set;
+import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
 import org.opendaylight.transportpce.nbinotifications.producer.Publisher;
 import org.opendaylight.transportpce.nbinotifications.utils.NbiNotificationsUtils;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishTapiNotificationService;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class NbiNotificationsListenerImpl implements NbiNotificationsListener {
-    private static final Logger LOG = LoggerFactory.getLogger(NbiNotificationsListenerImpl.class);
+public class NbiNotificationsHandler {
+    private static final Logger LOG = LoggerFactory.getLogger(NbiNotificationsHandler.class);
     private Map<String, Publisher<NotificationProcessService>> publishersServiceMap;
     private Map<String, Publisher<NotificationAlarmService>> publishersAlarmMap;
     private Map<String, Publisher<NotificationTapiService>> tapiPublisherMap;
+    private Registration reg;
 
-    public NbiNotificationsListenerImpl(Map<String, Publisher<NotificationProcessService>> publishersServiceMap,
+    public NbiNotificationsHandler(Map<String, Publisher<NotificationProcessService>> publishersServiceMap,
                                         Map<String, Publisher<NotificationAlarmService>> publishersAlarmMap,
                                         Map<String, Publisher<NotificationTapiService>> tapiPublisherMap) {
         this.publishersServiceMap = publishersServiceMap;
@@ -37,8 +40,18 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener {
         this.tapiPublisherMap = tapiPublisherMap;
     }
 
-    @Override
-    public void onPublishNotificationProcessService(PublishNotificationProcessService notification) {
+    public CompositeListener getCompositeListener() {
+        return new CompositeListener(Set.of(
+            new CompositeListener.Component<>(
+                PublishNotificationProcessService.class, this::onPublishNotificationProcessService),
+            new CompositeListener.Component<>(
+                PublishNotificationAlarmService.class, this::onPublishNotificationAlarmService),
+            new CompositeListener.Component<>(
+                PublishTapiNotificationService.class, this::onPublishTapiNotificationService)
+        ));
+    }
+
+    void onPublishNotificationProcessService(PublishNotificationProcessService notification) {
         LOG.info("Receiving request for publishing notification service");
         String publisherName = notification.getPublisherName();
         if (!publishersServiceMap.containsKey(publisherName)) {
@@ -46,7 +59,7 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener {
             return;
         }
         Publisher<NotificationProcessService> publisher = publishersServiceMap.get(publisherName);
-        publisher.sendEvent(new NotificationProcessServiceBuilder()
+        NotificationProcessServiceBuilder notificationProcessServiceBuilder = new NotificationProcessServiceBuilder()
                 .setCommonId(notification.getCommonId())
                 .setConnectionType(notification.getConnectionType())
                 .setMessage(notification.getMessage())
@@ -54,12 +67,21 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener {
                 .setResponseFailed(notification.getResponseFailed())
                 .setServiceAEnd(notification.getServiceAEnd())
                 .setServiceName(notification.getServiceName())
-                .setServiceZEnd(notification.getServiceZEnd())
-                        .build(), notification.getConnectionType().getName());
+                .setServiceZEnd(notification.getServiceZEnd());
+
+        if (notification.getIsTempService()) {
+            // A-to-Z and Z-to-A containers are only needed for temp-service-create notification
+            publisher.sendEvent(notificationProcessServiceBuilder
+                    .setAToZ(notification.getAToZ())
+                    .setZToA(notification.getZToA())
+                    .build(), notification.getConnectionType().getName());
+        } else {
+            publisher.sendEvent(notificationProcessServiceBuilder
+                    .build(), notification.getConnectionType().getName());
+        }
     }
 
-    @Override
-    public void onPublishNotificationAlarmService(PublishNotificationAlarmService notification) {
+    void onPublishNotificationAlarmService(PublishNotificationAlarmService notification) {
         LOG.info("Receiving request for publishing notification alarm service");
         String publisherName = notification.getPublisherName();
         if (!publishersAlarmMap.containsKey(publisherName)) {
@@ -75,8 +97,7 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener {
                         .build(), "alarm" + notification.getConnectionType().getName());
     }
 
-    @Override
-    public void onPublishTapiNotificationService(PublishTapiNotificationService notification) {
+    void onPublishTapiNotificationService(PublishTapiNotificationService notification) {
         LOG.info("Receiving request for publishing TAPI notification");
         String topic = notification.getTopic();
         if (!tapiPublisherMap.containsKey(topic)) {
index 4f0d19fcaae2ffea7cc785c1139382d871cba006..ffb3509d486cca95ea7393c2207349d55592fd08 100644 (file)
@@ -11,9 +11,9 @@ import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import org.apache.kafka.common.serialization.Deserializer;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.alarm.service.output.NotificationsAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.alarm.service.output.NotificationsAlarmServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.alarm.service.output.NotificationsAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.alarm.service.output.NotificationsAlarmServiceBuilder;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.slf4j.Logger;
index 9816d9f6ff7cd70f4463210463bd575a15c30f16..5d486fe9330023258eaace6dc522f415cfd44277 100644 (file)
@@ -12,7 +12,7 @@ import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import org.apache.kafka.common.serialization.Serializer;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.slf4j.Logger;
index 73e979310683355c0eb86d17e5dd4eaf5cb21d55..a975d6cffe4e7260adfa1a4f8e29c8bdb587a339 100644 (file)
@@ -11,9 +11,9 @@ import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import org.apache.kafka.common.serialization.Deserializer;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.process.service.output.NotificationsProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.process.service.output.NotificationsProcessServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.process.service.output.NotificationsProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.process.service.output.NotificationsProcessServiceBuilder;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.slf4j.Logger;
@@ -51,7 +51,7 @@ public class NotificationServiceDeserializer implements Deserializer<Notificatio
             return null;
         }
         LOG.info("Reading event {}", mappedString);
-        return new NotificationsProcessServiceBuilder()
+        NotificationsProcessServiceBuilder notificationsProcessServiceBuilder = new NotificationsProcessServiceBuilder()
                 .setCommonId(mappedString.getCommonId())
                 .setConnectionType(mappedString.getConnectionType())
                 .setMessage(mappedString.getMessage())
@@ -59,8 +59,14 @@ public class NotificationServiceDeserializer implements Deserializer<Notificatio
                 .setResponseFailed(mappedString.getResponseFailed())
                 .setServiceName(mappedString.getServiceName())
                 .setServiceAEnd(mappedString.getServiceAEnd())
-                .setServiceZEnd(mappedString.getServiceZEnd())
-                .build();
+                .setServiceZEnd(mappedString.getServiceZEnd());
+        if (mappedString.getIsTempService()) {
+            return notificationsProcessServiceBuilder
+                    .setAToZ(mappedString.getAToZ())
+                    .setZToA(mappedString.getZToA())
+                    .build();
+        }
+        return notificationsProcessServiceBuilder.build();
     }
 
 }
index 8090ccd268f8538027a56aec5999465d5520f321..bb816fb5f1984d74967155111c853c881de68c87 100644 (file)
@@ -12,7 +12,7 @@ import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import org.apache.kafka.common.serialization.Serializer;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.slf4j.Logger;
index c4317f34db974f0c21a57086c1ee83efbd73bca6..b650491f08e08334fac4f17abda8d10dad069433 100644 (file)
@@ -12,7 +12,7 @@ import java.util.HashMap;
 import java.util.Map;
 import org.apache.kafka.common.serialization.Deserializer;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.Name;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameBuilder;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameKey;
@@ -56,7 +56,7 @@ public class TapiNotificationDeserializer implements Deserializer<Notification>
         }
         String value = new String(data, StandardCharsets.UTF_8);
         // The message published is
-        // org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService
+        // org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService
         // we have to map it to
         // org.opendaylight.yang.gen.v1
         // .urn.onf.otcc.yang.tapi.notification.rev181210.get.notification.list.output.Notification
@@ -73,7 +73,7 @@ public class TapiNotificationDeserializer implements Deserializer<Notification>
         LOG.info("Transforming TAPI notification for getNotificationList rpc");
         Map<AdditionalInfoKey, AdditionalInfo> addInfoMap = new HashMap<>();
         if (mappedString.getAdditionalInfo() != null) {
-            for (org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AdditionalInfo
+            for (org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.AdditionalInfo
                     addInfo:mappedString.getAdditionalInfo().values()) {
                 AdditionalInfo transAddInfo = new AdditionalInfoBuilder()
                     .setValue(addInfo.getValue())
@@ -85,7 +85,7 @@ public class TapiNotificationDeserializer implements Deserializer<Notification>
         Map<ChangedAttributesKey, ChangedAttributes> changedAttMap = new HashMap<>();
         if (mappedString.getChangedAttributes() != null) {
             for (org.opendaylight.yang.gen.v1
-                    .nbi.notifications.rev211013.notification.tapi.service.ChangedAttributes changedAtt:mappedString
+                    .nbi.notifications.rev230726.notification.tapi.service.ChangedAttributes changedAtt:mappedString
                         .getChangedAttributes().values()) {
                 ChangedAttributes transChangedAtt = new ChangedAttributesBuilder(changedAtt).build();
                 changedAttMap.put(transChangedAtt.key(), transChangedAtt);
@@ -101,7 +101,7 @@ public class TapiNotificationDeserializer implements Deserializer<Notification>
         Map<TargetObjectNameKey, TargetObjectName> targetObjNameMap = new HashMap<>();
         if (mappedString.getTargetObjectName() != null) {
             for (org.opendaylight.yang.gen.v1
-                    .nbi.notifications.rev211013.notification.tapi.service.TargetObjectName
+                    .nbi.notifications.rev230726.notification.tapi.service.TargetObjectName
                         targetObjectName:mappedString.getTargetObjectName().values()) {
                 TargetObjectName transTargetObjName = new TargetObjectNameBuilder(targetObjectName).build();
                 targetObjNameMap.put(transTargetObjName.key(), transTargetObjName);
index 7525fcfec3cca8bef97bd2f904c6eb63edd4becb..f2aced4f6b7a340e21c5ee4918b66c889357e248 100644 (file)
@@ -12,7 +12,7 @@ import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import org.apache.kafka.common.serialization.Serializer;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.slf4j.Logger;
index 219f5288f73070200a9798fe30723ca7f25d7c86..8580482fd3d49199b150522ef2bf5f24785f1031 100644 (file)
@@ -13,20 +13,20 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.function.Function;
 import java.util.stream.Collectors;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AdditionalInfo;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AdditionalInfoBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AdditionalInfoKey;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AlarmInfoBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.ChangedAttributes;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.ChangedAttributesBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.ChangedAttributesKey;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TargetObjectName;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TargetObjectNameBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TargetObjectNameKey;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TcaInfoBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishTapiNotificationService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.AdditionalInfo;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.AdditionalInfoBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.AdditionalInfoKey;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.AlarmInfoBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.ChangedAttributes;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.ChangedAttributesBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.ChangedAttributesKey;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.TargetObjectName;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.TargetObjectNameBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.TargetObjectNameKey;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.tapi.service.TcaInfoBuilder;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.Name;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameKey;
 import org.slf4j.Logger;
index dad51171fcf151036b72de4d31bd357183b9e876..8933189c504e3a5910401fa7d44a1fab5f78d5a3 100644 (file)
@@ -10,14 +10,14 @@ package org.opendaylight.transportpce.nbinotifications.utils;
 import java.util.HashMap;
 import java.util.Map;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
-import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsListenerImpl;
+import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsHandler;
 import org.opendaylight.transportpce.nbinotifications.producer.Publisher;
 import org.opendaylight.transportpce.nbinotifications.serialization.NotificationAlarmServiceSerializer;
 import org.opendaylight.transportpce.nbinotifications.serialization.NotificationServiceSerializer;
 import org.opendaylight.transportpce.nbinotifications.serialization.TapiNotificationSerializer;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -29,7 +29,7 @@ public final class TopicManager {
     private Map<String, Publisher<NotificationTapiService>> tapiPublisherMap = new HashMap<>();
     private String publisherServer;
     private JsonStringConverter<NotificationTapiService> tapiConverter;
-    private NbiNotificationsListenerImpl nbiNotificationsListener;
+    private NbiNotificationsHandler nbiNotificationsListener;
     private Map<String, Publisher<NotificationAlarmService>> alarmPublisherMap = new HashMap<>();
     private Map<String, Publisher<NotificationProcessService>> processPublisherMap = new HashMap<>();
     private JsonStringConverter<NotificationProcessService> processConverter;
@@ -42,7 +42,7 @@ public final class TopicManager {
         return instance;
     }
 
-    public void setNbiNotificationsListener(NbiNotificationsListenerImpl nbiNotificationsListener) {
+    public void setNbiNotificationsListener(NbiNotificationsHandler nbiNotificationsListener) {
         this.nbiNotificationsListener = nbiNotificationsListener;
     }
 
index 5c5f6690f9032e0195af148e175c1f60074c894d..e491e961c5b41433016a0acacb67fac3e1f070e8 100644 (file)
@@ -23,11 +23,11 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.opendaylight.transportpce.nbinotifications.utils.NotificationServiceDataUtils;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.alarm.service.output.NotificationsAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.process.service.output.NotificationsProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.alarm.service.output.NotificationsAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.process.service.output.NotificationsProcessService;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.get.notification.list.output.Notification;
 
 public class SubscriberTest extends AbstractTest {
index c2e6e02b0ca64c8716795e9f67af6b9cd8775540..a6d042aef0dd1dfc5c02bdfda72789db9e66e6a3 100644 (file)
@@ -22,13 +22,13 @@ import org.opendaylight.transportpce.nbinotifications.utils.NotificationServiceD
 import org.opendaylight.transportpce.nbinotifications.utils.TopicManager;
 import org.opendaylight.transportpce.test.AbstractTest;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.ConnectionType;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsAlarmServiceInputBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsAlarmServiceOutput;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsProcessServiceInputBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.GetNotificationsProcessServiceOutput;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsAlarmServiceInputBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsAlarmServiceOutput;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsProcessServiceInputBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.GetNotificationsProcessServiceOutput;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.CreateNotificationSubscriptionServiceInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.CreateNotificationSubscriptionServiceOutput;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.GetNotificationListInputBuilder;
index 2b37bb5a31d0985a3cc6f0f84329fc56c1ecfde9..4bbfb6404f2a526917e84db6e4c05b56f4e20b0f 100644 (file)
@@ -19,7 +19,6 @@ import org.opendaylight.mdsal.binding.api.NotificationService;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
-import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsListenerImpl;
 import org.opendaylight.transportpce.test.AbstractTest;
 
 public class NbiNotificationsProviderTest  extends AbstractTest {
@@ -43,6 +42,6 @@ public class NbiNotificationsProviderTest  extends AbstractTest {
                 networkTransactionService);
         verify(rpcProviderRegistry, times(1)).registerRpcImplementations(any());
         verify(notificationService, times(1))
-                .registerNotificationListener(any(NbiNotificationsListenerImpl.class));
+                .registerCompositeListener(any(NotificationService.CompositeListener.class));
     }
 }
@@ -27,17 +27,17 @@ import org.opendaylight.transportpce.nbinotifications.utils.NotificationServiceD
 import org.opendaylight.transportpce.test.AbstractTest;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.ConnectionType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationAlarmServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishTapiNotificationService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishTapiNotificationServiceBuilder;
 
-public class NbiNotificationsListenerImplTest extends AbstractTest {
+public class NbiNotificationsHandlerTest extends AbstractTest {
     @Mock
     private Publisher<NotificationProcessService> publisherService;
     @Mock
@@ -52,12 +52,13 @@ public class NbiNotificationsListenerImplTest extends AbstractTest {
 
     @Test
     void onPublishNotificationServiceTest() {
-        NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
+        NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService),
                 Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
         PublishNotificationProcessService notification = new PublishNotificationProcessServiceBuilder()
                 .setPublisherName("test")
                 .setCommonId("commonId")
                 .setConnectionType(ConnectionType.Service)
+                .setIsTempService(false)
                 .setMessage("Service deleted")
                 .setOperationalState(State.OutOfService)
                 .setServiceName("service name")
@@ -68,7 +69,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest {
 
     @Test
     void onPublishNotificationServiceWrongPublisherTest() {
-        NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
+        NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService),
                 Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
         PublishNotificationProcessService notification = new PublishNotificationProcessServiceBuilder()
                 .setPublisherName("wrongPublisher")
@@ -84,7 +85,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest {
 
     @Test
     void onPublishNotificationAlarmServiceTest() {
-        NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
+        NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService),
                 Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
         PublishNotificationAlarmService notification = new PublishNotificationAlarmServiceBuilder()
                 .setPublisherName("test")
@@ -99,7 +100,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest {
 
     @Test
     void onPublishNotificationAlarmServiceWrongPublisherTest() {
-        NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
+        NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService),
                 Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
         PublishNotificationAlarmService notification = new PublishNotificationAlarmServiceBuilder()
                 .setPublisherName("wrongPublisher")
@@ -114,7 +115,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest {
 
     @Test
     void onPublishTapiNotificationServiceTest() throws ExecutionException, InterruptedException {
-        NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
+        NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService),
                 Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
 
         PublishTapiNotificationService notification
@@ -127,7 +128,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest {
 
     @Test
     void onPublishTapiNotificationServiceTestWrongPublisherTest() {
-        NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
+        NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService),
             Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
         PublishTapiNotificationService notification
             = new PublishTapiNotificationServiceBuilder(NotificationServiceDataUtils.buildReceivedTapiAlarmEvent())
@@ -139,7 +140,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest {
 
     @Test
     void getTapiPublisherFromTopicTest() {
-        NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
+        NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService),
                 Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
         assertNull(listener.getTapiPublisherFromTopic("toto"));
         assertEquals(publisherTapiService, listener.getTapiPublisherFromTopic("test"));
index e7d7fd66b57223b8ad302b008ec967245fd4225c..26d4edd538e78beb01dc2354881902b80d5f265b 100644 (file)
@@ -33,9 +33,9 @@ import org.opendaylight.transportpce.nbinotifications.serialization.TapiNotifica
 import org.opendaylight.transportpce.nbinotifications.utils.NotificationServiceDataUtils;
 import org.opendaylight.transportpce.nbinotifications.utils.TopicManager;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Uuid;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.CreateNotificationSubscriptionServiceInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.create.notification.subscription.service.input.SubscriptionFilter;
index cd642f09dcd148cb254c08cb439b672b33e76b95..78b05c51f1623595453d1184a210e6858307a74e 100755 (executable)
@@ -17,8 +17,8 @@ import java.util.Map;
 import org.junit.jupiter.api.Test;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.alarm.service.output.NotificationsAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.alarm.service.output.NotificationsAlarmService;
 
 public class NotificationAlarmServiceDeserializerTest extends AbstractTest {
 
index 8b267970bd4b28f8f717cdad5edfd0d96ed28179..6629a462bad053db3b3db9b6233fa85d20318a9e 100755 (executable)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.transportpce.nbinotifications.serialization;
 
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import com.fasterxml.jackson.databind.JsonNode;
@@ -18,17 +16,19 @@ import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.Map;
+import org.json.JSONException;
 import org.junit.jupiter.api.Test;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationAlarmService;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
+import org.skyscreamer.jsonassert.JSONAssert;
 
 public class NotificationAlarmServiceSerializerTest extends AbstractTest {
 
     @Test
-    void serializeTest() throws IOException {
+    void serializeTest() throws IOException, JSONException {
         JsonStringConverter<NotificationAlarmService> converter =
                 new JsonStringConverter<>(getDataStoreContextUtil().getBindingDOMCodecServices());
         String json = Files.readString(Paths.get("src/test/resources/event_alarm_service.json"));
@@ -44,6 +44,6 @@ public class NotificationAlarmServiceSerializerTest extends AbstractTest {
         String expectedJson = Files.readString(Paths.get("src/test/resources/expected_event_alarm_service.json"));
         // Minify the json string
         expectedJson = new ObjectMapper().readValue(expectedJson, JsonNode.class).toString();
-        assertEquals(expectedJson, new String(data, StandardCharsets.UTF_8), "The event should be equals");
+        JSONAssert.assertEquals(expectedJson, new String(data, StandardCharsets.UTF_8), true);
     }
 }
index 25edafea8a52c2f500e1c1fca96ec86743b8ffd7..e7fee7161f6d3cbf75d95975ddf2d5534bd7af08 100644 (file)
@@ -17,8 +17,8 @@ import java.util.Map;
 import org.junit.jupiter.api.Test;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.process.service.output.NotificationsProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.process.service.output.NotificationsProcessService;
 
 public class NotificationServiceDeserializerTest extends AbstractTest {
 
index 0a15d9ebc5e14a11599f641a30c136216cd788e3..566c7a5b536dc6eab28f620f4fb9dc9055c42ce9 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.transportpce.nbinotifications.serialization;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import com.fasterxml.jackson.databind.JsonNode;
@@ -17,17 +16,19 @@ import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.Map;
+import org.json.JSONException;
 import org.junit.jupiter.api.Test;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
+import org.skyscreamer.jsonassert.JSONAssert;
 
 public class NotificationServiceSerializerTest extends AbstractTest {
 
     @Test
-    void serializeTest() throws IOException {
+    void serializeTest() throws IOException, JSONException {
         JsonStringConverter<NotificationProcessService> converter =
                 new JsonStringConverter<>(getDataStoreContextUtil().getBindingDOMCodecServices());
         String json = Files.readString(Paths.get("src/test/resources/event.json"));
@@ -43,6 +44,6 @@ public class NotificationServiceSerializerTest extends AbstractTest {
         String expectedJson = Files.readString(Paths.get("src/test/resources/expected_event.json"));
         // Minify the json string
         expectedJson = new ObjectMapper().readValue(expectedJson, JsonNode.class).toString();
-        assertEquals(expectedJson, new String(data, StandardCharsets.UTF_8), "The event should be equals");
+        JSONAssert.assertEquals(expectedJson, new String(data, StandardCharsets.UTF_8), true);
     }
 }
index 929d6a58feef08ef309bcf1d448db931354db990..3dc4f297deb2bddd61205cca5dd1255a3c122b78 100644 (file)
@@ -17,7 +17,7 @@ import java.util.Map;
 import org.junit.jupiter.api.Test;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.get.notification.list.output.Notification;
 
 public class NotificationTapiServiceDeserializerTest extends AbstractTest {
index b040246fa8be19377c95a1ac62842a736a08dc5f..325bef37d799c21ba7191e7a2042a4cd37280366 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.transportpce.nbinotifications.serialization;
 
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import com.fasterxml.jackson.databind.JsonNode;
@@ -18,17 +17,19 @@ import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.Map;
+import org.json.JSONException;
 import org.junit.jupiter.api.Test;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationTapiService;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
+import org.skyscreamer.jsonassert.JSONAssert;
 
 public class NotificationTapiServiceSerializerTest extends AbstractTest {
 
     @Test
-    void serializeTest() throws IOException {
+    void serializeTest() throws IOException, JSONException {
         JsonStringConverter<NotificationTapiService> converter =
                 new JsonStringConverter<>(getDataStoreContextUtil().getBindingDOMCodecServices());
         String json = Files.readString(Paths.get("src/test/resources/tapi_event.json"));
@@ -44,6 +45,6 @@ public class NotificationTapiServiceSerializerTest extends AbstractTest {
         String expectedJson = Files.readString(Paths.get("src/test/resources/expected_tapi_event.json"));
         // Minify the json string
         expectedJson = new ObjectMapper().readValue(expectedJson, JsonNode.class).toString();
-        assertEquals(expectedJson, new String(data, StandardCharsets.UTF_8), "The event should be equals");
+        JSONAssert.assertEquals(expectedJson, new String(data, StandardCharsets.UTF_8), true);
     }
 }
index 0764890bf5b2d8e14454890902e96f1d92e8a490..e731b9f1879a4104a5bf75cc2fd4a3b4a795cd5b 100644 (file)
@@ -31,14 +31,14 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev2
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service.port.PortBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev191129.ServiceFormat;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.alarm.service.output.NotificationsAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.alarm.service.output.NotificationsAlarmServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.process.service.output.NotificationsProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.process.service.output.NotificationsProcessServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.NotificationProcessServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.alarm.service.output.NotificationsAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.alarm.service.output.NotificationsAlarmServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.process.service.output.NotificationsProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.get.notifications.process.service.output.NotificationsProcessServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceZEndBuilder;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.AdministrativeState;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Context;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.ContextBuilder;
index c09ee69721b0b2f785d295f0414ff4d0aa1f2238..9f628332879ac0ae607c81293585eb1ae3cf733b 100644 (file)
         },
         "service-name": "service1",
         "message": "message",
-        "response-failed": ""
+        "response-failed": "",
+        "is-temp-service": true,
+        "aToZ": {
+            "frequency": 196.125,
+            "width": 87.5,
+            "optical-operational-mode": "test",
+            "rx-estimated-osnr": 23.5,
+            "rx-estimated-gsnr": 23.5,
+            "max-output-power": 0.5,
+            "min-output-power": 0.5
+        },
+        "zToA": {
+            "frequency": 196.125,
+            "width": 87.5,
+            "optical-operational-mode": "test",
+            "rx-estimated-osnr": 23.5,
+            "rx-estimated-gsnr": 23.5,
+            "max-output-power": 0.5,
+            "min-output-power": 0.5
+        }
     }
 }
index 4e277d8a5171859faefbd8018330ffe8f2fc7648..ffeb3ee6591ba361220edcfe5777739b52bea0da 100644 (file)
     "operational-state": "inService",
     "common-id": "commond-id",
     "response-failed": "",
-    "service-name": "service1"
+    "is-temp-service": true,
+    "service-name": "service1",
+    "aToZ": {
+      "frequency": "196.125",
+      "width": "87.5",
+      "optical-operational-mode": "test",
+      "rx-estimated-osnr": "23.5",
+      "rx-estimated-gsnr": "23.5",
+      "max-output-power": "0.5",
+      "min-output-power": "0.5"
+    },
+    "zToA": {
+      "frequency": "196.125",
+      "width": "87.5",
+      "optical-operational-mode": "test",
+      "rx-estimated-osnr": "23.5",
+      "rx-estimated-gsnr": "23.5",
+      "max-output-power": "0.5",
+      "min-output-power": "0.5"
+    }
   }
 }
\ No newline at end of file
index 555910d30b7aa9b04796dfe0674ac247b9c43e45..657d08d52b28de1682c41c34243644695d5a7fa2 100644 (file)
@@ -162,10 +162,10 @@ import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdes
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.atoz.direction.AToZKey;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.pce.resource.resource.resource.TerminationPoint;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceZEndBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.Rpc;
index dccdb4f894912140c8d54a0a12cd82db4ead70f2..19e4e92c4efe78aaf1c44bb871ae0dc2b2859b68 100644 (file)
@@ -27,10 +27,10 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.list.Services;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118.RpcStatusEx;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118.response.parameters.sp.ResponseParametersBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceZEndBuilder;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Reference;
@@ -240,6 +240,7 @@ public class PceNotificationHandler implements PceListener {
                             .setServiceZEnd(new ServiceZEndBuilder(tempServiceList.getServiceZEnd()).build())
                             .setCommonId(tempServiceList.getCommonId())
                             .setConnectionType(tempServiceList.getConnectionType())
+                            .setIsTempService(true)
                             .setPublisherName(PUBLISHER);
         } else {
             Services service = serviceDataStoreOperations.getService(input.getServiceName()).orElseThrow();
@@ -250,6 +251,7 @@ public class PceNotificationHandler implements PceListener {
                             .setServiceAEnd(new ServiceAEndBuilder(service.getServiceAEnd()).build())
                             .setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
                             .setCommonId(service.getCommonId())
+                            .setIsTempService(false)
                             .setConnectionType(service.getConnectionType())
                             .setPublisherName(PUBLISHER);
 
index 4bf6d11dd5672da281c3d2534e6c93017f125a8f..2359412db3533f7db799f7613addc7930dcb37fc 100644 (file)
@@ -35,10 +35,10 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.rpc.result.PathComputationResultBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.rpc.result.path.computation.result.AToZBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.rpc.result.path.computation.result.ZToABuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessServiceBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationProcessServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service.ServiceZEndBuilder;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Reference;
@@ -120,6 +120,7 @@ public class RendererNotificationHandler implements RendererListener {
                         .setServiceAEnd(new ServiceAEndBuilder(service.getServiceAEnd()).build())
                         .setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
                         .setCommonId(service.getCommonId())
+                        .setIsTempService(false)
                         .setConnectionType(service.getConnectionType())
                         .setResponseFailed("Renderer service delete failed !")
                         .setMessage("ServiceDelete request failed ...")
@@ -179,32 +180,56 @@ public class RendererNotificationHandler implements RendererListener {
         updateOtnTopology(notification, false);
         PublishNotificationProcessServiceBuilder nbiNotificationBuilder =
             new PublishNotificationProcessServiceBuilder()
-                .setServiceName(input.getServiceName())
                 .setServiceAEnd(new ServiceAEndBuilder(input.getServiceAEnd()).build())
                 .setServiceZEnd(new ServiceZEndBuilder(input.getServiceZEnd()).build())
-                .setCommonId(input.getCommonId()).setConnectionType(input.getConnectionType())
                 .setPublisherName(PUBLISHER);
         String serviceTemp = "";
         if (tempService) {
+            nbiNotificationBuilder.setCommonId(input.getCommonId()).setConnectionType(input.getConnectionType());
+            nbiNotificationBuilder.setIsTempService(true);
+            if (input.getServiceName() != null) {
+                nbiNotificationBuilder.setServiceName(input.getServiceName());
+            }
             OperationResult operationResult = this.serviceDataStoreOperations.modifyTempService(
                     serviceRpcResultSp.getServiceName(), State.InService, AdminStates.InService);
             serviceTemp = "Temp ";
             if (operationResult.isSuccess()) {
+                ServiceRpcResult serviceRpcResult =
+                    sendServiceRpcResultNotification(notification, ServiceNotificationTypes.ServiceCreateResult);
                 sendNbiNotification(nbiNotificationBuilder
                     .setResponseFailed("")
-                    .setMessage("Temp Service implemented !")
+                    .setMessage("Temp Service implemented")
+                    .setAToZ(
+                        new org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service
+                                .AToZBuilder()
+                            .setFrequency(serviceRpcResult.getPathComputationResult().getAToZ().getFrequency())
+                            .setWidth(serviceRpcResult.getPathComputationResult().getAToZ().getWidth())
+                            .setOpticalOperationalMode(serviceRpcResult.getPathComputationResult()
+                                        .getAToZ().getOpticalOperationalMode())
+                            // TODO: add GNSR, OSNR, min/max output powers
+                            .build())
+                    .setZToA(
+                        new org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.notification.process.service
+                                .ZToABuilder()
+                            .setFrequency(serviceRpcResult.getPathComputationResult().getZToA().getFrequency())
+                            .setWidth(serviceRpcResult.getPathComputationResult().getZToA().getWidth())
+                            .setOpticalOperationalMode(serviceRpcResult.getPathComputationResult()
+                                        .getZToA().getOpticalOperationalMode())
+                            // TODO: add GNSR, OSNR, min/max output powers
+                            .build())
                     .setOperationalState(State.InService)
                     .build());
                 LOG.debug("For the Temp service, sending notification on service-result-rpc");
-                sendServiceRpcResultNotification(notification, ServiceNotificationTypes.ServiceCreateResult);
                 return;
             }
         } else {
-            OperationResult operationResult = this.serviceDataStoreOperations.modifyService(
-                    serviceRpcResultSp.getServiceName(), State.InService, AdminStates.InService);
             // Here the service is implemented and the tempService has to be deleted if present
+            nbiNotificationBuilder.setServiceName(input.getServiceName()).setConnectionType(input.getConnectionType());
+            // Make sure temp-service is false
+            nbiNotificationBuilder.setIsTempService(false);
             String commonId = input.getCommonId();
             if (commonId != null) {
+                nbiNotificationBuilder.setCommonId(commonId);
                 if (this.serviceDataStoreOperations.getTempService(commonId).isPresent()) {
                     LOG.info("Temp-service exists with the common-Id {}", commonId);
                     // Delete the common-id from this temp-service-list here
@@ -214,7 +239,8 @@ public class RendererNotificationHandler implements RendererListener {
                     LOG.info("Result for temp-service-list with {} is {}", commonId, tempServiceListDelete);
                 }
             }
-
+            OperationResult operationResult = this.serviceDataStoreOperations.modifyService(
+                    serviceRpcResultSp.getServiceName(), State.InService, AdminStates.InService);
             if (operationResult.isSuccess()) {
                 sendNbiNotification(nbiNotificationBuilder
                     .setResponseFailed("")
@@ -249,8 +275,7 @@ public class RendererNotificationHandler implements RendererListener {
                     .setNotificationType(type)
                     .build();
             LOG.debug("Service update in datastore OK, sending notification {}", serviceHandlerNotification);
-            notificationPublishService.putNotification(
-                    serviceHandlerNotification);
+            notificationPublishService.putNotification(serviceHandlerNotification);
         } catch (InterruptedException e) {
             LOG.warn("Something went wrong while sending notification for service {}",
                     serviceRpcResultSp.getServiceName(), e);
@@ -258,7 +283,8 @@ public class RendererNotificationHandler implements RendererListener {
         }
     }
 
-    private void sendServiceRpcResultNotification(RendererRpcResultSp notification, ServiceNotificationTypes type) {
+    private ServiceRpcResult sendServiceRpcResultNotification(
+            RendererRpcResultSp notification, ServiceNotificationTypes type) {
         try {
             ServiceRpcResult serviceRpcResult = new ServiceRpcResultBuilder()
                     .setServiceName(notification.getServiceName())
@@ -274,8 +300,9 @@ public class RendererNotificationHandler implements RendererListener {
                                                             .getAToZDirection()
                                                             .getWidth())
                                             // TODO: here the optical operational mode should be set
+                                            // A default value is set here
+                                            .setOpticalOperationalMode("OR-W-400G-oFEC-63.1Gbd")
                                             // TODO: also set the GNSR, OSNR, power values
-                                            .setOpticalOperationalMode("test")
                                             .build())
                             .setZToA(new ZToABuilder()
                                             .setFrequency(notification
@@ -285,19 +312,21 @@ public class RendererNotificationHandler implements RendererListener {
                                                             .getZToADirection()
                                                             .getWidth())
                                             // TODO: here the optical operational mode should be set
+                                            // A default value is set here
+                                            .setOpticalOperationalMode("OR-W-400G-oFEC-63.1Gbd")
                                             // TODO: also set the GNSR, OSNR, power values
-                                            .setOpticalOperationalMode("test")
                                             .build())
                             .build())
                     .build();
             LOG.info("Sending the notification for service-rpc-result {}", serviceRpcResult);
-            notificationPublishService.putNotification(
-                    serviceRpcResult);
+            notificationPublishService.putNotification(serviceRpcResult);
+            return serviceRpcResult;
         } catch (InterruptedException e) {
             LOG.warn("Something went wrong while sending notification for service {}",
                     serviceRpcResultSp.getServiceName(), e);
             Thread.currentThread().interrupt();
         }
+        return null;
     }
 
 
@@ -315,6 +344,7 @@ public class RendererNotificationHandler implements RendererListener {
                 .setServiceZEnd(new ServiceZEndBuilder(service.getServiceZEnd()).build())
                 .setCommonId(service.getCommonId())
                 .setConnectionType(service.getConnectionType())
+                .setIsTempService(false)
                 .setResponseFailed("Renderer implementation failed !")
                 .setMessage("ServiceCreate request failed ...")
                 .setOperationalState(service.getOperationalState())
index 021f9b8e7b100a1f60a7e46a52bbb32ff261b5e8..fcb4bf183e8f0961fc4e894a23946c177386c912 100644 (file)
@@ -44,8 +44,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.delete.input.ServiceDeleteReqInfo;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.delete.input.ServiceDeleteReqInfoBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.list.Services;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationAlarmServiceBuilder;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
index 08a1edb27e64cf5e378c97ef5789198c72c3364a..61e8dc97821d3820441003a6a7f2aa0c17b5ba05 100755 (executable)
@@ -57,8 +57,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.Service
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceRerouteOutputBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.list.Services;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.list.ServicesBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishNotificationAlarmServiceBuilder;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
index 6b750a188a27935fbabda9bb3192cb954a338f0e..79a9dc7c7db586a1ba9fecc0e96bb1f25d5bd13d 100644 (file)
@@ -16,8 +16,8 @@ import java.util.UUID;
 import java.util.concurrent.ExecutionException;
 import org.opendaylight.transportpce.common.OperationResult;
 import org.opendaylight.transportpce.common.ResponseCodes;
-import org.opendaylight.transportpce.tapi.listeners.TapiPceListenerImpl;
-import org.opendaylight.transportpce.tapi.listeners.TapiRendererListenerImpl;
+import org.opendaylight.transportpce.tapi.listeners.TapiPceNotificationHandler;
+import org.opendaylight.transportpce.tapi.listeners.TapiRendererNotificationHandler;
 import org.opendaylight.transportpce.tapi.utils.TapiContext;
 import org.opendaylight.transportpce.tapi.validation.CreateConnectivityServiceValidation;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.RpcActions;
@@ -102,12 +102,12 @@ public class TapiConnectivityImpl implements TapiConnectivityService {
     private OrgOpenroadmServiceService serviceHandler;
     private final TapiContext tapiContext;
     private final ConnectivityUtils connectivityUtils;
-    private TapiPceListenerImpl pceListenerImpl;
-    private TapiRendererListenerImpl rendererListenerImpl;
+    private TapiPceNotificationHandler pceListenerImpl;
+    private TapiRendererNotificationHandler rendererListenerImpl;
 
     public TapiConnectivityImpl(OrgOpenroadmServiceService serviceHandler, TapiContext tapiContext,
-                                ConnectivityUtils connectivityUtils, TapiPceListenerImpl pceListenerImpl,
-                                TapiRendererListenerImpl rendererListenerImpl) {
+                                ConnectivityUtils connectivityUtils, TapiPceNotificationHandler pceListenerImpl,
+                                TapiRendererNotificationHandler rendererListenerImpl) {
         LOG.info("inside TapiImpl constructor");
         this.serviceHandler = serviceHandler;
         this.tapiContext = tapiContext;
index 880ef0383d4e846193f7142481382b9279086b73..657b9c200a4c2f8fe4912b354f586601ef41c36d 100644 (file)
@@ -22,9 +22,10 @@ import org.opendaylight.transportpce.common.network.NetworkTransactionService;
 import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
 import org.opendaylight.transportpce.tapi.connectivity.ConnectivityUtils;
 import org.opendaylight.transportpce.tapi.connectivity.TapiConnectivityImpl;
-import org.opendaylight.transportpce.tapi.listeners.TapiPceListenerImpl;
-import org.opendaylight.transportpce.tapi.listeners.TapiRendererListenerImpl;
-import org.opendaylight.transportpce.tapi.listeners.TapiServiceHandlerListenerImpl;
+import org.opendaylight.transportpce.tapi.listeners.TapiNetworkModelNotificationHandler;
+import org.opendaylight.transportpce.tapi.listeners.TapiPceNotificationHandler;
+import org.opendaylight.transportpce.tapi.listeners.TapiRendererNotificationHandler;
+import org.opendaylight.transportpce.tapi.listeners.TapiServiceNotificationHandler;
 import org.opendaylight.transportpce.tapi.topology.TapiNetconfTopologyListener;
 import org.opendaylight.transportpce.tapi.topology.TapiNetworkModelService;
 import org.opendaylight.transportpce.tapi.topology.TapiOrLinkListener;
@@ -36,21 +37,18 @@ import org.opendaylight.transportpce.tapi.utils.TapiInitialORMapping;
 import org.opendaylight.transportpce.tapi.utils.TapiLink;
 import org.opendaylight.transportpce.tapi.utils.TapiLinkImpl;
 import org.opendaylight.transportpce.tapi.utils.TapiListener;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.TransportpcePceListener;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220922.Network;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220922.network.Nodes;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.TransportpceRendererListener;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.TransportpceServicehandlerListener;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.tapinetworkutils.rev210408.TransportpceTapinetworkutilsService;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.OrgOpenroadmServiceService;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NetworkId;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.NetworkKey;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Network1;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.TapiNotificationListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.tapi.rev180928.ServiceInterfacePoints;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.osgi.service.component.annotations.Activate;
@@ -82,12 +80,13 @@ public class TapiProvider {
     private final NetworkTransactionService networkTransactionService;
     private final OrgOpenroadmServiceService serviceHandler;
     private final ServiceDataStoreOperations serviceDataStoreOperations;
+    private ObjectRegistration<TransportpceTapinetworkutilsService> tapiNetworkutilsServiceRpcRegistration;
     private List<Registration> listeners;
-    private ListenerRegistration<TransportpcePceListener> pcelistenerRegistration;
-    private ListenerRegistration<TransportpceRendererListener> rendererlistenerRegistration;
-    private ListenerRegistration<TransportpceServicehandlerListener> servicehandlerlistenerRegistration;
-    private ListenerRegistration<TapiNotificationListener> tapinetworkmodellistenerRegistration;
     private List<Registration> rpcRegistrations = new ArrayList<>();
+    private Registration pcelistenerRegistration;
+    private Registration rendererlistenerRegistration;
+    private Registration servicehandlerlistenerRegistration;
+    private Registration tapinetworkmodellistenerRegistration;
 
     @Activate
     public TapiProvider(@Reference DataBroker dataBroker,
@@ -97,7 +96,7 @@ public class TapiProvider {
             @Reference NetworkTransactionService networkTransactionService,
             @Reference OrgOpenroadmServiceService serviceHandler,
             @Reference ServiceDataStoreOperations serviceDataStoreOperations,
-            @Reference TapiNotificationListener tapiNetworkModelListenerImpl,
+            @Reference TapiNetworkModelNotificationHandler tapiNetworkModelNotificationHandler,
             @Reference TapiNetworkModelService tapiNetworkModelServiceImpl) {
         this.dataBroker = dataBroker;
         this.networkTransactionService = networkTransactionService;
@@ -114,8 +113,8 @@ public class TapiProvider {
                 tapiContext, this.serviceDataStoreOperations);
         tapiInitialORMapping.performTopoInitialMapping();
         tapiInitialORMapping.performServInitialMapping();
-        TapiPceListenerImpl pceListenerImpl = new TapiPceListenerImpl(dataBroker);
-        TapiRendererListenerImpl rendererListenerImpl = new TapiRendererListenerImpl(dataBroker,
+        TapiPceNotificationHandler pceListenerImpl = new TapiPceNotificationHandler(dataBroker);
+        TapiRendererNotificationHandler rendererListenerImpl = new TapiRendererNotificationHandler(dataBroker,
                 notificationPublishService);
 
         TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(this.serviceHandler, tapiContext,
@@ -143,13 +142,14 @@ public class TapiProvider {
                         InstanceIdentifier.create(ServiceInterfacePoints.class)),
                 tapiListener));
         // Notification Listener
-        pcelistenerRegistration = notificationService.registerNotificationListener(pceListenerImpl);
-        rendererlistenerRegistration = notificationService.registerNotificationListener(rendererListenerImpl);
-        TapiServiceHandlerListenerImpl serviceHandlerListenerImpl = new TapiServiceHandlerListenerImpl(dataBroker);
+        pcelistenerRegistration = notificationService.registerCompositeListener(pceListenerImpl.getCompositeListener());
+        rendererlistenerRegistration = notificationService
+            .registerCompositeListener(rendererListenerImpl.getCompositeListener());
+        TapiServiceNotificationHandler serviceHandlerListenerImpl = new TapiServiceNotificationHandler(dataBroker);
         servicehandlerlistenerRegistration = notificationService
-            .registerNotificationListener(serviceHandlerListenerImpl);
+            .registerCompositeListener(serviceHandlerListenerImpl.getCompositeListener());
         tapinetworkmodellistenerRegistration = notificationService
-            .registerNotificationListener(tapiNetworkModelListenerImpl);
+            .registerCompositeListener(tapiNetworkModelNotificationHandler.getCompositeListener());
     }
 
     /**
similarity index 97%
rename from tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiNetworkModelListenerImpl.java
rename to tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiNetworkModelNotificationHandler.java
index ceef1feb24e3f722e613581fd44df9ff8c8087dc..8f5a7018839d10c10eb38f4c57fad142125c822c 100644 (file)
@@ -19,16 +19,18 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
+import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ExecutionException;
 import java.util.stream.Collectors;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
 import org.opendaylight.transportpce.tapi.TapiStringConstants;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishTapiNotificationService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishTapiNotificationServiceBuilder;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.AdministrativeState;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Context;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.DateAndTime;
@@ -50,7 +52,6 @@ import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev18121
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.Notification;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.NotificationType;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.ObjectType;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.TapiNotificationListener;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.notification.ChangedAttributes;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.notification.ChangedAttributesBuilder;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.notification.ChangedAttributesKey;
@@ -74,10 +75,10 @@ import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Component
-public class TapiNetworkModelListenerImpl implements TapiNotificationListener {
+@Component(service = TapiNetworkModelNotificationHandler.class)
+public class TapiNetworkModelNotificationHandler {
 
-    private static final Logger LOG = LoggerFactory.getLogger(TapiNetworkModelListenerImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(TapiNetworkModelNotificationHandler.class);
     private final NetworkTransactionService networkTransactionService;
     private final NotificationPublishService notificationPublishService;
     private final List<ConnectivityService> connectivityServiceChanges = new ArrayList<>();
@@ -86,7 +87,7 @@ public class TapiNetworkModelListenerImpl implements TapiNotificationListener {
     private final List<LayerProtocolName> orderedServiceLayerList;
 
     @Activate
-    public TapiNetworkModelListenerImpl(@Reference NetworkTransactionService networkTransactionService,
+    public TapiNetworkModelNotificationHandler(@Reference NetworkTransactionService networkTransactionService,
             @Reference NotificationPublishService notificationPublishService) {
         this.networkTransactionService = networkTransactionService;
         this.notificationPublishService = notificationPublishService;
@@ -95,8 +96,12 @@ public class TapiNetworkModelListenerImpl implements TapiNotificationListener {
         LOG.debug("TapiNetworkModelListenerImpl instantiated");
     }
 
-    @Override
-    public void onNotification(Notification notification) {
+    public CompositeListener getCompositeListener() {
+        return new CompositeListener(Set.of(
+            new CompositeListener.Component<>(Notification.class, this::onNotification)));
+    }
+
+    private void onNotification(Notification notification) {
         LOG.info("Received network model notification {}", notification);
         if (notification.getNotificationType() == NotificationType.ATTRIBUTEVALUECHANGE
                 && notification.getTargetObjectType() == ObjectType.NODEEDGEPOINT) {
similarity index 99%
rename from tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiPceListenerImpl.java
rename to tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiPceNotificationHandler.java
index ab977f070f81d9dededc048b639b43b15a7bfb89..b224491515de04d55adb98e469383df493f8b507 100644 (file)
@@ -15,16 +15,17 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ExecutionException;
 import java.util.stream.Collectors;
 import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
 import org.opendaylight.transportpce.tapi.TapiStringConstants;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.ServicePathRpcResult;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.TransportpcePceListener;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.service.path.rpc.result.PathDescription;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.service.path.rpc.result.PathDescriptionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220922.Network;
@@ -80,9 +81,9 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class TapiPceListenerImpl implements TransportpcePceListener {
+public class TapiPceNotificationHandler {
 
-    private static final Logger LOG = LoggerFactory.getLogger(TapiPceListenerImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(TapiPceNotificationHandler.class);
 
     private final Uuid tapiTopoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER
         .getBytes(Charset.forName("UTF-8"))).toString());
@@ -99,7 +100,7 @@ public class TapiPceListenerImpl implements TransportpcePceListener {
     private Connection topConnXpdrXpdrPhtn;
     private Connection topConnXpdrXpdrOdu;
 
-    public TapiPceListenerImpl(DataBroker dataBroker) {
+    public TapiPceNotificationHandler(DataBroker dataBroker) {
         this.connectionFullMap = new HashMap<>();
         this.dataBroker = dataBroker;
         this.networkTransactionService = new NetworkTransactionImpl(this.dataBroker);
@@ -108,8 +109,12 @@ public class TapiPceListenerImpl implements TransportpcePceListener {
         this.topConnXpdrXpdrOdu = null;
     }
 
-    @Override
-    public void onServicePathRpcResult(ServicePathRpcResult notification) {
+    public CompositeListener getCompositeListener() {
+        return new CompositeListener(Set.of(
+            new CompositeListener.Component<>(ServicePathRpcResult.class, this::onServicePathRpcResult)));
+    }
+
+    private void onServicePathRpcResult(ServicePathRpcResult notification) {
         if (compareServicePathRpcResult(notification)) {
             LOG.warn("ServicePathRpcResult already wired !");
             return;
similarity index 96%
rename from tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiRendererListenerImpl.java
rename to tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiRendererNotificationHandler.java
index 32d36391b767d2213a83a4429f68564925e15190..a41e9428bc868532ffd446d5ef971de64f328787 100644 (file)
@@ -15,17 +15,18 @@ import java.time.format.DateTimeFormatter;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Optional;
+import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ExecutionException;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.RendererRpcResultSp;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.TransportpceRendererListener;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishTapiNotificationService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev230726.PublishTapiNotificationServiceBuilder;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.AdministrativeState;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Context;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.DateAndTime;
@@ -53,23 +54,28 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class TapiRendererListenerImpl implements TransportpceRendererListener {
+public class TapiRendererNotificationHandler {
 
-    private static final Logger LOG = LoggerFactory.getLogger(TapiRendererListenerImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(TapiRendererNotificationHandler.class);
     private final DataBroker dataBroker;
     private Uuid serviceUuid;
     private RendererRpcResultSp serviceRpcResultSp;
     private final NetworkTransactionService networkTransactionService;
     private final NotificationPublishService notificationPublishService;
 
-    public TapiRendererListenerImpl(DataBroker dataBroker, NotificationPublishService notificationPublishService) {
+    public TapiRendererNotificationHandler(DataBroker dataBroker,
+            NotificationPublishService notificationPublishService) {
         this.dataBroker = dataBroker;
         this.networkTransactionService = new NetworkTransactionImpl(this.dataBroker);
         this.notificationPublishService = notificationPublishService;
     }
 
-    @Override
-    public void onRendererRpcResultSp(RendererRpcResultSp notification) {
+    public CompositeListener getCompositeListener() {
+        return new CompositeListener(Set.of(
+            new CompositeListener.Component<>(RendererRpcResultSp.class, this::onRendererRpcResultSp)));
+    }
+
+    private void onRendererRpcResultSp(RendererRpcResultSp notification) {
         if (compareServiceRpcResultSp(notification)) {
             LOG.warn("ServiceRpcResultSp already wired !");
             return;
similarity index 61%
rename from tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiServiceHandlerListenerImpl.java
rename to tapi/src/main/java/org/opendaylight/transportpce/tapi/listeners/TapiServiceNotificationHandler.java
index 03ad2e5e397630f1f8a30d9557c4d4e77b862ff6..b1930d8726d13e2da6982a9092cec7e811080ae6 100644 (file)
@@ -7,24 +7,28 @@
  */
 package org.opendaylight.transportpce.tapi.listeners;
 
+import java.util.Set;
 import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.ServiceRpcResultSh;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.TransportpceServicehandlerListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class TapiServiceHandlerListenerImpl implements TransportpceServicehandlerListener {
+public class TapiServiceNotificationHandler {
 
-    private static final Logger LOG = LoggerFactory.getLogger(TapiServiceHandlerListenerImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(TapiServiceNotificationHandler.class);
     private final DataBroker dataBroker;
 
-    public TapiServiceHandlerListenerImpl(DataBroker dataBroker) {
+    public TapiServiceNotificationHandler(DataBroker dataBroker) {
         this.dataBroker = dataBroker;
+    }
 
+    public CompositeListener getCompositeListener() {
+        return new CompositeListener(Set.of(
+            new CompositeListener.Component<>(ServiceRpcResultSh.class, this::onServiceRpcResultSh)));
     }
 
-    @Override
-    public void onServiceRpcResultSh(ServiceRpcResultSh notification) {
+    private void onServiceRpcResultSh(ServiceRpcResultSh notification) {
         LOG.info("Avoid dataBroker error {}", dataBroker.getClass().getCanonicalName());
     }
 }
index 70a9adcb392808f36f877f2d889c9b10d29f6f69..992514f99b49986242073c46f2e6f7c0088653f7 100644 (file)
@@ -39,9 +39,9 @@ import org.opendaylight.transportpce.servicehandler.listeners.PceListener;
 import org.opendaylight.transportpce.servicehandler.listeners.RendererListener;
 import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
 import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperationsImpl;
-import org.opendaylight.transportpce.tapi.listeners.TapiPceListenerImpl;
-import org.opendaylight.transportpce.tapi.listeners.TapiRendererListenerImpl;
-import org.opendaylight.transportpce.tapi.listeners.TapiServiceHandlerListenerImpl;
+import org.opendaylight.transportpce.tapi.listeners.TapiPceNotificationHandler;
+import org.opendaylight.transportpce.tapi.listeners.TapiRendererNotificationHandler;
+import org.opendaylight.transportpce.tapi.listeners.TapiServiceNotificationHandler;
 import org.opendaylight.transportpce.tapi.topology.TopologyUtils;
 import org.opendaylight.transportpce.tapi.utils.TapiConnectivityDataUtils;
 import org.opendaylight.transportpce.tapi.utils.TapiContext;
@@ -74,11 +74,11 @@ public class TapiConnectivityImplTest extends AbstractTest {
     @Mock
     private NotificationPublishService notificationPublishService;
     @Mock
-    private TapiPceListenerImpl tapipceListenerImpl;
+    private TapiPceNotificationHandler tapipceNotificationHandler;
     @Mock
-    private TapiRendererListenerImpl tapirendererListenerImpl;
+    private TapiRendererNotificationHandler tapirendererNotificationHandler;
     @Mock
-    private TapiServiceHandlerListenerImpl tapiserviceHandlerListenerImpl;
+    private TapiServiceNotificationHandler tapiserviceNotificationHandler;
     @Mock
     private PceListener pceListenerImpl;
     @Mock
@@ -137,7 +137,7 @@ public class TapiConnectivityImplTest extends AbstractTest {
             networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations);
 
         TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils,
-            tapipceListenerImpl, tapirendererListenerImpl);
+            tapipceNotificationHandler, tapirendererNotificationHandler);
 
         ListenableFuture<RpcResult<CreateConnectivityServiceOutput>> result =
             tapiConnectivity.createConnectivityService(new CreateConnectivityServiceInputBuilder().build());
@@ -165,7 +165,7 @@ public class TapiConnectivityImplTest extends AbstractTest {
         when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any()));
 
         TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils,
-            tapipceListenerImpl, tapirendererListenerImpl);
+            tapipceNotificationHandler, tapirendererNotificationHandler);
         ListenableFuture<RpcResult<CreateConnectivityServiceOutput>> result =
             tapiConnectivity.createConnectivityService(input);
         result.addListener(new Runnable() {
@@ -188,7 +188,7 @@ public class TapiConnectivityImplTest extends AbstractTest {
             networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations);
 
         TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils,
-            tapipceListenerImpl, tapirendererListenerImpl);
+            tapipceNotificationHandler, tapirendererNotificationHandler);
 
         ListenableFuture<RpcResult<DeleteConnectivityServiceOutput>> result =
             tapiConnectivity.deleteConnectivityService(new DeleteConnectivityServiceInputBuilder().build());
@@ -213,7 +213,7 @@ public class TapiConnectivityImplTest extends AbstractTest {
             networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations);
 
         TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils,
-            tapipceListenerImpl, tapirendererListenerImpl);
+            tapipceNotificationHandler, tapirendererNotificationHandler);
         ListenableFuture<RpcResult<DeleteConnectivityServiceOutput>> result =
             tapiConnectivity.deleteConnectivityService(input);
         result.addListener(new Runnable() {
@@ -238,7 +238,7 @@ public class TapiConnectivityImplTest extends AbstractTest {
             networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations);
 
         TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils,
-            tapipceListenerImpl, tapirendererListenerImpl);
+            tapipceNotificationHandler, tapirendererNotificationHandler);
 
         ServiceCreateInput createInput = TapiConnectivityDataUtils.buildServiceCreateInput();
         serviceDataStoreOperations.createService(createInput);
index 8efd0441021c50a5f683f7737823d0ac4050355b..9bafd9948d954950680ae5ba7d936f9fd5eee092 100644 (file)
@@ -27,9 +27,9 @@ import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
 import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
 import org.opendaylight.transportpce.tapi.impl.TapiProvider;
+import org.opendaylight.transportpce.tapi.listeners.TapiNetworkModelNotificationHandler;
 import org.opendaylight.transportpce.tapi.topology.TapiNetworkModelService;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.OrgOpenroadmServiceService;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.TapiNotificationListener;
 
 @ExtendWith(MockitoExtension.class)
 public class TapiProviderTest {
@@ -49,7 +49,7 @@ public class TapiProviderTest {
     @Mock
     private ServiceDataStoreOperations serviceDataStoreOperations;
     @Mock
-    private TapiNotificationListener tapiNetworkModelListenerImpl;
+    private TapiNetworkModelNotificationHandler tapiNetworkModelNotificationHandler;
     @Mock
     private TapiNetworkModelService tapiNetworkModelServiceImpl;
 
@@ -59,9 +59,9 @@ public class TapiProviderTest {
         doReturn(emptyFluentFuture()).when(networkTransactionService).commit();
         new TapiProvider(dataBroker, rpcProviderRegistry, notificationService, notificationPublishService,
                 networkTransactionService, serviceHandler, serviceDataStoreOperations,
-                tapiNetworkModelListenerImpl, tapiNetworkModelServiceImpl);
+                tapiNetworkModelNotificationHandler, tapiNetworkModelServiceImpl);
 
         verify(rpcProviderRegistry, times(2)).registerRpcImplementations(any());
         verify(dataBroker, times(4)).registerDataTreeChangeListener(any(), any());
     }
-}
\ No newline at end of file
+}
index e2d13cd12eba411c3a645576e7a49b68aa897c5d..cb637bbd458916b4dbc40561d8ca3d12f57797e6 100755 (executable)
@@ -18,5 +18,5 @@ fi
 . $USE_ODL_ALT_KARAF_ENV
 . ./reflectwarn.sh
 cd  ../$USE_ODL_ALT_KARAF_INSTALL_DIR
-mvn clean install -B -q -s ../tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true
+mvn clean install -B -q -s ../tests/odl_settings.xml -Pq
 ./target/assembly/ressources/post_install_for_tests.sh