From cb8ebd04e8e896faf9f2157ca182939191dd7ea2 Mon Sep 17 00:00:00 2001 From: "Errea Moreno, Javier" Date: Mon, 16 Nov 2020 18:50:20 +0100 Subject: [PATCH] Interface D creation. NetworkModel->ServiceHandler - Added common-ord-topology-types.yang and networkmodel.yang - Created empty NetworkModelListener in Service Handler module. - Initialization of Network model listener. - Modified servicehandler blueprint and ServicehandlerImplTest.java - Added models to TPCEUtils.java (lighty) - Added NetworkModelListenerImpl to the controller start up process JIRA: TRNSPRTPCE-359 Change-Id: I25e7b3f28741386c3d2b38ad49a04d7d4b304597 Signed-off-by: Javier --- ...-common-ord-topology-types@2020-11-16.yang | 61 ++++++++++++++ .../transportpce-networkmodel@2020-11-16.yang | 79 +++++++++++++++++++ .../tpce/module/TransportPCEImpl.java | 7 +- .../controllers/tpce/utils/TPCEUtils.java | 4 + .../impl/ServicehandlerImpl.java | 7 +- .../impl/ServicehandlerProvider.java | 10 ++- .../listeners/NetworkModelListenerImpl.java | 37 +++++++++ .../service/ServiceHandlerOperationsImpl.java | 6 +- .../blueprint/servicehandler-blueprint.xml | 6 ++ .../impl/ServicehandlerImplTest.java | 46 ++++++----- 10 files changed, 237 insertions(+), 26 deletions(-) create mode 100644 api/src/main/yang/service_path/transportpce-common-ord-topology-types@2020-11-16.yang create mode 100644 api/src/main/yang/service_path/transportpce-networkmodel@2020-11-16.yang create mode 100644 servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/NetworkModelListenerImpl.java diff --git a/api/src/main/yang/service_path/transportpce-common-ord-topology-types@2020-11-16.yang b/api/src/main/yang/service_path/transportpce-common-ord-topology-types@2020-11-16.yang new file mode 100644 index 000000000..c87f4eae1 --- /dev/null +++ b/api/src/main/yang/service_path/transportpce-common-ord-topology-types@2020-11-16.yang @@ -0,0 +1,61 @@ +module transportpce-common-ord-topology-types { + namespace "http://org/transportpce/D-interface/ord/topology/types"; + prefix transportpce-common-ord-topology-types; + + organization + "transportPCE"; + contact + "transportPCE committers - ODL"; + description + "YANG definitions of D interface (transportPCE). Adapted from network topology definition (openroadm) + Copyright © 2020 Nokia, Inc. and others. All rights reserved. + + openroadm copyright: + Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, + AT&T Intellectual Property. All other rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + * Neither the Members of the Open ROADM MSA Agreement nor the names of its + contributors may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA AGREEMENT ''AS IS'' + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA AGREEMENT BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE"; + + revision 2020-11-16 { + description + "Version 1.5"; + } + + typedef topology-notification-types { + type enumeration { + enum openroadm-topology-update { + value 1; + } + enum openroadm-network-update { + value 2; + } + enum clli-network-update { + value 3; + } + enum otn-topology-update { + value 4; + } + } + } +} \ No newline at end of file diff --git a/api/src/main/yang/service_path/transportpce-networkmodel@2020-11-16.yang b/api/src/main/yang/service_path/transportpce-networkmodel@2020-11-16.yang new file mode 100644 index 000000000..0624c3982 --- /dev/null +++ b/api/src/main/yang/service_path/transportpce-networkmodel@2020-11-16.yang @@ -0,0 +1,79 @@ +module transportpce-networkmodel { + namespace "http://org/opendaylight/transportpce/networkmodel"; + prefix org-opendaylight-transportpce-networkmodel; + + import transportpce-common-ord-topology-types { + prefix transportpce-common-ord-topology-types; + revision-date 2020-11-16; + } + + import org-openroadm-common-types { + prefix org-openroadm-common-types; + revision-date 2018-10-19; + } + + organization + "transportPCE"; + contact + "transportPCE committers - ODL"; + description + "YANG definitions proposed for interface D (transportPCE). Adapted from service definition (openroadm) + Copyright © 2020 Nokia, Inc. and others. All rights reserved. + + openroadm copyright: + Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, + AT&T Intellectual Property. All other rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + * Neither the Members of the Open ROADM MSA Agreement nor the names of its + contributors may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA AGREEMENT ''AS IS'' + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA AGREEMENT BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE"; + + revision 2020-11-16 { + description + "Initial revision of network model version 1.5"; + } + + grouping element-change { + leaf id { + type string; + mandatory true; + description "Id of abstracted element that changed in the topology"; + } + leaf state { + type org-openroadm-common-types:state; + mandatory true; + description "Operational state of the affected element"; + } + } + + notification topology-update-result { + description + "This Notification indicates result of an update in the openroadm topology"; + leaf notification-type { + type transportpce-common-ord-topology-types:topology-notification-types; + } + list ord-topology-changes { + key "id"; + uses element-change; + } + } +} \ No newline at end of file diff --git a/lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java b/lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java index eca1e4f8a..c7386fd18 100644 --- a/lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java +++ b/lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java @@ -61,6 +61,7 @@ import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOpe import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperationsImpl; import org.opendaylight.transportpce.renderer.rpcs.DeviceRendererRPCImpl; import org.opendaylight.transportpce.servicehandler.impl.ServicehandlerProvider; +import org.opendaylight.transportpce.servicehandler.listeners.NetworkModelListenerImpl; import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl; import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl; import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations; @@ -212,9 +213,13 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP lightyServices.getBindingDataBroker()); PceListenerImpl pceListenerImpl = new PceListenerImpl(rendererServiceOperations, pathComputationService, lightyServices.getBindingNotificationPublishService(), serviceDataStoreOperations); + NetworkModelListenerImpl networkModelListenerImpl = + new NetworkModelListenerImpl(lightyServices.getBindingNotificationPublishService(), + serviceDataStoreOperations); ServiceHandlerOperations serviceHandlerOperations = new ServiceHandlerOperationsImpl( lightyServices.getBindingDataBroker(), pathComputationService, rendererServiceOperations, - lightyServices.getBindingNotificationPublishService(), pceListenerImpl, rendererListenerImpl); + lightyServices.getBindingNotificationPublishService(), pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl); return new TapiProvider(lightyServices.getBindingDataBroker(), lightyServices.getRpcProviderService(), serviceHandlerOperations, new TapiListener()); } diff --git a/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java b/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java index 7e0a02b8d..bae69c256 100644 --- a/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java +++ b/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java @@ -207,6 +207,8 @@ public final class TPCEUtils { .getInstance(), org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128 .$YangModuleInfoImpl.getInstance(), + org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116 + .$YangModuleInfoImpl.getInstance(), org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.$YangModuleInfoImpl .getInstance(), org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.$YangModuleInfoImpl @@ -226,6 +228,8 @@ public final class TPCEUtils { .$YangModuleInfoImpl.getInstance(), org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.$YangModuleInfoImpl .getInstance(), + org.opendaylight.yang.gen.v1.http.org.transportpce.d._interface.ord.topology.types.rev201116 + .$YangModuleInfoImpl.getInstance(), org.opendaylight.yang.gen.v1.http.transportpce.topology.rev201019.$YangModuleInfoImpl.getInstance(), org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev170119.$YangModuleInfoImpl diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java index c07bf0cd2..4852cc6be 100644 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java @@ -21,6 +21,7 @@ import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOpe import org.opendaylight.transportpce.servicehandler.DowngradeConstraints; import org.opendaylight.transportpce.servicehandler.ModelMappingUtils; import org.opendaylight.transportpce.servicehandler.ServiceInput; +import org.opendaylight.transportpce.servicehandler.listeners.NetworkModelListenerImpl; import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl; import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl; import org.opendaylight.transportpce.servicehandler.service.PCEServiceWrapper; @@ -105,12 +106,14 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService { private RendererServiceWrapper rendererServiceWrapper; private PceListenerImpl pceListenerImpl; private RendererListenerImpl rendererListenerImpl; + private NetworkModelListenerImpl networkModelListenerImpl; //TODO: remove private request fields as they are in global scope public ServicehandlerImpl(DataBroker databroker, PathComputationService pathComputationService, RendererServiceOperations rendererServiceOperations, NotificationPublishService notificationPublishService, - PceListenerImpl pceListenerImpl, RendererListenerImpl rendererListenerImpl) { + PceListenerImpl pceListenerImpl, RendererListenerImpl rendererListenerImpl, + NetworkModelListenerImpl networkModelListenerImpl) { this.db = databroker; this.serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(this.db); this.serviceDataStoreOperations.initialize(); @@ -118,6 +121,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService { this.rendererServiceWrapper = new RendererServiceWrapper(rendererServiceOperations, notificationPublishService); this.pceListenerImpl = pceListenerImpl; this.rendererListenerImpl = rendererListenerImpl; + this.networkModelListenerImpl = networkModelListenerImpl; } @@ -172,6 +176,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService { this.pceListenerImpl.setserviceDataStoreOperations(this.serviceDataStoreOperations); this.rendererListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations); this.rendererListenerImpl.setServiceInput(new ServiceInput(input)); + this.networkModelListenerImpl.setserviceDataStoreOperations(serviceDataStoreOperations); LOG.debug(SERVICE_CREATE_MSG, LogMessages.PCE_CALLING); PathComputationRequestOutput output = this.pceServiceWrapper.performPCE(input, true); if (output == null) { diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerProvider.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerProvider.java index ec1e2f556..d8662c68d 100644 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerProvider.java +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerProvider.java @@ -14,8 +14,10 @@ import org.opendaylight.mdsal.binding.api.NotificationService; import org.opendaylight.mdsal.binding.api.RpcProviderService; import org.opendaylight.transportpce.pce.service.PathComputationService; import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations; +import org.opendaylight.transportpce.servicehandler.listeners.NetworkModelListenerImpl; import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl; import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TransportpceNetworkmodelListener; import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.TransportpcePceListener; import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.TransportpceRendererListener; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.OrgOpenroadmServiceService; @@ -40,6 +42,7 @@ public class ServicehandlerProvider { private final NotificationPublishService notificationPublishService; private ListenerRegistration pcelistenerRegistration; private ListenerRegistration rendererlistenerRegistration; + private ListenerRegistration networkmodellistenerRegistration; private ObjectRegistration rpcRegistration; private PathComputationService pathComputationService; private RendererServiceOperations rendererServiceOperations; @@ -65,10 +68,14 @@ public class ServicehandlerProvider { pathComputationService, notificationPublishService, null); final RendererListenerImpl rendererListenerImpl = new RendererListenerImpl(pathComputationService, notificationPublishService); + final NetworkModelListenerImpl networkModelListenerImpl = + new NetworkModelListenerImpl(notificationPublishService, null); pcelistenerRegistration = notificationService.registerNotificationListener(pceListenerImpl); rendererlistenerRegistration = notificationService.registerNotificationListener(rendererListenerImpl); + networkmodellistenerRegistration = notificationService.registerNotificationListener(networkModelListenerImpl); final ServicehandlerImpl servicehandler = new ServicehandlerImpl(dataBroker, pathComputationService, - rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl); + rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl); rpcRegistration = rpcService.registerRpcImplementation(OrgOpenroadmServiceService.class, servicehandler); } @@ -80,6 +87,7 @@ public class ServicehandlerProvider { LOG.info("ServicehandlerProvider Closed"); pcelistenerRegistration.close(); rendererlistenerRegistration.close(); + networkmodellistenerRegistration.close(); rpcRegistration.close(); } diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/NetworkModelListenerImpl.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/NetworkModelListenerImpl.java new file mode 100644 index 000000000..06b61aeaf --- /dev/null +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/NetworkModelListenerImpl.java @@ -0,0 +1,37 @@ +/* + * Copyright © 2020 Nokia, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.transportpce.servicehandler.listeners; + +import org.opendaylight.mdsal.binding.api.NotificationPublishService; +import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TopologyUpdateResult; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TransportpceNetworkmodelListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class NetworkModelListenerImpl implements TransportpceNetworkmodelListener { + + private static final Logger LOG = LoggerFactory.getLogger(NetworkModelListenerImpl.class); + private final NotificationPublishService notificationPublishService; // to be used for T-API notification + private ServiceDataStoreOperations serviceDataStoreOperations; + + public NetworkModelListenerImpl(NotificationPublishService notificationPublishService, + ServiceDataStoreOperations serviceDataStoreOperations) { + this.notificationPublishService = notificationPublishService; + this.serviceDataStoreOperations = serviceDataStoreOperations; + } + + @Override + public void onTopologyUpdateResult(TopologyUpdateResult notification) { + LOG.info("Topology update notification: {}", notification.toString()); + } + + public void setserviceDataStoreOperations(ServiceDataStoreOperations serviceData) { + this.serviceDataStoreOperations = serviceData; + } +} diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceHandlerOperationsImpl.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceHandlerOperationsImpl.java index bb3f257a3..53675b18f 100644 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceHandlerOperationsImpl.java +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceHandlerOperationsImpl.java @@ -14,6 +14,7 @@ import org.opendaylight.mdsal.binding.api.NotificationPublishService; import org.opendaylight.transportpce.pce.service.PathComputationService; import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations; import org.opendaylight.transportpce.servicehandler.impl.ServicehandlerImpl; +import org.opendaylight.transportpce.servicehandler.listeners.NetworkModelListenerImpl; import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl; import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput; @@ -32,9 +33,10 @@ public class ServiceHandlerOperationsImpl implements ServiceHandlerOperations { public ServiceHandlerOperationsImpl(DataBroker databroker, PathComputationService pathComputationService, RendererServiceOperations rendererServiceOperations, NotificationPublishService notificationPublishService, - PceListenerImpl pceListenerImpl, RendererListenerImpl rendererListenerImpl) { + PceListenerImpl pceListenerImpl, RendererListenerImpl rendererListenerImpl, + NetworkModelListenerImpl networkModelListenerImpl) { this.serviceHandler = new ServicehandlerImpl(databroker, pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); } @Override diff --git a/servicehandler/src/main/resources/OSGI-INF/blueprint/servicehandler-blueprint.xml b/servicehandler/src/main/resources/OSGI-INF/blueprint/servicehandler-blueprint.xml index da36c098e..6c7513f33 100644 --- a/servicehandler/src/main/resources/OSGI-INF/blueprint/servicehandler-blueprint.xml +++ b/servicehandler/src/main/resources/OSGI-INF/blueprint/servicehandler-blueprint.xml @@ -47,6 +47,11 @@ Author: Martial Coulibaly on behalf of Orange + + + + + @@ -54,6 +59,7 @@ Author: Martial Coulibaly on behalf of Orange + > result = servicehandlerImpl.serviceCreate(new ServiceCreateInputBuilder().build()); result.addListener(new Runnable() { @@ -120,7 +124,7 @@ public class ServicehandlerImplTest extends AbstractTest { Mockito.when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any())); ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceCreate(input); result.addListener(new Runnable() { @Override @@ -141,7 +145,7 @@ public class ServicehandlerImplTest extends AbstractTest { public void deleteServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceDelete(new ServiceDeleteInputBuilder() .setServiceDeleteReqInfo(new ServiceDeleteReqInfoBuilder().setServiceName("").build()).build()); @@ -165,7 +169,7 @@ public class ServicehandlerImplTest extends AbstractTest { ServiceDeleteInput input = ServiceDataUtils.buildServiceDeleteInput(); ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceDelete(input); result.addListener(new Runnable() { @Override @@ -188,7 +192,7 @@ public class ServicehandlerImplTest extends AbstractTest { Mockito.when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any())); ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(dataBroker, pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ServiceDataStoreOperationsImpl serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(dataBroker); ServiceCreateInput createInput = ServiceDataUtils.buildServiceCreateInput(); serviceDataStoreOperations.createService(createInput); @@ -214,7 +218,7 @@ public class ServicehandlerImplTest extends AbstractTest { public void serviceFeasibilityCheckShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceFeasibilityCheck(new ServiceFeasibilityCheckInputBuilder().build()); result.addListener(new Runnable() { @@ -239,7 +243,7 @@ public class ServicehandlerImplTest extends AbstractTest { Mockito.when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any())); ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceFeasibilityCheck(input); result.addListener(new Runnable() { @@ -261,7 +265,7 @@ public class ServicehandlerImplTest extends AbstractTest { public void serviceReconfigureShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceReconfigure(new ServiceReconfigureInputBuilder().setServiceName("").build()); result.addListener(new Runnable() { @@ -287,7 +291,7 @@ public class ServicehandlerImplTest extends AbstractTest { //action -> service reconfigure ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceReconfigure(input); result.addListener(new Runnable() { @@ -316,7 +320,7 @@ public class ServicehandlerImplTest extends AbstractTest { //create service to reconfigure ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(dataBroker, pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ServiceDataStoreOperationsImpl serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(dataBroker); ServiceCreateInput createInput = ServiceDataUtils.buildServiceCreateInput(); serviceDataStoreOperations.createService(createInput); @@ -344,7 +348,7 @@ public class ServicehandlerImplTest extends AbstractTest { public void serviceReRestorationShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceRestoration(new ServiceRestorationInputBuilder().setServiceName("").build()); result.addListener(new Runnable() { @@ -370,7 +374,7 @@ public class ServicehandlerImplTest extends AbstractTest { //action -> service restore ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceRestoration(input); result.addListener(new Runnable() { @@ -399,7 +403,7 @@ public class ServicehandlerImplTest extends AbstractTest { //create service to restore ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(dataBroker, pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ServiceDataStoreOperationsImpl serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(dataBroker); ServiceCreateInput createInput = ServiceDataUtils.buildServiceCreateInput(); serviceDataStoreOperations.createService(createInput); @@ -427,7 +431,7 @@ public class ServicehandlerImplTest extends AbstractTest { public void serviceRerouteShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceReroute(new ServiceRerouteInputBuilder().setServiceName("").build()); result.addListener(new Runnable() { @@ -452,7 +456,7 @@ public class ServicehandlerImplTest extends AbstractTest { //action -> service reconfigure ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.serviceReroute(input); result.addListener(new Runnable() { @@ -481,7 +485,7 @@ public class ServicehandlerImplTest extends AbstractTest { //create service to be rerouted later ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(dataBroker, pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ServiceDataStoreOperationsImpl serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(dataBroker); ServiceCreateInput createInput = ServiceDataUtils.buildServiceCreateInput(); serviceDataStoreOperations.createService(createInput); @@ -509,7 +513,7 @@ public class ServicehandlerImplTest extends AbstractTest { public void tempServiceDeleteShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.tempServiceDelete(new TempServiceDeleteInputBuilder() .setCommonId("").build()); @@ -536,7 +540,7 @@ public class ServicehandlerImplTest extends AbstractTest { TempServiceDeleteInput input = ServiceDataUtils.buildTempServiceDeleteInput(); ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.tempServiceDelete(input); result.addListener(new Runnable() { @Override @@ -561,7 +565,7 @@ public class ServicehandlerImplTest extends AbstractTest { //create temp service to delete in the temp delete action ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(dataBroker, pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ServiceDataStoreOperationsImpl serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(dataBroker); TempServiceCreateInput createInput = ServiceDataUtils.buildTempServiceCreateInput(); serviceDataStoreOperations.createTempService(createInput); @@ -588,7 +592,7 @@ public class ServicehandlerImplTest extends AbstractTest { public void tempServiceCreateShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.tempServiceCreate(new TempServiceCreateInputBuilder().build()); result.addListener(new Runnable() { @@ -615,7 +619,7 @@ public class ServicehandlerImplTest extends AbstractTest { ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations, - notificationPublishService, pceListenerImpl, rendererListenerImpl); + notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl); ListenableFuture> result = servicehandlerImpl.tempServiceCreate(input); result.addListener(new Runnable() { -- 2.36.6