<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-api</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-artifacts</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencyManagement>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-common</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>5.0.3</version>
+ <version>5.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-dmaap-client</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<description>client to send message to Dmaap message router</description>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.component.annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.metatype.annotations</artifactId>
+ </dependency>
<!-- Testing dependencies -->
<dependency>
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.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Component(configurationPid = "org.opendaylight.transportpce.dmaap")
public class DmaapClientProvider {
+
+ @ObjectClassDefinition
+ public @interface Configuration {
+ @AttributeDefinition
+ String dmaapBaseUrl() default "http://localhost:8080";
+ @AttributeDefinition
+ String dmaapUsername() default "";
+ @AttributeDefinition
+ String dmaapPassword() default "";
+ }
+
private static final Logger LOG = LoggerFactory.getLogger(DmaapClientProvider.class);
private ListenerRegistration<NbiNotificationsListener> listenerRegistration;
- private NotificationService notificationService;
- private final String baseUrl;
- private final String username;
- private final String password;
- public DmaapClientProvider(NotificationService notificationService, String baseUrl,
- String username, String password) {
- this.notificationService = notificationService;
- this.baseUrl = baseUrl;
- this.username = username;
- this.password = password;
+ @Activate
+ public DmaapClientProvider(@Reference NotificationService notificationService, Configuration config) {
+ this(notificationService, config.dmaapBaseUrl(), config.dmaapUsername(), config.dmaapPassword());
}
- /**
- * Method called when the blueprint container is created.
- */
- public void init() {
- LOG.info("DmaapClientProvider Session Initiated");
+ public DmaapClientProvider(NotificationService notificationService, String baseUrl,
+ String username, String password) {
listenerRegistration = notificationService.registerNotificationListener(
new NbiNotificationsListenerImpl(baseUrl, username, password));
+ LOG.info("DmaapClientProvider Session Initiated");
}
/**
listenerRegistration.close();
LOG.info("DmaapClientProvider Closed");
}
-
}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!-- Copyright © 2021 Orange 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 -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">
- <cm:property-placeholder persistent-id="org.opendaylight.transportpce.dmaap" update-strategy="reload">
- <cm:default-properties>
- <cm:property name="dmaap.baseUrl" value="http://localhost:8080" />
- <cm:property name="dmaap.username" value="" />
- <cm:property name="dmaap.password" value="" />
- </cm:default-properties>
- </cm:property-placeholder>
- <reference id="notificationService" interface="org.opendaylight.mdsal.binding.api.NotificationService"/>
-
- <bean id="provider"
- class="org.opendaylight.transportpce.dmaap.client.impl.DmaapClientProvider"
- init-method="init" destroy-method="close">
- <argument ref="notificationService" />
- <argument value="${dmaap.baseUrl}" />
- <argument value="${dmaap.username}" />
- <argument value="${dmaap.password}" />
- </bean>
-</blueprint>
@Test
void testInitRegisterNbiNotificationsToRpcRegistry() {
- DmaapClientProvider provider =
- new DmaapClientProvider(notificationService, "http://localhost", "username", "password");
- provider.init();
- (verify(notificationService, times(1)))
- .registerNotificationListener(Mockito.any(NbiNotificationsListenerImpl.class));
+ new DmaapClientProvider(notificationService, "http://localhost", "username", "password");
+ verify(notificationService, times(1))
+ .registerNotificationListener(Mockito.any(NbiNotificationsListenerImpl.class));
}
}
Phosphorus consolidates end to end support for high rate services (ODUC4, OTUC4),
allowing service creation and deletion from the NBI. The support of path
-computation for high rate services (OTUC4) will be added through the different P
+computation for high rate services (OTUC4) has been added through the different P
releases, relying on GNPy for impairment aware path computation. An experimental
support of T-API is provided allowing service-create/delete from a T-API version
2.1.1 compliant NBI. A T-API network topology, with different levels of abstraction
monitoring device port state changes. Associated notifications are handled through
Kafka and DMaaP clients.
-The chlorine release brings structural changes to the project. indeed, all the official
+Sulfur is introducing OpenROADM service and network models 10.1, which include the
+operational-modes catalog, needed for future support of Alien Wavelength use cases.
+It also offers T-API notification support, handling the RPC associated with the
+notification subscription service.
+
+The Chlorine release brings structural changes to the project. indeed, all the official
yang models of the OpenROADM and ONF-TAPI communities are no longer managed directly
in the TransportPCE project but in a dedicated sub-project: transportpce/models.
Also, the implementation of these models which is made in TransportPCE now imports
the models already compiled by maven dependency.
From a functional point of view, Chlorine supports the autonomous reroute of WDM services
terminated on 100G or 400G Transponders, as well as the beginning of developments around
-the OpenROAM catalog management that will allow to support Alien Wavelength use cases.
+the OpenROAM catalog management.
+
+The Argon release provides autonomous impairment aware path computation, relying on
+OpenROADM operational-modes catalog. It is used in a first step of the path validation,
+to evaluate the Optical Signal to Noise Ratio as well as the penalty associated with the
+signal across the calculated pass. Validation of the optical path by GNPy is still
+triggered, in a second step, leveraging advanced calculation of non linear contribution.
Module description
In Silicon release, the management of TopologyUpdateNotification coming from the *Topology Management*
module was implemented. This functionality enables the controller to update the information of existing
services according to the online status of the network infrastructure. If any service is affected by
-the topology update and the *odl-transportpce-nbi* feature is installed, the Service Handler will send a
-notification to a Kafka server with the service update information.
+the topology update and the *odl-transportpce-nbinotifications* feature is installed, the Service
+Handler will send a notification to a Kafka server with the service update information.
PCE
^^^
about current and planned services is available in the MD-SAL data store.
Current implementation of PCE allows finding the shortest path, minimizing either the hop
-count (default) or the propagation delay. Central wavelength is assigned considering a fixed
-grid of 96 wavelengths 50 GHz spaced. The assignment of wavelengths according to a flexible
-grid considering 768 subsequent slots of 6,25 GHz (total spectrum of 4.8 Thz), and their
-occupation by existing services is planned for later releases.
-In Neon SR0, the PCE calculates the OSNR, on the base of incremental noise specifications
-provided in Open ROADM MSA. The support of unidirectional ports is also added.
+count (default) or the propagation delay. The support of a flexible grid was introduced in Aluminium.
+The central wavelength assignment depends on the capabilities of the different devices on the path.
+If one of the elements only supports a fixed grid, the wavelength is assigned considering a grid of
+96 wavelengths 50 GHz spaced. If all the devices on the path support a flexible grid, the assignment
+of wavelengths is done according to a flexible grid considering 768 subsequent slots of 6,25 GHz
+(total spectrum of 4.8 Thz).
-PCE handles the following constraints as hard constraints:
+The PCE module handles the following constraints as hard constraints:
- **Node exclusion**
- **SRLG exclusion**
- **Maximum latency**
-In Magnesium SR0, the interconnection of the PCE with GNPY (Gaussian Noise Python), an
-open-source library developed in the scope of the Telecom Infra Project for building route
-planning and optimizing performance in optical mesh networks, is fully supported. Impairment
-aware path computation for service of higher rates (Beyond 100G) is planned across Phoshorus
-releases. It implies to make B100G OpenROADM specifications available in GNPy libraries.
-
-If the OSNR calculated by the PCE is too close to the limit defined in OpenROADM
-specifications, the PCE forwards through a REST interface to GNPY external tool the topology
-and the pre-computed path translated in routing constraints. GNPy calculates a set of Quality of
-Transmission metrics for this path using its own library which includes models for OpenROADM.
-The result is sent back to the PCE. If the path is validated, the PCE sends back a response to
-the service handler. In case of invalidation of the path by GNPY, the PCE sends a new request to
-GNPY, including only the constraints expressed in the path-computation-request initiated by the
-Service Handler. GNPy then tries to calculate a path based on these relaxed constraints. The
-result of the path computation is provided to the PCE which translates the path according to the
-topology handled in transportPCE and forwards the results to the Service Handler.
-
-GNPy relies on SNR and takes into account the linear and non-linear impairments
-to check feasibility. In the related tests, GNPy module runs externally in a
-docker and the communication with T-PCE is ensured via HTTPs.
+In Neon SR0, the PCE calculates the OSNR, on the base of incremental noise specifications provided
+in Open ROADM MSA. The support of unidirectional ports is also added. The interconnection of the PCE
+with GNPY (Gaussian Noise Python), an open-source library developed in the scope of the Telecom Infra
+Project for building route planning and optimizing performance in optical mesh networks, is supported
+since Magnesium SR0. This allowed introducing impairment aware path computation for (Beyond 100G)
+services across Phoshorus releases.
+
+In Argon, we introduce autonomous impairment aware path computation, leveraging OpenROADM yang
+specification catalog (R10.1), which translates the optical specifications provided in the MSA into
+models understandable by the controller. To each disaggregated element crossed along the path
+(Transponders, ROADM add/drop modules and degrees), is associated an operational mode, for which each
+physical parameters is described in the catalog. This allows evaluating the degradations that each
+element, whether it is a device of fiber span, brings to the signal transmission. The resulting
+Optical Signal to Noise Ratio is calculated, as well as the penalties associated with the cumulated
+chromatic dispersion, Polarisation Mode Dispersion (PMD), Polarization Dependant Loss (PDL)… and the
+non-linear contribution is evaluated.
+
+All of this is done in accordance with OpenROADM optical specifications. Handling OpenROADM specification
+catalogs improves the upgradability of the code, since the future evolution of the specifications only
+implies to add new operational modes to the catalog while the associated code remains unchanged.
+
+In Argon SR0, to benefit from this new functionality, the specification catalog must be manually loaded
+into the data store. The catalog includes 2 different parts, the first being dedicated to the
+translation of OpenROADM specifications, the second (optional) being dedicated to specific operational
+modes for transponders used in “bookended” mode (same transponders on both ends of the path). The
+automatic filling of the first part of the catalog is planned in Ar SR1. In this release will also be
+supported the 2 RPCs used to fill the different parts of the catalog :
+- **add-openroadm-operational-mode-to-catalog**
+- **add-specific-operational-mode-to-catalog**
+
+Autonomous impairment aware path computation is triggered in Argon for any path at the WDM layer,
+whatever is the service rate. The transmission margin is evaluated in both direction and the result is
+provided in INFO Logs. GNPy is used in a second step to enforce path validation. Indeed, it gives
+complementary information to the calculation made from OpenROADM specifications, with a finer assessment
+of non-linear contribution, and potentially a consideration of the interaction with other channels
+already provisioned on the network. This last capability will be added across Argon releases.
+The PCE forwards through a REST interface to GNPY external tool the topology and the pre-computed path
+translated in routing constraints. GNPy calculates a set of Quality of Transmission metrics for this path
+using its own library which includes models for OpenROADM. The result is sent back to the PCE. If the
+path is validated, the PCE sends back a response to the service handler. In case of invalidation of the
+path by GNPY, the PCE sends a new request to GNPY, including only the constraints expressed in the
+path-computation-request initiated by the Service Handler. GNPy then tries to calculate a path based on
+these relaxed constraints. The result of the path computation is provided to the PCE which translates
+the path according to the topology handled in transportPCE and forwards the results to the Service
+Handler.
+
+GNPy relies on SNR and takes into account the linear and non-linear impairments to check feasibility.
+In the related tests, GNPy module runs externally in a docker and the communication with T-PCE is
+ensured via HTTPs.
Topology Management
^^^^^^^^^^^^^^^^^^^
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>features-transportpce</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: TransportPCE :: Features</name>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-dmaap-client</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce :: dmaap-client</name>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-inventory</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce :: Inventory</name>
<properties>
<mdsal.version>11.0.7</mdsal.version>
- <netconf.version>5.0.3</netconf.version>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <netconf.version>5.0.4</netconf.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
<transportpce.db.host>localhost:3306</transportpce.db.host>
<transportpce.db.database>transportpce</transportpce.db.database>
<transportpce.db.username>root</transportpce.db.username>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-nbinotifications</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce :: nbinotifications</name>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-swagger</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce :: swagger</name>
<properties>
- <netconf.version>5.0.3</netconf.version>
+ <netconf.version>5.0.4</netconf.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
<skip.karaf.featureTest>false</skip.karaf.featureTest>
</properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-tapi</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce :: tapi</name>
<properties>
<mdsal.version>11.0.7</mdsal.version>
- <netconf.version>5.0.3</netconf.version>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <netconf.version>5.0.4</netconf.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
<skip.karaf.featureTest>false</skip.karaf.featureTest>
</properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce</name>
<properties>
- <netconf.version>5.0.3</netconf.version>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <netconf.version>5.0.4</netconf.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
<skip.karaf.featureTest>false</skip.karaf.featureTest>
</properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>features-aggregator</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-inventory</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>5.0.3</version>
+ <version>5.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>sal-netconf-connector</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.component.annotations</artifactId>
+ </dependency>
</dependencies>
<build>
import java.util.concurrent.ExecutionException;
import java.util.regex.Pattern;
import javax.sql.DataSource;
-import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private final DataSource dataSource;
private final INode inode;
- private final DeviceTransactionManager deviceTransactionManager;
- public DeviceInventory(DataSource dataSource, INode inode,
- DeviceTransactionManager deviceTransactionManager) {
+ public DeviceInventory(DataSource dataSource, INode inode) {
this.dataSource = dataSource;
this.inode = inode;
- this.deviceTransactionManager = deviceTransactionManager;
}
public void init() {
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.DataSource;
-import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(INode.class);
private final DataSource dataSource;
- private final DeviceTransactionManager deviceTransactionManager;
//private final INode221 inode221;
private final INode121 inode121;
- public INode(DataSource dataSource, DeviceTransactionManager deviceTransactionManager,
- INode121 inode121
+ public INode(DataSource dataSource, INode121 inode121
//, INode221 inode221
) {
this.dataSource = dataSource;
- this.deviceTransactionManager = deviceTransactionManager;
this.inode121 = inode121;
//this.inode221 = inode221;
}
*/
package org.opendaylight.transportpce.inventory;
+import java.util.ArrayList;
+import java.util.List;
+import javax.sql.DataSource;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.transportpce.common.InstanceIdentifiers;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.inventory.listener.ClliNetworkChangeListener;
import org.opendaylight.transportpce.inventory.listener.DeviceConfigListener;
import org.opendaylight.transportpce.inventory.listener.DeviceListener;
import org.opendaylight.transportpce.inventory.listener.OverlayNetworkChangeListener;
import org.opendaylight.transportpce.inventory.listener.UnderlayNetworkChangeListener;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+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.Deactivate;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* {@link ListenerProvider} registers {@link DataTreeChangeListener} for each network layer.
*/
+@Component
public class ListenerProvider {
private static final Logger LOG = LoggerFactory.getLogger(ListenerProvider.class);
-
- private final DataBroker dataBroker;
- private final OverlayNetworkChangeListener overlayNetworkListener;
- private final UnderlayNetworkChangeListener underlayNetworkListener;
- private final ClliNetworkChangeListener clliNetworkChangeListener;
- private final DeviceListener deviceListener;
- private final DeviceConfigListener deviceConfigListener;
+ private List<Registration> listeners = new ArrayList<>();
/**
* Constructor invoked by blueprint injects all dependencies.
*
* @param dataBroker dataBroker
- * @param overlayNetworkListener overlay-network Listener
- * @param underlayNetworkListener underlay-network Listener
- * @param clliNetworkChangeListener clli Network change Listener
- * @param deviceListener device listener
- * @param deviceConfigListener device config listener
+ * @param dataSource dataSource
+ * @param deviceTransactionManager deviceTransactionManager
*/
- public ListenerProvider(DataBroker dataBroker, OverlayNetworkChangeListener overlayNetworkListener,
- UnderlayNetworkChangeListener underlayNetworkListener, ClliNetworkChangeListener clliNetworkChangeListener,
- DeviceListener deviceListener, DeviceConfigListener deviceConfigListener) {
-
- this.dataBroker = dataBroker;
- this.overlayNetworkListener = overlayNetworkListener;
- this.underlayNetworkListener = underlayNetworkListener;
- this.clliNetworkChangeListener = clliNetworkChangeListener;
- this.deviceListener = deviceListener;
- this.deviceConfigListener = deviceConfigListener;
- }
+ @Activate
+ public ListenerProvider(@Reference DataBroker dataBroker,
+ @Reference DataSource dataSource,
+ @Reference DeviceTransactionManager deviceTransactionManager) {
- /**
- * Invoked by blueprint, registers the listeners.
- */
- public void initialize() {
LOG.debug("Registering listeners...");
- dataBroker.registerDataTreeChangeListener(
+ OverlayNetworkChangeListener overlayNetworkListener = new OverlayNetworkChangeListener();
+ listeners.add(dataBroker.registerDataTreeChangeListener(
DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, InstanceIdentifiers.OVERLAY_NETWORK_II),
- overlayNetworkListener);
+ overlayNetworkListener));
LOG.info("Overlay network change listener was successfully registered");
- dataBroker.registerDataTreeChangeListener(
+ UnderlayNetworkChangeListener underlayNetworkListener = new UnderlayNetworkChangeListener();
+ listeners.add(dataBroker.registerDataTreeChangeListener(
DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, InstanceIdentifiers.UNDERLAY_NETWORK_II),
- underlayNetworkListener);
+ underlayNetworkListener));
LOG.info("Underlay network change listener was successfully registered");
- dataBroker.registerDataTreeChangeListener(
+ ClliNetworkChangeListener clliNetworkChangeListener = new ClliNetworkChangeListener();
+ listeners.add(dataBroker.registerDataTreeChangeListener(
DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, InstanceIdentifiers.CLLI_NETWORK_II),
- clliNetworkChangeListener);
+ clliNetworkChangeListener));
LOG.info("CLLI network change listener was successfully registered");
- dataBroker.registerDataTreeChangeListener(
+ INode121 inode121 = new INode121(dataSource, deviceTransactionManager);
+ INode inode = new INode(dataSource, inode121);
+ DeviceInventory deviceInventory = new DeviceInventory(dataSource, inode);
+ DeviceListener deviceListener = new DeviceListener(deviceInventory);
+ listeners.add(dataBroker.registerDataTreeChangeListener(
DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
- InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), deviceListener);
+ InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), deviceListener));
LOG.info("Device change listener was successfully registered");
- dataBroker.registerDataTreeChangeListener(
+ DeviceConfigListener deviceConfigListener = new DeviceConfigListener(deviceInventory);
+ listeners.add(dataBroker.registerDataTreeChangeListener(
DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
- InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), deviceConfigListener);
+ InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), deviceConfigListener));
LOG.info("Device config change listener was successfully registered");
}
+ @Deactivate
+ public void close() {
+ listeners.forEach(lis -> lis.close());
+ listeners.clear();
+ }
}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!-- Copyright © 2016 Orange 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 -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-
- <reference id="dataBroker" interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
- <reference id="dataSource" interface="javax.sql.DataSource"/>
- <reference id="deviceTransactionManager"
- interface="org.opendaylight.transportpce.common.device.DeviceTransactionManager"/>
-
- <bean id="deviceInventory" class="org.opendaylight.transportpce.inventory.DeviceInventory">
- <argument ref="dataSource"/>
- <argument ref="iNodeImpl"/>
- <argument ref="deviceTransactionManager"/>
- </bean>
-
- <bean id="iNode121" class="org.opendaylight.transportpce.inventory.INode121">
- <argument ref="dataSource"/>
- <argument ref="deviceTransactionManager"/>
- </bean>
-
- <bean id="iNodeImpl" class="org.opendaylight.transportpce.inventory.INode">
- <argument ref="dataSource"/>
- <argument ref="deviceTransactionManager"/>
- <argument ref="iNode121"/>
-
- </bean>
-
- <bean id="overlayNetworkChangeListener"
- class="org.opendaylight.transportpce.inventory.listener.OverlayNetworkChangeListener"/>
- <bean id="underlayNetworkChangeListener"
- class="org.opendaylight.transportpce.inventory.listener.UnderlayNetworkChangeListener"/>
- <bean id="clliNetworkChangeListener"
- class="org.opendaylight.transportpce.inventory.listener.ClliNetworkChangeListener"/>
-
- <bean id="deviceListener" class="org.opendaylight.transportpce.inventory.listener.DeviceListener">
- <argument ref="deviceInventory"/>
- </bean>
-
- <bean id="deviceConfigListener" class="org.opendaylight.transportpce.inventory.listener.DeviceConfigListener">
- <argument ref="deviceInventory"/>
- </bean>
-
- <bean id="listenerProvider" class="org.opendaylight.transportpce.inventory.ListenerProvider"
- init-method="initialize">
- <argument ref="dataBroker"/>
- <argument ref="overlayNetworkChangeListener"/>
- <argument ref="underlayNetworkChangeListener"/>
- <argument ref="clliNetworkChangeListener"/>
- <argument ref="deviceListener"/>
- <argument ref="deviceConfigListener"/>
- </bean>
-
-</blueprint>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-karaf</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<groupId>io.lighty.controllers</groupId>
<artifactId>tpce</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<application.main.class>io.lighty.controllers.tpce.Main</application.main.class>
<application.attach.zip>true</application.attach.zip>
<maven.deploy.skip>true</maven.deploy.skip>
- <transportpce.version>7.0.0-SNAPSHOT</transportpce.version>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.version>7.0.1-SNAPSHOT</transportpce.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
import io.lighty.core.controller.api.AbstractLightyModule;
import io.lighty.core.controller.api.LightyServices;
-import java.util.Arrays;
-import java.util.List;
-import org.opendaylight.mdsal.binding.api.NotificationService;
import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
import org.opendaylight.transportpce.nbinotifications.impl.NbiNotificationsProvider;
import org.opendaylight.transportpce.networkmodel.NetConfTopologyListener;
import org.opendaylight.transportpce.networkmodel.NetworkModelProvider;
-import org.opendaylight.transportpce.networkmodel.NetworkUtilsImpl;
-import org.opendaylight.transportpce.networkmodel.R2RLinkDiscovery;
import org.opendaylight.transportpce.networkmodel.listeners.PortMappingListener;
import org.opendaylight.transportpce.networkmodel.service.FrequenciesService;
import org.opendaylight.transportpce.networkmodel.service.FrequenciesServiceImpl;
import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperationsImpl;
import org.opendaylight.transportpce.renderer.rpcs.DeviceRendererRPCImpl;
+import org.opendaylight.transportpce.renderer.rpcs.TransportPCEServicePathRPCImpl;
import org.opendaylight.transportpce.servicehandler.impl.ServicehandlerImpl;
import org.opendaylight.transportpce.servicehandler.impl.ServicehandlerProvider;
import org.opendaylight.transportpce.servicehandler.listeners.NetworkModelListenerImpl;
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.R2RTapiLinkDiscovery;
import org.opendaylight.transportpce.tapi.impl.TapiProvider;
import org.opendaylight.transportpce.tapi.listeners.TapiNetworkModelListenerImpl;
-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.topology.TapiNetconfTopologyListener;
import org.opendaylight.transportpce.tapi.topology.TapiNetworkModelService;
import org.opendaylight.transportpce.tapi.topology.TapiNetworkModelServiceImpl;
import org.opendaylight.transportpce.tapi.topology.TapiNetworkUtilsImpl;
-import org.opendaylight.transportpce.tapi.topology.TapiOrLinkListener;
-import org.opendaylight.transportpce.tapi.topology.TapiPortMappingListener;
import org.opendaylight.transportpce.tapi.utils.TapiLink;
-import org.opendaylight.transportpce.tapi.utils.TapiListener;
+import org.opendaylight.transportpce.tapi.utils.TapiLinkImpl;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.TransportpceOlmService;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.TransportpceRendererService;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.tapinetworkutils.rev210408.TransportpceTapinetworkutilsService;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.OrgOpenroadmServiceService;
import org.slf4j.Logger;
private TapiProvider tapiProvider;
// nbi-notifications beans
private NbiNotificationsProvider nbiNotificationsProvider;
- /**
- * List of publisher topics.
- */
- private final List<String> publisherServiceList = Arrays.asList("PceListener", "ServiceHandlerOperations",
- "ServiceHandler", "RendererListener");
- private final List<String> publisherAlarmList = Arrays.asList("ServiceListener");
public TransportPCEImpl(LightyServices lightyServices, boolean activateNbiNotification, boolean activateTapi,
String olmtimer1, String olmtimer2) {
networkTransaction = new NetworkTransactionImpl(lightyServices.getBindingDataBroker());
LOG.info("Creating network-model beans ...");
- R2RLinkDiscovery linkDiscoveryImpl = new R2RLinkDiscovery(lightyServices.getBindingDataBroker(),
- deviceTransactionManager, networkTransaction);
PortMapping portMapping = initPortMapping(lightyServices);
NetworkModelService networkModelService = new NetworkModelServiceImpl(lightyServices.getBindingDataBroker(),
deviceTransactionManager, networkTransaction, portMapping,
lightyServices.getBindingNotificationPublishService(), serviceDataStoreOperations);
NetworkModelListenerImpl networkModelListenerImpl = new NetworkModelListenerImpl(
lightyServices.getBindingNotificationPublishService(), serviceDataStoreOperations);
- ServicehandlerImpl servicehandler = new ServicehandlerImpl(lightyServices.getBindingDataBroker(),
- pathComputationService, rendererServiceOperations, lightyServices.getBindingNotificationPublishService(),
- pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, serviceDataStoreOperations);
+ ServicehandlerImpl servicehandler = new ServicehandlerImpl(pathComputationService, rendererServiceOperations,
+ lightyServices.getBindingNotificationPublishService(), pceListenerImpl, rendererListenerImpl,
+ networkModelListenerImpl, serviceDataStoreOperations);
ServiceListener serviceListener = new ServiceListener(servicehandler, serviceDataStoreOperations,
lightyServices.getBindingNotificationPublishService());
servicehandlerProvider = new ServicehandlerProvider(lightyServices.getBindingDataBroker(),
lightyServices.getRpcProviderService(), lightyServices.getNotificationService(),
- serviceDataStoreOperations, pceListenerImpl, serviceListener, rendererListenerImpl,
- networkModelListenerImpl, servicehandler);
+ serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
+ lightyServices.getBindingNotificationPublishService(), servicehandler, serviceListener);
if (activateTapi) {
LOG.info("Creating tapi beans ...");
- TapiLink tapiLink = new TapiLink(networkTransaction);
- R2RTapiLinkDiscovery tapilinkDiscoveryImpl = new R2RTapiLinkDiscovery(networkTransaction,
- deviceTransactionManager, tapiLink);
- TapiRendererListenerImpl tapiRendererListenerImpl = new TapiRendererListenerImpl(lightyServices
- .getBindingDataBroker(), lightyServices.getBindingNotificationPublishService());
- TapiPceListenerImpl tapiPceListenerImpl = new TapiPceListenerImpl(lightyServices.getBindingDataBroker());
- TapiServiceHandlerListenerImpl tapiServiceHandlerListener = new TapiServiceHandlerListenerImpl(
- lightyServices.getBindingDataBroker());
- TransportpceTapinetworkutilsService tapiNetworkutilsServiceImpl = new TapiNetworkUtilsImpl(
- networkTransaction, tapiLink);
- TapiNetworkModelService tapiNetworkModelService = new TapiNetworkModelServiceImpl(
- tapilinkDiscoveryImpl, networkTransaction, tapiLink,
- lightyServices.getBindingNotificationPublishService());
- TapiNetconfTopologyListener tapiNetConfTopologyListener =
- new TapiNetconfTopologyListener(tapiNetworkModelService);
- TapiOrLinkListener orLinkListener = new TapiOrLinkListener(tapiLink, networkTransaction);
- TapiPortMappingListener tapiPortMappingListener =
- new TapiPortMappingListener(tapiNetworkModelService);
+ TapiLink tapiLink = new TapiLinkImpl(networkTransaction);
+ new TapiNetworkUtilsImpl(networkTransaction, tapiLink);
+ TapiNetworkModelService tapiNetworkModelService = new TapiNetworkModelServiceImpl(networkTransaction,
+ deviceTransactionManager, tapiLink, lightyServices.getBindingNotificationPublishService());
TapiNetworkModelListenerImpl tapiNetworkModelListenerImpl =
new TapiNetworkModelListenerImpl(networkTransaction,
lightyServices.getBindingNotificationPublishService());
tapiProvider = initTapi(lightyServices, servicehandler, networkTransaction, serviceDataStoreOperations,
- tapiNetConfTopologyListener, tapiPortMappingListener, tapiNetworkutilsServiceImpl,
- tapiPceListenerImpl, tapiRendererListenerImpl, tapiServiceHandlerListener,
- lightyServices.getNotificationService(), orLinkListener, tapiNetworkModelListenerImpl);
+ tapiNetworkModelListenerImpl, tapiLink, tapiNetworkModelService);
+
}
if (activateNbiNotification) {
LOG.info("Creating nbi-notifications beans ...");
nbiNotificationsProvider = new NbiNotificationsProvider(
- publisherServiceList, publisherAlarmList, null, null, lightyServices.getRpcProviderService(),
+ null, null, lightyServices.getRpcProviderService(),
lightyServices.getNotificationService(), lightyServices.getAdapterContext().currentSerializer(),
networkTransaction);
}
@Override
protected boolean initProcedure() {
- LOG.info("Initializing service-handler provider ...");
- servicehandlerProvider.init();
if (tapiProvider != null) {
LOG.info("Initializing tapi provider ...");
- tapiProvider.init();
}
if (nbiNotificationsProvider != null) {
LOG.info("Initializing nbi-notifications provider ...");
- nbiNotificationsProvider.init();
}
LOG.info("Init done.");
return true;
private TapiProvider initTapi(LightyServices lightyServices, OrgOpenroadmServiceService servicehandler,
NetworkTransactionService networkTransactionService,
ServiceDataStoreOperations serviceDataStoreOperations,
- TapiNetconfTopologyListener tapiNetConfTopologyListener,
- TapiPortMappingListener tapiPortMappingListener,
- TransportpceTapinetworkutilsService tapiNetworkutilsServiceImpl,
- TapiPceListenerImpl pceListenerImpl, TapiRendererListenerImpl rendererListenerImpl,
- TapiServiceHandlerListenerImpl serviceHandlerListenerImpl,
- NotificationService notificationService, TapiOrLinkListener orLinkListener,
- TapiNetworkModelListenerImpl tapiNetworkModelListenerImpl) {
+ TapiNetworkModelListenerImpl tapiNetworkModelListenerImpl,
+ TapiLink tapiLink, TapiNetworkModelService tapiNetworkModelService) {
+ TransportpceTapinetworkutilsService tapiNetworkUtils = new TapiNetworkUtilsImpl(networkTransactionService,
+ tapiLink);
return new TapiProvider(lightyServices.getBindingDataBroker(), lightyServices.getRpcProviderService(),
- servicehandler, serviceDataStoreOperations, new TapiListener(), networkTransactionService,
- tapiNetConfTopologyListener, tapiPortMappingListener, tapiNetworkutilsServiceImpl, pceListenerImpl,
- rendererListenerImpl, serviceHandlerListenerImpl, notificationService, orLinkListener,
- tapiNetworkModelListenerImpl);
+ lightyServices.getNotificationService(), lightyServices.getBindingNotificationPublishService(),
+ networkTransactionService, servicehandler, serviceDataStoreOperations, tapiNetworkUtils,
+ tapiNetworkModelListenerImpl, tapiNetworkModelService);
}
private RendererProvider initRenderer(LightyServices lightyServices, TransportpceOlmService olmPowerServiceRpc,
lightyServices.getBindingDataBroker(), lightyServices.getBindingNotificationPublishService(),
portMapping);
return new RendererProvider(lightyServices.getRpcProviderService(), deviceRendererService,
- otnDeviceRendererService, rendererServiceOperations);
+ otnDeviceRendererService, deviceRendererRPC,
+ new TransportPCEServicePathRPCImpl(rendererServiceOperations));
}
private OpenRoadmInterfaceFactory initOpenRoadmFactory(MappingUtils mappingUtils,
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-nbinotifications</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
<kafka.version>3.0.0</kafka.version>
</properties>
<artifactId>kafka-clients</artifactId>
<version>${kafka.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.component.annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.metatype.annotations</artifactId>
+ </dependency>
<!-- Testing Dependencies -->
<dependency>
*/
package org.opendaylight.transportpce.nbinotifications.impl;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.TapiNotificationService;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Component(configurationPid = "org.opendaylight.transportpce.nbinotifications")
public class NbiNotificationsProvider {
+ @ObjectClassDefinition
+ public @interface Configuration {
+ @AttributeDefinition
+ String suscriberServer() default "";
+ @AttributeDefinition
+ String publisherServer() default "";
+ }
+
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 final RpcProviderService rpcService;
- private final NotificationService notificationService;
- private final JsonStringConverter<NotificationProcessService> converterService;
- private final JsonStringConverter<NotificationAlarmService> converterAlarmService;
- private final JsonStringConverter<NotificationTapiService> converterTapiService;
- private final String subscriberServer;
- private ObjectRegistration<NbiNotificationsService> rpcRegistration;
private ListenerRegistration<NbiNotificationsListener> listenerRegistration;
- private TopicManager topicManager = TopicManager.getInstance();
- private final NetworkTransactionService networkTransactionService;
+ private List<ObjectRegistration<NbiNotificationsImpl>> rpcRegistrations = new ArrayList<>();
+ @Activate
+ public NbiNotificationsProvider(@Reference RpcProviderService rpcProviderService,
+ @Reference NotificationService notificationService,
+ @Reference BindingDOMCodecServices bindingDOMCodecServices,
+ @Reference NetworkTransactionService networkTransactionService,
+ final Configuration configuration) {
+ this(configuration.suscriberServer(), configuration.publisherServer(), rpcProviderService, notificationService,
+ bindingDOMCodecServices, networkTransactionService);
+ }
- public NbiNotificationsProvider(List<String> publishersService, List<String> publishersAlarm,
- String subscriberServer, String publisherServer,
- RpcProviderService rpcProviderService, NotificationService notificationService,
- BindingDOMCodecServices bindingDOMCodecServices,
- NetworkTransactionService networkTransactionService) {
- this.rpcService = rpcProviderService;
- this.notificationService = notificationService;
- this.topicManager.setPublisherServer(publisherServer);
- converterService = new JsonStringConverter<>(bindingDOMCodecServices);
- this.topicManager.setProcessConverter(converterService);
- for (String publisherService: publishersService) {
+ public NbiNotificationsProvider(String subscriberServer, String publisherServer,
+ RpcProviderService rpcProviderService, NotificationService notificationService,
+ BindingDOMCodecServices bindingDOMCodecServices, NetworkTransactionService networkTransactionService) {
+ List<String> publishersServiceList = List.of("PceListener", "ServiceHandlerOperations", "ServiceHandler",
+ "RendererListener");
+ TopicManager topicManager = TopicManager.getInstance();
+ topicManager.setPublisherServer(publisherServer);
+ JsonStringConverter<NotificationProcessService> converterService =
+ new JsonStringConverter<>(bindingDOMCodecServices);
+ topicManager.setProcessConverter(converterService);
+ for (String publisherService: publishersServiceList) {
LOG.info("Creating publisher for the following class {}", publisherService);
- this.topicManager.addProcessTopic(publisherService);
+ topicManager.addProcessTopic(publisherService);
}
- converterAlarmService = new JsonStringConverter<>(bindingDOMCodecServices);
- this.topicManager.setAlarmConverter(converterAlarmService);
- for (String publisherAlarm: publishersAlarm) {
+ JsonStringConverter<NotificationAlarmService> converterAlarmService =
+ new JsonStringConverter<>(bindingDOMCodecServices);
+ topicManager.setAlarmConverter(converterAlarmService);
+ List<String> publishersAlarmList = List.of("ServiceListener");
+ for (String publisherAlarm: publishersAlarmList) {
LOG.info("Creating publisher for the following class {}", publisherAlarm);
- this.topicManager.addAlarmTopic(publisherAlarm);
+ topicManager.addAlarmTopic(publisherAlarm);
}
- this.subscriberServer = subscriberServer;
- converterTapiService = new JsonStringConverter<>(bindingDOMCodecServices);
+ JsonStringConverter<NotificationTapiService> converterTapiService =
+ new JsonStringConverter<>(bindingDOMCodecServices);
LOG.info("baozhi tapi converter: {}", converterTapiService);
- this.topicManager.setTapiConverter(converterTapiService);
- this.networkTransactionService = networkTransactionService;
- }
+ topicManager.setTapiConverter(converterTapiService);
- /**
- * Method called when the blueprint container is created.
- */
- public void init() {
- LOG.info("NbiNotificationsProvider Session Initiated");
NbiNotificationsImpl nbiImpl = new NbiNotificationsImpl(converterService, converterAlarmService,
- converterTapiService, subscriberServer, this.networkTransactionService, this.topicManager);
- rpcRegistration = rpcService.registerRpcImplementation(NbiNotificationsService.class, nbiImpl);
- rpcService.registerRpcImplementation(TapiNotificationService.class, nbiImpl);
- NbiNotificationsListenerImpl nbiNotificationsListener =
- new NbiNotificationsListenerImpl(this.topicManager.getProcessTopicMap(),
- this.topicManager.getAlarmTopicMap(), this.topicManager.getTapiTopicMap());
+ converterTapiService, subscriberServer, networkTransactionService, topicManager);
+ rpcRegistrations.add(rpcProviderService.registerRpcImplementation(NbiNotificationsService.class, nbiImpl));
+ rpcRegistrations.add(rpcProviderService.registerRpcImplementation(TapiNotificationService.class, nbiImpl));
+ NbiNotificationsListenerImpl nbiNotificationsListener = new NbiNotificationsListenerImpl(
+ topicManager.getProcessTopicMap(), topicManager.getAlarmTopicMap(), topicManager.getTapiTopicMap());
listenerRegistration = notificationService.registerNotificationListener(nbiNotificationsListener);
- this.topicManager.setNbiNotificationsListener(nbiNotificationsListener);
+ topicManager.setNbiNotificationsListener(nbiNotificationsListener);
+ LOG.info("NbiNotificationsProvider Session Initiated");
}
/**
* Method called when the blueprint container is destroyed.
*/
+ @Deactivate
public void close() {
for (Publisher<NotificationProcessService> publisher : publishersServiceMap.values()) {
publisher.close();
for (Publisher<NotificationAlarmService> publisherAlarm : publishersAlarmMap.values()) {
publisherAlarm.close();
}
- rpcRegistration.close();
+ rpcRegistrations.forEach(reg -> reg.close());
listenerRegistration.close();
LOG.info("NbiNotificationsProvider Closed");
}
-
}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!-- Copyright © 2020 Orange 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 -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">
- <cm:property-placeholder persistent-id="org.opendaylight.transportpce.nbinotifications" update-strategy="reload">
- <cm:default-properties>
- <cm:property name="suscriber.server" value="" />
- <cm:property name="publisher.server" value="" />
- </cm:default-properties>
- </cm:property-placeholder>
- <reference id="rpcService" interface="org.opendaylight.mdsal.binding.api.RpcProviderService"/>
- <reference id="notificationService" interface="org.opendaylight.mdsal.binding.api.NotificationService"/>
- <reference id="bindingDOMCodecServices" interface="org.opendaylight.mdsal.binding.dom.codec.spi.BindingDOMCodecServices" />
- <reference id="networkTransactionImpl"
- interface="org.opendaylight.transportpce.common.network.NetworkTransactionService" />
- <bean id="provider"
- class="org.opendaylight.transportpce.nbinotifications.impl.NbiNotificationsProvider"
- init-method="init" destroy-method="close">
- <argument>
- <list value-type="java.lang.String">
- <value>PceListener</value>
- <value>ServiceHandlerOperations</value>
- <value>ServiceHandler</value>
- <value>RendererListener</value>
- </list>
- </argument>
- <argument>
- <list value-type="java.lang.String">
- <value>ServiceListener</value>
- </list>
- </argument>
- <argument value="${suscriber.server}"/>
- <argument value="${publisher.server}"/>
- <argument ref="rpcService" />
- <argument ref="notificationService" />
- <argument ref="bindingDOMCodecServices" />
- <argument ref="networkTransactionImpl" />
- </bean>
-</blueprint>
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import java.util.Arrays;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
@Mock
RpcProviderService rpcProviderRegistry;
-
@Mock
private NotificationService notificationService;
@Test
void initTest() {
networkTransactionService = new NetworkTransactionImpl(getDataBroker());
- NbiNotificationsProvider provider = new NbiNotificationsProvider(
- Arrays.asList("topic1", "topic2"), Arrays.asList("topic1", "topic2"), "localhost:8080",
- "localhost:8080", rpcProviderRegistry, notificationService,
- getDataStoreContextUtil().getBindingDOMCodecServices(), networkTransactionService);
- provider.init();
+ NbiNotificationsProvider provider = new NbiNotificationsProvider("localhost:8080", "localhost:8080",
+ rpcProviderRegistry, notificationService, getDataStoreContextUtil().getBindingDOMCodecServices(),
+ networkTransactionService);
verify(rpcProviderRegistry, times(2))
.registerRpcImplementation(any(), any(NbiNotificationsImpl.class));
verify(notificationService, times(1))
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-networkmodel</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>5.0.3</version>
+ <version>5.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
*/
package org.opendaylight.transportpce.networkmodel;
+import java.util.ArrayList;
+import java.util.List;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
private final RpcProviderService rpcProviderService;
private final TransportpceNetworkutilsService networkutilsService;
private final NetConfTopologyListener topologyListener;
- private ListenerRegistration<NetConfTopologyListener> dataTreeChangeListenerRegistration;
- private ListenerRegistration<PortMappingListener> mappingListenerRegistration;
+ private List<Registration> listeners;
private @NonNull Registration networkutilsServiceRpcRegistration;
private TpceNetwork tpceNetwork;
private ListenerRegistration<TransportpceServicehandlerListener> serviceHandlerListenerRegistration;
this.rpcProviderService = rpcProviderService;
this.notificationService = notificationService;
this.frequenciesService = frequenciesService;
+ this.listeners = new ArrayList<>();
this.networkutilsService = new NetworkUtilsImpl(dataBroker);
this.topologyListener = new NetConfTopologyListener(networkModelService, dataBroker, deviceTransactionManager,
portMapping);
tpceNetwork.createLayer(NetworkUtils.UNDERLAY_NETWORK_ID);
tpceNetwork.createLayer(NetworkUtils.OVERLAY_NETWORK_ID);
tpceNetwork.createLayer(NetworkUtils.OTN_NETWORK_ID);
- dataTreeChangeListenerRegistration = dataBroker.registerDataTreeChangeListener(
+ listeners.add(dataBroker.registerDataTreeChangeListener(
DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
- InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), topologyListener);
- mappingListenerRegistration = dataBroker.registerDataTreeChangeListener(
- DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, MAPPING_II), portMappingListener);
+ InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), topologyListener));
+ listeners.add(dataBroker.registerDataTreeChangeListener(
+ DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, MAPPING_II), portMappingListener));
networkutilsServiceRpcRegistration = rpcProviderService
.registerRpcImplementation(TransportpceNetworkutilsService.class, networkutilsService);
TransportpceServicehandlerListener serviceHandlerListner = new ServiceHandlerListener(frequenciesService);
@Deactivate
public void close() {
LOG.info("NetworkModelProvider Closed");
- if (dataTreeChangeListenerRegistration != null) {
- dataTreeChangeListenerRegistration.close();
- }
- if (mappingListenerRegistration != null) {
- mappingListenerRegistration.close();
- }
+ listeners.forEach(lis -> lis.close());
+ listeners.clear();
if (networkutilsServiceRpcRegistration != null) {
networkutilsServiceRpcRegistration.close();
}
import org.mockito.invocation.InvocationOnMock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.mockito.stubbing.Answer;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.NotificationService;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.transportpce.common.network.NetworkTransactionService;
import org.opendaylight.transportpce.networkmodel.service.FrequenciesService;
import org.opendaylight.transportpce.networkmodel.service.NetworkModelService;
-import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev220630.TransportpceNetworkutilsService;
@ExtendWith(MockitoExtension.class)
-public class NetworkModelProviderTest extends AbstractTest {
+public class NetworkModelProviderTest {
@Mock
NetworkTransactionService networkTransactionService;
@Mock
+ DataBroker dataBroker;
+ @Mock
RpcProviderService rpcProviderService;
@Mock
NetworkModelService networkModelService;
};
when(networkTransactionService.commit()).then(answer);
- new NetworkModelProvider(networkTransactionService, getDataBroker(),
- rpcProviderService, networkModelService, deviceTransactionManager, portMapping, notificationService,
- frequenciesService);
+ new NetworkModelProvider(networkTransactionService, dataBroker, rpcProviderService, networkModelService,
+ deviceTransactionManager, portMapping, notificationService, frequenciesService);
verify(rpcProviderService, times(1))
.registerRpcImplementation(any(), any(TransportpceNetworkutilsService.class));
+ verify(dataBroker, times(2)).registerDataTreeChangeListener(any(), any());
}
}
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-olm</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-pce</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-aggregator</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<name>transportpce</name>
<packaging>pom</packaging>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-renderer</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRendererService;
-import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
-import org.opendaylight.transportpce.renderer.rpcs.DeviceRendererRPCImpl;
-import org.opendaylight.transportpce.renderer.rpcs.TransportPCEServicePathRPCImpl;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.TransportpceDeviceRendererService;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.TransportpceRendererService;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
private static final Logger LOG = LoggerFactory.getLogger(RendererProvider.class);
private final RpcProviderService rpcProviderService;
- private DeviceRendererRPCImpl deviceRendererRPCImpl;
- private TransportPCEServicePathRPCImpl transportPCEServicePathRPCImpl;
- private ObjectRegistration<DeviceRendererRPCImpl> deviceRendererRegistration;
+ private ObjectRegistration<TransportpceDeviceRendererService> deviceRendererRegistration;
private ObjectRegistration<TransportpceRendererService> tpceServiceRegistry;
@Activate
public RendererProvider(@Reference RpcProviderService rpcProviderService,
@Reference DeviceRendererService deviceRenderer,
@Reference OtnDeviceRendererService otnDeviceRendererService,
- @Reference RendererServiceOperations rendererServiceOperations) {
+ @Reference TransportpceDeviceRendererService deviceRendererRPCImpl,
+ @Reference TransportpceRendererService transportPCEServicePathRPCImpl) {
this.rpcProviderService = rpcProviderService;
- this.deviceRendererRPCImpl = new DeviceRendererRPCImpl(deviceRenderer, otnDeviceRendererService);
- this.transportPCEServicePathRPCImpl = new TransportPCEServicePathRPCImpl(rendererServiceOperations);
LOG.info("RendererProvider Session Initiated");
this.deviceRendererRegistration = this.rpcProviderService
.registerRpcImplementation(TransportpceDeviceRendererService.class, deviceRendererRPCImpl);
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.TransportpceDeviceRendererService;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Component(immediate = true)
public class DeviceRendererRPCImpl implements TransportpceDeviceRendererService {
private static final Logger LOG = LoggerFactory.getLogger(DeviceRendererRPCImpl.class);
private DeviceRendererService deviceRenderer;
private OtnDeviceRendererService otnDeviceRendererService;
- public DeviceRendererRPCImpl(DeviceRendererService deviceRenderer,
- OtnDeviceRendererService otnDeviceRendererService) {
+ @Activate
+ public DeviceRendererRPCImpl(@Reference DeviceRendererService deviceRenderer,
+ @Reference OtnDeviceRendererService otnDeviceRendererService) {
this.deviceRenderer = deviceRenderer;
this.otnDeviceRendererService = otnDeviceRendererService;
LOG.debug("DeviceRendererRPCImpl instantiated");
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.ServiceImplementationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.TransportpceRendererService;
import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Component(immediate = true)
public class TransportPCEServicePathRPCImpl implements TransportpceRendererService {
private static final Logger LOG = LoggerFactory.getLogger(TransportPCEServicePathRPCImpl.class);
private final RendererServiceOperations rendererServiceOperations;
- public TransportPCEServicePathRPCImpl(RendererServiceOperations rendererServiceOperations) {
+ @Activate
+ public TransportPCEServicePathRPCImpl(@Reference RendererServiceOperations rendererServiceOperations) {
this.rendererServiceOperations = rendererServiceOperations;
LOG.debug("TransportPCEServicePathRPCImpl instantiated");
}
import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRendererService;
-import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
import org.opendaylight.transportpce.renderer.rpcs.DeviceRendererRPCImpl;
import org.opendaylight.transportpce.renderer.rpcs.TransportPCEServicePathRPCImpl;
import org.opendaylight.transportpce.test.AbstractTest;
@Mock
OtnDeviceRendererService otnDeviceRendererService;
@Mock
- RendererServiceOperations rendererServiceOperations;
+ DeviceRendererRPCImpl deviceRendererRPCImpl;
+ @Mock
+ TransportPCEServicePathRPCImpl transportPCEServicePathRPCImpl;
@Test
void testInitMethodRegistersRendererToRpcService() {
- new RendererProvider(rpcProviderService, deviceRenderer, otnDeviceRendererService, rendererServiceOperations);
+ new RendererProvider(rpcProviderService, deviceRenderer, otnDeviceRendererService, deviceRendererRPCImpl,
+ transportPCEServicePathRPCImpl);
verify(rpcProviderService, times(1))
.registerRpcImplementation(any(), any(TransportPCEServicePathRPCImpl.class));
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-servicehandler</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.component.annotations</artifactId>
+ </dependency>
<!-- Testing Dependencies -->
<dependency>
import java.time.format.DateTimeFormatter;
import java.util.Map;
import java.util.Optional;
-import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.transportpce.common.OperationResult;
import org.opendaylight.transportpce.common.ResponseCodes;
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.listeners.NetworkListener;
+import org.opendaylight.transportpce.servicehandler.listeners.PceListener;
+import org.opendaylight.transportpce.servicehandler.listeners.RendererListener;
import org.opendaylight.transportpce.servicehandler.service.PCEServiceWrapper;
import org.opendaylight.transportpce.servicehandler.service.RendererServiceWrapper;
import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.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.yang.common.RpcResult;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Top level service interface providing main OpenROADM controller services.
*/
+@Component
public class ServicehandlerImpl implements OrgOpenroadmServiceService {
private static final Logger LOG = LoggerFactory.getLogger(ServicehandlerImpl.class);
private static final String PUBLISHER = "ServiceHandler";
private static final String SERVICE_DELETE_MSG = "serviceDelete: {}";
private static final String SERVICE_CREATE_MSG = "serviceCreate: {}";
- private DataBroker db;
private ServiceDataStoreOperations serviceDataStoreOperations;
private PCEServiceWrapper pceServiceWrapper;
private RendererServiceWrapper rendererServiceWrapper;
- private PceListenerImpl pceListenerImpl;
- private RendererListenerImpl rendererListenerImpl;
- private NetworkModelListenerImpl networkModelListenerImpl;
+ private PceListener pceListenerImpl;
+ private RendererListener rendererListenerImpl;
+ private NetworkListener networkModelListenerImpl;
private NotificationPublishService notificationPublishService;
- //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,
- NetworkModelListenerImpl networkModelListenerImpl, ServiceDataStoreOperations serviceDataStoreOperations) {
- this.db = databroker;
+ @Activate
+ public ServicehandlerImpl(@Reference PathComputationService pathComputationService,
+ @Reference RendererServiceOperations rendererServiceOperations,
+ @Reference NotificationPublishService notificationPublishService,
+ @Reference PceListener pceListenerImpl,
+ @Reference RendererListener rendererListenerImpl,
+ @Reference NetworkListener networkModelListenerImpl,
+ @Reference ServiceDataStoreOperations serviceDataStoreOperations) {
this.serviceDataStoreOperations = serviceDataStoreOperations;
+ this.notificationPublishService = notificationPublishService;
this.pceServiceWrapper = new PCEServiceWrapper(pathComputationService, notificationPublishService);
this.rendererServiceWrapper = new RendererServiceWrapper(rendererServiceOperations, notificationPublishService);
this.pceListenerImpl = pceListenerImpl;
this.rendererListenerImpl = rendererListenerImpl;
this.networkModelListenerImpl = networkModelListenerImpl;
- this.notificationPublishService = notificationPublishService;
+ LOG.info("ServicehandlerImpl Initiated");
}
package org.opendaylight.transportpce.servicehandler.impl;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.binding.api.NotificationService;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-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.listeners.ServiceListener;
import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TransportpceNetworkmodelListener;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.TransportpcePceListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*
*/
+@Component
public class ServicehandlerProvider {
private static final Logger LOG = LoggerFactory.getLogger(ServicehandlerProvider.class);
private static final InstanceIdentifier<Services> SERVICE = InstanceIdentifier.builder(ServiceList.class)
.child(Services.class).build();
- private final DataBroker dataBroker;
- private final RpcProviderService rpcService;
- private final NotificationService notificationService;
private ListenerRegistration<TransportpcePceListener> pcelistenerRegistration;
- private ListenerRegistration<ServiceListener> serviceDataTreeChangeListenerRegistration;
+ private ListenerRegistration<DataTreeChangeListener<Services>> serviceDataTreeChangeListenerRegistration;
private ListenerRegistration<TransportpceRendererListener> rendererlistenerRegistration;
private ListenerRegistration<TransportpceNetworkmodelListener> networkmodellistenerRegistration;
private ObjectRegistration<OrgOpenroadmServiceService> rpcRegistration;
private ServiceDataStoreOperations serviceDataStoreOperations;
- private PceListenerImpl pceListenerImpl;
- private ServiceListener serviceListener;
- private RendererListenerImpl rendererListenerImpl;
- private NetworkModelListenerImpl networkModelListenerImpl;
- private ServicehandlerImpl servicehandler;
- public ServicehandlerProvider(final DataBroker dataBroker, RpcProviderService rpcProviderService,
- NotificationService notificationService, ServiceDataStoreOperations serviceDataStoreOperations,
- PceListenerImpl pceListenerImpl, ServiceListener serviceListener, RendererListenerImpl rendererListenerImpl,
- NetworkModelListenerImpl networkModelListenerImpl, ServicehandlerImpl servicehandler) {
- this.dataBroker = dataBroker;
- this.rpcService = rpcProviderService;
- this.notificationService = notificationService;
+ @Activate
+ public ServicehandlerProvider(@Reference final DataBroker dataBroker,
+ @Reference RpcProviderService rpcProviderService,
+ @Reference NotificationService notificationService,
+ @Reference ServiceDataStoreOperations serviceDataStoreOperations,
+ @Reference TransportpcePceListener pceListenerImpl,
+ @Reference TransportpceRendererListener rendererListenerImpl,
+ @Reference TransportpceNetworkmodelListener networkModelListenerImpl,
+ @Reference NotificationPublishService notificationPublishService,
+ @Reference OrgOpenroadmServiceService servicehandler,
+ @Reference DataTreeChangeListener<Services> serviceListener) {
this.serviceDataStoreOperations = serviceDataStoreOperations;
this.serviceDataStoreOperations.initialize();
- this.pceListenerImpl = pceListenerImpl;
- this.serviceListener = serviceListener;
- this.rendererListenerImpl = rendererListenerImpl;
- this.networkModelListenerImpl = networkModelListenerImpl;
- this.servicehandler = servicehandler;
- }
-
- /**
- * Method called when the blueprint container is created.
- */
- public void init() {
- LOG.info("ServicehandlerProvider Session Initiated");
pcelistenerRegistration = notificationService.registerNotificationListener(pceListenerImpl);
- serviceDataTreeChangeListenerRegistration = dataBroker.registerDataTreeChangeListener(
- DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, SERVICE), serviceListener);
rendererlistenerRegistration = notificationService.registerNotificationListener(rendererListenerImpl);
networkmodellistenerRegistration = notificationService.registerNotificationListener(networkModelListenerImpl);
- rpcRegistration = rpcService.registerRpcImplementation(OrgOpenroadmServiceService.class, servicehandler);
+ serviceDataTreeChangeListenerRegistration = dataBroker.registerDataTreeChangeListener(
+ DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, SERVICE), serviceListener);
+ rpcRegistration = rpcProviderService
+ .registerRpcImplementation(OrgOpenroadmServiceService.class, servicehandler);
+ LOG.info("ServicehandlerProvider Session Initiated");
+ LOG.info("Transportpce controller started");
}
/**
* Method called when the blueprint container is destroyed.
*/
+ @Deactivate
public void close() {
LOG.info("ServicehandlerProvider Closed");
pcelistenerRegistration.close();
networkmodellistenerRegistration.close();
rpcRegistration.close();
}
-
-}
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © 2023 Orange, 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.transportpce.servicehandler.service.ServiceDataStoreOperations;
+
+public interface NetworkListener {
+
+ void setserviceDataStoreOperations(ServiceDataStoreOperations serviceData);
+}
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118.service.path.PathDescriptionBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class NetworkModelListenerImpl implements TransportpceNetworkmodelListener {
+@Component
+public class NetworkModelListenerImpl implements TransportpceNetworkmodelListener, NetworkListener {
private static final Logger LOG = LoggerFactory.getLogger(NetworkModelListenerImpl.class);
- private final NotificationPublishService notificationPublishService; // to be used for T-API notification
private ServiceDataStoreOperations serviceDataStoreOperations;
private TopologyUpdateResult topologyUpdateResult;
- public NetworkModelListenerImpl(NotificationPublishService notificationPublishService,
- ServiceDataStoreOperations serviceDataStoreOperations) {
- this.notificationPublishService = notificationPublishService;
+ @Activate
+ public NetworkModelListenerImpl(@Reference NotificationPublishService notificationPublishService,
+ @Reference ServiceDataStoreOperations serviceDataStoreOperations) {
this.serviceDataStoreOperations = serviceDataStoreOperations;
}
continue;
}
Services services = serviceOptional.get();
- OperationResult operationResult1 = null;
State newState;
switch (services.getOperationalState()) {
case InService:
&& topologyUpdateResult.getTopologyChanges().equals(notification.getTopologyChanges());
}
+ @Override
public void setserviceDataStoreOperations(ServiceDataStoreOperations serviceData) {
this.serviceDataStoreOperations = serviceData;
}
--- /dev/null
+/*
+ * Copyright © 2023 Orange, 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.transportpce.servicehandler.ServiceInput;
+import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
+
+public interface PceListener {
+
+ void setInput(ServiceInput serviceInput);
+
+ void setServiceReconfigure(Boolean serv);
+
+ void setserviceDataStoreOperations(ServiceDataStoreOperations serviceData);
+
+ void setTempService(Boolean tempService);
+
+ void setServiceFeasiblity(Boolean serviceFeasiblity);
+}
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.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class PceListenerImpl implements TransportpcePceListener {
+@Component
+public class PceListenerImpl implements TransportpcePceListener, PceListener {
private static final Logger LOG = LoggerFactory.getLogger(PceListenerImpl.class);
private static final String PUBLISHER = "PceListener";
private Boolean serviceFeasiblity;
private NotificationPublishService notificationPublishService;
+ @Activate
public PceListenerImpl(
- RendererServiceOperations rendererServiceOperations,
- PathComputationService pathComputationService,
- NotificationPublishService notificationPublishService,
- ServiceDataStoreOperations serviceDataStoreOperations) {
+ @Reference RendererServiceOperations rendererServiceOperations,
+ @Reference PathComputationService pathComputationService,
+ @Reference NotificationPublishService notificationPublishService,
+ @Reference ServiceDataStoreOperations serviceDataStoreOperations) {
this.rendererServiceOperations = rendererServiceOperations;
this.pceServiceWrapper = new PCEServiceWrapper(pathComputationService, notificationPublishService);
this.serviceDataStoreOperations = serviceDataStoreOperations;
return true;
}
+ @Override
public void setInput(ServiceInput serviceInput) {
this.input = serviceInput;
}
+ @Override
public void setServiceReconfigure(Boolean serv) {
this.serviceReconfigure = serv;
}
+ @Override
public void setserviceDataStoreOperations(ServiceDataStoreOperations serviceData) {
this.serviceDataStoreOperations = serviceData;
}
+ @Override
public void setTempService(Boolean tempService) {
this.tempService = tempService;
}
+ @Override
public void setServiceFeasiblity(Boolean serviceFeasiblity) {
this.serviceFeasiblity = serviceFeasiblity;
}
--- /dev/null
+/*
+ * Copyright © 2023 Orange, 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.transportpce.servicehandler.ServiceInput;
+import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
+
+public interface RendererListener {
+
+ void setServiceInput(ServiceInput serviceInput);
+
+ void setserviceDataStoreOperations(ServiceDataStoreOperations serviceData);
+
+ void setTempService(Boolean tempService);
+}
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.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*
*/
-public class RendererListenerImpl implements TransportpceRendererListener {
+@Component
+public class RendererListenerImpl implements TransportpceRendererListener, RendererListener {
private static final String PUBLISHER = "RendererListener";
private static final Logger LOG = LoggerFactory.getLogger(RendererListenerImpl.class);
private final NetworkModelService networkModelService;
- public RendererListenerImpl(PathComputationService pathComputationService,
- NotificationPublishService notificationPublishService, NetworkModelService networkModelService) {
+ @Activate
+ public RendererListenerImpl(@Reference PathComputationService pathComputationService,
+ @Reference NotificationPublishService notificationPublishService,
+ @Reference NetworkModelService networkModelService) {
this.pceServiceWrapper = new PCEServiceWrapper(pathComputationService, notificationPublishService);
setServiceInput(null);
setTempService(false);
return true;
}
+ @Override
public void setServiceInput(ServiceInput serviceInput) {
this.input = serviceInput;
}
+ @Override
public void setserviceDataStoreOperations(ServiceDataStoreOperations serviceData) {
this.serviceDataStoreOperations = serviceData;
}
+ @Override
public void setTempService(Boolean tempService) {
this.tempService = tempService;
}
import org.opendaylight.mdsal.binding.api.DataTreeModification;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.transportpce.common.ResponseCodes;
-import org.opendaylight.transportpce.pce.service.PathComputationService;
import org.opendaylight.transportpce.servicehandler.ServiceInput;
-import org.opendaylight.transportpce.servicehandler.impl.ServicehandlerImpl;
import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.Restorable;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.RpcActions;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.service.resiliency.ServiceResiliency;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.OrgOpenroadmServiceService;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceDeleteInputBuilder;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmServiceBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Component
public class ServiceListener implements DataTreeChangeListener<Services> {
private static final Logger LOG = LoggerFactory.getLogger(ServiceListener.class);
private static final String PUBLISHER = "ServiceListener";
- private ServicehandlerImpl servicehandlerImpl;
+ private OrgOpenroadmServiceService servicehandlerImpl;
private ServiceDataStoreOperations serviceDataStoreOperations;
private NotificationPublishService notificationPublishService;
- private PathComputationService pathComputationService;
private Map<String, ServiceInput> mapServiceInputReroute;
private final ScheduledExecutorService executor;
- public ServiceListener(ServicehandlerImpl servicehandlerImpl, ServiceDataStoreOperations serviceDataStoreOperations,
- NotificationPublishService notificationPublishService) {
+ @Activate
+ public ServiceListener(@Reference OrgOpenroadmServiceService servicehandlerImpl,
+ @Reference ServiceDataStoreOperations serviceDataStoreOperations,
+ @Reference NotificationPublishService notificationPublishService) {
this.servicehandlerImpl = servicehandlerImpl;
this.notificationPublishService = notificationPublishService;
this.serviceDataStoreOperations = serviceDataStoreOperations;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Component(immediate = true)
public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperations {
private static final Logger LOG = LoggerFactory.getLogger(ServiceDataStoreOperationsImpl.class);
private static final String CREATE_MSG = "create";
}
- public ServiceDataStoreOperationsImpl(DataBroker dataBroker) {
+ @Activate
+ public ServiceDataStoreOperationsImpl(@Reference DataBroker dataBroker) {
this.dataBroker = dataBroker;
}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-Copyright © 2017 Orange 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
-
-Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-
- <reference id="rpcService"
- interface="org.opendaylight.mdsal.binding.api.RpcProviderService"/>
-
- <reference id="dataBroker"
- interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
-
- <reference id="notificationService"
- interface="org.opendaylight.mdsal.binding.api.NotificationService"/>
-
- <reference id="notificationPublishService"
- interface="org.opendaylight.mdsal.binding.api.NotificationPublishService"/>
-
- <reference id="pathComputationService"
- interface="org.opendaylight.transportpce.pce.service.PathComputationService"/>
-
- <reference id="rendererServiceOperations"
- interface="org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations" />
- <reference id="networkModelService" interface="org.opendaylight.transportpce.networkmodel.service.NetworkModelService"/>
-
- <bean id="serviceDatastoreOperation" class="org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperationsImpl">
- <argument ref="dataBroker"/>
- </bean>
-
- <bean id="pceListener" class="org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl">
- <argument ref="rendererServiceOperations" />
- <argument ref="pathComputationService" />
- <argument ref="notificationPublishService" />
- <argument ref="serviceDatastoreOperation" />
- </bean>
-
- <bean id="serviceListener" class="org.opendaylight.transportpce.servicehandler.listeners.ServiceListener">
- <argument ref="serviceHandlerImpl" />
- <argument ref="serviceDatastoreOperation" />
- <argument ref="notificationPublishService" />
- </bean>
-
- <bean id="rendererListener" class="org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl">
- <argument ref="pathComputationService" />
- <argument ref="notificationPublishService" />
- <argument ref="networkModelService" />
- </bean>
-
- <bean id="networkModelListener" class="org.opendaylight.transportpce.servicehandler.listeners.NetworkModelListenerImpl">
- <argument ref="notificationPublishService" />
- <argument ref="serviceDatastoreOperation" />
- </bean>
-
- <bean id="serviceHandlerImpl" class="org.opendaylight.transportpce.servicehandler.impl.ServicehandlerImpl">
- <argument ref="dataBroker"/>
- <argument ref="pathComputationService" />
- <argument ref="notificationPublishService" />
- <argument ref="rendererServiceOperations" />
- <argument ref="pceListener" />
- <argument ref="rendererListener" />
- <argument ref="networkModelListener" />
- <argument ref="serviceDatastoreOperation" />
- </bean>
-
- <bean id="provider"
- class="org.opendaylight.transportpce.servicehandler.impl.ServicehandlerProvider"
- init-method="init" destroy-method="close">
- <argument ref="rpcService" />
- <argument ref="dataBroker" />
- <argument ref="notificationService" />
- <argument ref="serviceDatastoreOperation" />
- <argument ref="pceListener" />
- <argument ref="serviceListener" />
- <argument ref="rendererListener" />
- <argument ref="networkModelListener" />
- <argument ref="serviceHandlerImpl" />
- </bean>
-
- <service ref="serviceHandlerImpl"
- interface="org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.OrgOpenroadmServiceService"/>
- <service ref="serviceDatastoreOperation"
- interface="org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations"/>
-</blueprint>
import org.opendaylight.transportpce.pce.service.PathComputationService;
import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
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.listeners.NetworkListener;
+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.servicehandler.utils.ServiceDataUtils;
@Mock
private NotificationPublishService notificationPublishService;
@Mock
- private PceListenerImpl pceListenerImpl;
+ private PceListener pceListenerImpl;
@Mock
- private RendererListenerImpl rendererListenerImpl;
+ private RendererListener rendererListenerImpl;
@Mock
- private NetworkModelListenerImpl networkModelListenerImpl;
+ private NetworkListener networkModelListenerImpl;
private ServiceDataStoreOperations serviceDataStoreOperations;
private ServiceCreateInput serviceCreateInput;
@Test
void createServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceCreateOutput>> result = servicehandlerImpl
new ServicesBuilder()
.setServiceName(serviceCreateInput.getServiceName())
.build()));
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDSOperations);
ListenableFuture<RpcResult<ServiceCreateOutput>> result = servicehandlerImpl.serviceCreate(serviceCreateInput);
void createServiceShouldBeSuccessfulWhenPerformPCESuccessful()
throws ExecutionException, InterruptedException {
when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any()));
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceCreateOutput>> result = servicehandlerImpl.serviceCreate(serviceCreateInput);
@Test
void deleteServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceDeleteOutput>> result = servicehandlerImpl.serviceDelete(
@Test
void deleteServiceShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
ServicehandlerImpl servicehandlerImpl =
- new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
+ new ServicehandlerImpl(pathComputationService, rendererServiceOperations,
notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceDeleteOutput>> result = servicehandlerImpl.serviceDelete(serviceDeleteInput);
@Test
void deleteServiceShouldBeSuccessForExistingService() throws ExecutionException, InterruptedException {
when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
serviceDataStoreOperations.createService(serviceCreateInput);
@Test
void serviceFeasibilityCheckShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceFeasibilityCheckOutput>> result =
void serviceFeasibilityCheckShouldBeSuccessfulWhenPerformPCESuccessful()
throws ExecutionException, InterruptedException {
when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any()));
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceFeasibilityCheckOutput>> result =
@Test
void serviceReconfigureShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceReconfigureOutput>> result =
@Test
void serviceReconfigureShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
//action -> service reconfigure
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceReconfigureOutput>> result = servicehandlerImpl.serviceReconfigure(
// serviceReconfigure is calling service delete method in renderer
when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
//create service to reconfigure
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
serviceDataStoreOperations.createService(serviceCreateInput);
@Test
void serviceReRestorationShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceRestorationOutput>> result = servicehandlerImpl
@Test
void serviceRestorationShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
//action -> service restore
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceRestorationOutput>> result = servicehandlerImpl.serviceRestoration(
// serviceRestoration is calling service delete method in renderer
when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
//create service to restore
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
serviceDataStoreOperations.createService(serviceCreateInput);
@Test
void serviceRerouteShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceRerouteOutput>> result =
@Test
void serviceRerouteShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
//action -> service reconfigure
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceRerouteOutput>> result = servicehandlerImpl
.build());
serviceDataStoreOperations.createService(serviceCreateInput);
- ListenableFuture<RpcResult<ServiceRerouteOutput>> result = new ServicehandlerImpl(getNewDataBroker(),
- pathComputationService, rendererServiceOperations, notificationPublishService, pceListenerImpl,
+ ListenableFuture<RpcResult<ServiceRerouteOutput>> result = new ServicehandlerImpl(pathComputationService,
+ rendererServiceOperations, notificationPublishService, pceListenerImpl,
rendererListenerImpl, networkModelListenerImpl, serviceDataStoreOperations)
.serviceReroute(serviceRerouteInput);
result.addListener(() -> endSignal.countDown(), executorService);
@Test
void tempServiceDeleteShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<TempServiceDeleteOutput>> result =
@Test
void tempServiceDeleteShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<TempServiceDeleteOutput>> result = servicehandlerImpl.tempServiceDelete(
when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
//create temp service to delete in the temp delete action
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
TempServiceCreateInput createInput = ServiceDataUtils.buildTempServiceCreateInput();
@Test
void tempServiceCreateShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<TempServiceCreateOutput>> result =
throws ExecutionException, InterruptedException {
when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any()));
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
-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.listeners.ServiceListener;
import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TransportpceNetworkmodelListener;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.TransportpcePceListener;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.TransportpceRendererListener;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.OrgOpenroadmServiceService;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.service.list.Services;
@ExtendWith(MockitoExtension.class)
-public class ServicehandlerProviderTest extends AbstractTest {
+public class ServicehandlerProviderTest extends AbstractTest {
+ @Mock
+ DataBroker dataBroker;
@Mock
RpcProviderService rpcProviderRegistry;
@Mock
ServiceDataStoreOperations serviceDataStoreOperations;
@Mock
- PceListenerImpl pceListenerImpl;
+ TransportpcePceListener pceListenerImpl;
@Mock
- ServiceListener serviceListener;
+ TransportpceRendererListener rendererListenerImpl;
@Mock
- RendererListenerImpl rendererListenerImpl;
+ TransportpceNetworkmodelListener networkModelListenerImpl;
@Mock
- NetworkModelListenerImpl networkModelListenerImpl;
+ NotificationPublishService notificationPublishService;
@Mock
- ServicehandlerImpl servicehandler;
-
+ OrgOpenroadmServiceService servicehandler;
+ @Mock
+ DataTreeChangeListener<Services> serviceListener;
@Test
void testInitRegisterServiceHandlerToRpcRegistry() {
- ServicehandlerProvider provider = new ServicehandlerProvider(
- getDataBroker(), rpcProviderRegistry,
- getNotificationService() , serviceDataStoreOperations, pceListenerImpl, serviceListener,
- rendererListenerImpl, networkModelListenerImpl, servicehandler);
-
- provider.init();
+ new ServicehandlerProvider(dataBroker, rpcProviderRegistry, getNotificationService() ,
+ serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
+ notificationPublishService, servicehandler, serviceListener);
- verify(rpcProviderRegistry, times(1)).registerRpcImplementation(any(), any(ServicehandlerImpl.class));
+ verify(rpcProviderRegistry, times(1)).registerRpcImplementation(any(), any(OrgOpenroadmServiceService.class));
+ verify(dataBroker, times(1)).registerDataTreeChangeListener(any(), any());
}
}
\ No newline at end of file
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-tapi</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>5.0.3</version>
+ <version>5.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>sal-netconf-connector</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.component.annotations</artifactId>
+ </dependency>
<!-- Sodium bump: javax.annotation.Nullable and friends -->
<dependency>
private final TapiLink tapiLink;
public R2RTapiLinkDiscovery(NetworkTransactionService networkTransactionService,
- DeviceTransactionManager deviceTransactionManager, TapiLink tapiLink) {
+ DeviceTransactionManager deviceTransactionManager, TapiLink tapiLink) {
this.networkTransactionService = networkTransactionService;
this.deviceTransactionManager = deviceTransactionManager;
this.tapiLink = tapiLink;
*/
package org.opendaylight.transportpce.tapi.impl;
+import java.util.ArrayList;
import java.util.HashMap;
-import org.eclipse.jdt.annotation.NonNull;
+import java.util.List;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.binding.api.NotificationService;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
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.TapiNetworkModelListenerImpl;
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.topology.TapiNetconfTopologyListener;
+import org.opendaylight.transportpce.tapi.topology.TapiNetworkModelService;
import org.opendaylight.transportpce.tapi.topology.TapiOrLinkListener;
import org.opendaylight.transportpce.tapi.topology.TapiPortMappingListener;
import org.opendaylight.transportpce.tapi.topology.TapiTopologyImpl;
import org.opendaylight.transportpce.tapi.utils.TapiContext;
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.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.TapiCommonService;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.TapiConnectivityService;
+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.topology.rev181210.TapiTopologyService;
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;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* @author Gilles Thouenon (gilles.thouenon@orange.com) on behalf of Orange
*
*/
+@Component
public class TapiProvider {
private static final Logger LOG = LoggerFactory.getLogger(TapiProvider.class);
.child(Link.class);
private final DataBroker dataBroker;
private final RpcProviderService rpcProviderService;
+ private final NotificationService notificationService;
+ private final NetworkTransactionService networkTransactionService;
+ private final OrgOpenroadmServiceService serviceHandler;
+ private final ServiceDataStoreOperations serviceDataStoreOperations;
+ private final TransportpceTapinetworkutilsService tapiNetworkUtils;
+ private TapiNotificationListener tapiNetworkModelListenerImpl;
private ObjectRegistration<TapiConnectivityService> rpcRegistration;
private ObjectRegistration<TransportpceTapinetworkutilsService> tapiNetworkutilsServiceRpcRegistration;
- private ListenerRegistration<TapiNetconfTopologyListener> dataTreeChangeListenerRegistration;
- private ListenerRegistration<TapiOrLinkListener> dataTreeChangeListenerRegistration1;
- private ListenerRegistration<TapiPortMappingListener> mappingListenerListenerRegistration;
+ private List<Registration> listeners;
private ListenerRegistration<TransportpcePceListener> pcelistenerRegistration;
private ListenerRegistration<TransportpceRendererListener> rendererlistenerRegistration;
private ListenerRegistration<TransportpceServicehandlerListener> servicehandlerlistenerRegistration;
- private ListenerRegistration<TapiNetworkModelListenerImpl> tapinetworkmodellistenerRegistration;
- private final OrgOpenroadmServiceService serviceHandler;
- private final ServiceDataStoreOperations serviceDataStoreOperations;
- private final TapiListener tapiListener;
- private final TapiNetconfTopologyListener topologyListener;
- private final TapiOrLinkListener orLinkListener;
- private TapiPortMappingListener tapiPortMappingListener;
- private final NetworkTransactionService networkTransactionService;
- private final TransportpceTapinetworkutilsService tapiNetworkUtils;
- private TapiPceListenerImpl pceListenerImpl;
- private TapiRendererListenerImpl rendererListenerImpl;
- private TapiServiceHandlerListenerImpl serviceHandlerListenerImpl;
- private final NotificationService notificationService;
- private TapiNetworkModelListenerImpl tapiNetworkModelListenerImpl;
+ private ListenerRegistration<TapiNotificationListener> tapinetworkmodellistenerRegistration;
- public TapiProvider(DataBroker dataBroker, RpcProviderService rpcProviderService,
- OrgOpenroadmServiceService serviceHandler,ServiceDataStoreOperations serviceDataStoreOperations,
- TapiListener tapiListener, NetworkTransactionService networkTransactionService,
- TapiNetconfTopologyListener topologyListener, TapiPortMappingListener tapiPortMappingListener,
- TransportpceTapinetworkutilsService tapiNetworkUtils, TapiPceListenerImpl pceListenerImpl,
- TapiRendererListenerImpl rendererListenerImpl, TapiServiceHandlerListenerImpl serviceHandlerListenerImpl,
- NotificationService notificationService, TapiOrLinkListener orLinkListener,
- TapiNetworkModelListenerImpl tapiNetworkModelListenerImpl) {
+ @Activate
+ public TapiProvider(@Reference DataBroker dataBroker,
+ @Reference RpcProviderService rpcProviderService,
+ @Reference NotificationService notificationService,
+ @Reference NotificationPublishService notificationPublishService,
+ @Reference NetworkTransactionService networkTransactionService,
+ @Reference OrgOpenroadmServiceService serviceHandler,
+ @Reference ServiceDataStoreOperations serviceDataStoreOperations,
+ @Reference TransportpceTapinetworkutilsService tapiNetworkUtils,
+ @Reference TapiNotificationListener tapiNetworkModelListenerImpl,
+ @Reference TapiNetworkModelService tapiNetworkModelServiceImpl) {
this.dataBroker = dataBroker;
this.rpcProviderService = rpcProviderService;
+ this.notificationService = notificationService;
+ this.networkTransactionService = networkTransactionService;
this.serviceHandler = serviceHandler;
this.serviceDataStoreOperations = serviceDataStoreOperations;
- this.tapiListener = tapiListener;
- this.networkTransactionService = networkTransactionService;
- this.topologyListener = topologyListener;
- this.tapiPortMappingListener = tapiPortMappingListener;
this.tapiNetworkUtils = tapiNetworkUtils;
- this.pceListenerImpl = pceListenerImpl;
- this.rendererListenerImpl = rendererListenerImpl;
- this.serviceHandlerListenerImpl = serviceHandlerListenerImpl;
- this.notificationService = notificationService;
- this.orLinkListener = orLinkListener;
this.tapiNetworkModelListenerImpl = tapiNetworkModelListenerImpl;
- //this.notificationPublishService = notificationPublishService;
- }
- /**
- * Method called when the blueprint container is created.
- */
- public void init() {
LOG.info("TapiProvider Session Initiated");
TapiContext tapiContext = new TapiContext(this.networkTransactionService);
LOG.info("Empty TAPI context created: {}", tapiContext.getTapiContext());
- TapiLink tapiLink = new TapiLink(this.networkTransactionService);
+ TapiLink tapiLink = new TapiLinkImpl(this.networkTransactionService);
TopologyUtils topologyUtils = new TopologyUtils(this.networkTransactionService, this.dataBroker, tapiLink);
ConnectivityUtils connectivityUtils = new ConnectivityUtils(this.serviceDataStoreOperations, new HashMap<>(),
tapiContext, this.networkTransactionService);
tapiContext, this.serviceDataStoreOperations);
tapiInitialORMapping.performTopoInitialMapping();
tapiInitialORMapping.performServInitialMapping();
+ TapiPceListenerImpl pceListenerImpl = new TapiPceListenerImpl(dataBroker);
+ TapiRendererListenerImpl rendererListenerImpl = new TapiRendererListenerImpl(dataBroker,
+ notificationPublishService);
TapiConnectivityImpl tapi = new TapiConnectivityImpl(this.serviceHandler, tapiContext, connectivityUtils,
pceListenerImpl, rendererListenerImpl);
rpcRegistration = rpcProviderService.registerRpcImplementation(TapiConnectivityService.class, tapi);
rpcProviderService.registerRpcImplementation(TapiTopologyService.class, topo);
rpcProviderService.registerRpcImplementation(TapiCommonService.class, topo);
- dataTreeChangeListenerRegistration1 =
- dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
- LINK_II), orLinkListener);
- dataTreeChangeListenerRegistration =
- dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
- InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), topologyListener);
- mappingListenerListenerRegistration =
- dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
- MAPPING_II), tapiPortMappingListener);
+
+ this.listeners = new ArrayList<>();
+ TapiNetconfTopologyListener topologyListener = new TapiNetconfTopologyListener(tapiNetworkModelServiceImpl);
+ TapiOrLinkListener orLinkListener = new TapiOrLinkListener(tapiLink, networkTransactionService);
+ TapiPortMappingListener tapiPortMappingListener = new TapiPortMappingListener(tapiNetworkModelServiceImpl);
+ listeners.add(dataBroker.registerDataTreeChangeListener(
+ DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, LINK_II), orLinkListener));
+ listeners.add(dataBroker.registerDataTreeChangeListener(
+ DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, InstanceIdentifiers.NETCONF_TOPOLOGY_II
+ .child(Node.class)),
+ topologyListener));
+ listeners.add(dataBroker.registerDataTreeChangeListener(
+ DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, MAPPING_II), tapiPortMappingListener));
tapiNetworkutilsServiceRpcRegistration =
rpcProviderService.registerRpcImplementation(TransportpceTapinetworkutilsService.class,
this.tapiNetworkUtils);
- @NonNull
- InstanceIdentifier<ServiceInterfacePoints> sipIID = InstanceIdentifier.create(ServiceInterfacePoints.class);
- dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.create(
- LogicalDatastoreType.CONFIGURATION, sipIID), tapiListener);
+ TapiListener tapiListener = new TapiListener();
+ listeners.add(dataBroker.registerDataTreeChangeListener(
+ DataTreeIdentifier.create(
+ LogicalDatastoreType.CONFIGURATION,
+ InstanceIdentifier.create(ServiceInterfacePoints.class)),
+ tapiListener));
// Notification Listener
pcelistenerRegistration = notificationService.registerNotificationListener(pceListenerImpl);
rendererlistenerRegistration = notificationService.registerNotificationListener(rendererListenerImpl);
- servicehandlerlistenerRegistration =
- notificationService.registerNotificationListener(serviceHandlerListenerImpl);
- tapinetworkmodellistenerRegistration =
- notificationService.registerNotificationListener(tapiNetworkModelListenerImpl);
+ TapiServiceHandlerListenerImpl serviceHandlerListenerImpl = new TapiServiceHandlerListenerImpl(dataBroker);
+ servicehandlerlistenerRegistration = notificationService
+ .registerNotificationListener(serviceHandlerListenerImpl);
+ tapinetworkmodellistenerRegistration = notificationService
+ .registerNotificationListener(tapiNetworkModelListenerImpl);
}
/**
* Method called when the blueprint container is destroyed.
*/
+ @Deactivate
public void close() {
- LOG.info("TapiProvider Session Closed");
- if (dataTreeChangeListenerRegistration != null) {
- dataTreeChangeListenerRegistration.close();
- }
- if (mappingListenerListenerRegistration != null) {
- mappingListenerListenerRegistration.close();
- }
- if (dataTreeChangeListenerRegistration1 != null) {
- dataTreeChangeListenerRegistration1.close();
- }
+ listeners.forEach(lis -> lis.close());
+ listeners.clear();
if (tapiNetworkutilsServiceRpcRegistration != null) {
tapiNetworkutilsServiceRpcRegistration.close();
}
servicehandlerlistenerRegistration.close();
rpcRegistration.close();
tapinetworkmodellistenerRegistration.close();
+ LOG.info("TapiProvider Session Closed");
}
}
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.context.TopologyKey;
import org.opendaylight.yangtools.yang.binding.EnumTypeObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Component
public class TapiNetworkModelListenerImpl implements TapiNotificationListener {
private static final Logger LOG = LoggerFactory.getLogger(TapiNetworkModelListenerImpl.class);
private final NetworkTransactionService networkTransactionService;
+ private final NotificationPublishService notificationPublishService;
private final List<ConnectivityService> connectivityServiceChanges = new ArrayList<>();
private final Uuid tapiTopoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER
.getBytes(StandardCharsets.UTF_8)).toString());
private final List<LayerProtocolName> orderedServiceLayerList;
- private final NotificationPublishService notificationPublishService;
- public TapiNetworkModelListenerImpl(NetworkTransactionService networkTransactionService,
- NotificationPublishService notificationPublishService) {
+ @Activate
+ public TapiNetworkModelListenerImpl(@Reference NetworkTransactionService networkTransactionService,
+ @Reference NotificationPublishService notificationPublishService) {
this.networkTransactionService = networkTransactionService;
+ this.notificationPublishService = notificationPublishService;
this.orderedServiceLayerList = List.of(LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.ODU,
LayerProtocolName.DSR, LayerProtocolName.ETH);
- this.notificationPublishService = notificationPublishService;
+ LOG.debug("TapiNetworkModelListenerImpl instantiated");
}
@Override
import java.util.stream.Collectors;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.network.NetworkTransactionService;
import org.opendaylight.transportpce.tapi.R2RTapiLinkDiscovery;
import org.opendaylight.transportpce.tapi.TapiStringConstants;
import org.opendaylight.yangtools.yang.binding.Notification;
import org.opendaylight.yangtools.yang.common.Uint16;
import org.opendaylight.yangtools.yang.common.Uint32;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Component
public class TapiNetworkModelServiceImpl implements TapiNetworkModelService {
private static final Logger LOG = LoggerFactory.getLogger(TapiNetworkModelServiceImpl.class);
+
private final Uuid tapiTopoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER
.getBytes(StandardCharsets.UTF_8)).toString());
private final NetworkTransactionService networkTransactionService;
- private Map<ServiceInterfacePointKey, ServiceInterfacePoint> sipMap;
private final R2RTapiLinkDiscovery linkDiscovery;
private final TapiLink tapiLink;
private final NotificationPublishService notificationPublishService;
+ private Map<ServiceInterfacePointKey, ServiceInterfacePoint> sipMap = new HashMap<>();
- public TapiNetworkModelServiceImpl(final R2RTapiLinkDiscovery linkDiscovery,
- NetworkTransactionService networkTransactionService, TapiLink tapiLink,
- final NotificationPublishService notificationPublishService) {
+ @Activate
+ public TapiNetworkModelServiceImpl(@Reference NetworkTransactionService networkTransactionService,
+ @Reference DeviceTransactionManager deviceTransactionManager,
+ @Reference TapiLink tapiLink,
+ @Reference final NotificationPublishService notificationPublishService) {
this.networkTransactionService = networkTransactionService;
- this.sipMap = new HashMap<>();
- this.linkDiscovery = linkDiscovery;
+ this.linkDiscovery = new R2RTapiLinkDiscovery(networkTransactionService, deviceTransactionManager, tapiLink);
this.tapiLink = tapiLink;
this.notificationPublishService = notificationPublishService;
}
import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Component
public class TapiNetworkUtilsImpl implements TransportpceTapinetworkutilsService {
private static final Logger LOG = LoggerFactory.getLogger(TapiNetworkUtilsImpl.class);
private final NetworkTransactionService networkTransactionService;
private final TapiLink tapiLink;
- public TapiNetworkUtilsImpl(NetworkTransactionService networkTransactionService, TapiLink tapiLink) {
+ @Activate
+ public TapiNetworkUtilsImpl(@Reference NetworkTransactionService networkTransactionService,
+ @Reference TapiLink tapiLink) {
this.networkTransactionService = networkTransactionService;
this.tapiLink = tapiLink;
}
/*
- * Copyright © 2021 Nokia. All rights reserved.
+ * Copyright © 2023 Orange, 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,
*/
package org.opendaylight.transportpce.tapi.utils;
-import java.nio.charset.Charset;
-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.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.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
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.CapacityUnit;
-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.ForwardingDirection;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.LayerProtocolName;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.LifecycleState;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.OperationalState;
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.common.rev181210.capacity.TotalSizeBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.capacity.pac.AvailableCapacityBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.capacity.pac.TotalPotentialCapacityBuilder;
-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.topology.rev181210.Context1;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.ProtectionType;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.RestorationPolicy;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.context.TopologyContext;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.link.NodeEdgePoint;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.link.NodeEdgePointBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.link.NodeEdgePointKey;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.link.ResilienceTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.OwnedNodeEdgePoint;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.OwnedNodeEdgePointKey;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.risk.parameter.pac.RiskCharacteristic;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.risk.parameter.pac.RiskCharacteristicBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Link;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.LinkBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.context.Topology;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.context.TopologyKey;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.transfer.cost.pac.CostCharacteristic;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.transfer.cost.pac.CostCharacteristicBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.transfer.timing.pac.LatencyCharacteristic;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.transfer.timing.pac.LatencyCharacteristicBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.validation.pac.ValidationMechanism;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.validation.pac.ValidationMechanismBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.Uint64;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-public class TapiLink {
+public interface TapiLink {
- private static final Logger LOG = LoggerFactory.getLogger(TapiLink.class);
- private final NetworkTransactionService networkTransactionService;
+ Link createTapiLink(String srcNodeid, String srcTpId, String dstNodeId, String dstTpId, String linkType,
+ String srcNodeQual, String dstNodeQual, String srcTpQual, String dstTpQual,
+ String adminState, String operState, Set<LayerProtocolName> layerProtoNameList,
+ Set<String> transLayerNameList, Uuid tapiTopoUuid);
- public TapiLink(NetworkTransactionService networkTransactionService) {
- this.networkTransactionService = networkTransactionService;
- }
+ AdministrativeState setTapiAdminState(String adminState);
- public Link createTapiLink(String srcNodeid, String srcTpId, String dstNodeId, String dstTpId, String linkType,
- String srcNodeQual, String dstNodeQual, String srcTpQual, String dstTpQual,
- String adminState, String operState, Set<LayerProtocolName> layerProtoNameList,
- Set<String> transLayerNameList, Uuid tapiTopoUuid) {
- Map<NodeEdgePointKey, NodeEdgePoint> nepList = new HashMap<>();
- String sourceNodeKey = String.join("+", srcNodeid, srcNodeQual);
- String sourceNepKey = String.join("+", srcNodeid, srcTpQual, srcTpId);
- Uuid sourceUuidNode = new Uuid(UUID.nameUUIDFromBytes(sourceNodeKey.getBytes(Charset.forName("UTF-8")))
- .toString());
- Uuid sourceUuidTp = new Uuid(UUID.nameUUIDFromBytes(sourceNepKey.getBytes(Charset.forName("UTF-8")))
- .toString());
- String destNodeKey = String.join("+", dstNodeId, dstNodeQual);
- String destNepKey = String.join("+", dstNodeId, dstTpQual, dstTpId);
- String linkKey = String.join("to", sourceNepKey, destNepKey);
- Uuid destUuidNode = new Uuid(UUID.nameUUIDFromBytes(destNodeKey.getBytes(Charset.forName("UTF-8"))).toString());
- Uuid destUuidTp = new Uuid(UUID.nameUUIDFromBytes(destNepKey.getBytes(Charset.forName("UTF-8"))).toString());
- NodeEdgePoint sourceNep = new NodeEdgePointBuilder()
- .setTopologyUuid(tapiTopoUuid)
- .setNodeUuid(sourceUuidNode)
- .setNodeEdgePointUuid(sourceUuidTp)
- .build();
- nepList.put(sourceNep.key(), sourceNep);
- NodeEdgePoint destNep = new NodeEdgePointBuilder()
- .setTopologyUuid(tapiTopoUuid)
- .setNodeUuid(destUuidNode)
- .setNodeEdgePointUuid(destUuidTp)
- .build();
- nepList.put(destNep.key(), destNep);
- NameBuilder linkName = new NameBuilder();
- // TODO: variables for each type
- switch (linkType) {
- case TapiStringConstants.OMS_RDM_RDM_LINK:
- LOG.info("Roadm to roadm link");
- linkName
- .setValueName("OMS link name")
- .setValue(linkKey);
- break;
- case TapiStringConstants.TRANSITIONAL_LINK:
- LOG.info("Transitional link");
- linkName
- .setValueName("transitional link name")
- .setValue(linkKey);
- break;
- case TapiStringConstants.OMS_XPDR_RDM_LINK:
- LOG.info("Xpdr to roadm link");
- linkName
- .setValueName("XPDR-RDM link name")
- .setValue(linkKey);
- break;
- case TapiStringConstants.OTN_XPDR_XPDR_LINK:
- LOG.info("OTN Xpdr to roadm link");
- linkName
- .setValueName("otn link name")
- .setValue(linkKey);
- break;
- default:
- LOG.warn("Type {} not recognized", linkType);
- return null;
- }
- // Todo: common aspects of links and set all attributes
- CostCharacteristic costCharacteristic = new CostCharacteristicBuilder()
- .setCostAlgorithm("Restricted Shortest Path - RSP")
- .setCostName("HOP_COUNT")
- .setCostValue(TapiStringConstants.COST_HOP_VALUE)
- .build();
- LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder()
- .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE)
- .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE)
- .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE)
- .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE)
- .setTrafficPropertyName("FIXED_LATENCY")
- .build();
- RiskCharacteristic riskCharacteristic = new RiskCharacteristicBuilder()
- .setRiskCharacteristicName("risk characteristic")
- .setRiskIdentifierList(Set.of("risk identifier1", "risk identifier2"))
- .build();
- ValidationMechanism validationMechanism = new ValidationMechanismBuilder()
- .setValidationMechanism("validation mechanism")
- .setValidationRobustness("validation robustness")
- .setLayerProtocolAdjacencyValidated("layer protocol adjacency")
- .build();
- return new LinkBuilder()
- .setUuid(new Uuid(
- UUID.nameUUIDFromBytes(linkKey.getBytes(Charset.forName("UTF-8"))).toString()))
- .setName(Map.of(linkName.build().key(), linkName.build()))
- .setTransitionedLayerProtocolName(transLayerNameList)
- .setLayerProtocolName(layerProtoNameList)
- .setNodeEdgePoint(nepList)
- .setDirection(ForwardingDirection.BIDIRECTIONAL)
- .setAvailableCapacity(new AvailableCapacityBuilder().setTotalSize(
- new TotalSizeBuilder().setUnit(CapacityUnit.GBPS).setValue(Uint64.valueOf(100)).build())
- .build())
- .setResilienceType(new ResilienceTypeBuilder().setProtectionType(ProtectionType.NOPROTECTON)
- .setRestorationPolicy(RestorationPolicy.NA)
- .build())
- .setAdministrativeState(setTapiAdminState(adminState))
- .setOperationalState(setTapiOperationalState(operState))
- .setLifecycleState(LifecycleState.INSTALLED)
- .setTotalPotentialCapacity(new TotalPotentialCapacityBuilder().setTotalSize(
- new TotalSizeBuilder().setUnit(CapacityUnit.GBPS).setValue(Uint64.valueOf(100)).build())
- .build())
- .setCostCharacteristic(Map.of(costCharacteristic.key(), costCharacteristic))
- .setLatencyCharacteristic(Map.of(latencyCharacteristic.key(), latencyCharacteristic))
- .setRiskCharacteristic(Map.of(riskCharacteristic.key(), riskCharacteristic))
- .setErrorCharacteristic("error")
- .setLossCharacteristic("loss")
- .setRepeatDeliveryCharacteristic("repeat delivery")
- .setDeliveryOrderCharacteristic("delivery order")
- .setUnavailableTimeCharacteristic("unavailable time")
- .setServerIntegrityProcessCharacteristic("server integrity process")
- .setValidationMechanism(Map.of(validationMechanism.key(), validationMechanism))
- .build();
- }
+ AdministrativeState setTapiAdminState(AdminStates adminState1, AdminStates adminState2);
- public AdministrativeState setTapiAdminState(String adminState) {
- if (adminState == null) {
- return null;
- }
- return adminState.equals(AdminStates.InService.getName())
- || adminState.equals(AdministrativeState.UNLOCKED.getName()) ? AdministrativeState.UNLOCKED
- : AdministrativeState.LOCKED;
- }
+ OperationalState setTapiOperationalState(String operState);
- public AdministrativeState setTapiAdminState(AdminStates adminState1, AdminStates adminState2) {
- if (adminState1 == null || adminState2 == null) {
- return null;
- }
- LOG.info("Admin state 1 = {}, andmin state 2 = {}", adminState1.getName(), adminState2.getName());
- return AdminStates.InService.equals(adminState1) && AdminStates.InService.equals(adminState2)
- ? AdministrativeState.UNLOCKED : AdministrativeState.LOCKED;
- }
+ OperationalState setTapiOperationalState(State operState1, State operState2);
- public OperationalState setTapiOperationalState(String operState) {
- if (operState == null) {
- return null;
- }
- return operState.equals("inService") || operState.equals(OperationalState.ENABLED.getName())
- ? OperationalState.ENABLED : OperationalState.DISABLED;
- }
+ String getOperState(String srcNodeId, String destNodeId, String sourceTpId, String destTpId);
- public OperationalState setTapiOperationalState(State operState1, State operState2) {
- if (operState1 == null || operState2 == null) {
- return null;
- }
- return State.InService.equals(operState1) && State.InService.equals(operState2)
- ? OperationalState.ENABLED : OperationalState.DISABLED;
- }
-
- public String getOperState(String srcNodeId, String destNodeId, String sourceTpId, String destTpId) {
- Uuid tapiTopoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER
- .getBytes(Charset.forName("UTF-8"))).toString());
- Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", srcNodeId,
- TapiStringConstants.PHTNC_MEDIA).getBytes(Charset.forName("UTF-8"))).toString());
- Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", srcNodeId,
- TapiStringConstants.PHTNC_MEDIA, sourceTpId).getBytes(Charset.forName("UTF-8"))).toString());
- InstanceIdentifier<OwnedNodeEdgePoint> onepIID = InstanceIdentifier.builder(Context.class)
- .augmentation(Context1.class).child(TopologyContext.class)
- .child(Topology.class, new TopologyKey(tapiTopoUuid)).child(Node.class, new NodeKey(nodeUuid))
- .child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(nepUuid))
- .build();
- Uuid node1Uuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", destNodeId,
- TapiStringConstants.PHTNC_MEDIA).getBytes(Charset.forName("UTF-8"))).toString());
- Uuid nep1Uuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", destNodeId,
- TapiStringConstants.PHTNC_MEDIA, destTpId).getBytes(Charset.forName("UTF-8"))).toString());
- InstanceIdentifier<OwnedNodeEdgePoint> onep1IID = InstanceIdentifier.builder(Context.class)
- .augmentation(Context1.class).child(TopologyContext.class)
- .child(Topology.class, new TopologyKey(tapiTopoUuid)).child(Node.class, new NodeKey(node1Uuid))
- .child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(nep1Uuid))
- .build();
- try {
- Optional<OwnedNodeEdgePoint> optionalOnep = this.networkTransactionService.read(
- LogicalDatastoreType.OPERATIONAL, onepIID).get();
- Optional<OwnedNodeEdgePoint> optionalOnep1 = this.networkTransactionService.read(
- LogicalDatastoreType.OPERATIONAL, onep1IID).get();
- if (!optionalOnep.isPresent() || !optionalOnep1.isPresent()) {
- LOG.error("One of the 2 neps doesnt exist in the datastore: {} OR {}", nepUuid, nep1Uuid);
- return null;
- }
- return optionalOnep.get().getOperationalState().equals(optionalOnep1.get().getOperationalState())
- ? optionalOnep.get().getOperationalState().getName() : OperationalState.DISABLED.getName();
- } catch (InterruptedException | ExecutionException e) {
- LOG.error("Failed getting Mapping data from portMapping",e);
- return null;
- }
- }
-
- public String getAdminState(String srcNodeId, String destNodeId, String sourceTpId, String destTpId) {
- Uuid tapiTopoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER
- .getBytes(Charset.forName("UTF-8"))).toString());
- Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", srcNodeId,
- TapiStringConstants.PHTNC_MEDIA).getBytes(Charset.forName("UTF-8"))).toString());
- Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", srcNodeId,
- TapiStringConstants.PHTNC_MEDIA, sourceTpId).getBytes(Charset.forName("UTF-8"))).toString());
- InstanceIdentifier<OwnedNodeEdgePoint> onepIID = InstanceIdentifier.builder(Context.class)
- .augmentation(Context1.class).child(TopologyContext.class)
- .child(Topology.class, new TopologyKey(tapiTopoUuid)).child(Node.class, new NodeKey(nodeUuid))
- .child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(nepUuid))
- .build();
- Uuid node1Uuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", destNodeId,
- TapiStringConstants.PHTNC_MEDIA).getBytes(Charset.forName("UTF-8"))).toString());
- Uuid nep1Uuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", destNodeId,
- TapiStringConstants.PHTNC_MEDIA, destTpId).getBytes(Charset.forName("UTF-8"))).toString());
- InstanceIdentifier<OwnedNodeEdgePoint> onep1IID = InstanceIdentifier.builder(Context.class)
- .augmentation(Context1.class).child(TopologyContext.class)
- .child(Topology.class, new TopologyKey(tapiTopoUuid)).child(Node.class, new NodeKey(node1Uuid))
- .child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(nep1Uuid))
- .build();
- try {
- Optional<OwnedNodeEdgePoint> optionalOnep = this.networkTransactionService.read(
- LogicalDatastoreType.OPERATIONAL, onepIID).get();
- Optional<OwnedNodeEdgePoint> optionalOnep1 = this.networkTransactionService.read(
- LogicalDatastoreType.OPERATIONAL, onep1IID).get();
- if (!optionalOnep.isPresent() || !optionalOnep1.isPresent()) {
- LOG.error("One of the 2 neps doesnt exist in the datastore: {} OR {}", nepUuid, nep1Uuid);
- return null;
- }
- return optionalOnep.get().getAdministrativeState().equals(optionalOnep1.get().getAdministrativeState())
- ? optionalOnep.get().getAdministrativeState().getName() : AdministrativeState.UNLOCKED.getName();
- } catch (InterruptedException | ExecutionException e) {
- LOG.error("Failed getting Mapping data from portMapping",e);
- return null;
- }
- }
+ String getAdminState(String srcNodeId, String destNodeId, String sourceTpId, String destTpId);
}
--- /dev/null
+/*
+ * Copyright © 2021 Nokia. 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.tapi.utils;
+
+import java.nio.charset.Charset;
+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.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.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
+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.CapacityUnit;
+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.ForwardingDirection;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.LayerProtocolName;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.LifecycleState;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.OperationalState;
+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.common.rev181210.capacity.TotalSizeBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.capacity.pac.AvailableCapacityBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.capacity.pac.TotalPotentialCapacityBuilder;
+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.topology.rev181210.Context1;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.ProtectionType;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.RestorationPolicy;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.context.TopologyContext;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.link.NodeEdgePoint;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.link.NodeEdgePointBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.link.NodeEdgePointKey;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.link.ResilienceTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.OwnedNodeEdgePoint;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.OwnedNodeEdgePointKey;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.risk.parameter.pac.RiskCharacteristic;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.risk.parameter.pac.RiskCharacteristicBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Link;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.LinkBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.context.Topology;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.context.TopologyKey;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.transfer.cost.pac.CostCharacteristic;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.transfer.cost.pac.CostCharacteristicBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.transfer.timing.pac.LatencyCharacteristic;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.transfer.timing.pac.LatencyCharacteristicBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.validation.pac.ValidationMechanism;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.validation.pac.ValidationMechanismBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Component
+public class TapiLinkImpl implements TapiLink {
+
+ private static final Logger LOG = LoggerFactory.getLogger(TapiLinkImpl.class);
+ private final NetworkTransactionService networkTransactionService;
+
+ @Activate
+ public TapiLinkImpl(@Reference NetworkTransactionService networkTransactionService) {
+ this.networkTransactionService = networkTransactionService;
+ }
+
+ public Link createTapiLink(String srcNodeid, String srcTpId, String dstNodeId, String dstTpId, String linkType,
+ String srcNodeQual, String dstNodeQual, String srcTpQual, String dstTpQual,
+ String adminState, String operState, Set<LayerProtocolName> layerProtoNameList,
+ Set<String> transLayerNameList, Uuid tapiTopoUuid) {
+ Map<NodeEdgePointKey, NodeEdgePoint> nepList = new HashMap<>();
+ String sourceNodeKey = String.join("+", srcNodeid, srcNodeQual);
+ String sourceNepKey = String.join("+", srcNodeid, srcTpQual, srcTpId);
+ Uuid sourceUuidNode = new Uuid(UUID.nameUUIDFromBytes(sourceNodeKey.getBytes(Charset.forName("UTF-8")))
+ .toString());
+ Uuid sourceUuidTp = new Uuid(UUID.nameUUIDFromBytes(sourceNepKey.getBytes(Charset.forName("UTF-8")))
+ .toString());
+ String destNodeKey = String.join("+", dstNodeId, dstNodeQual);
+ String destNepKey = String.join("+", dstNodeId, dstTpQual, dstTpId);
+ String linkKey = String.join("to", sourceNepKey, destNepKey);
+ Uuid destUuidNode = new Uuid(UUID.nameUUIDFromBytes(destNodeKey.getBytes(Charset.forName("UTF-8"))).toString());
+ Uuid destUuidTp = new Uuid(UUID.nameUUIDFromBytes(destNepKey.getBytes(Charset.forName("UTF-8"))).toString());
+ NodeEdgePoint sourceNep = new NodeEdgePointBuilder()
+ .setTopologyUuid(tapiTopoUuid)
+ .setNodeUuid(sourceUuidNode)
+ .setNodeEdgePointUuid(sourceUuidTp)
+ .build();
+ nepList.put(sourceNep.key(), sourceNep);
+ NodeEdgePoint destNep = new NodeEdgePointBuilder()
+ .setTopologyUuid(tapiTopoUuid)
+ .setNodeUuid(destUuidNode)
+ .setNodeEdgePointUuid(destUuidTp)
+ .build();
+ nepList.put(destNep.key(), destNep);
+ NameBuilder linkName = new NameBuilder();
+ // TODO: variables for each type
+ switch (linkType) {
+ case TapiStringConstants.OMS_RDM_RDM_LINK:
+ LOG.info("Roadm to roadm link");
+ linkName
+ .setValueName("OMS link name")
+ .setValue(linkKey);
+ break;
+ case TapiStringConstants.TRANSITIONAL_LINK:
+ LOG.info("Transitional link");
+ linkName
+ .setValueName("transitional link name")
+ .setValue(linkKey);
+ break;
+ case TapiStringConstants.OMS_XPDR_RDM_LINK:
+ LOG.info("Xpdr to roadm link");
+ linkName
+ .setValueName("XPDR-RDM link name")
+ .setValue(linkKey);
+ break;
+ case TapiStringConstants.OTN_XPDR_XPDR_LINK:
+ LOG.info("OTN Xpdr to roadm link");
+ linkName
+ .setValueName("otn link name")
+ .setValue(linkKey);
+ break;
+ default:
+ LOG.warn("Type {} not recognized", linkType);
+ return null;
+ }
+ // Todo: common aspects of links and set all attributes
+ CostCharacteristic costCharacteristic = new CostCharacteristicBuilder()
+ .setCostAlgorithm("Restricted Shortest Path - RSP")
+ .setCostName("HOP_COUNT")
+ .setCostValue(TapiStringConstants.COST_HOP_VALUE)
+ .build();
+ LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder()
+ .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE)
+ .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE)
+ .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE)
+ .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE)
+ .setTrafficPropertyName("FIXED_LATENCY")
+ .build();
+ RiskCharacteristic riskCharacteristic = new RiskCharacteristicBuilder()
+ .setRiskCharacteristicName("risk characteristic")
+ .setRiskIdentifierList(Set.of("risk identifier1", "risk identifier2"))
+ .build();
+ ValidationMechanism validationMechanism = new ValidationMechanismBuilder()
+ .setValidationMechanism("validation mechanism")
+ .setValidationRobustness("validation robustness")
+ .setLayerProtocolAdjacencyValidated("layer protocol adjacency")
+ .build();
+ return new LinkBuilder()
+ .setUuid(new Uuid(
+ UUID.nameUUIDFromBytes(linkKey.getBytes(Charset.forName("UTF-8"))).toString()))
+ .setName(Map.of(linkName.build().key(), linkName.build()))
+ .setTransitionedLayerProtocolName(transLayerNameList)
+ .setLayerProtocolName(layerProtoNameList)
+ .setNodeEdgePoint(nepList)
+ .setDirection(ForwardingDirection.BIDIRECTIONAL)
+ .setAvailableCapacity(new AvailableCapacityBuilder().setTotalSize(
+ new TotalSizeBuilder().setUnit(CapacityUnit.GBPS).setValue(Uint64.valueOf(100)).build())
+ .build())
+ .setResilienceType(new ResilienceTypeBuilder().setProtectionType(ProtectionType.NOPROTECTON)
+ .setRestorationPolicy(RestorationPolicy.NA)
+ .build())
+ .setAdministrativeState(setTapiAdminState(adminState))
+ .setOperationalState(setTapiOperationalState(operState))
+ .setLifecycleState(LifecycleState.INSTALLED)
+ .setTotalPotentialCapacity(new TotalPotentialCapacityBuilder().setTotalSize(
+ new TotalSizeBuilder().setUnit(CapacityUnit.GBPS).setValue(Uint64.valueOf(100)).build())
+ .build())
+ .setCostCharacteristic(Map.of(costCharacteristic.key(), costCharacteristic))
+ .setLatencyCharacteristic(Map.of(latencyCharacteristic.key(), latencyCharacteristic))
+ .setRiskCharacteristic(Map.of(riskCharacteristic.key(), riskCharacteristic))
+ .setErrorCharacteristic("error")
+ .setLossCharacteristic("loss")
+ .setRepeatDeliveryCharacteristic("repeat delivery")
+ .setDeliveryOrderCharacteristic("delivery order")
+ .setUnavailableTimeCharacteristic("unavailable time")
+ .setServerIntegrityProcessCharacteristic("server integrity process")
+ .setValidationMechanism(Map.of(validationMechanism.key(), validationMechanism))
+ .build();
+ }
+
+ public AdministrativeState setTapiAdminState(String adminState) {
+ if (adminState == null) {
+ return null;
+ }
+ return adminState.equals(AdminStates.InService.getName())
+ || adminState.equals(AdministrativeState.UNLOCKED.getName()) ? AdministrativeState.UNLOCKED
+ : AdministrativeState.LOCKED;
+ }
+
+ public AdministrativeState setTapiAdminState(AdminStates adminState1, AdminStates adminState2) {
+ if (adminState1 == null || adminState2 == null) {
+ return null;
+ }
+ LOG.info("Admin state 1 = {}, andmin state 2 = {}", adminState1.getName(), adminState2.getName());
+ return AdminStates.InService.equals(adminState1) && AdminStates.InService.equals(adminState2)
+ ? AdministrativeState.UNLOCKED : AdministrativeState.LOCKED;
+ }
+
+ public OperationalState setTapiOperationalState(String operState) {
+ if (operState == null) {
+ return null;
+ }
+ return operState.equals("inService") || operState.equals(OperationalState.ENABLED.getName())
+ ? OperationalState.ENABLED : OperationalState.DISABLED;
+ }
+
+ public OperationalState setTapiOperationalState(State operState1, State operState2) {
+ if (operState1 == null || operState2 == null) {
+ return null;
+ }
+ return State.InService.equals(operState1) && State.InService.equals(operState2)
+ ? OperationalState.ENABLED : OperationalState.DISABLED;
+ }
+
+ public String getOperState(String srcNodeId, String destNodeId, String sourceTpId, String destTpId) {
+ Uuid tapiTopoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER
+ .getBytes(Charset.forName("UTF-8"))).toString());
+ Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", srcNodeId,
+ TapiStringConstants.PHTNC_MEDIA).getBytes(Charset.forName("UTF-8"))).toString());
+ Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", srcNodeId,
+ TapiStringConstants.PHTNC_MEDIA, sourceTpId).getBytes(Charset.forName("UTF-8"))).toString());
+ InstanceIdentifier<OwnedNodeEdgePoint> onepIID = InstanceIdentifier.builder(Context.class)
+ .augmentation(Context1.class).child(TopologyContext.class)
+ .child(Topology.class, new TopologyKey(tapiTopoUuid)).child(Node.class, new NodeKey(nodeUuid))
+ .child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(nepUuid))
+ .build();
+ Uuid node1Uuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", destNodeId,
+ TapiStringConstants.PHTNC_MEDIA).getBytes(Charset.forName("UTF-8"))).toString());
+ Uuid nep1Uuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", destNodeId,
+ TapiStringConstants.PHTNC_MEDIA, destTpId).getBytes(Charset.forName("UTF-8"))).toString());
+ InstanceIdentifier<OwnedNodeEdgePoint> onep1IID = InstanceIdentifier.builder(Context.class)
+ .augmentation(Context1.class).child(TopologyContext.class)
+ .child(Topology.class, new TopologyKey(tapiTopoUuid)).child(Node.class, new NodeKey(node1Uuid))
+ .child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(nep1Uuid))
+ .build();
+ try {
+ Optional<OwnedNodeEdgePoint> optionalOnep = this.networkTransactionService.read(
+ LogicalDatastoreType.OPERATIONAL, onepIID).get();
+ Optional<OwnedNodeEdgePoint> optionalOnep1 = this.networkTransactionService.read(
+ LogicalDatastoreType.OPERATIONAL, onep1IID).get();
+ if (!optionalOnep.isPresent() || !optionalOnep1.isPresent()) {
+ LOG.error("One of the 2 neps doesnt exist in the datastore: {} OR {}", nepUuid, nep1Uuid);
+ return null;
+ }
+ return optionalOnep.get().getOperationalState().equals(optionalOnep1.get().getOperationalState())
+ ? optionalOnep.get().getOperationalState().getName() : OperationalState.DISABLED.getName();
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("Failed getting Mapping data from portMapping",e);
+ return null;
+ }
+ }
+
+ public String getAdminState(String srcNodeId, String destNodeId, String sourceTpId, String destTpId) {
+ Uuid tapiTopoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER
+ .getBytes(Charset.forName("UTF-8"))).toString());
+ Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", srcNodeId,
+ TapiStringConstants.PHTNC_MEDIA).getBytes(Charset.forName("UTF-8"))).toString());
+ Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", srcNodeId,
+ TapiStringConstants.PHTNC_MEDIA, sourceTpId).getBytes(Charset.forName("UTF-8"))).toString());
+ InstanceIdentifier<OwnedNodeEdgePoint> onepIID = InstanceIdentifier.builder(Context.class)
+ .augmentation(Context1.class).child(TopologyContext.class)
+ .child(Topology.class, new TopologyKey(tapiTopoUuid)).child(Node.class, new NodeKey(nodeUuid))
+ .child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(nepUuid))
+ .build();
+ Uuid node1Uuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", destNodeId,
+ TapiStringConstants.PHTNC_MEDIA).getBytes(Charset.forName("UTF-8"))).toString());
+ Uuid nep1Uuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", destNodeId,
+ TapiStringConstants.PHTNC_MEDIA, destTpId).getBytes(Charset.forName("UTF-8"))).toString());
+ InstanceIdentifier<OwnedNodeEdgePoint> onep1IID = InstanceIdentifier.builder(Context.class)
+ .augmentation(Context1.class).child(TopologyContext.class)
+ .child(Topology.class, new TopologyKey(tapiTopoUuid)).child(Node.class, new NodeKey(node1Uuid))
+ .child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(nep1Uuid))
+ .build();
+ try {
+ Optional<OwnedNodeEdgePoint> optionalOnep = this.networkTransactionService.read(
+ LogicalDatastoreType.OPERATIONAL, onepIID).get();
+ Optional<OwnedNodeEdgePoint> optionalOnep1 = this.networkTransactionService.read(
+ LogicalDatastoreType.OPERATIONAL, onep1IID).get();
+ if (!optionalOnep.isPresent() || !optionalOnep1.isPresent()) {
+ LOG.error("One of the 2 neps doesnt exist in the datastore: {} OR {}", nepUuid, nep1Uuid);
+ return null;
+ }
+ return optionalOnep.get().getAdministrativeState().equals(optionalOnep1.get().getAdministrativeState())
+ ? optionalOnep.get().getAdministrativeState().getName() : AdministrativeState.UNLOCKED.getName();
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("Failed getting Mapping data from portMapping",e);
+ return null;
+ }
+ }
+}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-Copyright © 2018 Orange 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
-
-Author: Gilles Thouenon <gilles.thouenon@orange.com>
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-
- <reference id="dataBroker"
- interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
-
- <reference id="deviceTransactionManager"
- interface="org.opendaylight.transportpce.common.device.DeviceTransactionManager" />
-
- <reference id="notificationService"
- interface="org.opendaylight.mdsal.binding.api.NotificationService"/>
-
- <reference id="notificationPublishService"
- interface="org.opendaylight.mdsal.binding.api.NotificationPublishService"/>
-
- <reference id="rpcProviderService"
- interface="org.opendaylight.mdsal.binding.api.RpcProviderService"/>
-
- <reference id="serviceHandlerService"
- interface="org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.OrgOpenroadmServiceService" />
-
- <reference id="networkTransactionImpl"
- interface="org.opendaylight.transportpce.common.network.NetworkTransactionService" />
-
- <reference id="serviceDatastoreOperation"
- interface="org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations" />
-
- <bean id="tapiListener"
- class="org.opendaylight.transportpce.tapi.utils.TapiListener">
- </bean>
-
- <bean id="tapiLink"
- class="org.opendaylight.transportpce.tapi.utils.TapiLink">
- <argument ref="networkTransactionImpl" />
- </bean>
-
- <bean id="tapiPceListener" class="org.opendaylight.transportpce.tapi.listeners.TapiPceListenerImpl">
- <argument ref="dataBroker" />
- </bean>
-
- <bean id="tapiRendererListener" class="org.opendaylight.transportpce.tapi.listeners.TapiRendererListenerImpl">
- <argument ref="dataBroker" />
- <argument ref="notificationPublishService" />
- </bean>
-
- <bean id="tapiServiceHandlerListener" class="org.opendaylight.transportpce.tapi.listeners.TapiServiceHandlerListenerImpl">
- <argument ref="dataBroker" />
- </bean>
-
- <bean id="tapiNetworkModelListenerImpl" class="org.opendaylight.transportpce.tapi.listeners.TapiNetworkModelListenerImpl">
- <argument ref="networkTransactionImpl" />
- <argument ref="notificationPublishService" />
- </bean>
-
- <bean id="tapiNetworkModelService" class="org.opendaylight.transportpce.tapi.topology.TapiNetworkModelServiceImpl">
- <argument ref="tapilinkDiscoveryImpl" />
- <argument ref="networkTransactionImpl" />
- <argument ref="tapiLink" />
- <argument ref="notificationPublishService" />
- </bean>
-
- <bean id="tapiNetconfTopologyListener" class="org.opendaylight.transportpce.tapi.topology.TapiNetconfTopologyListener">
- <argument ref="tapiNetworkModelService" />
- </bean>
-
- <bean id="tapiOrLinkListener" class="org.opendaylight.transportpce.tapi.topology.TapiOrLinkListener">
- <argument ref="tapiLink" />
- <argument ref="networkTransactionImpl" />
- </bean>
-
- <bean id="tapiNetworkUtilsImpl" class="org.opendaylight.transportpce.tapi.topology.TapiNetworkUtilsImpl">
- <argument ref="networkTransactionImpl" />
- <argument ref="tapiLink" />
- </bean>
-
- <bean id="tapiProvider"
- class="org.opendaylight.transportpce.tapi.impl.TapiProvider"
- init-method="init" destroy-method="close">
- <argument ref="dataBroker" />
- <argument ref="rpcProviderService" />
- <argument ref="serviceHandlerService" />
- <argument ref="serviceDatastoreOperation" />
- <argument ref="tapiListener" />
- <argument ref="networkTransactionImpl" />
- <argument ref="tapiNetconfTopologyListener" />
- <argument ref="tapiPortMappingListener" />
- <argument ref="tapiNetworkUtilsImpl" />
- <argument ref="tapiPceListener" />
- <argument ref="tapiRendererListener" />
- <argument ref="tapiServiceHandlerListener" />
- <argument ref="notificationService" />
- <argument ref="tapiOrLinkListener" />
- <argument ref="tapiNetworkModelListenerImpl" />
- </bean>
-
- <bean id="tapiPortMappingListener" class="org.opendaylight.transportpce.tapi.topology.TapiPortMappingListener">
- <argument ref="tapiNetworkModelService" />
- </bean>
-
- <bean id="tapilinkDiscoveryImpl" class="org.opendaylight.transportpce.tapi.R2RTapiLinkDiscovery">
- <argument ref="networkTransactionImpl" />
- <argument ref="deviceTransactionManager" />
- <argument ref="tapiLink" />
- </bean>
-
- <service ref="tapiNetworkModelService" interface="org.opendaylight.transportpce.tapi.topology.TapiNetworkModelService" />
-
-</blueprint>
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.transportpce.servicehandler.listeners.NetworkListener;
+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.utils.TapiContext;
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.TapiTopologyDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.transportpce.test.utils.TopologyDataUtils;
@Mock
private TapiServiceHandlerListenerImpl tapiserviceHandlerListenerImpl;
@Mock
- private PceListenerImpl pceListenerImpl;
+ private PceListener pceListenerImpl;
@Mock
- private RendererListenerImpl rendererListenerImpl;
+ private RendererListener rendererListenerImpl;
@Mock
- private NetworkModelListenerImpl networkModelListenerImpl;
+ private NetworkListener networkModelListenerImpl;
private static final Logger LOG = LoggerFactory.getLogger(TapiConnectivityImplTest.class);
private static ServiceDataStoreOperations serviceDataStoreOperations;
TapiTopologyDataUtils.PORTMAPPING_FILE);
networkTransactionService = new NetworkTransactionImpl(getDataBroker());
- tapilink = new TapiLink(networkTransactionService);
+ tapilink = new TapiLinkImpl(networkTransactionService);
serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(getDataStoreContextUtil().getDataBroker());
tapiContext = new TapiContext(networkTransactionService);
topologyUtils = new TopologyUtils(networkTransactionService, getDataStoreContextUtil().getDataBroker(),
@Test
void createConnServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
@Test
void createConnServiceShouldBeSuccessfulWhenPerformPCESuccessful()
throws ExecutionException, InterruptedException {
- OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
@Test
void deleteConnServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
@Test
void deleteConnServiceShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
DeleteConnectivityServiceInput input = TapiConnectivityDataUtils.buildConnServiceDeleteInput1();
- OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
void deleteConnServiceShouldBeSuccessForExistingService() throws ExecutionException, InterruptedException {
when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
- OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
package org.opendaylight.transportpce.tapi.provider;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.opendaylight.mdsal.common.api.CommitInfo.emptyFluentFuture;
-import org.junit.jupiter.api.BeforeAll;
+import com.google.common.util.concurrent.Futures;
+import java.util.Optional;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+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.servicehandler.service.ServiceDataStoreOperations;
import org.opendaylight.transportpce.tapi.impl.TapiProvider;
-import org.opendaylight.transportpce.tapi.listeners.TapiNetworkModelListenerImpl;
-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.topology.TapiNetconfTopologyListener;
-import org.opendaylight.transportpce.tapi.topology.TapiOrLinkListener;
-import org.opendaylight.transportpce.tapi.topology.TapiPortMappingListener;
-import org.opendaylight.transportpce.tapi.utils.TapiListener;
-import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.transportpce.tapi.topology.TapiNetworkModelService;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.tapinetworkutils.rev210408.TransportpceTapinetworkutilsService;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.OrgOpenroadmServiceService;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.TapiCommonService;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.TapiConnectivityService;
+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.topology.rev181210.TapiTopologyService;
@ExtendWith(MockitoExtension.class)
-public class TapiProviderTest extends AbstractTest {
- private static NetworkTransactionService networkTransactionService;
+public class TapiProviderTest {
@Mock
- private RpcProviderService rpcProviderRegistry;
- @Mock
- private OrgOpenroadmServiceService serviceHandler;
+ private DataBroker dataBroker;
@Mock
- private ServiceDataStoreOperations serviceDataStoreOperations;
- @Mock
- private TapiListener tapiListener;
+ private RpcProviderService rpcProviderRegistry;
@Mock
- private TransportpceTapinetworkutilsService tapiNetworkUtils;
+ private NotificationService notificationService;
@Mock
- private TapiPortMappingListener tapiPortMappingListener;
+ private NotificationPublishService notificationPublishService;
@Mock
- private TapiNetconfTopologyListener topologyListener;
+ private NetworkTransactionService networkTransactionService;
@Mock
- private TapiOrLinkListener orLinkListener;
+ private OrgOpenroadmServiceService serviceHandler;
@Mock
- private TapiPceListenerImpl pceListenerImpl;
+ private ServiceDataStoreOperations serviceDataStoreOperations;
@Mock
- private TapiRendererListenerImpl rendererListenerImpl;
+ private TransportpceTapinetworkutilsService tapiNetworkUtils;
@Mock
- private TapiServiceHandlerListenerImpl serviceHandlerListenerImpl;
+ private TapiNotificationListener tapiNetworkModelListenerImpl;
@Mock
- private TapiNetworkModelListenerImpl networkModelListener;
-
-
- @BeforeAll
- static void setUp() {
- networkTransactionService = new NetworkTransactionImpl(getDataBroker());
- }
+ private TapiNetworkModelService tapiNetworkModelServiceImpl;
@Test
void testInitRegisterTapiToRpcRegistry() {
- TapiProvider provider = new TapiProvider(getDataBroker(), rpcProviderRegistry, serviceHandler,
- serviceDataStoreOperations, tapiListener, networkTransactionService, topologyListener,
- tapiPortMappingListener, tapiNetworkUtils, pceListenerImpl, rendererListenerImpl,
- serviceHandlerListenerImpl, getNotificationService(), orLinkListener, networkModelListener);
-
- provider.init();
+ when(networkTransactionService.read(any(), any())).thenReturn(Futures.immediateFuture(Optional.empty()));
+ doReturn(emptyFluentFuture()).when(networkTransactionService).commit();
+ new TapiProvider(dataBroker, rpcProviderRegistry, notificationService, notificationPublishService,
+ networkTransactionService, serviceHandler, serviceDataStoreOperations, tapiNetworkUtils,
+ tapiNetworkModelListenerImpl, tapiNetworkModelServiceImpl);
verify(rpcProviderRegistry, times(1)).registerRpcImplementation(any(), any(TapiConnectivityService.class));
verify(rpcProviderRegistry, times(2)).registerRpcImplementation(any(), any(TapiTopologyService.class));
verify(rpcProviderRegistry, times(2)).registerRpcImplementation(any(), any(TapiCommonService.class));
+ verify(dataBroker, times(4)).registerDataTreeChangeListener(any(), any());
}
}
\ No newline at end of file
import org.opendaylight.transportpce.common.network.NetworkTransactionService;
import org.opendaylight.transportpce.tapi.TapiStringConstants;
import org.opendaylight.transportpce.tapi.utils.TapiLink;
+import org.opendaylight.transportpce.tapi.utils.TapiLinkImpl;
import org.opendaylight.transportpce.tapi.utils.TapiTopologyDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.transportpce.test.utils.TopologyDataUtils;
topologyUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER.getBytes(
Charset.forName("UTF-8"))).toString());
networkTransactionService = new NetworkTransactionImpl(getDataBroker());
- tapiLink = new TapiLink(networkTransactionService);
+ tapiLink = new TapiLinkImpl(networkTransactionService);
LOG.info("TEST SETUP READY");
}
import org.opendaylight.transportpce.common.network.NetworkTransactionService;
import org.opendaylight.transportpce.tapi.TapiStringConstants;
import org.opendaylight.transportpce.tapi.utils.TapiLink;
+import org.opendaylight.transportpce.tapi.utils.TapiLinkImpl;
import org.opendaylight.transportpce.tapi.utils.TapiTopologyDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.transportpce.test.utils.TopologyDataUtils;
topologyUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_MULTILAYER.getBytes(
Charset.forName("UTF-8"))).toString());
networkTransactionService = new NetworkTransactionImpl(getDataBroker());
- tapiLink = new TapiLink(networkTransactionService);
+ tapiLink = new TapiLinkImpl(networkTransactionService);
LOG.info("TEST SETUP READY");
}
};
when(networkTransactionService.commit()).then(answer);
tapiContext = new TapiContext(networkTransactionService);
- tapiLink = new TapiLink(networkTransactionService);
GetTopologyDetailsInput input = TapiTopologyDataUtils.buildGetTopologyDetailsInput(
TapiStringConstants.T0_MULTILAYER);
import org.opendaylight.transportpce.tapi.utils.TapiContext;
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.TapiTopologyDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.transportpce.test.utils.TopologyDataUtils;
TopologyDataUtils.writePortmappingFromFileToDatastore(getDataStoreContextUtil(),
TapiTopologyDataUtils.PORTMAPPING_FILE);
networkTransactionService = new NetworkTransactionImpl(getDataBroker());
- tapiLink = new TapiLink(networkTransactionService);
+ tapiLink = new TapiLinkImpl(networkTransactionService);
serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(getDataStoreContextUtil().getDataBroker());
tapiContext = new TapiContext(networkTransactionService);
topologyUtils = new TopologyUtils(networkTransactionService, getDataStoreContextUtil().getDataBroker(),
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>test-common</artifactId>
- <version>7.0.0-SNAPSHOT</version>
+ <version>7.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
- <transportpce.models.version>18.0.0</transportpce.models.version>
+ <transportpce.models.version>18.0.1</transportpce.models.version>
</properties>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>5.0.3</version>
+ <version>5.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
SIMS = simulators.SIMS
HONEYNODE_OK_START_MSG = 'Netconf SSH endpoint started successfully at 0.0.0.0'
-KARAF_OK_START_MSG = "Blueprint container for bundle org.opendaylight.transportpce.servicehandler.+" \
- "was successfully created"
+KARAF_OK_START_MSG = "Transportpce controller started"
LIGHTY_OK_START_MSG = re.escape("lighty.io and RESTCONF-NETCONF started")
ODL_LOGIN = 'admin'