Merge "fix netconf testtool portmapping"
authorGuillaume Lambert <guillaume.lambert@orange.com>
Thu, 13 Sep 2018 13:01:12 +0000 (13:01 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 13 Sep 2018 13:01:12 +0000 (13:01 +0000)
61 files changed:
.gitignore
api/pom.xml
api/src/main/yang/portmapping@2017-02-28.yang
artifacts/pom.xml
common/pom.xml
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingImpl.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfaces.java
docs/_static/logo.png [new file with mode: 0644]
docs/conf.py [new file with mode: 0644]
docs/conf.yaml [new file with mode: 0644]
docs/developer-guide.rst [new file with mode: 0644]
docs/favicon.ico [new file with mode: 0644]
docs/images/tpce_architecture.jpg [new file with mode: 0644]
docs/index.rst [new file with mode: 0644]
docs/requirements.txt [new file with mode: 0644]
docs/user-guide.rst [new file with mode: 0644]
features/features-transportpce/pom.xml
features/odl-transportpce-api/pom.xml
features/odl-transportpce-ordmodels/pom.xml
features/odl-transportpce-stubmodels/pom.xml
features/odl-transportpce/pom.xml
features/pom.xml
impl/pom.xml
it/pom.xml
karaf/pom.xml
networkmodel/pom.xml
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/R2RLinkDiscovery.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/OpenRoadmTopology.java
olm/pom.xml
ordmodels/common/pom.xml
ordmodels/device/pom.xml
ordmodels/network/pom.xml
ordmodels/pom.xml
ordmodels/service/pom.xml
pce/pom.xml
pce/src/test/java/org/opendaylight/transportpce/pce/PceManyTests.java
pce/src/test/java/org/opendaylight/transportpce/pce/utils/PceTestData.java
pom.xml
renderer/pom.xml
renderer/src/main/java/org/opendaylight/transportpce/renderer/ModelMappingUtils.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterfaceFactory.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/NetworkModelWaveLengthServiceFreeTest.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/NetworkModelWaveLengthServiceUseTest.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/NodeIdPairTest.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImplCreateOtsOmsTest.java [new file with mode: 0644]
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImplDeleteTest.java [new file with mode: 0644]
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImplTest.java [new file with mode: 0644]
renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/CreateOtsOmsDataUtils.java [new file with mode: 0644]
renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/MountPointUtils.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/ServiceDataUtils.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/ServiceDeleteDataUtils.java
servicehandler/pom.xml
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/validation/checks/CheckCoherencyHardSoft.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/validation/checks/ServicehandlerCompliancyCheck.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/validation/checks/ServicehandlerTxRxCheck.java
test-common/pom.xml
tests/pom.xml
tests/stubmodels/pom.xml
tests/stubpce/pom.xml
tests/stubrenderer/pom.xml
tox.ini [new file with mode: 0644]

index 04e0228f4b233a88fe068eaa7154102450640b0b..8da0b1eec1fd8fe493716d9f31f59cabab2aaad4 100644 (file)
@@ -21,4 +21,9 @@ classes
 .metadata
 ordmodels/src/main/java
 tests/config.xml
-tests/models
\ No newline at end of file
+tests/models
+
+# Sphinx documentation
+.tox/
+docs/_build/
+
index ee4f2f9990718d146ce29b7e9218325081f4fb35..d512730a853611ed282ef908e61e3392651e1ed1 100644 (file)
@@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-api</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencies>
index 9daec9e681eeacc608228d958b485c61d2778769..7f683fa772d2d7816dcd7b1f95ebedde9072416c 100644 (file)
@@ -73,7 +73,10 @@ module portmapping {
        }
        leaf degree-number{
             type uint32;
-        }
+       }
+       leaf interface-name{
+          type string;
+       }
       }
     }
   }
index 4de4129d2c1bb5b5bd6179f90a886701c8605c10..b8f90c20c25dee4b310738b2ab39737a64cc8eec 100644 (file)
@@ -13,13 +13,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-artifacts</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <dependencyManagement>
index abe279f6db6ec5340c657a462ab554917a728294..c1c9f73c0db54b2b021055c20093439adf63c8d7 100644 (file)
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>bundle-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath />
     </parent>
 
     <groupId>org.opendaylight.transportpce</groupId>
     <artifactId>transportpce-common</artifactId>
-    <version>0.2.0-SNAPSHOT</version>
+    <version>0.3.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <dependencyManagement>
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>1.8.0-SNAPSHOT</version>
+                <version>1.9.0-SNAPSHOT</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.netconf</groupId>
                 <artifactId>netconf-artifacts</artifactId>
-                <version>1.5.0-SNAPSHOT</version>
+                <version>1.6.0-SNAPSHOT</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.mdsal.model</groupId>
                 <artifactId>mdsal-model-artifacts</artifactId>
-                <version>0.13.0-SNAPSHOT</version>
+                <version>0.14.0-SNAPSHOT</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index 7bf21e29d56c62b7b0f09e3d7848f300874685f1..66752cea539836485e2bb42bc7914536accc5ab0 100644 (file)
@@ -40,16 +40,21 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.degree.ConnectionPorts;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Degree;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.DegreeKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Info;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Protocols;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroup;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroupKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.port.Interfaces;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.InterfaceType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpenROADMOpticalMultiplex;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalTransport;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.Protocols1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.Lldp;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.PortConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.Network;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.NetworkBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.Nodes;
@@ -151,7 +156,9 @@ public class PortMappingImpl implements PortMapping {
 
         List<Degree> degrees = getDegrees(nodeId, deviceInfo);
         List<ConnectionPorts> degreeConPorts = getDegreePorts(degrees);
-        List<CpToDegree> cpToDegreeList = getCpToDegreeList(degrees);
+        Map<String, String> interfaceList = getEthInterfaceList(nodeId);
+        List<CpToDegree> cpToDegreeList = getCpToDegreeList(degrees, nodeId, interfaceList);
+        LOG.info("Map looks like this {}",interfaceList);
 
         postPortMapping(deviceInfo, null, deviceInfo.getNodeType().getIntValue(), cpToDegreeList);
 
@@ -433,9 +440,14 @@ public class PortMappingImpl implements PortMapping {
         return mpBldr.build();
     }
 
-    private static CpToDegree createCpToDegreeObject(String circuitPackName, String degreeNumber) {
+    private CpToDegree createCpToDegreeObject(String circuitPackName, String degreeNumber, String nodeId,
+                                                     Map<String, String> interfaceList) {
+        String interfaceName = null;
+        if (interfaceList.get(circuitPackName) !=  null) {
+            interfaceName = interfaceList.get(circuitPackName);
+        }
         return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
-            .setDegreeNumber(new Long(degreeNumber)).build();
+            .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
     }
 
     private static List<ConnectionPorts> getDegreePorts(List<Degree> degrees) {
@@ -443,12 +455,15 @@ public class PortMappingImpl implements PortMapping {
             .flatMap(degree -> degree.getConnectionPorts().stream()).collect(Collectors.toList());
     }
 
-    private List<CpToDegree> getCpToDegreeList(List<Degree> degrees) {
+    private List<CpToDegree> getCpToDegreeList(List<Degree> degrees, String nodeId,
+                                               Map<String, String> interfaceList) {
         List<CpToDegree> cpToDegreeList = new ArrayList<>();
         for (Degree degree : degrees) {
             if (degree.getCircuitPacks() != null) {
+                LOG.info("Inside CP to degree list");
                 cpToDegreeList.addAll(degree.getCircuitPacks().stream()
-                    .map(cp -> createCpToDegreeObject(cp.getCircuitPackName(), degree.getDegreeNumber().toString()))
+                    .map(cp -> createCpToDegreeObject(cp.getCircuitPackName() ,
+                            degree.getDegreeNumber().toString(), nodeId ,interfaceList))
                     .collect(Collectors.toList()));
             }
         }
@@ -627,4 +642,42 @@ public class PortMappingImpl implements PortMapping {
 
     }
 
-}
\ No newline at end of file
+    private Map<String, String> getEthInterfaceList(String nodeId) {
+        LOG.info("It is calling get ethernet interface");
+        Map<String, String> cpToInterfaceMap = new HashMap<>();
+        InstanceIdentifier<Lldp> lldpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                .child(Protocols.class).augmentation(Protocols1.class).child(Lldp.class);
+        Optional<Lldp> lldpObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+                LogicalDatastoreType.OPERATIONAL, lldpIID, Timeouts.DEVICE_READ_TIMEOUT,
+                Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+        if (lldpObject.isPresent() && (lldpObject.get().getPortConfig() != null)) {
+            for (PortConfig portConfig : lldpObject.get().getPortConfig()) {
+                if (portConfig.getAdminStatus().equals(PortConfig.AdminStatus.Txandrx)) {
+                    InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                            .child(Interface.class, new InterfaceKey(portConfig.getIfName()));
+                    Optional<Interface> interfaceObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+                            LogicalDatastoreType.OPERATIONAL, interfaceIID, Timeouts.DEVICE_READ_TIMEOUT,
+                            Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+                    if (interfaceObject.isPresent() && (interfaceObject.get().getSupportingCircuitPackName() != null)) {
+                        String supportingCircuitPackName = interfaceObject.get().getSupportingCircuitPackName();
+                        cpToInterfaceMap.put(supportingCircuitPackName, portConfig.getIfName());
+                        InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier.create(OrgOpenroadmDevice
+                                .class).child(CircuitPacks.class, new CircuitPacksKey(supportingCircuitPackName));
+                        Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(
+                                nodeId, LogicalDatastoreType.OPERATIONAL, circuitPacksIID, Timeouts
+                                                .DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+                        if (circuitPackObject.isPresent() && (circuitPackObject.get().getParentCircuitPack() != null)) {
+                            cpToInterfaceMap.put(circuitPackObject.get().getParentCircuitPack().getCircuitPackName() ,
+                                    portConfig.getIfName());
+                        }
+                    }
+                }
+            }
+        } else {
+            LOG.warn("Couldnt find port config under LLDP for Node : {}", nodeId);
+        }
+        LOG.info("Processiong is done.. now returning..");
+        return cpToInterfaceMap;
+    }
+
+}
index d0bc45e9553d97c74eda18163ef21b57462f29b4..fa45f1913f300518d0272300c9a4186febdd680c 100644 (file)
@@ -43,6 +43,8 @@ public interface OpenRoadmInterfaces {
      * @param nodeId node ID
      * @param circuitPackName Circtuit-Pack name
      * @param activate activate or not
+     *
+     * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
      */
     void postEquipmentState(String nodeId, String circuitPackName, boolean activate) throws OpenRoadmInterfaceException;
 
diff --git a/docs/_static/logo.png b/docs/_static/logo.png
new file mode 100644 (file)
index 0000000..861e1af
Binary files /dev/null and b/docs/_static/logo.png differ
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644 (file)
index 0000000..925316a
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2018 The Linux Foundation 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
+##############################################################################
+
+from docs_conf.conf import *
+
diff --git a/docs/conf.yaml b/docs/conf.yaml
new file mode 100644 (file)
index 0000000..2dd95bc
--- /dev/null
@@ -0,0 +1,4 @@
+project_cfg: opendaylight
+project: Transport PCE
+version: Neon
+
diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst
new file mode 100644 (file)
index 0000000..d8412b0
--- /dev/null
@@ -0,0 +1,567 @@
+.. _transportpce-dev-guide:
+
+TransportPCE Developer Guide
+============================
+
+Overview
+--------
+
+TransportPCE describes an application running on top of the OpenDaylight
+controller. Its primary function is to control an optical transport
+infrastructure using a non-proprietary South Bound Interface (SBI). It may be
+interconnected with Controllers of different layers (L2, L3 Controller…), a
+higher layer Controller and/or an Orchestrator through non-proprietary
+Application Programing Interfaces (APIs). Control includes the capability to
+configure the optical equipment, and to provision services according to a
+request coming from a higher layer controller and/or an orchestrator.
+This capability may rely on the controller only or it may be delegated to
+distributed (standardized) protocols.
+
+
+Architecture
+------------
+
+TransportPCE modular architecture is described on the next diagram. Each main
+function such as Topology management, Path Calculation Engine (PCE), Service
+handler, Renderer \_responsible for the path configuration through optical
+equipment\_ and Optical Line Management (OLM) is associated with a generic block
+relying on open models, each of them communicating through published APIs.
+
+
+.. figure:: ./images/tpce_architecture.jpg
+   :alt: TransportPCE architecture
+
+   TransportPCE architecture
+
+The current version of transportPCE is dedicated to the control of WDM transport
+infrastructure. OTN layer will be integrated in a later step. The WDM layer is
+built from colorless ROADMs and transponders.
+
+The interest of using a controller to provision automatically services strongly
+relies on its ability to handle end to end optical services that spans through
+the different network domains, potentially equipped with equipment coming from
+different suppliers. Thus, interoperability in the optical layer is a key
+element to get the benefit of automated control.
+
+Initial design of TransportPCE leverages Open ROADM Multi-Source-Agreement (MSA)
+which defines interoperability specifications, consisting of both Optical
+interoperability and Yang data models.
+
+Module description
+~~~~~~~~~~~~~~~~~~
+
+ServiceHandler
+^^^^^^^^^^^^^^
+
+Service Handler handles request coming from a higher level controller or an
+orchestrator through the northbound API, as defined in the Open ROADM service
+model. Current implementation addresses the following rpcs: service-create,
+service–delete, service-reroute.
+It checks the request consistency and trigs path calculation sending rpcs to the
+PCE. If a valid path is returned by the PCE, path configuration is initiated
+relying on Renderer and OLM.
+At the confirmation of a successful service creation, the Service Handler
+updates the service-list in the MD-SAL.
+For service deletion, the Service Handler relies on the Renderer and the OLM to
+delete connections and reset power levels associated with the service.
+The service-list is updated following a successful service deletion.
+
+
+PCE
+^^^^^^^^^^^^^^
+
+The Path Computation Element (PCE) is the component responsible for path
+calculation. An interface allows the Renderer or external components such as an
+orchestrator to request a path computation and get a response from the PCE
+including the computed path(s) in case of success, or errors and indication of
+the reason for the failure in case the request cannot be satisfied. Additional
+parameters can be provided by the PCE in addition to the computed paths if
+requested by the client module. An interface to the Topology Management module
+allows keeping PCE aligned with the latest changes in the topology. Information
+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. Wavelength is assigned
+considering a fixed grid of 96 wavelengths. Current PCE handles the following
+constraints as hard constraints:
+
+-   **Node exclusion**
+-   **SRLG exclusion**
+-   **Maximum latency**
+
+
+Topology Management
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Topology management module builds the Topology according to the Network model
+defined in OpenROADM. The topology is aligned with I2RS model. It includes
+several network layers:
+
+-  **CLLI layer corresponds to the locations that host equipment**
+-  **Network layer corresponds to a first level of disaggregation where we
+   separate Xponders (transponder, muxponders or switchponders) from ROADMs**
+-  **Topology layer introduces a second level of disaggregation where ROADMs
+   Add/Drop modules ("SRGs") are separated from the degrees which includes line
+   amplifiers and WSS that switch wavelengths from one to another degree**
+
+OTN layer which includes OTN elements having or not the ability to switch OTN
+containers from client to line cards is not currently implemented.
+
+Renderer
+^^^^^^^^
+
+The Renderer module, on request coming from the Service Handler through a
+service-implementation-request /service delete rpc, sets/deletes the path
+corresponding to a specific service between A and Z ends.
+It first checks what are the existing interfaces on the ports of the different
+nodes that the path crosses. It then creates missing interfaces. After all
+needed interfaces have been created it sets the connections required in the
+nodes and notifies the Service Handler on the status of the path creation.
+Path is created in 2 steps (from A to Z and Z to A). In case the path between
+A and Z could not be fully created, a rollback function is called to set the
+equipment on the path back to their initial configuration (as they were before
+invoking the Renderer).
+
+OLM
+^^^^^^^^
+
+Optical Line Management module implements two main features: it is responsible
+for setting up the optical power levels on the different interfaces, and is in
+charge of adjusting these settings across the life of the optical
+infrastructure.
+
+After the different connections have been established in the ROADMS, between 2
+Degrees for an express path, or between a SRG and a Degree for an Add or Drop
+path; meaning the devices have set WSS and all other required elements to
+provide path continuity, power setting are provided as attributes of these
+connections. This allows the device to set all complementary elements such as
+VOAs, to guaranty that the signal is launched at a correct power level
+(in accordance to the specifications) in the fiber span. This also applies
+to X-Ponders, as their output power must comply with the specifications defined
+for the Add/Drop ports (SRG) of the ROADM. OLM has the responsibility of
+calculating the right power settings, sending it to the device, and check the
+PM retrieved from the device to verify that the setting was correctly applied
+and the configuration was successfully completed.
+
+Key APIs and Interfaces
+-----------------------
+
+External API
+~~~~~~~~~~~~
+
+North API, interconnecting the Service Handler to higher level applications
+relies on the Service Model defined in the MSA. The Renderer and the OLM are
+developed to allow configuring Open ROADM devices through a southbound
+Netconf/Yang interface and rely on the MSA’s device model.
+
+ServiceHandler Service
+^^^^^^^^^^^^^^^^^^^^^^
+
+-  RPC call
+
+   -  service-create (given service-name, service-aend, service-zend)
+
+   -  service-delete (given service-name)
+
+   -  service-reroute (given service-name, service-aend, service-zend)
+
+-  Data structure
+
+   -  service list : composed of services
+   -  service : composed of service-name, topology wich describes the detailed path (list of used resources)
+
+-  Notification
+
+   - service-rpc-result : result of service RPC
+   - service-notification : service has been added, modified or removed
+
+Netconf Service
+^^^^^^^^^^^^^^^
+
+-  RPC call
+
+   -  connect-device : PUT
+   -  disconnect-device : DELETE
+   -  check-connected-device : GET
+
+-  Data Structure
+
+   -  node list : composed of netconf nodes in topology-netconf
+
+
+Internal APIs
+~~~~~~~~~~~~~
+
+Internal APIs define REST APIs to interconnect TransportPCE modules :
+
+-   Service Handler to PCE
+-   PCE to Topology Management
+-   Service Handler to Renderer
+-   Renderer to OLM
+
+Pce Service
+^^^^^^^^^^^
+
+-  RPC call
+
+   -  path-computation-request (given service-name, service-aend, service-zend)
+
+   -  cancel-resource-reserve (given service-name)
+
+-  Notification
+
+   - service-path-rpc-result : result of service RPC
+
+Renderer Service
+^^^^^^^^^^^^^^^^
+
+-  RPC call
+
+   -  service-implementation-request (given service-name, service-aend, service-zend)
+
+   -  service-delete (given service-name)
+
+-  Data structure
+
+   -  service path list : composed of service paths
+   -  service path : composed of service-name, path description giving the list of abstracted elements (nodes, tps, links)
+
+-  Notification
+
+   - service-path-rpc-result : result of service RPC
+
+Topology Management Service
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+-  Data structure
+
+   -  network list : composed of networks(openroadm-topology, netconf-topology)
+   -  node list : composed of node-id
+   -  link list : composed of link-id
+   -  node : composed of roadm, xponder
+      link : composed of links of different types (roadm-to-roadm, express, add-drop ...)
+
+OLM Service
+^^^^^^^^^^^
+
+-  RPC call
+
+   -  get-pm (given node-id)
+
+   -  service-power-setup
+
+   -  service-power-turndown
+
+   -  service-power-reset
+
+   -  calculate-spanloss-base
+
+   -  calculate-spanloss-current
+
+
+Running transportPCE project
+----------------------------
+
+To use transportPCE controller, the first step is to connect the controller to optical nodes
+through the NETCONF connector.
+
+.. note::
+
+    In the current version, only optical equipment compliant with open ROADM datamodels are managed
+    by transportPCE.
+
+
+Connecting nodes
+~~~~~~~~~~~~~~~~
+
+To connect a node, use the following JSON RPC
+
+**REST API** : *POST /restconf/config/network-topology:network-topology/topology/topology-netconf/node/<node-id>*
+
+**Sample JSON Data**
+
+.. code:: json
+
+    {
+        "node": [
+            {
+                "node-id": "<node-id>",
+                       "netconf-node-topology:tcp-only": "false",
+                       "netconf-node-topology:reconnect-on-changed-schema": "false",
+                       "netconf-node-topology:host": "<node-ip-address>",
+                       "netconf-node-topology:default-request-timeout-millis": "120000",
+                       "netconf-node-topology:max-connection-attempts": "0",
+                       "netconf-node-topology:sleep-factor": "1.5",
+                       "netconf-node-topology:actor-response-wait-time": "5",
+                       "netconf-node-topology:concurrent-rpc-limit": "0",
+                       "netconf-node-topology:between-attempts-timeout-millis": "2000",
+                       "netconf-node-topology:port": "<netconf-port>",
+                       "netconf-node-topology:connection-timeout-millis": "20000",
+                       "netconf-node-topology:username": "<node-username>",
+                       "netconf-node-topology:password": "<node-password>",
+                       "netconf-node-topology:keepalive-delay": "300"
+            }
+        ]
+    }
+
+
+Then check that the netconf session has been correctly established between the controller and the
+node. the status of **netconf-node-topology:connection-status** must be **connected**
+
+**REST API** : *GET /restconf/operational/network-topology:network-topology/topology/topology-netconf/node/<node-id>*
+
+
+Node configuration discovery
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Once the controller is connected to the node, transportPCE application automatically launchs a
+discovery of the node configuration datastore and creates **Logical Connection Points** to any
+physical ports related to transmission. All *circuit-packs* inside the node configuration are
+analyzed.
+
+Use the following JSON RPC to check that function internally named *portMapping*.
+
+**REST API** : *GET /restconf/config/portmapping:network*
+
+.. note::
+
+    In ``org-openroadm-device.yang``, two types of optical nodes can be managed:
+        * rdm: ROADM device (optical switch)
+        * xpdr: Xponder device (device that converts client to optical channel interface)
+
+Depending on the kind of open ROADM device connected, different kind of *Logical Connection Points*
+should appear, if the node configuration is not empty:
+
+-  DEG<degree-number>-TTP-<port-direction>: created on the line port of a degree on a rdm equipment
+-  SRG<srg-number>-PP<port-number>: created on the client port of a srg on a rdm equipment
+-  XPDR<number>-CLIENT<port-number>: created on the client port of a xpdr equipment
+-  XPDR<number>-NETWORK<port-number>: created on the line port of a xpdr equipment
+
+    For further details on openROADM device models, see `openROADM MSA white paper <https://0201.nccdn.net/1_2/000/000/134/c50/Open-ROADM-MSA-release-2-Device-White-paper-v1-1.pdf>`__.
+
+Optical Network topology
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Before creating an optical connectivity service, your topology must contain at least two xpdr
+devices connected to two different rdm devices. Normally, the *openroadm-topology* is automatically
+created by transportPCE. Nevertheless, depending on the configuration inside optical nodes, this
+topology can be partial. Check that link of type *ROADMtoROADM* exists between two adjacent rdm
+nodes.
+
+**REST API** : *GET /restconf/config/ietf-network:network/openroadm-topology*
+
+If it is not the case, you need to manually complement the topology with *ROADMtoROADM* link using
+the following REST RPC:
+
+
+**REST API** : *POST /restconf/operations/networkutils:init-roadm-nodes*
+
+**Sample JSON Data**
+
+.. code:: json
+
+    {
+      "networkutils:input": {
+        "networkutils:rdm-a-node": "<node-id-A>",
+        "networkutils:deg-a-num": "<degree-A-number>",
+        "networkutils:termination-point-a": "<Logical-Connection-Point>",
+        "networkutils:rdm-z-node": "<node-id-Z>",
+        "networkutils:deg-z-num": "<degree-Z-number>",
+        "networkutils:termination-point-z": "<Logical-Connection-Point>"
+      }
+    }
+
+*<Logical-Connection-Point> comes from the portMapping function*.
+
+Unidirectional links between xpdr and rdm nodes must be created manually. To that end use the two
+following REST RPCs:
+
+From xpdr to rdm:
+^^^^^^^^^^^^^^^^^
+
+**REST API** : *POST /restconf/operations/networkutils:init-xpdr-rdm-links*
+
+**Sample JSON Data**
+
+.. code:: json
+
+    {
+      "networkutils:input": {
+        "networkutils:links-input": {
+          "networkutils:xpdr-node": "<xpdr-node-id>",
+          "networkutils:xpdr-num": "1",
+          "networkutils:network-num": "<xpdr-network-port-number>",
+          "networkutils:rdm-node": "<rdm-node-id>",
+          "networkutils:srg-num": "<srg-number>",
+          "networkutils:termination-point-num": "<Logical-Connection-Point>"
+        }
+      }
+    }
+
+From rdm to xpdr:
+^^^^^^^^^^^^^^^^^
+
+**REST API** : *POST /restconf/operations/networkutils:init-rdm-xpdr-links*
+
+**Sample JSON Data**
+
+.. code:: json
+
+    {
+      "networkutils:input": {
+        "networkutils:links-input": {
+          "networkutils:xpdr-node": "<xpdr-node-id>",
+          "networkutils:xpdr-num": "1",
+          "networkutils:network-num": "<xpdr-network-port-number>",
+          "networkutils:rdm-node": "<rdm-node-id>",
+          "networkutils:srg-num": "<srg-number>",
+          "networkutils:termination-point-num": "<Logical-Connection-Point>"
+        }
+      }
+    }
+
+
+Creating a service
+~~~~~~~~~~~~~~~~~~
+
+Use the following REST RPC to invoke *service handler* module in order to create a bidirectional
+end-to-end optical connectivity service between two xpdr over an optical network composed of rdm
+nodes.
+
+**REST API** : *POST /restconf/operations/org-openroadm-service:service-create*
+
+**Sample JSON Data**
+
+.. code:: json
+
+    {
+       "input": {
+               "sdnc-request-header": {
+                       "request-id": "request-1",
+                       "rpc-action": "service-create",
+                       "request-system-id": "appname"
+               },
+               "service-name": "test1",
+               "common-id": "commonId",
+               "connection-type": "service",
+               "service-a-end": {
+                       "service-rate": "100",
+                       "node-id": "<xpdr-node-id>",
+                       "service-format": "Ethernet",
+                       "clli": "<ccli-name>",
+                       "tx-direction": {
+                               "port": {
+                                       "port-device-name": "<xpdr-client-port>",
+                                       "port-type": "fixed",
+                                       "port-name": "<xpdr-client-port-number>",
+                                       "port-rack": "000000.00",
+                                       "port-shelf": "Chassis#1"
+                               },
+                               "lgx": {
+                                       "lgx-device-name": "Some lgx-device-name",
+                                       "lgx-port-name": "Some lgx-port-name",
+                                       "lgx-port-rack": "000000.00",
+                                       "lgx-port-shelf": "00"
+                               }
+                       },
+                       "rx-direction": {
+                               "port": {
+                                       "port-device-name": "<xpdr-client-port>",
+                                       "port-type": "fixed",
+                                       "port-name": "<xpdr-client-port-number>",
+                                       "port-rack": "000000.00",
+                                       "port-shelf": "Chassis#1"
+                               },
+                               "lgx": {
+                                       "lgx-device-name": "Some lgx-device-name",
+                                       "lgx-port-name": "Some lgx-port-name",
+                                       "lgx-port-rack": "000000.00",
+                                       "lgx-port-shelf": "00"
+                               }
+                       },
+                       "optic-type": "gray"
+               },
+               "service-z-end": {
+                       "service-rate": "100",
+                       "node-id": "<xpdr-node-id>",
+                       "service-format": "Ethernet",
+                       "clli": "<ccli-name>",
+                       "tx-direction": {
+                               "port": {
+                                       "port-device-name": "<xpdr-client-port>",
+                                       "port-type": "fixed",
+                                       "port-name": "<xpdr-client-port-number>",
+                                       "port-rack": "000000.00",
+                                       "port-shelf": "Chassis#1"
+                               },
+                               "lgx": {
+                                       "lgx-device-name": "Some lgx-device-name",
+                                       "lgx-port-name": "Some lgx-port-name",
+                                       "lgx-port-rack": "000000.00",
+                                       "lgx-port-shelf": "00"
+                               }
+                       },
+                       "rx-direction": {
+                               "port": {
+                                       "port-device-name": "<xpdr-client-port>",
+                                       "port-type": "fixed",
+                                       "port-name": "<xpdr-client-port-number>",
+                                       "port-rack": "000000.00",
+                                       "port-shelf": "Chassis#1"
+                               },
+                               "lgx": {
+                                       "lgx-device-name": "Some lgx-device-name",
+                                       "lgx-port-name": "Some lgx-port-name",
+                                       "lgx-port-rack": "000000.00",
+                                       "lgx-port-shelf": "00"
+                               }
+                       },
+                       "optic-type": "gray"
+               },
+               "due-date": "yyyy-mm-ddT00:00:01Z",
+               "operator-contact": "some-contact-info"
+       }
+    }
+
+Most important parameters for this REST RPC are the identification of the two physical client ports
+on xpdr nodes.This RPC invokes the *PCE* module to compute a path over the *openroadm-topology* and
+then invokes *renderer* and *OLM* to implement the end-to-end path into the devices.
+
+
+Deleting a service
+~~~~~~~~~~~~~~~~~~
+
+Use the following REST RPC to invoke *service handler* module in order to delete a given optical
+connectivity service.
+
+**REST API** : *POST /restconf/operations/org-openroadm-service:service-delete*
+
+**Sample JSON Data**
+
+.. code:: json
+
+    {
+       "input": {
+               "sdnc-request-header": {
+                       "request-id": "request-1",
+                       "rpc-action": "service-delete",
+                       "request-system-id": "appname",
+                       "notification-url": "http://localhost:8585/NotificationServer/notify"
+               },
+               "service-delete-req-info": {
+                       "service-name": "test1",
+                       "tail-retention": "no"
+               }
+       }
+    }
+
+Most important parameters for this REST RPC is the *service-name*.
+
+
+Help
+----
+
+-  `TransportPCE Wiki <https://wiki.opendaylight.org/view/TransportPCE:Main>`__
+
+-  TransportPCE Mailing List
+   (`developer <https://lists.opendaylight.org/mailman/listinfo/transportpce-dev>`__)
diff --git a/docs/favicon.ico b/docs/favicon.ico
new file mode 100644 (file)
index 0000000..c9b3888
Binary files /dev/null and b/docs/favicon.ico differ
diff --git a/docs/images/tpce_architecture.jpg b/docs/images/tpce_architecture.jpg
new file mode 100644 (file)
index 0000000..4f81fbf
Binary files /dev/null and b/docs/images/tpce_architecture.jpg differ
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644 (file)
index 0000000..194db26
--- /dev/null
@@ -0,0 +1,11 @@
+.. _transportpce:
+
+###########################
+Transport PCE Documentation
+###########################
+
+.. toctree::
+   :maxdepth: 1
+
+   developer-guide
+   user-guide
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644 (file)
index 0000000..74a3b7a
--- /dev/null
@@ -0,0 +1 @@
+lfdocs-conf
diff --git a/docs/user-guide.rst b/docs/user-guide.rst
new file mode 100644 (file)
index 0000000..3c7994f
--- /dev/null
@@ -0,0 +1,83 @@
+.. _transportpce-user-guide:
+
+TransportPCE User Guide
+=======================
+
+Overview
+--------
+
+TransportPCE describes an application running on top of the OpenDaylight
+controller. Its primary function is to control an optical transport
+infrastructure using a non-proprietary South Bound Interface (SBI). It may be
+interconnected with Controllers of different layers (L2, L3 Controller…),
+a higher layer Controller and/or an Orchestrator through non-proprietary
+Application Programing Interfaces (APIs). Control includes the capability to
+configure the optical equipment, and to provision services according to a
+request coming from a higher layer controller and/or an orchestrator.
+This capability may rely on the controller only or it may be delegated to
+distributed (standardized) protocols.
+
+It provides alarm/fault and performance
+monitoring, but this function might be externalized to improve the scalability.
+A Graphical User Interface could be developed in a later step, but is not
+considered as a priority since automated control does not imply user
+interactions at the transport controller level.
+
+TransportPCE modular architecture is described on the next diagram. Each main
+function such as Topology management, Path Calculation Engine (PCE), Service
+handler, Renderer responsible for the path configuration through optical
+equipment and Optical Line Management (OLM) is associated with a generic block
+relying on open models, each of them communicating through published APIs.
+
+.. figure:: ./images/tpce_architecture.jpg
+   :alt: TransportPCE architecture
+
+   TransportPCE architecture
+
+TransportPCE User-Facing Features
+---------------------------------
+-  **odl-transportpce**
+
+   -  This feature contains all other features/bundles of TransportPCE project.
+      If you install it, it provides all functions that the TransportPCE project
+      can support.
+
+-  **odl-transportpce-api**
+
+   -  This feature contains all Transportpce project specific models defined in "Service-path".
+      These models complement OpenROADM models describing South and Northbound APIs, and define the
+      data structure used to interconnect the generic blocks/functions described on the previous
+      diagram.
+
+-  **odl-transportpce-ordmodels**
+
+   -  This feature contains all OpenROADM models : Common, Device, Network and Service models.
+
+-  **odl-transportpce-stubmodels**
+
+   -  This feature provides function to be able to stub some of TransportPCE modules, pce and
+      renderer (Stubpce and Stubrenderer).
+      Stubs are used for development purposes and required for some of the functionnal tests.
+
+
+How To Start
+------------
+
+Preparing for Installation
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1. Devices must support the standard OpenROADM Models more precisely versions
+   1.2.1 and 2.1.
+
+2. Devices must support configuration through NETCONF protocol/API.
+
+
+
+Installation Feature
+~~~~~~~~~~~~~~~~~~~~
+
+Run OpenDaylight and install TransportPCE Service *odl-transportpce* as below::
+
+   feature:install odl-transportpce
+
+For a more detailed overview of the TransportPCE, see the :ref:`transportpce-dev-guide`.
index 0b995d0b245983e23305018b7ab4baadcbd03959..8e96c85fd267ae14adf2b281de72bad0c6fe865c 100644 (file)
@@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>feature-repo-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>features-transportpce</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>feature</packaging>
 
   <dependencies>
index 04d5678b873219dc9087bf60a70a49460d907aa0..7660d2d3e611dc00ffad1a8a6d9d8c9345f37425 100644 (file)
@@ -12,22 +12,22 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>odl-transportpce-api</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>feature</packaging>
 
 
   <properties>
-    <mdsal.model.version>0.13.0-SNAPSHOT</mdsal.model.version>
-    <mdsal.version>1.8.0-SNAPSHOT</mdsal.version>
-    <restconf.version>1.8.0-SNAPSHOT</restconf.version>
-    <yangtools.version>2.0.7</yangtools.version>
-    <netconf.version>1.5.0-SNAPSHOT</netconf.version>
+    <mdsal.model.version>0.14.0-SNAPSHOT</mdsal.model.version>
+    <mdsal.version>1.9.0-SNAPSHOT</mdsal.version>
+    <restconf.version>1.9.0-SNAPSHOT</restconf.version>
+    <yangtools.version>2.0.9</yangtools.version>
+    <netconf.version>1.6.0-SNAPSHOT</netconf.version>
     <configfile.directory>etc/opendaylight/karaf</configfile.directory>
   </properties>
 
index 8e95a6fad3aaa207c1ceb0a41c3d75e8f0ff373c..9f7c94ac70cd9a4d8ca8d5ad089bc87ad0bf7d52 100644 (file)
@@ -12,21 +12,21 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>odl-transportpce-ordmodels</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>feature</packaging>
 
   <properties>
-    <mdsal.model.version>0.13.0-SNAPSHOT</mdsal.model.version>
-    <mdsal.version>1.8.0-SNAPSHOT</mdsal.version>
-    <restconf.version>1.8.0-SNAPSHOT</restconf.version>
-    <yangtools.version>2.0.7</yangtools.version>
-    <netconf.version>1.5.0-SNAPSHOT</netconf.version>
+    <mdsal.model.version>0.14.0-SNAPSHOT</mdsal.model.version>
+    <mdsal.version>1.9.0-SNAPSHOT</mdsal.version>
+    <restconf.version>1.9.0-SNAPSHOT</restconf.version>
+    <yangtools.version>2.0.9</yangtools.version>
+    <netconf.version>1.6.0-SNAPSHOT</netconf.version>
     <configfile.directory>etc/opendaylight/karaf</configfile.directory>
   </properties>
 
index af8ce30b7dee620842ee2020597ca226c35797e9..3c0df451876dcecad229574fd2286196f34ff6d2 100644 (file)
@@ -12,18 +12,18 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>odl-transportpce-stubmodels</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>feature</packaging>
 
 
   <properties>
-    <mdsal.model.version>0.13.0-SNAPSHOT</mdsal.model.version>
+    <mdsal.model.version>0.14.0-SNAPSHOT</mdsal.model.version>
     <configfile.directory>etc/opendaylight/karaf</configfile.directory>
   </properties>
 
@@ -34,7 +34,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-inet-types-2013-07-15</artifactId>
-      <version>1.5.0-SNAPSHOT</version>
+      <version>1.6.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
index b1ceee092f34e523573a409184526f5bd8a79964..5f5eded9ac1839344d80baf7f8855d57d4676de3 100644 (file)
@@ -12,22 +12,22 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>odl-transportpce</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>feature</packaging>
 
 
   <properties>
-    <mdsal.model.version>0.13.0-SNAPSHOT</mdsal.model.version>
-    <mdsal.version>1.8.0-SNAPSHOT</mdsal.version>
-    <yangtools.version>2.0.7</yangtools.version>
-    <netconf.version>1.5.0-SNAPSHOT</netconf.version>
-    <restconf.version>1.8.0-SNAPSHOT</restconf.version>
+    <mdsal.model.version>0.14.0-SNAPSHOT</mdsal.model.version>
+    <mdsal.version>1.9.0-SNAPSHOT</mdsal.version>
+    <yangtools.version>2.0.9</yangtools.version>
+    <netconf.version>1.6.0-SNAPSHOT</netconf.version>
+    <restconf.version>1.9.0-SNAPSHOT</restconf.version>
     <configfile.directory>etc/opendaylight/karaf</configfile.directory>
   </properties>
 
index fed6f17b923dc2ff94e44b1d8f259c38be402cb0..6ab23c37e8a74c739667ca81aa697e1abecfeb2a 100644 (file)
@@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>features-aggregator</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <name>${project.artifactId}</name>
   <packaging>pom</packaging>
 
index 6d7e8dd324ecf4791d687b9e3fcac665fa1e2bd6..796f9f2dd50488143f5045452774d68c701e03b1 100644 (file)
@@ -19,7 +19,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-impl</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencies>
index c78c38f44c4ce413cadfcb7a5464c99746f971a7..af1fc47444e8c14525906319cdd4d5e1c8f4859f 100644 (file)
@@ -18,14 +18,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-it</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <properties>
     <skipITs>true</skipITs>
     <karaf.distro.groupId>org.opendaylight.transportpce</karaf.distro.groupId>
     <karaf.distro.artifactId>transportpce-karaf</karaf.distro.artifactId>
-    <karaf.distro.version>0.2.0-SNAPSHOT</karaf.distro.version>
+    <karaf.distro.version>0.3.0-SNAPSHOT</karaf.distro.version>
     <karaf.distro.type>zip</karaf.distro.type>
   </properties>
 
index ed689b708f1ee6603d6eb9e452506cedfc69ef61..2cd5bc35c23c72a72759e6361f095cba56fe0c37 100644 (file)
@@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>karaf4-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-karaf</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <name>${project.artifactId}</name>
   <packaging>pom</packaging>
 
index bcc5066f621e4af33801ac2e815d2501b9fcf283..efcf87b2089f5f9b306df7bbe47a21a8e574195c 100644 (file)
@@ -13,13 +13,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>bundle-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-networkmodel</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencyManagement>
@@ -27,7 +27,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <dependency>
         <groupId>org.opendaylight.netconf</groupId>
         <artifactId>netconf-artifacts</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
index 40ae84c062bf48438ad0a4d2993bbbaed8d9474e..78b76f2d29111a3119e60648edc1e8b35d8c400e 100644 (file)
@@ -7,24 +7,22 @@
  */
 package org.opendaylight.transportpce.networkmodel;
 
+import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.MountPoint;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.Timeouts;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
-import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.networkmodel.util.OpenRoadmTopology;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev170929.Direction;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacks;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Degree;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.DegreeKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Protocols;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.Protocols1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.NbrList;
@@ -35,7 +33,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapp
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.NodesKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.CpToDegree;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.CpToDegreeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -50,7 +48,7 @@ public class R2RLinkDiscovery {
     private final OpenRoadmInterfaces openRoadmInterfaces;
 
     public R2RLinkDiscovery(final DataBroker dataBroker, DeviceTransactionManager deviceTransactionManager,
-            OpenRoadmTopology openRoadmTopology, OpenRoadmInterfaces openRoadmInterfaces) {
+                            OpenRoadmTopology openRoadmTopology, OpenRoadmInterfaces openRoadmInterfaces) {
         this.dataBroker = dataBroker;
         this.deviceTransactionManager = deviceTransactionManager;
         this.openRoadmTopology = openRoadmTopology;
@@ -71,19 +69,21 @@ public class R2RLinkDiscovery {
         LOG.info("LLDP subtree is present. Device has {} neighbours", nbrList.getIfName().size());
         for (IfName ifName : nbrList.getIfName()) {
             if (ifName.getRemoteSysName() == null) {
-                LOG.error("LLDP subtree is empty in the device for nodeId: {}", nodeId.getValue());
-                return false;
-            }
-            Optional<MountPoint> mps = this.deviceTransactionManager.getDeviceMountPoint(ifName.getRemoteSysName());
-            if (!mps.isPresent()) {
-                LOG.warn("Neighbouring nodeId: {} is not mounted yet", ifName.getRemoteSysName());
-                // The controller raises a warning rather than an error because the first node to
-                // mount cannot see its neighbors yet. The link will be detected when processing
-                // the neighbor node.
+                LOG.warn("LLDP subtree neighbour is empty for nodeId: {}, ifName: {}",
+                        nodeId.getValue(),ifName.getIfName());
             } else {
-                if (!createR2RLink(nodeId, ifName.getIfName(), ifName.getRemoteSysName(), ifName.getRemotePortId())) {
-                    LOG.error("Link Creation failed between {} and {} nodes.", nodeId, ifName.getRemoteSysName());
-                    return false;
+                Optional<MountPoint> mps = this.deviceTransactionManager.getDeviceMountPoint(ifName.getRemoteSysName());
+                if (!mps.isPresent()) {
+                    LOG.warn("Neighbouring nodeId: {} is not mounted yet", ifName.getRemoteSysName());
+                    // The controller raises a warning rather than an error because the first node to
+                    // mount cannot see its neighbors yet. The link will be detected when processing
+                    // the neighbor node.
+                } else {
+                    if (!createR2RLink(nodeId, ifName.getIfName(), ifName.getRemoteSysName(),
+                            ifName.getRemotePortId())) {
+                        LOG.error("Link Creation failed between {} and {} nodes.", nodeId, ifName.getRemoteSysName());
+                        return false;
+                    }
                 }
             }
         }
@@ -91,36 +91,37 @@ public class R2RLinkDiscovery {
     }
 
     public Direction getDegreeDirection(Integer degreeCounter, NodeId nodeId) {
-        InstanceIdentifier<Degree> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(Degree.class,
-                new DegreeKey(degreeCounter));
-        Optional<Degree> degreeObject = this.deviceTransactionManager.getDataFromDevice(nodeId.getValue(),
-                LogicalDatastoreType.OPERATIONAL, deviceIID, Timeouts.DEVICE_READ_TIMEOUT,
-                Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-        if (degreeObject.isPresent()) {
-            Integer connectionPortCount = degreeObject.get().getConnectionPorts().size();
-            if (connectionPortCount == 1) {
-                return Direction.Bidirectional;
-            } else if (connectionPortCount > 1) {
-                return Direction.Tx;
-            } else {
-                return Direction.NotApplicable;
+        InstanceIdentifier<Nodes> nodesIID = InstanceIdentifier.builder(Network.class)
+                .child(Nodes.class, new NodesKey(nodeId.getValue())).build();
+        try (ReadOnlyTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
+            Optional<Nodes> nodesObject = readTx.read(LogicalDatastoreType.CONFIGURATION, nodesIID)
+                    .get().toJavaUtil();
+            if (nodesObject.isPresent() && nodesObject.get().getMapping() != null) {
+                List<Mapping> mappingList = nodesObject.get().getMapping();
+                mappingList = mappingList.stream().filter(mp -> mp.getLogicalConnectionPoint().contains("DEG"
+                        + degreeCounter)).collect(Collectors.toList());
+                if (mappingList.size() == 1) {
+                    return Direction.Bidirectional;
+                } else if (mappingList.size() > 1) {
+                    return Direction.Tx;
+                } else {
+                    return Direction.NotApplicable;
+                }
             }
-        } else {
-            LOG.error("Couldnt retrieve Degree object for nodeId: {} and DegreeNumbner: {}", nodeId.getValue(),
-                    degreeCounter);
-            return Direction.NotApplicable;
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.error("Failed getting Mapping data from portMapping",e);
         }
+        return Direction.NotApplicable;
     }
 
     public boolean createR2RLink(NodeId nodeId, String interfaceName, String remoteSystemName,
-            String remoteInterfaceName) {
+                                 String remoteInterfaceName) {
         String srcTpTx = null;
         String srcTpRx = null;
         String destTpTx = null;
         String destTpRx = null;
         // Find which degree is associated with ethernet interface
-        // portmapping.getDegFromCP(nodeId,interfaceName);
-        Integer srcDegId = getDegFromCP(nodeId, interfaceName);
+        Integer srcDegId = getDegFromInterface(nodeId, interfaceName);
         if (srcDegId == null) {
             LOG.error("Couldnt find degree connected to Ethernet interface for nodeId: {}", nodeId);
             return false;
@@ -141,8 +142,7 @@ public class R2RLinkDiscovery {
         }
         // Find degree for which Ethernet interface is created on other end
         NodeId destNodeId = new NodeId(remoteSystemName);
-        Integer destDegId = getDegFromCP(destNodeId, remoteInterfaceName);
-        // portmapping.getDegFromCP(nodeId,interfaceName);
+        Integer destDegId = getDegFromInterface(destNodeId, remoteInterfaceName);
         if (destDegId == null) {
             LOG.error("Couldnt find degree connected to Ethernet interface for nodeId: {}", nodeId);
             return false;
@@ -164,7 +164,7 @@ public class R2RLinkDiscovery {
         // A->Z
         LOG.debug(
             "Found a neighbor SrcNodeId: {} , SrcDegId: {} , SrcTPId: {}, DestNodeId:{} , DestDegId: {}, DestTPId: {}",
-                nodeId.getValue(), srcDegId, srcTpTx, destNodeId, destDegId, destTpRx);
+            nodeId.getValue(), srcDegId, srcTpTx, destNodeId, destDegId, destTpRx);
         InitRoadmNodesInputBuilder r2rlinkBuilderAToZ = new InitRoadmNodesInputBuilder();
         r2rlinkBuilderAToZ.setRdmANode(nodeId.getValue()).setDegANum(srcDegId.shortValue())
                 .setTerminationPointA(srcTpTx).setRdmZNode(destNodeId.getValue()).setDegZNum(destDegId.shortValue())
@@ -193,14 +193,13 @@ public class R2RLinkDiscovery {
     }
 
     public boolean deleteR2RLink(NodeId nodeId, String interfaceName, String remoteSystemName,
-            String remoteInterfaceName) {
+                                 String remoteInterfaceName) {
         String srcTpTx = null;
         String srcTpRx = null;
         String destTpTx = null;
         String destTpRx = null;
         // Find which degree is associated with ethernet interface
-        // portmapping.getDegFromCP(nodeId,interfaceName);
-        Integer srcDegId = getDegFromCP(nodeId, interfaceName);
+        Integer srcDegId = getDegFromInterface(nodeId, interfaceName);
         if (srcDegId == null) {
             LOG.error("Couldnt find degree connected to Ethernet interface for nodeId: {}", nodeId);
             return false;
@@ -220,8 +219,7 @@ public class R2RLinkDiscovery {
         }
         // Find degree for which Ethernet interface is created on other end
         NodeId destNodeId = new NodeId(remoteSystemName);
-        // portmapping.getDegFromCP(nodeId,interfaceName);
-        Integer destDegId = getDegFromCP(destNodeId, remoteInterfaceName);
+        Integer destDegId = getDegFromInterface(destNodeId, remoteInterfaceName);
         if (destDegId == null) {
             LOG.error("Couldnt find degree connected to Ethernet interface for nodeId: {}", nodeId);
             return false;
@@ -239,78 +237,42 @@ public class R2RLinkDiscovery {
             destTpTx = "DEG" + destDegId + "-TTP-TX";
             destTpRx = "DEG" + destDegId + "-TTP-RX";
         }
-        return this.openRoadmTopology.deleteLink(nodeId.getValue(), destNodeId.getValue(), srcTpTx, destTpRx)
-                && this.openRoadmTopology.deleteLink(destNodeId.getValue(), nodeId.getValue(), destTpTx, srcTpRx);
+        return this.openRoadmTopology.deleteLink(nodeId.getValue(), destNodeId.getValue(),
+                srcDegId, destDegId, srcTpTx, destTpRx)
+                && this.openRoadmTopology.deleteLink(destNodeId.getValue(), nodeId.getValue(),
+                destDegId, srcDegId, destTpTx, srcTpRx);
     }
 
-    private CpToDegree getCPtoDegreeMapping(NodeId nodeId, String circuitPackName) {
-        InstanceIdentifier<CpToDegree> cptoDegMappingIID = InstanceIdentifier.builder(Network.class)
-                .child(Nodes.class, new NodesKey(nodeId.getValue()))
-                .child(CpToDegree.class, new CpToDegreeKey(circuitPackName)).build();
-        LOG.debug("Input parameters are {},{}", nodeId.getValue(), circuitPackName);
+    private Integer getDegFromInterface(NodeId nodeId, String interfaceName) {
+        InstanceIdentifier<Nodes> nodesIID = InstanceIdentifier.builder(Network.class)
+                .child(Nodes.class, new NodesKey(nodeId.getValue())).build();
         try (ReadOnlyTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
-            Optional<CpToDegree> cptpDegObject = readTx.read(LogicalDatastoreType.CONFIGURATION, cptoDegMappingIID)
+            Optional<Nodes> nodesObject = readTx.read(LogicalDatastoreType.CONFIGURATION, nodesIID)
                     .get().toJavaUtil();
-            if (cptpDegObject.isPresent()) {
-                CpToDegree cpToDeg = cptpDegObject.get();
-                LOG.debug("Found mapping for the Circuit Pack {}. Degree: {}", circuitPackName, cpToDeg);
-                return cpToDeg;
+            if (nodesObject.isPresent() && nodesObject.get().getCpToDegree() != null) {
+                List<CpToDegree> cpToDeg = nodesObject.get().getCpToDegree();
+                Stream cpToDegStream = cpToDeg.stream().filter(cp -> cp.getInterfaceName() != null)
+                        .filter(cp -> cp.getInterfaceName().equals(interfaceName));
+                if (cpToDegStream != null) {
+                    Optional<CpToDegree> firstCpToDegree = cpToDegStream.findFirst();
+                    if (firstCpToDegree.isPresent() && firstCpToDegree != null) {
+                        LOG.debug("Found and returning {}",firstCpToDegree.get().getDegreeNumber().intValue());
+                        return firstCpToDegree.get().getDegreeNumber().intValue();
+                    } else {
+                        LOG.debug("Not found so returning nothing");
+                        return null;
+                    }
+                } else {
+                    LOG.warn("CircuitPack stream couldnt find anything for nodeId: {} and interfaceName: {}",
+                            nodeId.getValue(),interfaceName);
+                }
             } else {
-                LOG.warn("Could not find mapping for Circuit Pack {} for nodeId {}", circuitPackName,
-                        nodeId.getValue());
+                LOG.warn("Could not find mapping for Interface {} for nodeId {}", interfaceName,
+                            nodeId.getValue());
             }
         } catch (InterruptedException | ExecutionException ex) {
-            LOG.error("Unable to read mapping for circuit pack : {} for nodeId {}", circuitPackName, nodeId, ex);
+            LOG.error("Unable to read mapping for Interface : {} for nodeId {}", interfaceName, nodeId, ex);
         }
         return null;
     }
-
-    private Integer getDegFromParentCP(NodeId nodeId, String interfaceName, String supportingCircuitPack) {
-        InstanceIdentifier<CircuitPacks> circuitPackIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
-                .child(CircuitPacks.class, new CircuitPacksKey(supportingCircuitPack));
-        Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(nodeId.getValue(),
-                LogicalDatastoreType.OPERATIONAL, circuitPackIID, Timeouts.DEVICE_READ_TIMEOUT,
-                Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-        if (!circuitPackObject.isPresent()
-                || (circuitPackObject.get().getParentCircuitPack().getCircuitPackName() == null)) {
-            LOG.warn("Parent circuitpack not found for NodeId: {} and Interface: {}", nodeId, interfaceName);
-            return null;
-        }
-        String parentCP = circuitPackObject.get().getParentCircuitPack().getCircuitPackName();
-        CpToDegree cpToDegree = getCPtoDegreeMapping(nodeId, parentCP);
-        if (cpToDegree == null) {
-            LOG.error("CP to Degree mapping not found even with parent circuitpack for NodeID: {}" + "and Interface {}",
-                    nodeId, interfaceName);
-            return null;
-        } else {
-            LOG.debug("CP to degree is {}", cpToDegree.getDegreeNumber());
-            return cpToDegree.getDegreeNumber().intValue();
-        }
-    }
-
-    private Integer getDegFromCP(NodeId nodeId, String interfaceName) {
-        try {
-            java.util.Optional<Interface> interfaceOpt = this.openRoadmInterfaces.getInterface(nodeId.getValue(),
-                    interfaceName);
-            if (!interfaceOpt.isPresent()) {
-                LOG.warn("Interface with {} on node {} was not found!", interfaceName, nodeId.getValue());
-                return null;
-            }
-            String supportingCircuitPack = interfaceOpt.get().getSupportingCircuitPackName();
-            LOG.debug("Supporting circuitpack name is :{}", interfaceOpt.get().getSupportingCircuitPackName());
-            CpToDegree cpToDegree = getCPtoDegreeMapping(nodeId, supportingCircuitPack);
-            // Currently devices have different ways to represent connection to Ethernet port
-            // and degree port.
-            // If Circuit pack is not present under degree tree then read parent CP of given
-            // CP (Circuit pack).
-            if (cpToDegree != null) {
-                return cpToDegree.getDegreeNumber().intValue();
-            } else {
-                return getDegFromParentCP(nodeId, interfaceName, supportingCircuitPack);
-            }
-        } catch (OpenRoadmInterfaceException ex) {
-            LOG.error("Failed to get source interface {} from node {}!", interfaceName, nodeId, ex);
-            return null;
-        }
-    }
 }
index 950e821aed8f149e2a87f3145ec5477a9f2464a5..a447f5fd4c4ea027eb50aeec1cfc4cceeee30a72 100644 (file)
@@ -804,16 +804,21 @@ public class OpenRoadmTopology {
     }
 
     // This method returns the linkBuilder object for given source and destination.
-    public boolean deleteLink(String srcNode, String dstNode, String srcTp, String destTp) {
+    public boolean deleteLink(String srcNode, String dstNode, Integer srcDegId,
+            Integer destDegId ,String srcTp, String destTp) {
         LOG.info("deleting link for {}-{}", srcNode, dstNode);
         try {
+            LinkId linkId = LinkIdUtil.buildLinkId(srcNode + "-DEG" + srcDegId,
+                    srcTp, dstNode + "-DEG" + destDegId, destTp);
+            LOG.info("Link is for the link is {}", linkId.getValue());
             InstanceIdentifierBuilder<Link> linkIID = InstanceIdentifier
                     .builder(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
-                    .augmentation(Network1.class)
-                    .child(Link.class, new LinkKey(LinkIdUtil.buildLinkId(srcNode, srcTp, dstNode, destTp)));
+                    .augmentation(Network1.class).child(Link.class, new LinkKey(linkId));
             WriteTransaction wrtx = this.dataBroker.newWriteOnlyTransaction();
             wrtx.delete(LogicalDatastoreType.CONFIGURATION, linkIID.build());
+            LOG.info("Deleted");
             wrtx.submit().get(1, TimeUnit.SECONDS);
+            LOG.info("Submitted");
         } catch (InterruptedException | ExecutionException | TimeoutException e) {
             LOG.error(e.getMessage(), e);
             return false;
index 7671215dfeb4f82b628b139982c3e7fde9242a18..b311f27cc5a3046fa751366e95aaad671ff25579 100644 (file)
@@ -13,13 +13,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-olm</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencyManagement>
@@ -27,14 +27,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>1.8.0-SNAPSHOT</version>
+        <version>1.9.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.netconf</groupId>
         <artifactId>netconf-artifacts</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
index 9bb422d210e05072b9b33630747556cf09579a9e..7fa7f490ae2307be4e8dfca8763ccda3cbd5372e 100644 (file)
@@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce.ordmodels</groupId>
   <artifactId>transportpce-ordmodels-common</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencyManagement>
@@ -26,7 +26,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <dependency>
         <groupId>org.opendaylight.mdsal.model</groupId>
         <artifactId>mdsal-model-artifacts</artifactId>
-        <version>0.13.0-SNAPSHOT</version>
+        <version>0.14.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
index f438c66ee0598d4fe1d0f65afefbfe093006413c..2466103109a4c8f646c761b49e5583d55570a37e 100644 (file)
@@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce.ordmodels</groupId>
   <artifactId>transportpce-ordmodels-device</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencyManagement>
@@ -26,14 +26,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <dependency>
         <groupId>org.opendaylight.netconf</groupId>
         <artifactId>netconf-artifacts</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.mdsal.model</groupId>
         <artifactId>mdsal-model-artifacts</artifactId>
-        <version>0.13.0-SNAPSHOT</version>
+        <version>0.14.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
index 50f546b0564ea41b01b89be7146624d9690978a5..c2485695df1ced7414659647ffbd9c2c2ae48540 100644 (file)
@@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce.ordmodels</groupId>
   <artifactId>transportpce-ordmodels-network</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencyManagement>
@@ -26,7 +26,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <dependency>
         <groupId>org.opendaylight.mdsal.model</groupId>
         <artifactId>mdsal-model-artifacts</artifactId>
-        <version>0.13.0-SNAPSHOT</version>
+        <version>0.14.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
@@ -69,7 +69,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-network-2015-06-08</artifactId>
-      <version>1.5.0-SNAPSHOT</version>
+      <version>1.6.0-SNAPSHOT</version>
     </dependency-->
   </dependencies>
 </project>
index b85177387258797f686201b0f06e24030414a4c8..fd6ead1d48cff273388b462aad97e9817f4758a4 100644 (file)
@@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-ordmodels</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <modules>
@@ -82,14 +82,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <dependency>
         <groupId>org.opendaylight.netconf</groupId>
         <artifactId>netconf-artifacts</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.mdsal.model</groupId>
         <artifactId>mdsal-model-artifacts</artifactId>
-        <version>0.13.0-SNAPSHOT</version>
+        <version>0.14.0-SNAPSHOT</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
index e243d2cab76c057fc0b0a0f13d5f7448284da476..c331e3ea51bf84eb7f0c34bf148f375dba3af36a 100644 (file)
@@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce.ordmodels</groupId>
   <artifactId>transportpce-ordmodels-service</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencyManagement>
@@ -26,7 +26,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <dependency>
         <groupId>org.opendaylight.mdsal.model</groupId>
         <artifactId>mdsal-model-artifacts</artifactId>
-        <version>0.13.0-SNAPSHOT</version>
+        <version>0.14.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
index 677d51c120563c3191b75fd72b6b6f2fd08e08a0..943c06885742cf472bd6d1725847e68016cf27bc 100755 (executable)
@@ -17,13 +17,13 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>bundle-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-pce</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <build>
@@ -80,7 +80,7 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-binding-broker-impl</artifactId>
-      <version>1.8.0-SNAPSHOT</version>
+      <version>1.9.0-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
 
index ef1e5d41910e091b40fb0b38c3bdb349d6588b4a..5575e4722c87e67e396047bfc77a05b4240ae7a5 100644 (file)
@@ -47,6 +47,8 @@ public class PceManyTests extends AbstractTest {
      *   expected path computation result
      * @param topologyDataPath
      *   path to topology data file to be used for DataStore population
+     *
+     * @throws Exception exception throws by the function
      */
     public PceManyTests(PathComputationRequestInput input,
                         PathComputationRequestOutput expectedOutput, String topologyDataPath) throws Exception {
index 0e1394e4f2f1c908837c9c6ba5aa085e3a310a4b..d4747a53f125d30f2e83175bd8f0feff1a116627 100644 (file)
@@ -223,6 +223,8 @@ public final class PceTestData {
 
     /**
      * Generate Data for Test 1 result 5-4.
+     * @param wl WaveLength
+     *
      * @return output PathComputationRequestOutput data
      */
     public static PathComputationRequestOutput getPCE_test_result_54(Long wl) {
@@ -466,6 +468,8 @@ public final class PceTestData {
          "pce:pce-metric": "hop-count"
        }
      }</code>
+     * @param base Path Computation Request Input base
+     *
      * @return input PathComputationRequestInput data
      */
     public static PathComputationRequestInput build_diversity_from_request(PathComputationRequestInput base) {
diff --git a/pom.xml b/pom.xml
index f38c20b34efc10ce55976516b91f572b526ef98e..d82ad328842c20d95c6d90e0c0631b9a01c89c6d 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -11,13 +11,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-aggregator</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <name>transportpce</name>
   <packaging>pom</packaging>
 
index 69dcc6eb467f930e0fba58c616f410a63067693a..779cd79a5b35bec4b155e1afdc3a6f8c0405e1f8 100644 (file)
@@ -13,13 +13,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-renderer</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencyManagement>
@@ -27,14 +27,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>1.8.0-SNAPSHOT</version>
+        <version>1.9.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.netconf</groupId>
         <artifactId>netconf-artifacts</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
index c06207fa974847584c262d31924eb04cc01b22c6..24ec071747370ede785cbfda49bf4c6bc9899f9f 100644 (file)
@@ -13,7 +13,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommon;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
@@ -145,7 +144,7 @@ public final class ModelMappingUtils {
                     int[] pos = findTheLongestSubstring(nodeID, tpID);
                     //TODO: do not rely on nodeId to be integer
                     int id = Integer.parseInt(sortId);
-                   treeMap.put(id, new NodeIdPair(nodeID.substring(0, pos[0] - 1), tpID));
+                    treeMap.put(id, new NodeIdPair(nodeID.substring(0, pos[0] - 1), tpID));
                 } else if (resourceType.equals("Link")) {
                     LOG.info("The type is link");
                 } else {
@@ -221,7 +220,7 @@ public final class ModelMappingUtils {
                     int[] pos = findTheLongestSubstring(nodeID, tpID);
                     //TODO: do not rely on nodeId to be integer
                     int id = Integer.parseInt(sortId);
-                   treeMap.put(id, new NodeIdPair(nodeID.substring(0, pos[0] - 1), tpID));
+                    treeMap.put(id, new NodeIdPair(nodeID.substring(0, pos[0] - 1), tpID));
                 } else if (resourceType.equals("Link")) {
                     LOG.info("The type is link");
                 } else {
index 734c6e5818dcba4b648e8d376b2e1eb336766e3f..5d3b2a86eedde87c858047863aff58c1a17fc031 100644 (file)
@@ -219,6 +219,7 @@ public class OpenRoadmInterfaceFactory {
      *
      *
      * @return Name of the interface if successful, otherwise return null.
+     * @throws OpenRoadmInterfaceException OpenRoadmInterfaceException
      */
 
     public String createOpenRoadmOtu4Interface(String nodeId, String logicalConnPoint, String supportOchInterface)
index ce7aa0f50c263fec812fe0de2909e426e79e8c00..6bd143299f474973589fae1b18f9a2bb691b37d3 100644 (file)
@@ -66,7 +66,7 @@ public class NetworkModelWaveLengthServiceFreeTest extends AbstractTest {
     }
 
     @Parameterized.Parameters
-    public static Collection primeNumbers() {
+    public static Collection createParameters() {
         List<Object[]> parameters = new ArrayList<>();
 
         PathDescription pathDescription =
@@ -130,13 +130,17 @@ public class NetworkModelWaveLengthServiceFreeTest extends AbstractTest {
 
     @Test
     public void freeWavelengthsTest() throws ExecutionException, InterruptedException {
-        WaveLengthServiceUtils.putTerminationPoint1ToDatastore("node1", "node1-" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+        WaveLengthServiceUtils.putTerminationPoint1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+            OpenRoadmInterfacesImpl.TTP_TOKEN,
             this.terminationPoint1, this.deviceTransactionManager);
-        WaveLengthServiceUtils.putNode1ToDatastore("node1", this.node1, this.deviceTransactionManager);
+        WaveLengthServiceUtils.putNode1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN, this.node1,
+            this.deviceTransactionManager);
         this.networkModelWavelengthService.freeWavelengths(this.pathDescription);
-        Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1", this.deviceTransactionManager);
-        TerminationPoint1 updatedTerminationPoint1 = WaveLengthServiceUtils.getTerminationPoint1FromDatastore("node1",
-            "node1-" + OpenRoadmInterfacesImpl.TTP_TOKEN, this.deviceTransactionManager);
+        Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+            this.deviceTransactionManager);
+        TerminationPoint1 updatedTerminationPoint1 =
+            WaveLengthServiceUtils.getTerminationPoint1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+                OpenRoadmInterfacesImpl.TTP_TOKEN, this.deviceTransactionManager);
         switch (updatedTerminationPoint1.getTpType()) {
             case DEGREETXRXCTP:
             case DEGREETXCTP:
index 3f0c1f3cfdde38ae1d7c57067bb21be3d1291bbc..c3f1706b6a45aa8503f795771017d108dd5b3a94 100644 (file)
@@ -71,7 +71,7 @@ public class NetworkModelWaveLengthServiceUseTest extends AbstractTest {
     }
 
     @Parameterized.Parameters
-    public static Collection primeNumbers() {
+    public static Collection createParameters() {
         List<Object[]> parameters = new ArrayList<>();
 
         PathDescription pathDescription =
@@ -119,13 +119,17 @@ public class NetworkModelWaveLengthServiceUseTest extends AbstractTest {
     @Test
     public void freeWavelengthsTest() throws ExecutionException, InterruptedException {
         WaveLengthServiceUtils
-            .putTerminationPoint1ToDatastore("node1", "node1-" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+            .putTerminationPoint1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+                OpenRoadmInterfacesImpl.TTP_TOKEN,
                 this.terminationPoint1, this.deviceTransactionManager);
-        WaveLengthServiceUtils.putNode1ToDatastore("node1", this.node1, this.deviceTransactionManager);
+        WaveLengthServiceUtils.putNode1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN, this.node1,
+            this.deviceTransactionManager);
         this.networkModelWavelengthService.useWavelengths(this.pathDescription);
-        Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1", this.deviceTransactionManager);
+        Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+            this.deviceTransactionManager);
         TerminationPoint1 updatedTerminationPoint1 = WaveLengthServiceUtils
-            .getTerminationPoint1FromDatastore("node1", "node1-" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+            .getTerminationPoint1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+                OpenRoadmInterfacesImpl.TTP_TOKEN,
                 this.deviceTransactionManager);
 
         switch (updatedTerminationPoint1.getTpType()) {
index 41d07df37c0ceb2e52a7a120c9cbc8587a734f6d..2f40c3de88578f7db07b4392e7cbe4655b0b2623 100644 (file)
@@ -29,7 +29,7 @@ public class NodeIdPairTest {
     }
 
     @Parameterized.Parameters
-    public static Collection primeNumbers() {
+    public static Collection nodes() {
         NodeIdPair same = new NodeIdPair("nodeS", "CLIENT");
         return Arrays.asList(new Object[][] {
                 { new NodeIdPair("",""), null, false },
@@ -49,7 +49,7 @@ public class NodeIdPairTest {
     @Test
     public void equalityTest() {
         Assert.assertEquals(this.equality, firstPair.equals(this.secondPair));
-        if (this.secondPair != null && this.firstPair.getClass().equals(this.secondPair.getClass())) {
+        if ((this.secondPair != null) && this.firstPair.getClass().equals(this.secondPair.getClass())) {
             Assert.assertEquals(this.equality, this.firstPair.hashCode() == this.secondPair.hashCode());
         }
     }
diff --git a/renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImplCreateOtsOmsTest.java b/renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImplCreateOtsOmsTest.java
new file mode 100644 (file)
index 0000000..6440bfc
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright Â© 2018 Orange Systems, 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.renderer.provisiondevice;
+
+import java.util.ArrayList;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.opendaylight.controller.md.sal.binding.api.MountPoint;
+import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
+import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
+import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
+import org.opendaylight.transportpce.renderer.utils.CreateOtsOmsDataUtils;
+import org.opendaylight.transportpce.renderer.utils.MountPointUtils;
+import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsOutput;
+
+public class DeviceRendererServiceImplCreateOtsOmsTest extends AbstractTest {
+
+    private DeviceRendererService deviceRendererService;
+    private CrossConnect crossConnect;
+    private OpenRoadmInterfaces openRoadmInterfaces;
+    private OpenRoadmInterfaceFactory openRoadmInterfaceFactory;
+    private DeviceTransactionManager deviceTransactionManager;
+
+    private void setMountPoint(MountPoint mountPoint) {
+        MountPointService mountPointService = new MountPointServiceStub(mountPoint);
+        this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
+        this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
+        PortMapping portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
+                this.openRoadmInterfaces);
+        this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
+                this.openRoadmInterfaces);
+        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+        this.crossConnect = Mockito.spy(this.crossConnect);
+        this.deviceRendererService = new DeviceRendererServiceImpl(this.getDataBroker(),
+            this.deviceTransactionManager, this.openRoadmInterfaceFactory, this.openRoadmInterfaces,
+            this.crossConnect, portMapping);
+    }
+
+    @Test
+    public void testCreateOtsOmsWhenDeviceIsNotMounted() throws OpenRoadmInterfaceException {
+        setMountPoint(null);
+        CreateOtsOmsInput input = CreateOtsOmsDataUtils.buildCreateOtsOms();
+        CreateOtsOmsOutput result = this.deviceRendererService.createOtsOms(input);
+        Assert.assertFalse(result.isSuccess());
+        Assert.assertEquals("node 1 is not mounted on the controller",
+                result.getResult());
+    }
+
+    @Test
+    public void testCreateOtsOmsWhenDeviceIsMountedWithNoMapping() throws OpenRoadmInterfaceException {
+        setMountPoint(MountPointUtils.getMountPoint(new ArrayList<>(), getDataBroker()));
+        CreateOtsOmsInput input = CreateOtsOmsDataUtils.buildCreateOtsOms();
+        CreateOtsOmsOutput result = this.deviceRendererService.createOtsOms(input);
+        Assert.assertFalse(result.isSuccess());
+    }
+
+    @Test
+    public void testCreateOtsOmsWhenDeviceIsMountedWithMapping() throws OpenRoadmInterfaceException {
+        setMountPoint(MountPointUtils.getMountPoint(new ArrayList<>(), getDataBroker()));
+        CreateOtsOmsInput input = CreateOtsOmsDataUtils.buildCreateOtsOms();
+        writePortMapping(input);
+        CreateOtsOmsOutput result = this.deviceRendererService.createOtsOms(input);
+        Assert.assertTrue(result.isSuccess());
+    }
+
+    private void writePortMapping(CreateOtsOmsInput input) {
+        MountPointUtils.writeMapping(
+            input.getNodeId(),
+            input.getLogicalConnectionPoint(),
+            this.deviceTransactionManager
+        );
+    }
+
+}
diff --git a/renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImplDeleteTest.java b/renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImplDeleteTest.java
new file mode 100644 (file)
index 0000000..62a9609
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ * Copyright Â© 2018 Orange Systems, 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.renderer.provisiondevice;
+
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Executors;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.opendaylight.controller.md.sal.binding.api.MountPoint;
+import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.ResponseCodes;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
+import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
+import org.opendaylight.transportpce.renderer.NetworkModelWavelengthServiceImpl;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
+import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
+import org.opendaylight.transportpce.renderer.stub.MountPointStub;
+import org.opendaylight.transportpce.renderer.stub.OlmServiceStub;
+import org.opendaylight.transportpce.renderer.utils.ServiceDeleteDataUtils;
+import org.opendaylight.transportpce.renderer.utils.TransactionUtils;
+import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.handler.header.ServiceHandlerHeaderBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServicePathList;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePaths;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutputBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+
+public class RendererServiceOperationsImplDeleteTest extends AbstractTest {
+
+    private static final int NUMBER_OF_THREADS = 4;
+    private DeviceTransactionManager deviceTransactionManager;
+    private RendererServiceOperationsImpl rendererServiceOperations;
+    private OpenRoadmInterfaces openRoadmInterfaces;
+    private DeviceRendererService deviceRenderer;
+    private PortMapping portMapping;
+    private CrossConnect crossConnect;
+    private NetworkModelWavelengthService networkModelWavelengthService;
+    private OlmService olmService;
+
+    private void setMountPoint(MountPoint mountPoint) {
+        MountPointService mountPointService = new MountPointServiceStub(mountPoint);
+        this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
+        this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
+                openRoadmInterfaces);
+        OpenRoadmInterfaceFactory openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
+                openRoadmInterfaces);
+        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+        this.crossConnect = Mockito.spy(crossConnect);
+        this.deviceRenderer = new DeviceRendererServiceImpl(this.getDataBroker(),
+                this.deviceTransactionManager, openRoadmInterfaceFactory, openRoadmInterfaces, crossConnect,
+            this.portMapping);
+    }
+
+    @Before
+    public void setUp() {
+        setMountPoint(new MountPointStub(getDataBroker()));
+        this.olmService = new OlmServiceStub();
+        this.olmService = Mockito.spy(this.olmService);
+        ListeningExecutorService executor =
+                MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(NUMBER_OF_THREADS));
+        this.networkModelWavelengthService = new NetworkModelWavelengthServiceImpl(getDataBroker());
+        this.rendererServiceOperations =  new RendererServiceOperationsImpl(this.deviceRenderer, olmService,
+                getDataBroker(), this.networkModelWavelengthService);
+
+    }
+
+
+    @Test
+    public void serviceDeleteOperationPp() throws ExecutionException, InterruptedException {
+        writePathDescription();
+        ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
+        serviceDeleteInputBuilder.setServiceName("service 1");
+        serviceDeleteInputBuilder.setServiceHandlerHeader((new ServiceHandlerHeaderBuilder())
+                .setRequestId("request1").build());
+        Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect(Mockito.anyString(), Mockito.anyString());
+        ServiceDeleteOutput serviceDeleteOutput
+                = this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build());
+        Assert.assertEquals(ResponseCodes.RESPONSE_OK,
+                serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+        Mockito.verify(this.crossConnect, Mockito.times(2)).deleteCrossConnect(Mockito.any(), Mockito.any());
+    }
+
+    @Test
+    public void serviceDeleteOperationNoDescription() {
+        ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
+        serviceDeleteInputBuilder.setServiceName("service 1");
+        ServiceDeleteOutput serviceDeleteOutput
+                = this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build());
+        Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
+                serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+        Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.any(), Mockito.any());
+    }
+
+    @Test
+    public void serviceDeleteOperationTearDownFailedAtoZ() throws ExecutionException, InterruptedException {
+        Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect(Mockito.anyString(), Mockito.anyString());
+        Mockito.doReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
+                .setResult("Failed").build()).buildFuture()).when(this.olmService).servicePowerTurndown(Mockito.any());
+
+        writePathDescription();
+        ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
+        serviceDeleteInputBuilder.setServiceName("service 1");
+        serviceDeleteInputBuilder.setServiceHandlerHeader((new ServiceHandlerHeaderBuilder())
+                .setRequestId("request1").build());
+        ServiceDeleteOutput serviceDeleteOutput
+                = this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build());
+        Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
+                serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+        Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.eq("node1"), Mockito.any());
+        Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.eq("node2"), Mockito.any());
+    }
+
+    @Test
+    public void serviceDeleteOperationTearDownFailedZtoA() throws ExecutionException, InterruptedException {
+        Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect(Mockito.anyString(), Mockito.anyString());
+        Mockito.when(this.olmService.servicePowerTurndown(Mockito.any()))
+                .thenReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
+                        .setResult("Success").build()).buildFuture())
+                .thenReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
+                        .setResult("Failed").build()).buildFuture());
+
+        writePathDescription();
+        ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
+        serviceDeleteInputBuilder.setServiceName("service 1");
+        serviceDeleteInputBuilder.setServiceHandlerHeader((new ServiceHandlerHeaderBuilder())
+                .setRequestId("request1").build());
+        ServiceDeleteOutput serviceDeleteOutput =
+                this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build());
+        Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
+                serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+        Mockito.verify(this.olmService, Mockito.times(2)).servicePowerTurndown(Mockito.any());
+        Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.eq("node1"), Mockito.any());
+        Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.eq("node2"), Mockito.any());
+    }
+
+    private void writePathDescription() throws ExecutionException, InterruptedException {
+        ServicePathsBuilder servicePathsBuilder = new ServicePathsBuilder();
+        servicePathsBuilder.setPathDescription(ServiceDeleteDataUtils
+            .createTransactionPathDescription(OpenRoadmInterfacesImpl.PP_TOKEN));
+        servicePathsBuilder.setServiceAEnd(ServiceDeleteDataUtils.getServiceAEndBuild().build())
+            .setServiceZEnd(ServiceDeleteDataUtils.getServiceZEndBuild().build());
+        servicePathsBuilder.withKey(new ServicePathsKey("service 1"));
+        servicePathsBuilder.setServiceHandlerHeader(new ServiceHandlerHeaderBuilder().setRequestId("Request 1")
+            .build());
+        InstanceIdentifier<ServicePaths> servicePathsInstanceIdentifier = InstanceIdentifier.create(
+            ServicePathList.class).child(ServicePaths.class, new ServicePathsKey("service 1"));
+        TransactionUtils.writeTransaction(
+                this.deviceTransactionManager,
+                "node1" + OpenRoadmInterfacesImpl.PP_TOKEN,
+                LogicalDatastoreType.OPERATIONAL,
+                servicePathsInstanceIdentifier,
+                servicePathsBuilder.build());
+    }
+}
diff --git a/renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImplTest.java b/renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImplTest.java
new file mode 100644 (file)
index 0000000..563fde1
--- /dev/null
@@ -0,0 +1,394 @@
+/*
+ * Copyright Â© 2018 Orange Systems, 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.renderer.provisiondevice;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.opendaylight.controller.md.sal.binding.api.MountPoint;
+import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.transportpce.common.ResponseCodes;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
+import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
+import org.opendaylight.transportpce.renderer.NetworkModelWavelengthServiceImpl;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
+import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
+import org.opendaylight.transportpce.renderer.stub.MountPointStub;
+import org.opendaylight.transportpce.renderer.stub.OlmServiceStub;
+import org.opendaylight.transportpce.renderer.utils.MountPointUtils;
+import org.opendaylight.transportpce.renderer.utils.ServiceDataUtils;
+import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev161014.PmGranularity;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceTypeEnum;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.get.pm.input.ResourceIdentifierBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.Measurements;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.MeasurementsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+
+public class RendererServiceOperationsImplTest extends AbstractTest {
+
+    private MountPointService mountPointService;
+    private DeviceTransactionManager deviceTransactionManager;
+    private RendererServiceOperationsImpl rendererServiceOperations;
+    private OpenRoadmInterfaces openRoadmInterfaces;
+    private DeviceRendererService deviceRenderer;
+    private PortMapping portMapping;
+    private OpenRoadmInterfaceFactory openRoadmInterfaceFactory;
+    private CrossConnect crossConnect;
+    private OlmService olmService;
+    private NetworkModelWavelengthService networkModelWavelengthService;
+
+    private void setMountPoint(MountPoint mountPoint) {
+        this.mountPointService = new MountPointServiceStub(mountPoint);
+        this.deviceTransactionManager = new DeviceTransactionManagerImpl(this.mountPointService, 3000);
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
+        this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
+        this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
+            openRoadmInterfaces);
+        this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
+            openRoadmInterfaces);
+        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+    }
+
+    @Before
+    public void setUp() throws OpenRoadmInterfaceException {
+        setMountPoint(new MountPointStub(getDataBroker()));
+        this.olmService = new OlmServiceStub();
+        this.networkModelWavelengthService = new NetworkModelWavelengthServiceImpl(getDataBroker());
+        this.deviceRenderer = new DeviceRendererServiceImpl(this.getDataBroker(),
+            this.deviceTransactionManager, openRoadmInterfaceFactory, openRoadmInterfaces, crossConnect, portMapping);
+        Mockito.doNothing().when(this.openRoadmInterfaces).postEquipmentState(Mockito.anyString(),
+            Mockito.anyString(), Mockito.anyBoolean());
+
+        this.olmService = Mockito.spy(this.olmService);
+        this.deviceRenderer = Mockito.spy(this.deviceRenderer);
+        this.rendererServiceOperations =  new RendererServiceOperationsImpl(this.deviceRenderer, this.olmService,
+            getDataBroker(), this.networkModelWavelengthService);
+
+        ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+            .setSuccess(true);
+        Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+            Mockito.any());
+    }
+
+    @Test
+    public void serviceImplementationTerminationPointAsResourceTtp() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.TTP_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.TTP_TOKEN);
+        ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+            .setSuccess(true);
+        Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+            Mockito.any());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    @Test
+    public void serviceImplementationTerminationPointAsResourceTtp2() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.TTP_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.TTP_TOKEN);
+        ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+            .setSuccess(true);
+        Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+            Mockito.any());
+        Mockito.doReturn(RpcResultBuilder.failed().buildFuture()).when(this.olmService)
+            .servicePowerSetup(Mockito.any());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    @Test
+    public void serviceImplementationTerminationPointAsResourcePp() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.PP_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.PP_TOKEN);
+        ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+            .setSuccess(true);
+        Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+            Mockito.any());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    @Test
+    public void serviceImplementationTerminationPointAsResourceNetwork() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+            .setSuccess(true);
+        Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+            Mockito.any());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    @Test
+    public void serviceImplementationTerminationPointAsResourceClient() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.CLIENT_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.CLIENT_TOKEN);
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+    }
+
+    @Test
+    public void serviceImplementationTerminationPointAsResourceNoMapping() {
+
+        String[] interfaceTokens = {
+            OpenRoadmInterfacesImpl.NETWORK_TOKEN,
+            OpenRoadmInterfacesImpl.CLIENT_TOKEN,
+            OpenRoadmInterfacesImpl.TTP_TOKEN,
+            OpenRoadmInterfacesImpl.PP_TOKEN
+        };
+
+        ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("failed")
+            .setSuccess(false);
+        Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+            Mockito.any());
+
+        for (String tpToken : interfaceTokens) {
+            ServiceImplementationRequestInput input = ServiceDataUtils
+                .buildServiceImplementationRequestInputTerminationPointResource(tpToken);
+            ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+            Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
+                    result.getConfigurationResponseCommon().getResponseCode());
+        }
+    }
+
+    private void writePortMapping(ServiceImplementationRequestInput input, String tpToken) {
+        MountPointUtils.writeMapping(
+            input.getServiceAEnd().getNodeId(),
+            input.getServiceAEnd().getNodeId() + "-" + tpToken,
+            this.deviceTransactionManager
+        );
+        MountPointUtils.writeMapping(
+                input.getServiceZEnd().getNodeId(),
+                input.getServiceZEnd().getNodeId() + "-"
+                    + input.getServiceAEnd().getNodeId() + "-" + tpToken,
+                this.deviceTransactionManager
+        );
+        MountPointUtils.writeMapping(
+                input.getServiceAEnd().getNodeId(),
+                input.getServiceAEnd().getNodeId() + "-"
+                    + input.getServiceZEnd().getNodeId() + "-" + tpToken,
+                this.deviceTransactionManager
+        );
+        MountPointUtils.writeMapping(
+            input.getServiceZEnd().getNodeId(),
+            input.getServiceZEnd().getNodeId() + "-" + tpToken,
+            this.deviceTransactionManager
+        );
+    }
+
+    @Test
+    public void serviceImplementationRollbackAllNecessary() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        Mockito.doReturn(RpcResultBuilder.failed().buildFuture()).when(this.olmService)
+            .servicePowerSetup(Mockito.any());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    private GetPmInput createGetPmInput(String nodeId, String tp) {
+        GetPmInputBuilder getPmIpBldr = new GetPmInputBuilder();
+        getPmIpBldr.setNodeId(nodeId);
+        getPmIpBldr.setGranularity(PmGranularity._15min);
+        ResourceIdentifierBuilder rsrcBldr = new ResourceIdentifierBuilder();
+        rsrcBldr.setResourceName(tp + "-OTU");
+        getPmIpBldr.setResourceIdentifier(rsrcBldr.build());
+        getPmIpBldr.setResourceType(ResourceTypeEnum.Interface);
+        return getPmIpBldr.build();
+    }
+
+    @Test
+    public void serviceImplementationServiceInActive() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        Measurements measurements = new MeasurementsBuilder().setPmparameterName("FECUncorrectableBlocks")
+            .setPmparameterValue("1").build();
+        List<Measurements> measurementsList = new ArrayList<Measurements>();
+        measurementsList.add(measurements);
+        GetPmOutput getPmOutput = new GetPmOutputBuilder()
+            .setNodeId("node1").setMeasurements(measurementsList).build();
+        Mockito.doReturn(RpcResultBuilder.success(getPmOutput).buildFuture()).when(this.olmService)
+            .getPm(Mockito.any());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    @Test
+    public void serviceImplementationServiceInActive2() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        Measurements measurements = new MeasurementsBuilder().setPmparameterName("FECUncorrectableBlocks")
+            .setPmparameterValue("1").build();
+        List<Measurements> measurementsList = new ArrayList<Measurements>();
+        measurementsList.add(measurements);
+        GetPmOutput getPmOutput = new GetPmOutputBuilder()
+            .setNodeId("node1").setMeasurements(measurementsList).build();
+        GetPmOutput getPmOutput2 = new GetPmOutputBuilder()
+            .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
+
+        Mockito.when(this.olmService.getPm(Mockito.any()))
+            .thenReturn(RpcResultBuilder.success(getPmOutput).buildFuture());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    @Test
+    public void serviceImplementationServiceInActive3() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        Measurements measurements = new MeasurementsBuilder().setPmparameterName("FECUncorrectableBlocks")
+            .setPmparameterValue("1").build();
+        List<Measurements> measurementsList = new ArrayList<Measurements>();
+        measurementsList.add(measurements);
+        GetPmOutput getPmOutput = new GetPmOutputBuilder()
+                .setNodeId("node1").setMeasurements(measurementsList).build();
+        GetPmOutput getPmOutput2 = new GetPmOutputBuilder()
+                .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
+
+        GetPmInput getPmInputZ = createGetPmInput("XPONDER-2-3",
+            OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        GetPmInput getPmInputA = createGetPmInput("XPONDER-1-2",
+            OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+
+        Mockito.when(this.olmService.getPm(Mockito.eq(getPmInputZ)))
+            .thenReturn(RpcResultBuilder.success(getPmOutput2).buildFuture());
+        Mockito.when(this.olmService.getPm(Mockito.eq(getPmInputA)))
+            .thenReturn(RpcResultBuilder.success(getPmOutput).buildFuture());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    @Test
+    public void serviceImplementationServiceActive() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        GetPmOutput getPmOutput = new GetPmOutputBuilder()
+            .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
+        GetPmOutput getPmOutput1 = null;
+        Mockito.when(this.olmService.getPm(Mockito.any())).thenReturn(RpcResultBuilder.success(getPmOutput1)
+            .buildFuture());
+        ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+            .setSuccess(true);
+        Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+            Mockito.any());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    @Test
+    public void serviceImplementationServiceActive2() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        GetPmOutput getPmOutput = new GetPmOutputBuilder().setMeasurements(new ArrayList<>()).build();
+        Mockito.when(this.olmService.getPm(Mockito.any())).thenReturn(RpcResultBuilder.success(getPmOutput)
+            .buildFuture());
+        ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+            .setSuccess(true);
+        Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+            Mockito.any());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    @Test
+    public void serviceImplementationServiceInActive4() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        Measurements measurements = new MeasurementsBuilder().setPmparameterName("preFECCorrectedErrors")
+            .setPmparameterValue("1").build();
+        List<Measurements> measurementsList = new ArrayList<Measurements>();
+        measurementsList.add(measurements);
+        GetPmOutput getPmOutput = new GetPmOutputBuilder()
+            .setNodeId("node1").setMeasurements(measurementsList).build();
+
+        Mockito.doReturn(RpcResultBuilder.success(getPmOutput).buildFuture()).when(this.olmService)
+            .getPm(Mockito.any());
+        ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+            .setSuccess(true);
+        Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+            Mockito.any());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+
+    @Test
+    public void serviceImplementationServiceInActive5() {
+
+        ServiceImplementationRequestInput input = ServiceDataUtils
+            .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+        Measurements measurements = new MeasurementsBuilder().setPmparameterName("preFECCorrectedErrors")
+            .setPmparameterValue("112000000000d").build();
+        List<Measurements> measurementsList = new ArrayList<Measurements>();
+        measurementsList.add(measurements);
+        GetPmOutput getPmOutput = new GetPmOutputBuilder()
+            .setNodeId("node1").setMeasurements(measurementsList).build();
+
+        Mockito.doReturn(RpcResultBuilder.success(getPmOutput).buildFuture()).when(this.olmService)
+            .getPm(Mockito.any());
+        ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+        Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+    }
+}
diff --git a/renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/CreateOtsOmsDataUtils.java b/renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/CreateOtsOmsDataUtils.java
new file mode 100644 (file)
index 0000000..588f5f2
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright Â© 2018 Orange Systems, 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.renderer.utils;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInputBuilder;
+
+public final class CreateOtsOmsDataUtils {
+
+    private CreateOtsOmsDataUtils() {
+
+    }
+
+    public static CreateOtsOmsInput buildCreateOtsOms() {
+        CreateOtsOmsInputBuilder builder = new CreateOtsOmsInputBuilder()
+            .setLogicalConnectionPoint("logical point")
+            .setNodeId("node 1");
+        return builder.build();
+    }
+}
index 5adc54bf9e48ff0fce6eed1f0ca0723cd7158c01..aa20447d0ab24c091095a04ca70e5c39bc655ecd 100644 (file)
@@ -68,6 +68,7 @@ public final class MountPointUtils {
     }
 
     private MountPointUtils() {
+
     }
 
 }
index b2980baeac62d9e5918582ec0cc9fac3578a069f..e646ed94ba214fda74399547b6db22e275d37ba4 100644 (file)
@@ -88,12 +88,12 @@ public final class ServiceDataUtils {
         ServiceImplementationRequestInputBuilder builder = new ServiceImplementationRequestInputBuilder()
             .setServiceName("service 1").setPathDescription(createPathDescriptionTerminationPointResource(tpId))
             .setServiceHandlerHeader(new ServiceHandlerHeaderBuilder().setRequestId("Request 1").build())
-            .setServiceAEnd(getServiceAEndBuild().build())
-            .setServiceZEnd(getServiceZEndBuild().build());
+            .setServiceAEnd(getServiceAEndBuild(tpId).build())
+            .setServiceZEnd(getServiceZEndBuild(tpId).build());
         return builder.build();
     }
 
-    public static ServiceImplementationRequestInput buildServiceImplementationRequestInputInvalidResource() {
+    /*public static ServiceImplementationRequestInput buildServiceImplementationRequestInputInvalidResource() {
         ServiceImplementationRequestInputBuilder builder = new ServiceImplementationRequestInputBuilder()
             .setServiceName("service 1").setPathDescription(createPathDescriptionInvalidResource())
             .setServiceHandlerHeader(new ServiceHandlerHeaderBuilder().setRequestId("Request 1").build())
@@ -109,7 +109,7 @@ public final class ServiceDataUtils {
             .setServiceAEnd(getServiceAEndBuild().build())
             .setServiceZEnd(getServiceZEndBuild().build());
         return builder.build();
-    }
+    }*/
 
     private static PathDescription createPathDescriptionInvalidResource() {
         List<AToZ> atoZList = new ArrayList<AToZ>();
@@ -158,8 +158,9 @@ public final class ServiceDataUtils {
         for (String nodeId : nodeIds) {
             for (String otherNodeId : nodeIds) {
                 TerminationPoint terminationPoint = terminationPointBuilder
-                    .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId(nodeId)
-                        .setTpId((nodeId.equals(otherNodeId) ? "" : nodeId + "-") + otherNodeId + "-" + tpId).build())
+                    .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId(nodeId + '-'
+                            + tpId)
+                        .setTpId(tpId).build())
                     .build();
                 AToZ atoZ = new AToZBuilder().setId(atozId.toString())
                     .withKey(new AToZKey(atozId.toString())).setResource(new ResourceBuilder()
@@ -180,8 +181,9 @@ public final class ServiceDataUtils {
         for (String nodeId : nodeIds) {
             for (String otherNodeId : nodeIds) {
                 TerminationPoint terminationPoint = terminationPointBuilder
-                    .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId(nodeId)
-                        .setTpId((nodeId.equals(otherNodeId) ? "" : nodeId + "-") + otherNodeId + "-" + tpId).build())
+                    .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId(nodeId + '-'
+                            + tpId)
+                        .setTpId(tpId).build())
                     .build();
                 ZToA ztoA = new ZToABuilder().setId(ztoaId.toString())
                     .withKey(new ZToAKey(ztoaId.toString())).setResource(new ResourceBuilder()
@@ -238,9 +240,10 @@ public final class ServiceDataUtils {
         return builder.build();
     }
 
-    public static ServiceAEndBuilder getServiceAEndBuild() {
+    public static ServiceAEndBuilder getServiceAEndBuild(String tpId) {
         return new ServiceAEndBuilder()
-            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate((long) 1).setNodeId("XPONDER-1-2")
+            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate((long) 1).setNodeId("XPONDER-1-2-"
+                    + tpId)
             .setTxDirection(
                 new TxDirectionBuilder()
                     .setPort(new PortBuilder().setPortDeviceName("device name").setPortName("port name")
@@ -255,9 +258,10 @@ public final class ServiceDataUtils {
                     .build());
     }
 
-    public static ServiceZEndBuilder getServiceZEndBuild() {
+    public static ServiceZEndBuilder getServiceZEndBuild(String tpId) {
         return new ServiceZEndBuilder()
-            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate((long) 1).setNodeId("XPONDER-2-3")
+            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate((long) 1).setNodeId("XPONDER-2-3-"
+                    + tpId)
             .setTxDirection(
                 new TxDirectionBuilder()
                     .setPort(new PortBuilder().setPortDeviceName("device name").setPortName("port name")
index a5a5a7421b6ae3bd939524191eceb1ad9bab8758..6928dd658552bbff72696cde7fcceceee51e1574 100644 (file)
@@ -43,11 +43,11 @@ public final class ServiceDeleteDataUtils {
         List<AToZ> atoZList = new ArrayList<AToZ>();
         TerminationPointBuilder terminationPointBuilder = new TerminationPointBuilder();
         TerminationPoint terminationPoint = terminationPointBuilder
-                .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("node2")
-                        .setTpId("node2-" + tpId).build()).build();
+                .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("node2" + tpId)
+                        .setTpId(tpId).build()).build();
         TerminationPoint terminationPoint2 = terminationPointBuilder
-                .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("node1")
-                        .setTpId("node1-" + tpId).build()).build();
+                .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("node1" + tpId)
+                        .setTpId(tpId).build()).build();
         AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
                 .setResource(terminationPoint).build()).build();
         AToZ atoZ2 = new AToZBuilder().setId("2").withKey(new AToZKey("2")).setResource(new ResourceBuilder()
index 4f4cf1afb2006728a349abee3137d40508f34217..e8f15f800eccf59a1099e7d4394ed708cf89938d 100644 (file)
@@ -15,13 +15,13 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-servicehandler</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencyManagement>
@@ -29,7 +29,7 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>1.8.0-SNAPSHOT</version>
+        <version>1.9.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
index a9a2d80b25ff496ba3043ba902989a800e3e47cc..f3c015a0446dce3f76cbbda2fd5717599f05c738 100644 (file)
@@ -23,6 +23,9 @@ public final class CheckCoherencyHardSoft {
 
     /**
      * function to check coherency between hard and soft constraints.
+     * @param hard Hard Constraints
+     * @param soft Soft Constraints
+     *
      * @return  <code> true </code>  if coherent
      *          <code> false </code> else
      */
index 72995e6ba474c716161461b19b152edc4212af08..0ee2ba8f701a9d4e97a320df1cf3f0a895996af6 100644 (file)
@@ -35,16 +35,24 @@ public final class ServicehandlerCompliancyCheck {
     /**
      * Check Compliancy of Service request.
      *
+     * @param serviceName
+     *            Service Name
+     * @param sdncRequestHeader
+     *            sdncRequestHeader
+     * @param conType
+     *            Connection type
+     * @param action
+     *            RPC Actions
      * @param contype
      *            Boolean to check connection Type
-     * @param sndcRequest
-     *            Boolean to check sndcRequestHeader
+     * @param sdncRequest
+     *            Boolean to check sdncRequestHeader
      *
      * @return true if String ok false if not
      */
     public static ComplianceCheckResult check(String serviceName, SdncRequestHeader sdncRequestHeader,
                                        ConnectionType conType, RpcActions action,
-                                       Boolean contype, Boolean sndcRequest) {
+                                       Boolean contype, Boolean sdncRequest) {
         boolean result = true;
         String message = "";
         if (!checkString(serviceName)) {
@@ -54,7 +62,7 @@ public final class ServicehandlerCompliancyCheck {
             result = false;
             message = "Service ConnectionType is not set";
         }
-        if (sndcRequest) {
+        if (sdncRequest) {
             if (sdncRequestHeader != null) {
                 RpcActions serviceAction = sdncRequestHeader.getRpcAction();
                 String requestId = sdncRequestHeader.getRequestId();
index 367e26dc113255919d830f5a6a5292ff8441effb..e55cf5cdc7fe8cb6e7e27de797f0a305c1e3d071 100644 (file)
@@ -124,6 +124,8 @@ public final class ServicehandlerTxRxCheck {
 
     /**
      * Check Compliancy of Service TxRx info.
+     * @param serviceEnd Service Endpoint
+     * @param endpointType Endpoint type
      *
      * @return true if String ok false if not
      */
index 53e26b7576e3a862064c2d186fdd28344ed70db6..eb6c5fbd528687849ef944c9e159defcbb016036 100644 (file)
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>bundle-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
     <groupId>org.opendaylight.transportpce</groupId>
     <artifactId>test-common</artifactId>
-    <version>0.2.0-SNAPSHOT</version>
+    <version>0.3.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <dependencyManagement>
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>1.8.0-SNAPSHOT</version>
+                <version>1.9.0-SNAPSHOT</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>2.0.7</version>
+                <version>2.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 15ebc4e36cd8002c5d73157cae94350b9374a8ea..bfbdbcec75f3477208cc4c142be7f9dfadd940ef 100644 (file)
@@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>stubs-aggregator</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <name>${project.artifactId}</name>
   <packaging>pom</packaging>
 
index 4d8f74feaa6cb420a142c17051c03346c8262d0e..864d69088ba56105b196d3f8dfcc7e736f732d05 100644 (file)
@@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-stubmodels</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencies>
index fb612a0f619c2da29a6c28a6e48923489d97f664..94ba894856b8acac4a66ed4ba816b4f51ac0f950 100644 (file)
@@ -17,13 +17,13 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-stubpce</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <!-- Ajout Fakepce to add fakepce.xml to target/classes -->
@@ -46,14 +46,14 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>1.8.0-SNAPSHOT</version>
+        <version>1.9.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.netconf</groupId>
         <artifactId>netconf-artifacts</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
index 56b4b33b57cf30d8f57387acb761dea3484d849e..29adb86cedd94be2d79c5460e7d9ffdcf620f35c 100644 (file)
@@ -15,13 +15,13 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
+    <version>0.14.0-SNAPSHOT</version>
     <relativePath/>
   </parent>
 
   <groupId>org.opendaylight.transportpce</groupId>
   <artifactId>transportpce-stubrenderer</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
+  <version>0.3.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <dependencyManagement>
@@ -29,14 +29,14 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>1.8.0-SNAPSHOT</version>
+        <version>1.9.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.netconf</groupId>
         <artifactId>netconf-artifacts</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
diff --git a/tox.ini b/tox.ini
new file mode 100644 (file)
index 0000000..8d4a48f
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,16 @@
+[tox]
+minversion = 1.6
+envlist =
+    docs
+    docs-linkcheck
+skipsdist = true
+
+[testenv:docs]
+deps = -rdocs/requirements.txt
+commands =
+    sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
+
+[testenv:docs-linkcheck]
+deps = -rdocs/requirements.txt
+commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
+