package ietf-network 2015-06-08 yang models 96/74296/7
authorguillaume.lambert <guillaume.lambert@orange.com>
Fri, 20 Jul 2018 15:44:29 +0000 (17:44 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Tue, 31 Jul 2018 14:05:01 +0000 (16:05 +0200)
JIRA: NETCONF-550
JIRA: TSC-124
JIRA: TRNSPRTPCE-29

Change-Id: I416422e94a8f684b1246efa21cddb424d2136c11
Co-authored-by: Martial COULIBALY <martial.coulibaly@gfi.fr>
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
51 files changed:
api/src/main/yang/olm@2017-04-18.yang
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingImpl.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl.java
features/features-transportpce/pom.xml
features/odl-transportpce/pom.xml
inventory/src/main/java/org/opendaylight/transportpce/inventory/job/PeriodicDeviceBackupJob.java
inventory/src/main/java/org/opendaylight/transportpce/inventory/listener/DeviceListener.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/NetConfTopologyListener.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/NetworkUtilsImpl.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/R2RLinkDiscovery.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/Rdm2XpdrLink.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/service/NetworkModelServiceImpl.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/ClliNetwork.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/OpenRoadmNetwork.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/OpenRoadmTopology.java
olm/src/main/java/org/opendaylight/transportpce/olm/OlmPowerServiceRpcImpl.java
olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmt.java
olm/src/main/java/org/opendaylight/transportpce/olm/service/OlmPowerServiceImpl.java
ordmodels/network/src/main/yang/old-ietf-network-topology@2015-06-08.yang [new file with mode: 0644]
ordmodels/network/src/main/yang/old-ietf-network@2015-06-08.yang [new file with mode: 0644]
ordmodels/network/src/main/yang/org-openroadm-clli-network@2017-06-26.yang
ordmodels/network/src/main/yang/org-openroadm-network-topology@2017-09-29.yang
ordmodels/network/src/main/yang/org-openroadm-network-types@2017-09-29.yang
ordmodels/network/src/main/yang/org-openroadm-network@2017-09-29.yang
ordmodels/network/src/main/yang/org-openroadm-opposite-links@2017-09-29.yang
ordmodels/network/src/main/yang/org-openroadm-otn-network-topology@2017-09-29.yang
ordmodels/network/src/main/yang/org-openroadm-xponder@2017-09-29.yang
pce/src/main/java/org/opendaylight/transportpce/pce/PceCalculation.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceLink.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceNode.java
pce/src/main/java/org/opendaylight/transportpce/pce/PcePathDescription.java
pce/src/main/java/org/opendaylight/transportpce/pce/impl/PceServiceRPCImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/ModelMappingUtils.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterfaceFactory.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/rpcs/DeviceRendererRPCImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/rpcs/TransportPCEServicePathRPCImpl.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImplTest.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/stub/OlmServiceStub.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/MountPointUtils.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/ServiceDataUtils.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java
test-common/src/main/java/org/opendaylight/transportpce/test/common/DataStoreContextImpl.java
tests/stubpce/pom.xml
tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/TpNodeTp.java
tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/impl/StubpceImpl.java
tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/topology/InterNodePath.java
tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/topology/SuperNodePath.java
tests/stubrenderer/pom.xml
tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererImpl.java

index 541b429ccc3aca83f9ebce32a3fd493243d10fde..a0b58126f841c7ae503d5df80cd1be13f0836560 100644 (file)
@@ -8,7 +8,7 @@ module olm {
       revision-date 2017-09-07;
   }
 
-  import ietf-network-topology {
+  import old-ietf-network-topology {
      prefix ietf-network-topology;
      revision-date 2015-06-08;
   }
index 3dc9f3f6be339f7ba87045191f2476e46c586c8f..a3d10279cddc08bf44ec0b788209a587fa662cdc 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.transportpce.common.mapping;
 
 import com.google.common.util.concurrent.CheckedFuture;
-
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -22,7 +21,6 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.stream.Collectors;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
@@ -405,7 +403,7 @@ public class PortMappingImpl implements PortMapping {
     private Mapping createMappingObject(String nodeId, Ports port, String circuitPackName,
         String logicalConnectionPoint) {
         MappingBuilder mpBldr = new MappingBuilder();
-        mpBldr.setKey(new MappingKey(logicalConnectionPoint)).setLogicalConnectionPoint(logicalConnectionPoint)
+        mpBldr.withKey(new MappingKey(logicalConnectionPoint)).setLogicalConnectionPoint(logicalConnectionPoint)
             .setSupportingCircuitPackName(circuitPackName).setSupportingPort(port.getPortName());
 
         // Get OMS and OTS interface provisioned on the TTP's
@@ -436,7 +434,7 @@ public class PortMappingImpl implements PortMapping {
     }
 
     private static CpToDegree createCpToDegreeObject(String circuitPackName, String degreeNumber) {
-        return new CpToDegreeBuilder().setKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
+        return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
             .setDegreeNumber(new Long(degreeNumber)).build();
     }
 
@@ -476,7 +474,7 @@ public class PortMappingImpl implements PortMapping {
     private boolean postPortMapping(Info deviceInfo, List<Mapping> portMapList, Integer nodeType,
         List<CpToDegree> cp2DegreeList) {
         NodesBuilder nodesBldr = new NodesBuilder();
-        nodesBldr.setKey(new NodesKey(deviceInfo.getNodeId())).setNodeId(deviceInfo.getNodeId());
+        nodesBldr.withKey(new NodesKey(deviceInfo.getNodeId())).setNodeId(deviceInfo.getNodeId());
         nodesBldr.setNodeType(NodeTypes.forValue(nodeType));
 
         if (portMapList != null) {
index d85b36db1e3a2d65de67656b049cf7a7a0f5db1b..6e1714cf790efd2c555dc79dbfd84c670b65ef9d 100644 (file)
@@ -9,11 +9,9 @@
 package org.opendaylight.transportpce.common.openroadminterfaces;
 
 import com.google.common.util.concurrent.ListenableFuture;
-
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.Timeouts;
 import org.opendaylight.transportpce.common.device.DeviceTransaction;
@@ -105,7 +103,7 @@ public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
             // State admin state to out of service
             InterfaceBuilder ifBuilder = new InterfaceBuilder(intf2Delete);
             if (ifBuilder.getType() == OtnOdu.class) {
-                Interface1Builder oduBuilder = new Interface1Builder(intf2Delete.getAugmentation(Interface1.class));
+                Interface1Builder oduBuilder = new Interface1Builder(intf2Delete.augmentation(Interface1.class));
                 OduBuilder odu = new OduBuilder(oduBuilder.getOdu());
                 if (odu.getMaintTestsignal() != null) {
                     MaintTestsignalBuilder maintSignalBuilder =
@@ -120,7 +118,7 @@ public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
                     .interfaces.rev161014.Interface1Builder otuBuilder =
                     new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu
                     .interfaces.rev161014.Interface1Builder(intf2Delete
-                            .getAugmentation(org.opendaylight.yang.gen.v1
+                            .augmentation(org.opendaylight.yang.gen.v1
                                     .http.org.openroadm.otn.otu.interfaces.rev161014.Interface1.class));
                 OtuBuilder otu = new OtuBuilder(otuBuilder.getOtu());
                 if (otu.getMaintLoopback() != null) {
index a9d52281ddf7a64a7ff4e4710fe65e6b33a1a2f3..e05558d054c16ef607e8a2d21d95640f9c4b705f 100644 (file)
@@ -50,12 +50,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <classifier>features</classifier>
       <type>xml</type>
     </dependency>
-    <dependency>
+    <!-- <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>odl-transportpce-inventory</artifactId>
       <version>${project.version}</version>
       <classifier>features</classifier>
       <type>xml</type>
-    </dependency>
+    </dependency> -->
   </dependencies>
 </project>
index 07f6a58f3b7686580daf1a0720360ee9a24c9675..b1ceee092f34e523573a409184526f5bd8a79964 100644 (file)
@@ -27,12 +27,20 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <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>
     <configfile.directory>etc/opendaylight/karaf</configfile.directory>
   </properties>
 
   <name>OpenDaylight :: transportpce</name>
 
   <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>odl-restconf-all</artifactId>
+      <version>${restconf.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>odl-mdsal-broker</artifactId>
index a431dd21b5eaa7c18197c7434bc5420bea3ce235..a99b4def0f71deedf676bd01a17ca22eaa164d61 100644 (file)
@@ -12,7 +12,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.base.Strings;
 import com.google.common.io.Files;
-
 import java.io.File;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
@@ -20,7 +19,6 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
-
 import org.apache.karaf.scheduler.Job;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
@@ -82,7 +80,7 @@ public class PeriodicDeviceBackupJob implements Runnable {
 
     @Override
     public void run() {
-        LOG.info("Running periodical device backup into {}", folder);
+        LOG.info("Running periodical device backup into {}", this.folder);
         try {
             backupAllDevices();
         } catch (InterruptedException | ExecutionException e) {
@@ -96,7 +94,7 @@ public class PeriodicDeviceBackupJob implements Runnable {
      * @return the folder
      */
     public String getFolder() {
-        return folder;
+        return this.folder;
     }
 
     /**
@@ -114,7 +112,7 @@ public class PeriodicDeviceBackupJob implements Runnable {
      * @return the filePrefix
      */
     public String getFilePrefix() {
-        return filePrefix;
+        return this.filePrefix;
     }
 
     /**
@@ -133,7 +131,7 @@ public class PeriodicDeviceBackupJob implements Runnable {
      * @throws ExecutionException execution exception
      */
     private void backupAllDevices() throws InterruptedException, ExecutionException {
-        ReadOnlyTransaction newReadOnlyTransaction = dataBroker.newReadOnlyTransaction();
+        ReadOnlyTransaction newReadOnlyTransaction = this.dataBroker.newReadOnlyTransaction();
         Optional<Topology> topology = newReadOnlyTransaction
                 .read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifiers.NETCONF_TOPOLOGY_II).get().toJavaUtil();
         if (!topology.isPresent()) {
@@ -159,7 +157,7 @@ public class PeriodicDeviceBackupJob implements Runnable {
     private void storeRoadmDevice(String nodeId) {
         InstanceIdentifier<OrgOpenroadmDevice> deviceIi = InstanceIdentifier.create(OrgOpenroadmDevice.class);
         Optional<OrgOpenroadmDevice> deviceObject =
-                deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL, deviceIi,
+                this.deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL, deviceIi,
                         Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
         if (!deviceObject.isPresent()) {
             LOG.warn("Device object {} is not present.", nodeId);
@@ -182,13 +180,13 @@ public class PeriodicDeviceBackupJob implements Runnable {
         }
 
         String prepareFileName = prepareFileName(nodeId);
-        File parent = new File(folder);
+        File parent = new File(this.folder);
         if (!parent.exists() && !parent.isDirectory() && !parent.mkdirs()) {
-            LOG.error("Could not create empty directory {}", folder);
-            throw new IllegalStateException(String.format("Could not create empty directory %s", folder));
+            LOG.error("Could not create empty directory {}", this.folder);
+            throw new IllegalStateException(String.format("Could not create empty directory %s", this.folder));
         }
 
-        File file = new File(parent, filePrefix.concat(prepareFileName));
+        File file = new File(parent, this.filePrefix.concat(prepareFileName));
         if (file.exists()) {
             throw new IllegalStateException(String.format("The file %s already exists", file));
         }
@@ -200,7 +198,7 @@ public class PeriodicDeviceBackupJob implements Runnable {
     }
 
     private String prepareFileName(String nodeId) {
-        String format = filenameFormatter.format(new Date());
+        String format = this.filenameFormatter.format(new Date());
         StringBuilder sb = new StringBuilder(format);
         sb.append("__").append(nodeId).append("__").append(".xml");
         return sb.toString();
@@ -219,31 +217,31 @@ public class PeriodicDeviceBackupJob implements Runnable {
             LOG.trace("The node is null");
             return "";
         }
-        NetconfNode netconfNode = node.getAugmentation(NetconfNode.class);
+        NetconfNode netconfNode = node.augmentation(NetconfNode.class);
         if (netconfNode == null) {
             LOG.trace("The node {} has not properties of NetconfNode", node);
             return "";
         }
-        if (netconfNode.getAvailableCapabilities() == null
-                || netconfNode.getAvailableCapabilities().getAvailableCapability() == null) {
+        if ((netconfNode.getAvailableCapabilities() == null)
+                || (netconfNode.getAvailableCapabilities().getAvailableCapability() == null)) {
             LOG.trace("No available capabilities");
             return "";
         }
         long count = netconfNode.getAvailableCapabilities().getAvailableCapability().stream()
-                .filter(cp -> cp.getCapability() != null && cp.getCapability().contains(ORG_OPENROADM_DEVICE)).count();
+                .filter(cp -> (cp.getCapability() != null) && cp.getCapability().contains(ORG_OPENROADM_DEVICE)).count();
         if (count < 1) {
             LOG.trace("The node {} has not capabilities of OpenROADMDevice", node);
             return "";
         }
-        if (node.getKey() == null || node.getKey().getNodeId() == null) {
+        if ((node.key() == null) || (node.key().getNodeId() == null)) {
             LOG.trace("Node {} has invalid key", node);
             return "";
         }
-        if ("controller-config".equalsIgnoreCase(node.getKey().getNodeId().getValue())) {
+        if ("controller-config".equalsIgnoreCase(node.key().getNodeId().getValue())) {
             LOG.info("Got controller-config instead of roadm-node");
             return "";
         }
-        return node.getKey().getNodeId().getValue();
+        return node.key().getNodeId().getValue();
     }
 
 }
index 2f8f8c67327f8e6ab7abfe83b0246d7bbcf61b60..daa2b30f7945e4dd5cffc907698a200fc850b83b 100644 (file)
@@ -47,8 +47,8 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
     public void onDataTreeChanged(Collection<DataTreeModification<Node>> changes) {
         List<DataTreeModification<Node>> changesWithoutDefaultNetconfNode = getRealDevicesOnly(changes);
         for (DataTreeModification<Node> device : changesWithoutDefaultNetconfNode) {
-            String nodeId = device.getRootNode().getDataAfter().getKey().getNodeId().getValue();
-            NetconfNode netconfNode = device.getRootNode().getDataAfter().getAugmentation(NetconfNode.class);
+            String nodeId = device.getRootNode().getDataAfter().key().getNodeId().getValue();
+            NetconfNode netconfNode = device.getRootNode().getDataAfter().augmentation(NetconfNode.class);
             if (isCreate(device) || isUpdate(device)) {
                 LOG.info("Node {} was modified", nodeId);
                 try {
@@ -82,7 +82,7 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
             return;
         }
         if (ConnectionStatus.Connected.equals(connectionStatus)) {
-            deviceInventory.initializeDevice(nodeId);
+            this.deviceInventory.initializeDevice(nodeId);
         } else if (ConnectionStatus.Connecting.equals(connectionStatus)
                 || ConnectionStatus.UnableToConnect.equals(connectionStatus)) {
             LOG.info("The device is in {} state", connectionStatus);
@@ -100,14 +100,14 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
      */
     private static List<DataTreeModification<Node>> getRealDevicesOnly(Collection<DataTreeModification<Node>> changes) {
         return changes.stream()
-                .filter(change -> (change.getRootNode().getDataAfter() != null
+                .filter(change -> ((change.getRootNode().getDataAfter() != null)
                         && !StringConstants.DEFAULT_NETCONF_NODEID
-                                .equalsIgnoreCase(change.getRootNode().getDataAfter().getKey().getNodeId().getValue())
-                        && change.getRootNode().getDataAfter().getAugmentation(NetconfNode.class) != null)
-                        || (change.getRootNode().getDataBefore() != null
+                                .equalsIgnoreCase(change.getRootNode().getDataAfter().key().getNodeId().getValue())
+                        && (change.getRootNode().getDataAfter().augmentation(NetconfNode.class) != null))
+                        || ((change.getRootNode().getDataBefore() != null)
                                 && !StringConstants.DEFAULT_NETCONF_NODEID.equalsIgnoreCase(
-                                        change.getRootNode().getDataBefore().getKey().getNodeId().getValue())
-                                && change.getRootNode().getDataBefore().getAugmentation(NetconfNode.class) != null
+                                        change.getRootNode().getDataBefore().key().getNodeId().getValue())
+                                && (change.getRootNode().getDataBefore().augmentation(NetconfNode.class) != null)
 
                         )).collect(Collectors.toList());
     }
@@ -119,7 +119,7 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
      * @return boolean true if the change is a new write
      */
     private static boolean isCreate(DataTreeModification<Node> change) {
-        return change.getRootNode().getDataBefore() == null && change.getRootNode().getDataAfter() != null
+        return (change.getRootNode().getDataBefore() == null) && (change.getRootNode().getDataAfter() != null)
                 && ModificationType.WRITE.equals(change.getRootNode().getModificationType());
     }
 
@@ -140,7 +140,7 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
      * @return boolean true if the node was deleted
      */
     private static boolean isDelete(DataTreeModification<Node> change) {
-        return change.getRootNode().getDataBefore() != null && change.getRootNode().getDataAfter() == null
+        return (change.getRootNode().getDataBefore() != null) && (change.getRootNode().getDataAfter() == null)
                 && ModificationType.DELETE.equals(change.getRootNode().getModificationType());
     }
 }
index 059479b021c7b1daf4363bd738441409e6a6cd73..06ab2f73aefa2a815abbb0ae790257cb5b529204 100644 (file)
@@ -163,7 +163,7 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
             }
             if (rootNode.getModificationType() == ModificationType.DELETE) {
                 if (rootNode.getDataBefore() != null) {
-                    String nodeId = rootNode.getDataBefore().getKey().getNodeId().getValue();
+                    String nodeId = rootNode.getDataBefore().key().getNodeId().getValue();
                     LOG.info("Node {} deleted", nodeId);
                     this.networkModelService.deleteOpenROADMnode(nodeId);
                     onDeviceDisConnected(nodeId);
@@ -172,8 +172,8 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
                 }
                 continue;
             }
-            String nodeId = rootNode.getDataAfter().getKey().getNodeId().getValue();
-            NetconfNode netconfNode = rootNode.getDataAfter().getAugmentation(NetconfNode.class);
+            String nodeId = rootNode.getDataAfter().key().getNodeId().getValue();
+            NetconfNode netconfNode = rootNode.getDataAfter().augmentation(NetconfNode.class);
 
             if ((netconfNode != null) && !StringConstants.DEFAULT_NETCONF_NODEID.equals(nodeId)) {
                 switch (rootNode.getModificationType()) {
index 4286976185b1a030368690fdb71f2bf6a598d033..7100c56c1d2777b03e0f71105860ee26536753df 100644 (file)
@@ -8,10 +8,9 @@
 package org.opendaylight.transportpce.networkmodel;
 
 import com.google.common.base.Optional;
+import com.google.common.util.concurrent.ListenableFuture;
 
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
@@ -56,7 +55,7 @@ public class NetworkUtilsImpl implements NetworkutilsService {
     }
 
     @Override
-    public Future<RpcResult<DeleteLinkOutput>> deleteLink(DeleteLinkInput input) {
+    public ListenableFuture<RpcResult<DeleteLinkOutput>> deleteLink(DeleteLinkInput input) {
 
         LinkId linkId = new LinkId(input.getLinkId());
         // Building link instance identifier
@@ -99,9 +98,9 @@ public class NetworkUtilsImpl implements NetworkutilsService {
         }
     }
 
-    public Future<RpcResult<InitRoadmNodesOutput>> initRoadmNodes(InitRoadmNodesInput input) {
+    public ListenableFuture<RpcResult<InitRoadmNodesOutput>> initRoadmNodes(InitRoadmNodesInput input) {
         boolean createRdmLinks = OrdLink.createRdm2RdmLinks(input,
-            openRoadmTopology, dataBroker);
+                this.openRoadmTopology,this.dataBroker);
         if (createRdmLinks) {
             return RpcResultBuilder
                 .success(new InitRoadmNodesOutputBuilder().setResult(
@@ -113,10 +112,10 @@ public class NetworkUtilsImpl implements NetworkutilsService {
     }
 
     @Override
-    public Future<RpcResult<InitXpdrRdmLinksOutput>> initXpdrRdmLinks(InitXpdrRdmLinksInput input) {
+    public ListenableFuture<RpcResult<InitXpdrRdmLinksOutput>> initXpdrRdmLinks(InitXpdrRdmLinksInput input) {
         // Assigns user provided input in init-network-view RPC to nodeId
         boolean createXpdrRdmLinks = Rdm2XpdrLink.createXpdrRdmLinks(input.getLinksInput(),
-            openRoadmTopology, dataBroker);
+                this.openRoadmTopology,this.dataBroker);
         if (createXpdrRdmLinks) {
             return RpcResultBuilder
                 .success(new InitXpdrRdmLinksOutputBuilder().setResult("Xponder Roadm Link created successfully"))
@@ -126,9 +125,10 @@ public class NetworkUtilsImpl implements NetworkutilsService {
         }
     }
 
-    public Future<RpcResult<InitRdmXpdrLinksOutput>> initRdmXpdrLinks(InitRdmXpdrLinksInput input) {
+    @Override
+    public ListenableFuture<RpcResult<InitRdmXpdrLinksOutput>> initRdmXpdrLinks(InitRdmXpdrLinksInput input) {
         boolean createRdmXpdrLinks = Rdm2XpdrLink.createRdmXpdrLinks(input.getLinksInput(),
-            openRoadmTopology, dataBroker);
+                this.openRoadmTopology,this.dataBroker);
         if (createRdmXpdrLinks) {
             return RpcResultBuilder
                 .success(new InitRdmXpdrLinksOutputBuilder().setResult("Roadm Xponder links created successfully"))
index 2dd9da35332b8c01cc4345feab1d8d5403d938e3..40ae84c062bf48438ad0a4d2993bbbaed8d9474e 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.transportpce.networkmodel;
 
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
-
 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;
@@ -64,11 +63,11 @@ public class R2RLinkDiscovery {
         Optional<Protocols> protocolObject = this.deviceTransactionManager.getDataFromDevice(nodeId.getValue(),
                 LogicalDatastoreType.OPERATIONAL, protocolsIID, Timeouts.DEVICE_READ_TIMEOUT,
                 Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-        if (!protocolObject.isPresent() || (protocolObject.get().getAugmentation(Protocols1.class) == null)) {
+        if (!protocolObject.isPresent() || (protocolObject.get().augmentation(Protocols1.class) == null)) {
             LOG.warn("LLDP subtree is missing : isolated openroadm device");
             return false;
         }
-        NbrList nbrList = protocolObject.get().getAugmentation(Protocols1.class).getLldp().getNbrList();
+        NbrList nbrList = protocolObject.get().augmentation(Protocols1.class).getLldp().getNbrList();
         LOG.info("LLDP subtree is present. Device has {} neighbours", nbrList.getIfName().size());
         for (IfName ifName : nbrList.getIfName()) {
             if (ifName.getRemoteSysName() == null) {
@@ -170,7 +169,7 @@ public class R2RLinkDiscovery {
         r2rlinkBuilderAToZ.setRdmANode(nodeId.getValue()).setDegANum(srcDegId.shortValue())
                 .setTerminationPointA(srcTpTx).setRdmZNode(destNodeId.getValue()).setDegZNum(destDegId.shortValue())
                 .setTerminationPointZ(destTpRx);
-        if (!OrdLink.createRdm2RdmLinks(r2rlinkBuilderAToZ.build(), openRoadmTopology, dataBroker)) {
+        if (!OrdLink.createRdm2RdmLinks(r2rlinkBuilderAToZ.build(), this.openRoadmTopology, this.dataBroker)) {
             LOG.error("OMS Link creation failed between node: {} and nodeId: {} in A->Z direction", nodeId.getValue(),
                     destNodeId.getValue());
             return false;
@@ -185,7 +184,7 @@ public class R2RLinkDiscovery {
         r2rlinkBuilderZToA.setRdmANode(destNodeId.getValue()).setDegANum(destDegId.shortValue())
                 .setTerminationPointA(destTpTx).setRdmZNode(nodeId.getValue()).setDegZNum(srcDegId.shortValue())
                 .setTerminationPointZ(srcTpRx);
-        if (!OrdLink.createRdm2RdmLinks(r2rlinkBuilderZToA.build(), openRoadmTopology, dataBroker)) {
+        if (!OrdLink.createRdm2RdmLinks(r2rlinkBuilderZToA.build(), this.openRoadmTopology, this.dataBroker)) {
             LOG.error("OMS Link creation failed between node: {} and nodeId: {} in Z->A direction",
                     destNodeId.getValue(), nodeId.getValue());
             return false;
index 73b765cf7bdf47c82c0053d56f7901a357959437..b67091ee7cc4d4a5b0c22fe6bd046f1dd2b9e7ca 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.transportpce.networkmodel;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.CheckedFuture;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -100,13 +99,13 @@ final class Rdm2XpdrLink {
         NetworkId nwId = new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID);
         NetworkBuilder nwBuilder = new NetworkBuilder();
         nwBuilder.setNetworkId(nwId);
-        nwBuilder.setKey(new NetworkKey(nwId));
+        nwBuilder.withKey(new NetworkKey(nwId));
         Link1Builder lnk1bldr = new Link1Builder();
         LinkBuilder linkBuilder = openRoadmTopology.createLink(srcNode, destNode, srcTp, destTp);
         lnk1bldr.setLinkType(isXponderInput ? OpenroadmLinkType.XPONDERINPUT : OpenroadmLinkType.XPONDEROUTPUT);
         linkBuilder.addAugmentation(Link1.class, lnk1bldr.build());
         LOG.info("Link id in the linkbldr {}", linkBuilder.getLinkId());
-        LOG.info("Link with oppo link {}", linkBuilder.getAugmentation(Link1.class));
+        LOG.info("Link with oppo link {}", linkBuilder.augmentation(Link1.class));
         Network1Builder nwBldr1 = new Network1Builder();
         nwBldr1.setLink(ImmutableList.of(linkBuilder.build()));
         nwBuilder.addAugmentation(Network1.class, nwBldr1.build());
index 78e4510a2e3f7380b10ca800377ffcb34c662bfb..81079870e9022d32b1f09b69195f0d44c0880612 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.transportpce.networkmodel.service;
 
 import java.util.HashMap;
 import java.util.concurrent.ExecutionException;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -95,14 +94,14 @@ public class NetworkModelServiceImpl implements NetworkModelService {
             LOG.info("creating node in {}", NetworkUtils.CLLI_NETWORK_ID);
             InstanceIdentifier<Node> iiClliNode = InstanceIdentifier
                     .builder(Network.class, new NetworkKey(new NetworkId(NetworkUtils.CLLI_NETWORK_ID)))
-                    .child(Node.class, clliNode.getKey())
+                    .child(Node.class, clliNode.key())
                     .build();
             writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, iiClliNode, clliNode,
                     CREATE_MISSING_PARENTS);
             LOG.info("creating node in {}", NetworkUtils.UNDERLAY_NETWORK_ID);
             InstanceIdentifier<Node> iiOpenRoadmNode = InstanceIdentifier
                     .builder(Network.class, new NetworkKey(new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID)))
-                    .child(Node.class, openRoadmNode.getKey())
+                    .child(Node.class, openRoadmNode.key())
                     .build();
             writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, iiOpenRoadmNode, openRoadmNode,
                     CREATE_MISSING_PARENTS);
@@ -111,7 +110,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
                         NetworkUtils.OVERLAY_NETWORK_ID);
                 InstanceIdentifier<Node> iiOpenRoadmTopologyNode = InstanceIdentifier
                         .builder(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
-                        .child(Node.class, openRoadmTopologyNode.getKey())
+                        .child(Node.class, openRoadmTopologyNode.key())
                         .build();
                 writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, iiOpenRoadmTopologyNode,
                         openRoadmTopologyNode, CREATE_MISSING_PARENTS);
@@ -122,7 +121,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
                 InstanceIdentifier<Link> iiOpenRoadmTopologyLink = InstanceIdentifier
                         .builder(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
                         .augmentation(Network1.class)
-                        .child(Link.class, openRoadmTopologyLink.getKey())
+                        .child(Link.class, openRoadmTopologyLink.key())
                         .build();
                 writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, iiOpenRoadmTopologyLink,
                         openRoadmTopologyLink, CREATE_MISSING_PARENTS);
@@ -176,7 +175,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
                             NetworkUtils.OVERLAY_NETWORK_ID);
                     InstanceIdentifier<Node> iiOpenRoadmTopologyNode = InstanceIdentifier
                             .builder(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
-                            .child(Node.class, openRoadmTopologyNode.getKey())
+                            .child(Node.class, openRoadmTopologyNode.key())
                             .build();
                     writeTransaction.delete(LogicalDatastoreType.CONFIGURATION, iiOpenRoadmTopologyNode);
                 }
@@ -186,7 +185,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
                     InstanceIdentifier<Link> iiOpenRoadmTopologyLink = InstanceIdentifier
                             .builder(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
                             .augmentation(Network1.class)
-                            .child(Link.class, openRoadmTopologyLink.getKey())
+                            .child(Link.class, openRoadmTopologyLink.key())
                             .build();
                     writeTransaction.delete(LogicalDatastoreType.CONFIGURATION, iiOpenRoadmTopologyLink);
                 }
index 1af2d3567c0e27ea30b664c6fc7206b224b95227..0379442620228deeaeff71d5c9dca630db9d6b2a 100644 (file)
@@ -12,7 +12,6 @@ import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -89,7 +88,7 @@ public final class ClliNetwork {
         NodeBuilder nodeBldr = new NodeBuilder();
         NodeId nwNodeId = new NodeId(clli);
         nodeBldr.setNodeId(nwNodeId);
-        nodeBldr.setKey(new NodeKey(nwNodeId));
+        nodeBldr.withKey(new NodeKey(nwNodeId));
         /*
          * create clli node augmentation
          * defined in openroadm-clli-network.yang
@@ -107,7 +106,7 @@ public final class ClliNetwork {
         NetworkBuilder nwBuilder = new NetworkBuilder();
         NetworkId nwId = new NetworkId(NetworkUtils.CLLI_NETWORK_ID);
         nwBuilder.setNetworkId(nwId);
-        nwBuilder.setKey(new NetworkKey(nwId));
+        nwBuilder.withKey(new NetworkKey(nwId));
         //set network type to clli
         NetworkTypes1Builder clliNetworkTypesBldr = new NetworkTypes1Builder();
         clliNetworkTypesBldr.setClliNetwork(new ClliNetworkBuilder().build());
index 39924b27edee2f12d19dd26cc9e0fadf28e66c3e..df6f824be97d70ad6b90fc5516c3f519cbc72424 100644 (file)
@@ -9,12 +9,10 @@
 package org.opendaylight.transportpce.networkmodel.util;
 
 import com.google.common.collect.ImmutableList;
-
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -96,7 +94,7 @@ public final class OpenRoadmNetwork {
         NodeBuilder nodeBldr = new NodeBuilder();
         NodeId nwNodeId = new NodeId(nodeId);
         nodeBldr.setNodeId(nwNodeId);
-        nodeBldr.setKey(new NodeKey(nwNodeId));
+        nodeBldr.withKey(new NodeKey(nwNodeId));
         Node1Builder node1bldr = new Node1Builder();
 
         /*
@@ -126,7 +124,7 @@ public final class OpenRoadmNetwork {
         // attribute
         String clli = deviceInfo.getClli();
         SupportingNodeBuilder supportbldr = new SupportingNodeBuilder();
-        supportbldr.setKey(new SupportingNodeKey(new NetworkId(NetworkUtils.CLLI_NETWORK_ID), new NodeId(clli)));
+        supportbldr.withKey(new SupportingNodeKey(new NetworkId(NetworkUtils.CLLI_NETWORK_ID), new NodeId(clli)));
         supportbldr.setNetworkRef(new NetworkId(NetworkUtils.CLLI_NETWORK_ID));
         supportbldr.setNodeRef(new NodeId(clli));
         nodeBldr.setSupportingNode(ImmutableList.of(supportbldr.build()));
@@ -143,7 +141,7 @@ public final class OpenRoadmNetwork {
         NetworkBuilder openrdmnwBuilder = new NetworkBuilder();
         NetworkId nwId = new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID);
         openrdmnwBuilder.setNetworkId(nwId);
-        openrdmnwBuilder.setKey(new NetworkKey(nwId));
+        openrdmnwBuilder.withKey(new NetworkKey(nwId));
         // sets network type to OpenRoadmNetwork
         NetworkTypes1Builder openRoadmNetworkTypesBldr = new NetworkTypes1Builder();
         openRoadmNetworkTypesBldr.setOpenroadmNetwork(new OpenroadmNetworkBuilder().build());
index 0abc53d5cd40a16d431e09f20fd49c157d89d431..95364d09e3bc9971fc3bad7bd68ea97be4254812 100644 (file)
@@ -15,7 +15,6 @@ import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -124,7 +123,7 @@ public class OpenRoadmTopology {
         NetworkBuilder nwBuilder = new NetworkBuilder();
         NetworkId nwId = new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID);
         nwBuilder.setNetworkId(nwId);
-        nwBuilder.setKey(new NetworkKey(nwId));
+        nwBuilder.withKey(new NetworkKey(nwId));
         // set network type to Transport Underlay
         NetworkTypes1Builder topoNetworkTypesBldr = new NetworkTypes1Builder();
         topoNetworkTypesBldr.setOpenroadmTopology(new OpenroadmTopologyBuilder().build());
@@ -300,7 +299,7 @@ public class OpenRoadmTopology {
         String nodeIdtopo = new StringBuilder().append(nodeId).append("-XPDR1").toString();
         // Ad degree node specific augmentation
         nodebldr.setNodeId(new NodeId(nodeIdtopo));
-        nodebldr.setKey(new NodeKey(new NodeId(nodeIdtopo)));
+        nodebldr.withKey(new NodeKey(new NodeId(nodeIdtopo)));
         nodebldr.addAugmentation(Node1.class, node1bldr.build());
         while (clientCounter != 0) {
             // Create CLNT-TX termination
@@ -589,7 +588,7 @@ public class OpenRoadmTopology {
         // Sets the value of Network-ref and Node-ref as a part of the supporting node
         // attribute
         SupportingNodeBuilder supportbldr = new SupportingNodeBuilder();
-        supportbldr.setKey(new SupportingNodeKey(new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID), new NodeId(nodeId)));
+        supportbldr.withKey(new SupportingNodeKey(new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID), new NodeId(nodeId)));
         supportbldr.setNetworkRef(new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID));
         supportbldr.setNodeRef(new NodeId(nodeId));
         ArrayList<SupportingNode> supportlist = new ArrayList<>();
@@ -629,7 +628,7 @@ public class OpenRoadmTopology {
         TerminationPointBuilder tpBldr = new TerminationPointBuilder();
         TpId tp = new TpId(tpId);
         TerminationPointKey tpKey = new TerminationPointKey(tp);
-        tpBldr.setKey(tpKey);
+        tpBldr.withKey(tpKey);
         tpBldr.setTpId(tp);
         return tpBldr;
     }
@@ -650,7 +649,7 @@ public class OpenRoadmTopology {
         lnkBldr.setDestination(dstNodeBldr.build());
         lnkBldr.setSource(srcNodeBldr.build());
         lnkBldr.setLinkId(LinkIdUtil.buildLinkId(srcNode, srcTp, dstNode, destTp));
-        lnkBldr.setKey(new LinkKey(lnkBldr.getLinkId()));
+        lnkBldr.withKey(new LinkKey(lnkBldr.getLinkId()));
         org.opendaylight.yang.gen.v1.http.org.openroadm.opposite.links.rev170929.Link1Builder lnk1Bldr =
             new org.opendaylight.yang.gen.v1.http.org.openroadm.opposite.links.rev170929.Link1Builder();
         LinkId oppositeLinkId = LinkIdUtil.getOppositeLinkId(srcNode, srcTp, dstNode, destTp);
@@ -829,7 +828,7 @@ public class OpenRoadmTopology {
         for (int i = 1; i < 97; i++) {
             AvailableWavelengthsBuilder avalBldr = new AvailableWavelengthsBuilder();
             avalBldr.setIndex((long) i);
-            avalBldr.setKey(new AvailableWavelengthsKey((long) i));
+            avalBldr.withKey(new AvailableWavelengthsKey((long) i));
             waveList.add(avalBldr.build());
         }
 
@@ -848,7 +847,7 @@ public class OpenRoadmTopology {
                 new org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev170929.srg.node.attributes
                     .AvailableWavelengthsBuilder();
             avalBldr.setIndex((long) i);
-            avalBldr.setKey(
+            avalBldr.withKey(
                 new org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev170929.srg.node.attributes
                     .AvailableWavelengthsKey((long) i));
             waveList.add(avalBldr.build());
index 85244577c22e8938dee0e7b7b8b881ec7c137b50..c0dfb20549a013aac5bfe17e9a24214481f92fd8 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.transportpce.olm;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.transportpce.olm.service.OlmPowerService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossBaseInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossBaseOutput;
@@ -53,8 +53,8 @@ public class OlmPowerServiceRpcImpl implements OlmService {
      * @return Result of the request
      */
     @Override
-    public Future<RpcResult<GetPmOutput>> getPm(GetPmInput input) {
-        return RpcResultBuilder.success(olmPowerService.getPm(input)).buildFuture();
+    public ListenableFuture<RpcResult<GetPmOutput>> getPm(GetPmInput input) {
+        return RpcResultBuilder.success(this.olmPowerService.getPm(input)).buildFuture();
     }
 
     /**
@@ -78,9 +78,9 @@ public class OlmPowerServiceRpcImpl implements OlmService {
      * @return Result of the request
      */
     @Override
-    public Future<org.opendaylight.yangtools.yang.common.RpcResult<ServicePowerSetupOutput>> servicePowerSetup(
+    public ListenableFuture<RpcResult<ServicePowerSetupOutput>> servicePowerSetup(
         ServicePowerSetupInput input) {
-        return RpcResultBuilder.success(olmPowerService.servicePowerSetup(input)).buildFuture();
+        return RpcResultBuilder.success(this.olmPowerService.servicePowerSetup(input)).buildFuture();
     }
 
     /**
@@ -104,8 +104,8 @@ public class OlmPowerServiceRpcImpl implements OlmService {
      * @return Result of the request
      */
     @Override
-    public  Future<RpcResult<ServicePowerTurndownOutput>> servicePowerTurndown(ServicePowerTurndownInput input) {
-        return RpcResultBuilder.success(olmPowerService.servicePowerTurndown(input)).buildFuture();
+    public  ListenableFuture<RpcResult<ServicePowerTurndownOutput>> servicePowerTurndown(ServicePowerTurndownInput input) {
+        return RpcResultBuilder.success(this.olmPowerService.servicePowerTurndown(input)).buildFuture();
     }
 
     /**
@@ -131,18 +131,18 @@ public class OlmPowerServiceRpcImpl implements OlmService {
      * @return Result of the request
      */
     @Override
-    public Future<RpcResult<CalculateSpanlossBaseOutput>> calculateSpanlossBase(CalculateSpanlossBaseInput input) {
-        return RpcResultBuilder.success(olmPowerService.calculateSpanlossBase(input)).buildFuture();
+    public ListenableFuture<RpcResult<CalculateSpanlossBaseOutput>> calculateSpanlossBase(CalculateSpanlossBaseInput input) {
+        return RpcResultBuilder.success(this.olmPowerService.calculateSpanlossBase(input)).buildFuture();
     }
 
     @Override
-    public Future<RpcResult<CalculateSpanlossCurrentOutput>> calculateSpanlossCurrent(
+    public ListenableFuture<RpcResult<CalculateSpanlossCurrentOutput>> calculateSpanlossCurrent(
             CalculateSpanlossCurrentInput input) {
-        return RpcResultBuilder.success(olmPowerService.calculateSpanlossCurrent(input)).buildFuture();
+        return RpcResultBuilder.success(this.olmPowerService.calculateSpanlossCurrent(input)).buildFuture();
     }
 
     @Override
-    public Future<RpcResult<ServicePowerResetOutput>> servicePowerReset(ServicePowerResetInput input) {
-        return RpcResultBuilder.success(olmPowerService.servicePowerReset(input)).buildFuture();
+    public ListenableFuture<RpcResult<ServicePowerResetOutput>> servicePowerReset(ServicePowerResetInput input) {
+        return RpcResultBuilder.success(this.olmPowerService.servicePowerReset(input)).buildFuture();
     }
 }
\ No newline at end of file
index 8cbb41def5c12b08c0255025ea1ac3c48f324bb0..45172d4a559d9cb6d41cc5f5aa43de7c135495e7 100644 (file)
@@ -9,14 +9,12 @@
 package org.opendaylight.transportpce.olm.power;
 
 import com.google.common.util.concurrent.ListenableFuture;
-
 import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.Timeouts;
@@ -85,19 +83,19 @@ public class PowerMgmt {
             String nodeId = input.getNodes().get(i).getNodeId();
             String srcTpId =  input.getNodes().get(i).getSrcTp();
             String destTpId = input.getNodes().get(i).getDestTp();
-            Optional<Nodes> inputNodeOptional = OlmUtils.getNode(nodeId, db);
+            Optional<Nodes> inputNodeOptional = OlmUtils.getNode(nodeId, this.db);
             // If node type is transponder
             if (inputNodeOptional.isPresent()
-                    && inputNodeOptional.get().getNodeType() != null
+                    && (inputNodeOptional.get().getNodeType() != null)
                     && inputNodeOptional.get().getNodeType().equals(NodeTypes.Xpdr)) {
 
                 Nodes inputNode = inputNodeOptional.get();
                 LOG.info("Getting data from input node {}", inputNode.getNodeType());
-                LOG.info("Getting mapping data for node is {}", inputNode.getMapping().stream().filter(o -> o.getKey()
+                LOG.info("Getting mapping data for node is {}", inputNode.getMapping().stream().filter(o -> o.key()
                         .equals(new MappingKey(destTpId))).findFirst().toString());
                 // If its A-End transponder
                 if (destTpId.toLowerCase().contains("network")) {
-                    java.util.Optional<Mapping> mappingObject = inputNode.getMapping().stream().filter(o -> o.getKey()
+                    java.util.Optional<Mapping> mappingObject = inputNode.getMapping().stream().filter(o -> o.key()
                             .equals(new MappingKey(destTpId))).findFirst();
                     if (mappingObject.isPresent()) {
                         Map<String, Double> txPowerRangeMap = getXponderPowerRange(mappingObject.get()
@@ -158,7 +156,7 @@ public class PowerMgmt {
                     LOG.info("{} is a drop node. Net power settings needed", nodeId);
                 }
             } else if (inputNodeOptional.isPresent()
-                    && inputNodeOptional.get().getNodeType() != null
+                    && (inputNodeOptional.get().getNodeType() != null)
                     && inputNodeOptional.get().getNodeType().equals(NodeTypes.Rdm)) {
                 // If Degree is transmitting end then set power
                 Nodes inputNode = inputNodeOptional.get();
@@ -166,21 +164,21 @@ public class PowerMgmt {
                 String connectionNumber = srcTpId + "-" + destTpId + "-" + input.getWaveNumber();
                 LOG.info("Connection number is {}", connectionNumber);
                 if (destTpId.toLowerCase().contains("deg")) {
-                    Optional<Mapping> mappingObjectOptional = inputNode.getMapping().stream().filter(o -> o.getKey()
+                    Optional<Mapping> mappingObjectOptional = inputNode.getMapping().stream().filter(o -> o.key()
                             .equals(new MappingKey(destTpId))).findFirst();
                     if (mappingObjectOptional.isPresent()) {
                         LOG.info("Dest point is Degree {}", mappingObjectOptional.get());
                         Mapping portMapping = mappingObjectOptional.get();
                         Optional<Interface> interfaceOpt;
                         try {
-                            interfaceOpt = openRoadmInterfaces.getInterface(nodeId, portMapping.getSupportingOts());
+                            interfaceOpt = this.openRoadmInterfaces.getInterface(nodeId, portMapping.getSupportingOts());
                         } catch (OpenRoadmInterfaceException ex) {
                             LOG.error("Failed to get interface {} from node {}!", portMapping.getSupportingOts(),
                                     nodeId, ex);
                             return false;
                         }
                         if (interfaceOpt.isPresent()) {
-                            BigDecimal spanLossTx = interfaceOpt.get().getAugmentation(Interface1.class).getOts()
+                            BigDecimal spanLossTx = interfaceOpt.get().augmentation(Interface1.class).getOts()
                                     .getSpanLossTransmit().getValue();
                             LOG.info("Spanloss TX is {}", spanLossTx);
                             BigDecimal powerValue = BigDecimal.valueOf(Math.min(spanLossTx.doubleValue() - 9, 2));
@@ -304,7 +302,7 @@ public class PowerMgmt {
                 .child(Interface.class, new InterfaceKey(interfaceName));
         Optional<Interface> nodeInterfaceOpt;
         try {
-            nodeInterfaceOpt = openRoadmInterfaces.getInterface(nodeId, interfaceName);
+            nodeInterfaceOpt = this.openRoadmInterfaces.getInterface(nodeId, interfaceName);
         } catch (OpenRoadmInterfaceException ex) {
             LOG.error("Failed to get interface {} from node {}!", interfaceName, nodeId, ex);
             return false;
@@ -312,7 +310,7 @@ public class PowerMgmt {
         if (nodeInterfaceOpt.isPresent()) {
             InterfaceBuilder intfBuilder = new InterfaceBuilder(nodeInterfaceOpt.get());
             intfBuilder.setAdministrativeState(AdminStates.OutOfService);
-            Future<Optional<DeviceTransaction>> deviceTxFuture = deviceTransactionManager.getDeviceTransaction(nodeId);
+            Future<Optional<DeviceTransaction>> deviceTxFuture = this.deviceTransactionManager.getDeviceTransaction(nodeId);
             DeviceTransaction deviceTx;
             try {
                 Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
@@ -361,7 +359,7 @@ public class PowerMgmt {
         Map<String, Double> powerRangeMap = new HashMap<>();
         LOG.info("Fetching logical Connection Point value for port {} at circuit pack {}", portName, circuitPackName);
         Optional<Ports> portObject =
-                deviceTransactionManager.getDataFromDevice(deviceId, LogicalDatastoreType.OPERATIONAL, portIID,
+                this.deviceTransactionManager.getDataFromDevice(deviceId, LogicalDatastoreType.OPERATIONAL, portIID,
                         Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
         if (portObject.isPresent()) {
             Ports port = portObject.get();
@@ -389,8 +387,8 @@ public class PowerMgmt {
     private Map<String, Double> getSRGRxPowerRange(String nodeId, String srgId) {
         Map<String, Double> powerRangeMap = new HashMap<>();
         LOG.info("Coming inside Xpdr power range");
-        Optional<Mapping> mappingSRGOptional = OlmUtils.getNode(nodeId, db).flatMap(node -> node.getMapping()
-                .stream().filter(o -> o.getKey()
+        Optional<Mapping> mappingSRGOptional = OlmUtils.getNode(nodeId, this.db).flatMap(node -> node.getMapping()
+                .stream().filter(o -> o.key()
                         .equals(new MappingKey(srgId))).findFirst());
         if (mappingSRGOptional.isPresent()) {
             LOG.info("Mapping object exists.");
@@ -403,7 +401,7 @@ public class PowerMgmt {
             LOG.info("Fetching logical Connection Point value for port {} at circuit pack {}{}", portName,
                     circuitPackName, portIID);
             Optional<Ports> portObject =
-                    deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL, portIID,
+                    this.deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL, portIID,
                             Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
             if (portObject.isPresent()) {
                 Ports port = portObject.get();
@@ -446,7 +444,7 @@ public class PowerMgmt {
                 nodeId, interfaceName);
         Optional<Interface> interfaceOptional;
         try {
-            interfaceOptional = openRoadmInterfaces.getInterface(nodeId, interfaceName);
+            interfaceOptional = this.openRoadmInterfaces.getInterface(nodeId, interfaceName);
         } catch (OpenRoadmInterfaceException ex) {
             LOG.error("Failed to get interface {} from node {}!", interfaceName, nodeId, ex);
             return false;
@@ -454,7 +452,7 @@ public class PowerMgmt {
         if (interfaceOptional.isPresent()) {
             InterfaceBuilder ochInterfaceBuilder =
                     new InterfaceBuilder(interfaceOptional.get());
-            OchBuilder ochBuilder = new OchBuilder(ochInterfaceBuilder.getAugmentation(
+            OchBuilder ochBuilder = new OchBuilder(ochInterfaceBuilder.augmentation(
                     org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014
                             .Interface1.class).getOch());
             ochBuilder.setTransmitPower(new PowerDBm(txPower));
@@ -462,7 +460,7 @@ public class PowerMgmt {
                     org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014
                             .Interface1.class, new Interface1Builder().setOch(ochBuilder.build()).build());
 
-            Future<Optional<DeviceTransaction>> deviceTxFuture = deviceTransactionManager.getDeviceTransaction(nodeId);
+            Future<Optional<DeviceTransaction>> deviceTxFuture = this.deviceTransactionManager.getDeviceTransaction(nodeId);
             DeviceTransaction deviceTx;
             try {
                 Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
@@ -512,7 +510,7 @@ public class PowerMgmt {
      */
     private boolean setPowerLevel(String deviceId, OpticalControlMode mode, BigDecimal powerValue,
             String connectionNumber) {
-        Optional<RoadmConnections> rdmConnOpt = crossConnect.getCrossConnect(deviceId, connectionNumber);
+        Optional<RoadmConnections> rdmConnOpt = this.crossConnect.getCrossConnect(deviceId, connectionNumber);
         if (rdmConnOpt.isPresent()) {
             RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder(rdmConnOpt.get());
             rdmConnBldr.setOpticalControlMode(mode);
@@ -522,7 +520,7 @@ public class PowerMgmt {
             RoadmConnections newRdmConn = rdmConnBldr.build();
 
             Future<Optional<DeviceTransaction>> deviceTxFuture =
-                    deviceTransactionManager.getDeviceTransaction(deviceId);
+                    this.deviceTransactionManager.getDeviceTransaction(deviceId);
             DeviceTransaction deviceTx;
             try {
                 Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
index ba455724b830461ff0e145f5fd694600efa339e4..d06f64042a803f524d9d296155b9a3bd13a96f8e 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.transportpce.olm.service;
 
 import com.google.common.base.Strings;
 import com.google.common.util.concurrent.ListenableFuture;
-
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.ArrayList;
@@ -22,7 +21,6 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.stream.Collectors;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -112,14 +110,14 @@ public class OlmPowerServiceImpl implements OlmPowerService {
 
     @Override
     public GetPmOutput getPm(GetPmInput pmInput) {
-        GetPmOutputBuilder pmOutputBuilder = OlmUtils.pmFetch(pmInput, deviceTransactionManager);
+        GetPmOutputBuilder pmOutputBuilder = OlmUtils.pmFetch(pmInput, this.deviceTransactionManager);
         return pmOutputBuilder.build();
     }
 
     @Override
     public ServicePowerSetupOutput servicePowerSetup(ServicePowerSetupInput powerSetupInput) {
         ServicePowerSetupOutputBuilder powerSetupOutput = new ServicePowerSetupOutputBuilder();
-        boolean successValPowerCalculation = powerMgmt.setPower(powerSetupInput);
+        boolean successValPowerCalculation = this.powerMgmt.setPower(powerSetupInput);
 
         if (successValPowerCalculation) {
             powerSetupOutput.setResult(SUCCESS);
@@ -135,7 +133,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
 
         ServicePowerTurndownOutputBuilder powerTurnDownOutput = new ServicePowerTurndownOutputBuilder();
         // TODO add flag or return failure instead of string
-        if (powerMgmt.powerTurnDown(powerTurndownInput)) {
+        if (this.powerMgmt.powerTurnDown(powerTurndownInput)) {
             powerTurnDownOutput.setResult(SUCCESS);
         } else {
             powerTurnDownOutput.setResult(FAILED);
@@ -162,7 +160,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
 
         List<RoadmLinks> roadmLinks = new ArrayList<>();
         for (Link link : networkLinks) {
-            Link1 roadmLinkAugmentation = link.getAugmentation(Link1.class);
+            Link1 roadmLinkAugmentation = link.augmentation(Link1.class);
             if (roadmLinkAugmentation == null) {
                 LOG.debug("Missing OpenRoadm link augmentation in link {} from {} topology.",
                         link.getLinkId().getValue(), NetworkUtils.OVERLAY_NETWORK_ID);
@@ -207,7 +205,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
         }
         List<RoadmLinks> roadmLinks = new ArrayList<>();
         for (Link link : networkLinks) {
-            Link1 roadmLinkAugmentation = link.getAugmentation(Link1.class);
+            Link1 roadmLinkAugmentation = link.augmentation(Link1.class);
             if (roadmLinkAugmentation == null) {
                 LOG.debug("Missing OpenRoadm link augmentation in link {} from {} topology.",
                         link.getLinkId().getValue(), NetworkUtils.OVERLAY_NETWORK_ID);
@@ -254,7 +252,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
                 .augmentation(Network1.class)
                 .build();
         Optional<Network1> networkOptional;
-        try (ReadOnlyTransaction rtx = dataBroker.newReadOnlyTransaction()) {
+        try (ReadOnlyTransaction rtx = this.dataBroker.newReadOnlyTransaction()) {
             //TODO change to constant from Timeouts class when it will be merged.
             networkOptional = rtx.read(LogicalDatastoreType.CONFIGURATION, networkIID).get(Timeouts.DATASTORE_READ,
                     TimeUnit.MILLISECONDS).toJavaUtil();
@@ -270,7 +268,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
         }
 
         List<Link> networkLinks = networkOptional.get().getLink();
-        if (networkLinks == null || networkLinks.isEmpty()) {
+        if ((networkLinks == null) || networkLinks.isEmpty()) {
             LOG.warn("Links are not present in {} topology.", NetworkUtils.OVERLAY_NETWORK_ID);
             return Collections.emptyList();
         }
@@ -292,7 +290,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
      */
     private OtsPmHolder getPmMeasurements(String nodeId, String tpID, String pmName) {
         String realNodeId = getRealNodeId(nodeId);
-        Mapping mapping = portMapping.getMapping(realNodeId, tpID);
+        Mapping mapping = this.portMapping.getMapping(realNodeId, tpID);
         if (mapping == null) {
             return null;
         }
@@ -343,7 +341,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
         com.google.common.base.Optional<Interface> interfaceObject;
         try {
             Future<Optional<DeviceTransaction>> deviceTxFuture =
-                    deviceTransactionManager.getDeviceTransaction(realNodeId);
+                    this.deviceTransactionManager.getDeviceTransaction(realNodeId);
             java.util.Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
             DeviceTransaction deviceTx;
             if (deviceTxOpt.isPresent()) {
@@ -360,9 +358,9 @@ public class OlmPowerServiceImpl implements OlmPowerService {
                 Interface intf = interfaceObject.get();
                 InterfaceBuilder interfaceBuilder = new InterfaceBuilder(intf);
                 OtsBuilder otsBuilder = new OtsBuilder();
-                if (intf.getAugmentation(Interface1.class) != null
-                    && intf.getAugmentation(Interface1.class).getOts() != null) {
-                    Ots ots = intf.getAugmentation(Interface1.class).getOts();
+                if ((intf.augmentation(Interface1.class) != null)
+                    && (intf.augmentation(Interface1.class).getOts() != null)) {
+                    Ots ots = intf.augmentation(Interface1.class).getOts();
                     otsBuilder.setFiberType(ots.getFiberType());
                     spanLossRx = ots.getSpanLossReceive();
                     spanLossTx = ots.getSpanLossTransmit();
@@ -416,7 +414,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
                     .setScale(0, RoundingMode.HALF_UP);
             LOG.info("Spanloss Calculated as :" + spanLoss + "=" + srcOtsPmHoler.getOtsParameterVal() + "-"
                     + destOtsPmHoler.getOtsParameterVal());
-            if (spanLoss.doubleValue() < 28 && spanLoss.doubleValue() > 0) {
+            if ((spanLoss.doubleValue() < 28) && (spanLoss.doubleValue() > 0)) {
                 if (!setSpanLoss(roadmLinks.get(i).getSrcNodeId(), srcOtsPmHoler.getOtsInterfaceName(), spanLoss,
                         "TX")) {
                     LOG.info("Setting spanLoss failed for " + roadmLinks.get(i).getSrcNodeId());
@@ -436,22 +434,22 @@ public class OlmPowerServiceImpl implements OlmPowerService {
         KeyedInstanceIdentifier<Node, NodeKey> mappedNodeII =
                 InstanceIdentifiers.OVERLAY_NETWORK_II.child(Node.class, new NodeKey(new NodeId(mappedNodeId)));
         com.google.common.base.Optional<Node> realNode;
-        try (ReadOnlyTransaction readOnlyTransaction = dataBroker.newReadOnlyTransaction()) {
+        try (ReadOnlyTransaction readOnlyTransaction = this.dataBroker.newReadOnlyTransaction()) {
             realNode = readOnlyTransaction.read(LogicalDatastoreType.CONFIGURATION, mappedNodeII).get();
         } catch (InterruptedException | ExecutionException e) {
             LOG.error(e.getMessage(), e);
             throw new IllegalStateException(e);
         }
-        if (!realNode.isPresent() || realNode.get().getSupportingNode() == null) {
+        if (!realNode.isPresent() || (realNode.get().getSupportingNode() == null)) {
             throw new IllegalArgumentException(
                     String.format("Could not find node %s, or supporting node is not present", mappedNodeId));
         }
         List<SupportingNode> collect = realNode.get().getSupportingNode().stream()
-                .filter(node -> node.getNetworkRef() != null
+                .filter(node -> (node.getNetworkRef() != null)
                         && NetworkUtils.UNDERLAY_NETWORK_ID.equals(node.getNetworkRef().getValue())
-                        && node.getNodeRef() != null && !Strings.isNullOrEmpty(node.getNodeRef().getValue()))
+                        && (node.getNodeRef() != null) && !Strings.isNullOrEmpty(node.getNodeRef().getValue()))
                 .collect(Collectors.toList());
-        if (collect.isEmpty() || collect.size() > 1) {
+        if (collect.isEmpty() || (collect.size() > 1)) {
             throw new IllegalArgumentException(String.format("Invalid support node count [%d] was found for node %s",
                     collect.size(), mappedNodeId));
         }
diff --git a/ordmodels/network/src/main/yang/old-ietf-network-topology@2015-06-08.yang b/ordmodels/network/src/main/yang/old-ietf-network-topology@2015-06-08.yang
new file mode 100644 (file)
index 0000000..81a8a28
--- /dev/null
@@ -0,0 +1,243 @@
+module old-ietf-network-topology {\r
+  yang-version 1;\r
+  namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology";\r
+  prefix lnk;\r
+\r
+  import ietf-inet-types {\r
+    prefix inet;\r
+  }\r
+  import old-ietf-network {\r
+    prefix nd;\r
+  }\r
+\r
+  organization "TBD";\r
+  contact\r
+    "WILL-BE-DEFINED-LATER";\r
+  description\r
+    "This module defines a common base model for network topology, \r
+     augmenting the base network model with links to connect nodes, \r
+     as well as termination points to terminate links on nodes.";\r
+\r
+  revision 2015-06-08 {\r
+    description\r
+      "Initial revision.";\r
+    reference "draft-ietf-i2rs-yang-network-topo-01";\r
+  }\r
+\r
+  typedef link-id {\r
+    type inet:uri;\r
+    description\r
+      "An identifier for a link in a topology.\r
+       The identifier may be opaque.\r
+       The identifier SHOULD be chosen such that the same link in a\r
+       real network topology will always be identified through the\r
+       same identifier, even if the model is instantiated in \r
+          separate datastores. An implementation MAY choose to capture\r
+       semantics in the identifier, for example to indicate the type\r
+       of link and/or the type of topology that the link is a part \r
+       of.";\r
+  }\r
+\r
+  typedef tp-id {\r
+    type inet:uri;\r
+    description\r
+      "An identifier for termination points on a node.\r
+       The identifier may be opaque.\r
+       The identifier SHOULD be chosen such that the same TP in a\r
+       real network topology will always be identified through the\r
+       same identifier, even if the model is instantiated in\r
+       separate datastores. An implementation MAY choose to capture\r
+       semantics in the identifier, for example to indicate the type\r
+       of TP and/or the type of node and topology that the TP is a \r
+       part of.";\r
+  }\r
+\r
+  grouping link-ref {\r
+    description\r
+      "References a link in a specific network.";\r
+    leaf link-ref {\r
+      type leafref {\r
+        path "/nd:network[nd:network-id=current()/../"+\r
+          "nd:network-ref]/link/link-id";\r
+      }\r
+      description\r
+        "A type for an absolute reference a link instance.\r
+         (This type should not be used for relative references.\r
+         In such a case, a relative path should be used instead.)";\r
+    }\r
+    uses nd:network-ref;\r
+  }\r
+\r
+  grouping tp-ref {\r
+    description\r
+      "References a termination point in a specific node.";\r
+    leaf tp-ref {\r
+      type leafref {\r
+        path "/nd:network[nd:network-id=current()/../"+\r
+          "nd:network-ref]/nd:node[nd:node-id=current()/../"+\r
+          "nd:node-ref]/termination-point/tp-id";\r
+      }\r
+      description\r
+        "A type for an absolute reference to a termination point.\r
+         (This type should not be used for relative references.\r
+         In such a case, a relative path should be used instead.)";\r
+    }\r
+    uses nd:node-ref;\r
+  }\r
+\r
+  augment "/nd:network" {\r
+    description \r
+      "Add links to the network model.";\r
+    list link {\r
+      key "link-id";\r
+      description\r
+        "A Network Link connects a by Local (Source) node and\r
+         a Remote (Destination) Network Nodes via a set of the\r
+         nodes' termination points.\r
+         As it is possible to have several links between the same\r
+         source and destination nodes, and as a link could\r
+         potentially be re-homed between termination points, to\r
+         ensure that we would always know to distinguish between\r
+         links, every link is identified by a dedicated link\r
+         identifier.\r
+         Note that a link models a point-to-point link, not a\r
+         multipoint link.\r
+         Layering dependencies on links in underlay topologies are\r
+         not represented as the layering information of nodes and of\r
+         termination points is sufficient.";\r
+      container source {\r
+        description\r
+          "This container holds the logical source of a particular\r
+           link.";\r
+        leaf source-node {\r
+          type leafref {\r
+            path "../../../nd:node/nd:node-id";\r
+          }\r
+          mandatory true;\r
+          description\r
+            "Source node identifier, must be in same topology.";\r
+        }\r
+        leaf source-tp {\r
+          type leafref {\r
+            path "../../../nd:node[nd:node-id=current()/../"+\r
+              "source-node]/termination-point/tp-id";\r
+          }\r
+          description\r
+            "Termination point within source node that terminates\r
+             the link.";\r
+        }\r
+      }\r
+      container destination {\r
+        description\r
+          "This container holds the logical destination of a\r
+           particular link.";\r
+        leaf dest-node {\r
+          type leafref {\r
+            path "../../../nd:node/nd:node-id";\r
+          }\r
+          mandatory true;\r
+          description\r
+            "Destination node identifier, must be in the same\r
+             network.";\r
+        }\r
+        leaf dest-tp {\r
+          type leafref {\r
+            path "../../../nd:node[nd:node-id=current()/../"+\r
+              "dest-node]/termination-point/tp-id";\r
+          }\r
+          description\r
+            "Termination point within destination node that\r
+             terminates the link.";\r
+        }\r
+      }\r
+      leaf link-id {\r
+        type link-id;\r
+        description\r
+          "The identifier of a link in the topology.\r
+           A link is specific to a topology to which it belongs.";\r
+      }\r
+      list supporting-link {\r
+        key "network-ref link-ref";\r
+        description\r
+          "Identifies the link, or links, that this link\r
+           is dependent on.";\r
+        leaf network-ref {\r
+          type leafref {\r
+            path "../../../nd:supporting-network/nd:network-ref";\r
+          }\r
+          description\r
+            "This leaf identifies in which underlay topology\r
+             supporting link is present.";\r
+        }\r
+        leaf link-ref {\r
+          type leafref {\r
+            path "/nd:network[nd:network-id=current()/.."+\r
+              "/network-ref]/link/link-id";\r
+          }\r
+          description\r
+            "This leaf identifies a link which is a part\r
+             of this link's underlay. Reference loops, in which\r
+             a link identifies itself as its underlay, either\r
+             directly or transitively, are not allowed.";\r
+        }\r
+      }\r
+    }\r
+  }\r
+  augment "/nd:network/nd:node" {\r
+    description\r
+      "Augment termination points which terminate links.  \r
+       Termination points can ultimately be mapped to interfaces.";\r
+    list termination-point {\r
+      key "tp-id";\r
+      description\r
+        "A termination point can terminate a link.\r
+         Depending on the type of topology, a termination point\r
+         could, for example, refer to a port or an interface.";\r
+      leaf tp-id {\r
+        type tp-id;\r
+        description\r
+          "Termination point identifier.";\r
+      }\r
+      list supporting-termination-point {\r
+        key "network-ref node-ref tp-ref";\r
+        description\r
+          "The leaf list identifies any termination points that\r
+           the termination point is dependent on, or maps onto.\r
+           Those termination points will themselves be contained\r
+           in a supporting node.\r
+           This dependency information can be inferred from\r
+           the dependencies between links.  For this reason,\r
+           this item is not separately configurable.  Hence no\r
+           corresponding constraint needs to be articulated.\r
+           The corresponding information is simply provided by the\r
+           implementing system.";\r
+        leaf network-ref {\r
+          type leafref {\r
+            path "../../../nd:supporting-node/nd:network-ref";\r
+          }\r
+          description\r
+            "This leaf identifies in which topology the\r
+             supporting termination point is present.";\r
+        }\r
+        leaf node-ref {\r
+          type leafref {\r
+            path "../../../nd:supporting-node/nd:node-ref";\r
+          }\r
+          description\r
+            "This leaf identifies in which node the supporting\r
+             termination point is present.";\r
+        }\r
+        leaf tp-ref {\r
+          type leafref {\r
+            path "/nd:network[nd:network-id=current()/../"+\r
+              "network-ref]/nd:node[nd:node-id=current()/../"+\r
+              "node-ref]/termination-point/tp-id";\r
+          }\r
+          description\r
+            "Reference to the underlay node, must be in a\r
+             different topology";\r
+        }\r
+      }\r
+    }\r
+  }\r
+}\r
diff --git a/ordmodels/network/src/main/yang/old-ietf-network@2015-06-08.yang b/ordmodels/network/src/main/yang/old-ietf-network@2015-06-08.yang
new file mode 100644 (file)
index 0000000..cc90ce2
--- /dev/null
@@ -0,0 +1,144 @@
+module old-ietf-network {\r
+  yang-version 1;\r
+  namespace "urn:ietf:params:xml:ns:yang:ietf-network";\r
+  prefix nd;\r
+\r
+  import ietf-inet-types {\r
+    prefix inet;\r
+  }\r
+\r
+  organization "TBD";\r
+  contact\r
+    "WILL-BE-DEFINED-LATER";\r
+  description\r
+    "This module defines a common base model for a collection \r
+     of nodes in a network. Node definitions s are further used\r
+     in network topologies and inventories.";\r
+\r
+  revision 2015-06-08 {\r
+    description\r
+      "Initial revision.";\r
+    reference "draft-ietf-i2rs-yang-network-topo-01";\r
+  }\r
+\r
+  typedef node-id {\r
+    type inet:uri;\r
+    description\r
+      "Identifier for a node.";\r
+  }\r
+\r
+  typedef network-id {\r
+    type inet:uri;\r
+    description\r
+      "Identifier for a network.";\r
+  }\r
+\r
+  grouping network-ref {\r
+    description\r
+      "Contains the information necessary to reference a network,\r
+       for example an underlay network.";\r
+    leaf network-ref {\r
+      type leafref {\r
+        path "/network/network-id";\r
+      }\r
+      description\r
+        "Used to reference a network, for example an underlay\r
+         network.";\r
+    }\r
+  }\r
+\r
+  grouping node-ref {\r
+    description \r
+      "Contains the information necessary to reference a node.";\r
+    leaf node-ref {\r
+      type leafref {\r
+        path "/network[network-id=current()/../network-ref]"+\r
+          "/node/node-id";\r
+      }\r
+      description\r
+        "Used to reference a node.  \r
+         Nodes are identified relative to the network they are\r
+         contained in.";\r
+    }\r
+    uses network-ref;\r
+  }\r
+\r
+  list network {\r
+    key "network-id";\r
+    description\r
+      "Describes a network.\r
+       A network typically contains an inventory of nodes,\r
+       topological information (augmented through \r
+       network-topology model), as well as layering \r
+       information.";\r
+    container network-types {\r
+      description\r
+        "Serves as an augmentation target.  \r
+         The network type is indicated through corresponding\r
+         presence containers augmented into this container.";\r
+    }\r
+    leaf network-id {\r
+      type network-id;\r
+      description\r
+        "Identifies a network.";\r
+    }\r
+    leaf server-provided {\r
+      type boolean;\r
+      config false;\r
+      description\r
+        "Indicates whether the information concerning this\r
+         particular network is populated by the server \r
+         (server-provided true, the general case for network \r
+         information discovered from the server), \r
+         or whether it is configured by a client \r
+         (server-provided true, possible e.g. for \r
+         service overlays managed through a controller).";\r
+    }\r
+    list supporting-network {\r
+      key "network-ref";\r
+      description\r
+        "An underlay network, used to represent layered network\r
+         topologies.";\r
+      leaf network-ref {\r
+        type leafref {\r
+          path "/network/network-id";\r
+        }\r
+        description\r
+          "References the underlay network.";\r
+      }\r
+    }\r
+    list node {\r
+      key "node-id";\r
+      description\r
+        "The inventory of nodes of this network.";\r
+      leaf node-id {\r
+        type node-id;\r
+        description\r
+          "Identifies a node uniquely within the containing \r
+           network.";\r
+      }\r
+      list supporting-node {\r
+        key "network-ref node-ref";\r
+        description\r
+          "Represents another node, in an underlay network, that \r
+           this node is supported by.  Used to represent layering \r
+           structure.";\r
+        leaf network-ref {\r
+          type leafref {\r
+            path "../../../supporting-network/network-ref";\r
+          }\r
+          description\r
+            "References the underlay network that the \r
+             underlay node is part of.";\r
+        }\r
+        leaf node-ref {\r
+          type leafref {\r
+            path "/network/node/node-id";\r
+          }\r
+          description\r
+            "References the underlay node itself.";\r
+        }\r
+      }\r
+    }\r
+  }\r
+}\r
index 6dbd262d70a80c9e910e07e5072bcb6aaa17ea59..45916db3691c8a936bd0a5711cae714a0fc9cca8 100644 (file)
@@ -2,7 +2,7 @@ module org-openroadm-clli-network {
   namespace "http://org/openroadm/clli/network";
   prefix cn;
 
-  import ietf-network {
+  import old-ietf-network {
     prefix nd;
     revision-date 2015-06-08;
   }
index 817cdf164d7025295a110cb3ccb004d2eb4ce138..afa5f7162ac801bed420730e3a8d3675f398f210 100644 (file)
@@ -2,11 +2,11 @@ module org-openroadm-network-topology {
   namespace "http://org/openroadm/network/topology";
   prefix topo;
 
-  import ietf-network {
+  import old-ietf-network {
     prefix nd;
     revision-date 2015-06-08;
   }
-  import ietf-network-topology {
+  import old-ietf-network-topology {
     prefix nwt;
     revision-date 2015-06-08;
   }
index bfc6da9c4ed1a497ffa217d8330268f7f44b3c4d..308f7124f88cc578f19a35ebe32a7b296d40e004 100644 (file)
@@ -2,7 +2,7 @@ module org-openroadm-network-types {
   namespace "http://org/openroadm/network/types";
   prefix nt;
 
-  import ietf-network-topology {
+  import old-ietf-network-topology {
     prefix nwt;
     revision-date 2015-06-08;
   }
index cb949867582bee1e3b826a5cce8bb3d684fe8f55..8a87a3a7634d85a573571d05ab23cc1fdb9c13e1 100644 (file)
@@ -2,7 +2,7 @@ module org-openroadm-network {
   namespace "http://org/openroadm/network";
   prefix net;
 
-  import ietf-network {
+  import old-ietf-network {
     prefix nd;
     revision-date 2015-06-08;
   }
index 67641777c27d9651551e885d31dddafe6adb0abd..36bdbd8c05e5da2731804af60e42ae065b654372 100644 (file)
@@ -2,11 +2,11 @@ module org-openroadm-opposite-links {
   namespace "http://org/openroadm/opposite/links";
   prefix opp-links;
 
-  import ietf-network {
+  import old-ietf-network {
     prefix nd;
     revision-date 2015-06-08;
   }
-  import ietf-network-topology {
+  import old-ietf-network-topology {
     prefix nwt;
     revision-date 2015-06-08;
   }
index 2b890510de5742b85539bc3fbf9d3da177d58e14..3de95e74a581c27f7eb4de6c65b3f5d18b1689f8 100644 (file)
@@ -2,11 +2,11 @@ module org-openroadm-otn-network-topology {
   namespace "http://org/openroadm/otn/network/topology";
   prefix otn-topo;
 
-  import ietf-network {
+  import old-ietf-network {
     prefix nd;
     revision-date 2015-06-08;
   }
-  import ietf-network-topology {
+  import old-ietf-network-topology {
     prefix nwt;
     revision-date 2015-06-08;
   }
index d6934d2be20483763775dc3ea72d9c2270d94ee8..f6f03b8dcc154e9c23a4662cc9597dc6a0c128bc 100644 (file)
@@ -2,11 +2,11 @@ module org-openroadm-xponder {
   namespace "http://org/openroadm/xponder";
   prefix xpndr;
 
-  import ietf-network {
+  import old-ietf-network {
     prefix nd;
     revision-date 2015-06-08;
   }
-  import ietf-network-topology {
+  import old-ietf-network-topology {
     prefix nwt;
     revision-date 2015-06-08;
   }
index 3f6bccdee90d96acbf430a8c8eba9e3be373a649..aede67294f734b894fc1ab38cc10e7c66ca9d958 100644 (file)
@@ -9,14 +9,12 @@
 package org.opendaylight.transportpce.pce;
 
 import com.google.common.base.Optional;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -149,7 +147,7 @@ public class PceCalculation {
             return false;
         }
         this.allNodes = nw.getNode();
-        Network1 nw1 = nw.getAugmentation(Network1.class);
+        Network1 nw1 = nw.augmentation(Network1.class);
 
         this.allLinks = nw1.getLink();
         if ((this.allNodes == null) || this.allNodes.isEmpty()) {
@@ -353,7 +351,7 @@ public class PceCalculation {
             }
 
             // extract node type
-            Node1 node1 = node.getAugmentation(Node1.class);
+            Node1 node1 = node.augmentation(Node1.class);
             if (node1 == null) {
                 LOG.error("validateNode: no Node1 (type) Augmentation for node: [{}]. Node is ignored",
                         nodeId.getValue());
index 1ed5c122e0b859213874adecad4d84de6368b50b..f9278ada62f5e7d6755436ebc628c7cdb9baca91 100644 (file)
@@ -68,7 +68,7 @@ public class PceLink {
         OpenroadmLinkType tmplType = null;
 
         // ID and type
-        link1 = link.getAugmentation(Link1.class);
+        link1 = link.augmentation(Link1.class);
         if (link1 == null) {
             this.isValid = false;
             LOG.error("PceLink: No Link augmentation available. Link is ignored {}", this.linkId);
@@ -88,7 +88,7 @@ public class PceLink {
         // opposite link
         LinkId tmpoppositeLink = null;
         org.opendaylight.yang.gen.v1.http.org.openroadm.opposite.links.rev170929.Link1 linkOpposite = link
-            .getAugmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.opposite.links.rev170929.Link1.class);
+            .augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.opposite.links.rev170929.Link1.class);
         tmpoppositeLink = linkOpposite.getOppositeLink();
         LOG.debug("PceLink: reading oppositeLink.  {}", linkOpposite.toString());
         if (tmpoppositeLink == null) {
@@ -103,7 +103,7 @@ public class PceLink {
         Long tmplatency = (long)0;
         Link1 link1 = null;
         // latency
-        link1 = link.getAugmentation(Link1.class);
+        link1 = link.augmentation(Link1.class);
         tmplatency = link1.getLinkLatency();
         if (tmplatency == null) {
             tmplatency = (long) 0;
index 3ec85d9f70156ab622b7bb58849a783e70ba4c24..1fc66905b94ce223c863721fc0da1ed78b9887bc 100644 (file)
@@ -12,7 +12,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.TerminationPoint1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev170929.OpenroadmNodeType;
@@ -52,34 +51,34 @@ public class PceNode {
 
         if ((node == null) || (nodeId == null) || (nodeType == null)) {
             LOG.error("PceNode: one of parameters is not populated : nodeId, node type");
-            valid = false;
+            this.valid = false;
         }
     }
 
     public void initWLlist() {
 
-        availableWLindex.clear();
+        this.availableWLindex.clear();
 
         if (!isValid()) {
             return;
         }
 
-        Node1 node1 = node.getAugmentation(Node1.class);
+        Node1 node1 = this.node.augmentation(Node1.class);
 
-        switch (nodeType) {
+        switch (this.nodeType) {
             case SRG:
                 List<org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev170929.srg.node.attributes
                     .AvailableWavelengths> srgAvailableWL = node1.getSrgAttributes().getAvailableWavelengths();
 
                 if (srgAvailableWL == null) {
-                    valid = false;
+                    this.valid = false;
                     LOG.error("initWLlist: SRG AvailableWavelengths is empty for node  {}", this.toString());
                     return;
                 }
 
                 for (org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev170929.srg.node.attributes
                     .AvailableWavelengths awl : srgAvailableWL) {
-                    availableWLindex.add(awl.getIndex());
+                    this.availableWLindex.add(awl.getIndex());
                     LOG.debug("initWLlist: SRG next = {} in {}" , awl.getIndex() , this.toString());
                 }
 
@@ -90,14 +89,14 @@ public class PceNode {
                     .AvailableWavelengths> degAvailableWL = node1.getDegreeAttributes().getAvailableWavelengths();
 
                 if (degAvailableWL == null) {
-                    valid = false;
+                    this.valid = false;
                     LOG.error("initWLlist: DEG AvailableWavelengths is empty for node  {}", this.toString());
                     return;
                 }
 
                 for (org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev170929.degree.node.attributes
                     .AvailableWavelengths awl : degAvailableWL) {
-                    availableWLindex.add(awl.getIndex());
+                    this.availableWLindex.add(awl.getIndex());
                     LOG.debug("initWLlist: DEGREE next = {} in {}", awl.getIndex(), this.toString());
                 }
 
@@ -107,21 +106,21 @@ public class PceNode {
 
                 // HARD CODED 96
                 for (long i = 1; i <= 96; i++) {
-                    availableWLindex.add(i);
+                    this.availableWLindex.add(i);
                 }
 
                 break;
 
             default:
-                LOG.error("initWLlist: unsupported node type {} in node {}" , nodeType, this.toString());
+                LOG.error("initWLlist: unsupported node type {} in node {}" , this.nodeType, this.toString());
                 break;
         }
 
-        if (availableWLindex.size() == 0) {
+        if (this.availableWLindex.size() == 0) {
             LOG.debug("initWLlist: There are no available wavelengths in node {}", this.toString());
-            valid = false;
+            this.valid = false;
         }
-        LOG.debug("initWLlist: availableWLindex size = {} in {}" , availableWLindex.size(), this.toString());
+        LOG.debug("initWLlist: availableWLindex size = {} in {}" , this.availableWLindex.size(), this.toString());
 
         return;
     }
@@ -133,32 +132,32 @@ public class PceNode {
         }
 
         org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.Node1 nodeTp =
-            node.getAugmentation(
+            this.node.augmentation(
                 org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.Node1.class);
 
         List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.network.node
             .TerminationPoint> allTps = nodeTp.getTerminationPoint();
 
         if (allTps == null) {
-            valid = false;
+            this.valid = false;
             LOG.error("initXndrTps: XPONDER TerminationPoint list is empty for node {}", this.toString());
             return;
         }
 
-        valid = false;
+        this.valid = false;
 
         for (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.network.node
             .TerminationPoint tp : allTps) {
 
-            TerminationPoint1 tp1 = tp.getAugmentation(TerminationPoint1.class);
+            TerminationPoint1 tp1 = tp.augmentation(TerminationPoint1.class);
 
             if (tp1.getTpType() == OpenroadmTpType.XPONDERNETWORK) {
 
                 if (tp1.getXpdrNetworkAttributes().getWavelength() != null) {
-                    usedXpndrNWTps.add(tp.getTpId().getValue());
+                    this.usedXpndrNWTps.add(tp.getTpId().getValue());
                     LOG.debug("initWLlist: XPONDER tp = {} is used", tp.getTpId().getValue());
                 } else {
-                    valid = true;
+                    this.valid = true;
                 }
 
                 // find Client of this network TP
@@ -166,9 +165,9 @@ public class PceNode {
                 if ((client.equals("")) || (client == null)) {
                     LOG.error("initXndrTps: XPONDER {} NW TP doesn't have defined Client {}",
                         this.toString(),tp.getTpId().getValue());
-                    valid = false;
+                    this.valid = false;
                 }
-                clientPerNwTp.put(tp.getTpId().getValue(), client);
+                this.clientPerNwTp.put(tp.getTpId().getValue(), client);
 
             }
         }
@@ -181,25 +180,25 @@ public class PceNode {
     }
 
     public boolean checkTP(String tp) {
-        if (usedXpndrNWTps.contains(tp)) {
+        if (this.usedXpndrNWTps.contains(tp)) {
             return false;
         }
         return true;
     }
 
     public boolean checkWL(long index) {
-        if (availableWLindex.contains(index)) {
+        if (this.availableWLindex.contains(index)) {
             return true;
         }
         return false;
     }
 
     public boolean isValid() {
-        return valid;
+        return this.valid;
     }
 
     public List<Long> getAvailableWLs() {
-        return availableWLindex;
+        return this.availableWLindex;
     }
 
     public void addOutgoingLink(PceLink outLink) {
@@ -207,16 +206,16 @@ public class PceNode {
     }
 
     public List<PceLink> getOutgoingLinks() {
-        return outgoingLinks;
+        return this.outgoingLinks;
     }
 
     public String getClient(String tp) {
-        return clientPerNwTp.get(tp);
+        return this.clientPerNwTp.get(tp);
     }
 
     @Override
     public String toString() {
-        return "PceNode type=" + nodeType + " ID=" + nodeId.getValue();
+        return "PceNode type=" + this.nodeType + " ID=" + this.nodeId.getValue();
     }
 
 }
index 5fc23c8868e6ad092ddf9ad79befe5554d4b4902..6c31082170bb3f9a9f67113976edcc56b04d469d 100644 (file)
@@ -8,11 +8,9 @@
 package org.opendaylight.transportpce.pce;
 
 import com.google.common.collect.ImmutableList;
-
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-
 import org.opendaylight.transportpce.common.ResponseCodes;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.AToZDirectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirectionBuilder;
@@ -43,7 +41,7 @@ public class PcePathDescription {
     private PceResult rc;
 
     public PceResult getReturnStructure() {
-        return rc;
+        return this.rc;
     }
 
     private Map<LinkId, PceLink> allPceLinks = null;
@@ -58,34 +56,34 @@ public class PcePathDescription {
     }
 
     public PceResult buildDescriptions() {
-        LOG.info("In buildDescriptions: AtoZ {}", pathAtoZ.toString());
+        LOG.info("In buildDescriptions: AtoZ {}", this.pathAtoZ.toString());
         List<AToZ> atozList = new ArrayList<AToZ>();
-        if (pathAtoZ == null) {
-            rc.setRC(ResponseCodes.RESPONSE_FAILED);
+        if (this.pathAtoZ == null) {
+            this.rc.setRC(ResponseCodes.RESPONSE_FAILED);
             LOG.error("In buildDescriptions: there is empty AtoZ path");
-            return rc;
+            return this.rc;
         }
 
-        buildAtoZ(atozList, pathAtoZ);
+        buildAtoZ(atozList, this.pathAtoZ);
 
-        rc.setAtoZDirection(new AToZDirectionBuilder().setRate(rc.getRate())
-                .setAToZWavelengthNumber(rc.getResultWavelength()).setAToZ(atozList).build());
+        this.rc.setAtoZDirection(new AToZDirectionBuilder().setRate(this.rc.getRate())
+                .setAToZWavelengthNumber(this.rc.getResultWavelength()).setAToZ(atozList).build());
 
-        pathZtoA = ImmutableList.copyOf(pathAtoZ).reverse();
-        LOG.info("In buildDescriptions: ZtoA {}", pathZtoA.toString());
+        this.pathZtoA = ImmutableList.copyOf(this.pathAtoZ).reverse();
+        LOG.info("In buildDescriptions: ZtoA {}", this.pathZtoA.toString());
 
         List<ZToA> ztoaList = new ArrayList<ZToA>();
-        if (pathZtoA == null) {
-            rc.setRC(ResponseCodes.RESPONSE_FAILED);
+        if (this.pathZtoA == null) {
+            this.rc.setRC(ResponseCodes.RESPONSE_FAILED);
             LOG.error("In buildDescriptions: there is empty ZtoA path");
-            return rc;
+            return this.rc;
         }
-        buildZtoA(ztoaList, pathZtoA);
+        buildZtoA(ztoaList, this.pathZtoA);
 
-        rc.setZtoADirection(new ZToADirectionBuilder().setRate(rc.getRate())
-                .setZToAWavelengthNumber(rc.getResultWavelength()).setZToA(ztoaList).build());
+        this.rc.setZtoADirection(new ZToADirectionBuilder().setRate(this.rc.getRate())
+                .setZToAWavelengthNumber(this.rc.getResultWavelength()).setZToA(ztoaList).build());
 
-        return rc;
+        return this.rc;
     }
 
     private void buildAtoZ(List<AToZ> etoeList, List<PceLink> path) {
@@ -104,7 +102,7 @@ public class PcePathDescription {
 
         AToZKey clientKey = new AToZKey(index.toString());
         Resource clientResource = new ResourceBuilder().setResource(stp).build();
-        AToZ firstResource = new AToZBuilder().setId(tpName).setKey(clientKey).setResource(clientResource).build();
+        AToZ firstResource = new AToZBuilder().setId(tpName).withKey(clientKey).setResource(clientResource).build();
         etoeList.add(firstResource);
 
         index++;
@@ -122,7 +120,7 @@ public class PcePathDescription {
             // Source Resource
             AToZKey sourceKey = new AToZKey(index.toString());
             Resource nodeResource1 = new ResourceBuilder().setResource(sourceNode).build();
-            AToZ srcResource = new AToZBuilder().setId(srcName).setKey(sourceKey).setResource(nodeResource1).build();
+            AToZ srcResource = new AToZBuilder().setId(srcName).withKey(sourceKey).setResource(nodeResource1).build();
             index++;
             etoeList.add(srcResource);
 
@@ -136,7 +134,7 @@ public class PcePathDescription {
             // Resource
             AToZKey srcTPKey = new AToZKey(index.toString());// tpName);
             Resource tpResource1 = new ResourceBuilder().setResource(stp).build();
-            AToZ stpResource = new AToZBuilder().setId(tpName).setKey(srcTPKey).setResource(tpResource1).build();
+            AToZ stpResource = new AToZBuilder().setId(tpName).withKey(srcTPKey).setResource(tpResource1).build();
             index++;
             etoeList.add(stpResource);
 
@@ -150,7 +148,7 @@ public class PcePathDescription {
             // Link Resource
             AToZKey linkKey = new AToZKey(index.toString());
             Resource nodeResource2 = new ResourceBuilder().setResource(atozLink).build();
-            AToZ linkResource = new AToZBuilder().setId(linkName).setKey(linkKey).setResource(nodeResource2).build();
+            AToZ linkResource = new AToZBuilder().setId(linkName).withKey(linkKey).setResource(nodeResource2).build();
             index++;
             etoeList.add(linkResource);
 
@@ -165,7 +163,7 @@ public class PcePathDescription {
             // Resource
             AToZKey destTPKey = new AToZKey(index.toString());
             Resource tpResource2 = new ResourceBuilder().setResource(dtp).build();
-            AToZ ttpResource = new AToZBuilder().setId(tpName).setKey(destTPKey).setResource(tpResource2).build();
+            AToZ ttpResource = new AToZBuilder().setId(tpName).withKey(destTPKey).setResource(tpResource2).build();
             index++;
             etoeList.add(ttpResource);
 
@@ -177,7 +175,7 @@ public class PcePathDescription {
             // Target Resource
             AToZKey targetKey = new AToZKey(index.toString());
             Resource nodeResource3 = new ResourceBuilder().setResource(targetNode).build();
-            lastResource = new AToZBuilder().setId(destName).setKey(targetKey).setResource(nodeResource3).build();
+            lastResource = new AToZBuilder().setId(destName).withKey(targetKey).setResource(nodeResource3).build();
 
             lastLink = pcelink;
         }
@@ -196,7 +194,7 @@ public class PcePathDescription {
         index++;
         clientKey = new AToZKey(index.toString());
         clientResource = new ResourceBuilder().setResource(stp).build();
-        lastResource = new AToZBuilder().setId(tpName).setKey(clientKey).setResource(clientResource).build();
+        lastResource = new AToZBuilder().setId(tpName).withKey(clientKey).setResource(clientResource).build();
         etoeList.add(lastResource);
 
     }
@@ -207,7 +205,7 @@ public class PcePathDescription {
         ZToA lastResource = null;
 
         // build Z size Client TP
-        PceLink pcelink = allPceLinks.get(path.get(0).getOppositeLink());
+        PceLink pcelink = this.allPceLinks.get(path.get(0).getOppositeLink());
         String tpName = pcelink.getClient();
         String xname = pcelink.getSourceId().getValue();
         TerminationPoint stp = new TerminationPointBuilder()
@@ -217,13 +215,13 @@ public class PcePathDescription {
 
         ZToAKey clientKey = new ZToAKey(index.toString());
         Resource clientResource = new ResourceBuilder().setResource(stp).build();
-        ZToA firstResource = new ZToABuilder().setId(tpName).setKey(clientKey).setResource(clientResource).build();
+        ZToA firstResource = new ZToABuilder().setId(tpName).withKey(clientKey).setResource(clientResource).build();
         etoelist.add(firstResource);
         index++;
 
         for (PceLink pcelinkAtoZ : path) {
 
-            pcelink = allPceLinks.get(pcelinkAtoZ.getOppositeLink());
+            pcelink = this.allPceLinks.get(pcelinkAtoZ.getOppositeLink());
             LOG.debug("link to oppsite: {} to {}", pcelinkAtoZ.toString(), pcelink.toString());
 
             String srcName = pcelink.getSourceId().getValue();
@@ -239,7 +237,7 @@ public class PcePathDescription {
             // Source Resource
             ZToAKey sourceKey = new ZToAKey(index.toString());
             Resource nodeResource1 = new ResourceBuilder().setResource(sourceNode).build();
-            ZToA srcResource = new ZToABuilder().setId(srcName).setKey(sourceKey).setResource(nodeResource1).build();
+            ZToA srcResource = new ZToABuilder().setId(srcName).withKey(sourceKey).setResource(nodeResource1).build();
             index++;
             etoelist.add(srcResource);
 
@@ -253,7 +251,7 @@ public class PcePathDescription {
             // Resource
             ZToAKey srcTPKey = new ZToAKey(index.toString());
             Resource tpResource1 = new ResourceBuilder().setResource(stp).build();
-            ZToA stpResource = new ZToABuilder().setId(tpName).setKey(srcTPKey).setResource(tpResource1).build();
+            ZToA stpResource = new ZToABuilder().setId(tpName).withKey(srcTPKey).setResource(tpResource1).build();
             index++;
             etoelist.add(stpResource);
 
@@ -266,7 +264,7 @@ public class PcePathDescription {
             // Link Resource
             ZToAKey linkKey = new ZToAKey(index.toString());
             Resource nodeResource2 = new ResourceBuilder().setResource(ztoaLink).build();
-            ZToA linkResource = new ZToABuilder().setId(linkName).setKey(linkKey).setResource(nodeResource2).build();
+            ZToA linkResource = new ZToABuilder().setId(linkName).withKey(linkKey).setResource(nodeResource2).build();
             index++;
             etoelist.add(linkResource);
 
@@ -281,7 +279,7 @@ public class PcePathDescription {
             // Resource
             ZToAKey destTPKey = new ZToAKey(index.toString());
             Resource tpResource2 = new ResourceBuilder().setResource(ttp).build();
-            ZToA ttpResource = new ZToABuilder().setId(tpName).setKey(destTPKey).setResource(tpResource2).build();
+            ZToA ttpResource = new ZToABuilder().setId(tpName).withKey(destTPKey).setResource(tpResource2).build();
             index++;
             etoelist.add(ttpResource);
 
@@ -292,7 +290,7 @@ public class PcePathDescription {
             // Target Resource
             ZToAKey targetKey = new ZToAKey(index.toString());
             Resource nodeResource3 = new ResourceBuilder().setResource(targetNode).build();
-            lastResource = new ZToABuilder().setId(destName).setKey(targetKey).setResource(nodeResource3).build();
+            lastResource = new ZToABuilder().setId(destName).withKey(targetKey).setResource(nodeResource3).build();
 
             lastLink = pcelink;
         }
@@ -310,7 +308,7 @@ public class PcePathDescription {
         index++;
         clientKey = new ZToAKey(index.toString());
         clientResource = new ResourceBuilder().setResource(stp).build();
-        lastResource = new ZToABuilder().setId(tpName).setKey(clientKey).setResource(clientResource).build();
+        lastResource = new ZToABuilder().setId(tpName).withKey(clientKey).setResource(clientResource).build();
         etoelist.add(lastResource);
 
     }
index 9b1d1f2f72810bf69ba050ca353b6ac68efb22e7..824550d3276518678c4735e205bea3342ef88617 100755 (executable)
@@ -7,12 +7,10 @@
  */
 package org.opendaylight.transportpce.pce.impl;
 
-import java.util.concurrent.Future;
-
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.transportpce.pce.service.PathComputationService;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.CancelResourceReserveInput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.CancelResourceReserveOutput;
-
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestInput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PceService;
@@ -40,16 +38,16 @@ public class PceServiceRPCImpl implements PceService {
     }
 
     @Override
-    public Future<RpcResult<CancelResourceReserveOutput>> cancelResourceReserve(CancelResourceReserveInput input) {
+    public ListenableFuture<RpcResult<CancelResourceReserveOutput>> cancelResourceReserve(CancelResourceReserveInput input) {
         LOG.info("RPC cancelResourceReserve request received");
-        return RpcResultBuilder.success(pathComputationService.cancelResourceReserve(input)).buildFuture();
+        return RpcResultBuilder.success(this.pathComputationService.cancelResourceReserve(input)).buildFuture();
     }
 
 
     @Override
-    public Future<RpcResult<PathComputationRequestOutput>> pathComputationRequest(PathComputationRequestInput input) {
+    public ListenableFuture<RpcResult<PathComputationRequestOutput>> pathComputationRequest(PathComputationRequestInput input) {
         LOG.info("RPC path computation request received");
-        return RpcResultBuilder.success(pathComputationService.pathComputationRequest(input)).buildFuture();
+        return RpcResultBuilder.success(this.pathComputationService.pathComputationRequest(input)).buildFuture();
     }
 
 }
index 6305d34aa27b65354cdd4865abd035c1d0389e0d..b747475a5a4cc5f7109695335650aa0d94d8d89a 100644 (file)
@@ -7,12 +7,12 @@
  */
 package org.opendaylight.transportpce.renderer;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import java.util.concurrent.Future;
 
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommon;
@@ -74,7 +74,7 @@ public final class ModelMappingUtils {
         return cmBldr.build();
     }
 
-    public static Future<RpcResult<ServiceImplementationRequestOutput>>
+    public static ListenableFuture<RpcResult<ServiceImplementationRequestOutput>>
         createRpcResponse(ServiceImplementationRequestOutput payload) {
         return RpcResultBuilder.success(payload).buildFuture();
     }
@@ -165,7 +165,7 @@ public final class ModelMappingUtils {
             } else if (desID == null) {
                 desID = values.getTpID();
                 NodesBuilder nb = new NodesBuilder();
-                nb.setKey(new NodesKey(values.getNodeID()));
+                nb.withKey(new NodesKey(values.getNodeID()));
                 nb.setDestTp(desID);
                 nb.setSrcTp(srcID);
                 list.add(nb.build());
@@ -241,7 +241,7 @@ public final class ModelMappingUtils {
             } else if (desID == null) {
                 desID = values.getTpID();
                 NodesBuilder nb = new NodesBuilder();
-                nb.setKey(new NodesKey(values.getNodeID()));
+                nb.withKey(new NodesKey(values.getNodeID()));
                 nb.setDestTp(desID);
                 nb.setSrcTp(srcID);
                 list.add(nb.build());
@@ -261,7 +261,7 @@ public final class ModelMappingUtils {
     }
 
     public static int[] findTheLongestSubstring(String s1, String s2) {
-        if (s1 == null || s2 == null) {
+        if ((s1 == null) || (s2 == null)) {
             return null;
         }
         int[][] dp = new int[s1.length() + 1][s2.length() + 1];
index a9814833c981d5259f98a939d0fab8a08de01ff6..7636b26a16175ec57548f869b8dfbc9a01ac9af7 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.transportpce.renderer.openroadminterface;
 
 import java.math.BigDecimal;
-
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
@@ -245,7 +244,7 @@ public class OpenRoadmInterfaceFactory {
         interfaceBuilder.setAdministrativeState(AdminStates.InService);
         interfaceBuilder.setType(type);
         interfaceBuilder.setName(key);
-        interfaceBuilder.setKey(new InterfaceKey(key));
+        interfaceBuilder.withKey(new InterfaceKey(key));
         return interfaceBuilder;
     }
 }
index d0212f3d6e70898af2084c9f7c4ebec00dcf6a57..b9ec7e89f1600cbe888782528c27f1b4153615a4 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.transportpce.renderer.provisiondevice;
 
 import com.google.common.collect.Sets;
-
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
@@ -23,7 +22,6 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
@@ -208,7 +206,7 @@ public class DeviceRendererServiceImpl implements DeviceRendererService {
                 }
 
                 NodeInterfaceBuilder nodeInterfaceBuilder = new NodeInterfaceBuilder();
-                nodeInterfaceBuilder.setKey(new NodeInterfaceKey(nodeId));
+                nodeInterfaceBuilder.withKey(new NodeInterfaceKey(nodeId));
                 nodeInterfaceBuilder.setNodeId(nodeId);
                 nodeInterfaceBuilder.setConnectionId(createdConnections);
                 nodeInterfaceBuilder.setEthInterfaceId(createdEthInterfaces);
@@ -407,7 +405,7 @@ public class DeviceRendererServiceImpl implements DeviceRendererService {
                 }
             }
             failedToRollbackList.add(new FailedToRollbackBuilder()
-                    .setKey(new FailedToRollbackKey(nodeId))
+                    .withKey(new FailedToRollbackKey(nodeId))
                     .setNodeId(nodeId)
                     .setInterface(failedInterfaces)
                     .build()
@@ -421,7 +419,7 @@ public class DeviceRendererServiceImpl implements DeviceRendererService {
 
     private boolean alarmSuppressionNodeRegistration(ServicePathInput input) {
         NodelistBuilder nodeListBuilder = new NodelistBuilder();
-        nodeListBuilder.setKey(new NodelistKey(input.getServiceName()));
+        nodeListBuilder.withKey(new NodelistKey(input.getServiceName()));
         nodeListBuilder.setServiceName(input.getServiceName());
         List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service
             .nodelist.nodelist.Nodes> nodeList = new ArrayList<>();
@@ -493,7 +491,7 @@ public class DeviceRendererServiceImpl implements DeviceRendererService {
             servicesBuilder = new ServicesBuilder(services.get());
         } else {
             servicesBuilder = new ServicesBuilder();
-            servicesBuilder.setKey(serviceKey);
+            servicesBuilder.withKey(serviceKey);
         }
         servicesBuilder.setTopology(topo);
 
index f5c35496ff34c3f11e06c6138e53105c3c221e69..0edd950b3c6f46747e40282f5b2f9887b4ea5127 100644 (file)
@@ -8,8 +8,7 @@
 
 package org.opendaylight.transportpce.renderer.rpcs;
 
-import java.util.concurrent.Future;
-
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.RendererRollbackInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.RendererRollbackOutput;
@@ -56,13 +55,13 @@ public class DeviceRendererRPCImpl implements RendererService {
      * @return Result of the request
      */
     @Override
-    public Future<RpcResult<ServicePathOutput>> servicePath(ServicePathInput input) {
+    public ListenableFuture<RpcResult<ServicePathOutput>> servicePath(ServicePathInput input) {
         if (input.getOperation().getIntValue() == 1) {
             LOG.info("Create operation request received");
-            return RpcResultBuilder.success(deviceRenderer.setupServicePath(input, null)).buildFuture();
+            return RpcResultBuilder.success(this.deviceRenderer.setupServicePath(input, null)).buildFuture();
         } else if (input.getOperation().getIntValue() == 2) {
             LOG.info("Delete operation request received");
-            return RpcResultBuilder.success(deviceRenderer.deleteServicePath(input)).buildFuture();
+            return RpcResultBuilder.success(this.deviceRenderer.deleteServicePath(input)).buildFuture();
         }
         return RpcResultBuilder.success(new ServicePathOutputBuilder().setResult("Invalid operation")).buildFuture();
     }
@@ -74,7 +73,7 @@ public class DeviceRendererRPCImpl implements RendererService {
      * @return Success flag and nodes which failed to rollback
      */
     @Override
-    public Future<RpcResult<RendererRollbackOutput>> rendererRollback(RendererRollbackInput input) {
-        return RpcResultBuilder.success(deviceRenderer.rendererRollback(input)).buildFuture();
+    public ListenableFuture<RpcResult<RendererRollbackOutput>> rendererRollback(RendererRollbackInput input) {
+        return RpcResultBuilder.success(this.deviceRenderer.rendererRollback(input)).buildFuture();
     }
 }
index 4b3ec1074de1bc96fccc0fa0aa2c62d941c52cbe..be29295f063a09a4b24c2bc5c3fa643f46e13df0 100644 (file)
@@ -7,8 +7,7 @@
  */
 package org.opendaylight.transportpce.renderer.rpcs;
 
-import java.util.concurrent.Future;
-
+import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.transportpce.renderer.ModelMappingUtils;
 import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.CancelResourceReserveInput;
@@ -35,27 +34,27 @@ public class TransportPCEServicePathRPCImpl implements TransportpceServicepathSe
     }
 
     @Override
-    public Future<RpcResult<CancelResourceReserveOutput>> cancelResourceReserve(CancelResourceReserveInput input) {
+    public ListenableFuture<RpcResult<CancelResourceReserveOutput>> cancelResourceReserve(CancelResourceReserveInput input) {
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public Future<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
+    public ListenableFuture<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public Future<RpcResult<ServiceImplementationRequestOutput>> serviceImplementationRequest(
+    public ListenableFuture<RpcResult<ServiceImplementationRequestOutput>> serviceImplementationRequest(
             ServiceImplementationRequestInput input) {
         String serviceName = input.getServiceName();
         LOG.info("Calling RPC service impl request {} {}", serviceName);
-        return ModelMappingUtils.createRpcResponse(rendererServiceOperations.serviceImplementation(input));
+        return ModelMappingUtils.createRpcResponse(this.rendererServiceOperations.serviceImplementation(input));
     }
 
     @Override
-    public Future<RpcResult<PathComputationRequestOutput>> pathComputationRequest(PathComputationRequestInput input) {
+    public ListenableFuture<RpcResult<PathComputationRequestOutput>> pathComputationRequest(PathComputationRequestInput input) {
         // TODO Auto-generated method stub
         return null;
     }
index 8c32e76c301935bf59be74a3686f1d083a2d24d1..47085695d4d8af0a88ee5fb2c9baf7579d275e54 100644 (file)
@@ -161,7 +161,7 @@ public class DeviceRendererServiceImplTest extends AbstractTest {
 
         NodeInterfaceBuilder nodeInterfaceBuilder = new NodeInterfaceBuilder();
         nodeInterfaceBuilder.setNodeId("node1");
-        nodeInterfaceBuilder.setKey(new NodeInterfaceKey("node1"));
+        nodeInterfaceBuilder.withKey(new NodeInterfaceKey("node1"));
         List<String> connectionID = new ArrayList<>();
         connectionID.add("node1-PP");
         nodeInterfaceBuilder.setConnectionId(connectionID);
index cd559929d76de686d6a312785b1f7aa8ad7319f3..47308807966cc881b00e622f0c0afc7e19585990 100644 (file)
@@ -7,8 +7,8 @@
  */
 package org.opendaylight.transportpce.renderer.stub;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
-import java.util.concurrent.Future;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossBaseInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossBaseOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossCurrentInput;
@@ -29,33 +29,33 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
 public class OlmServiceStub implements OlmService {
 
-    @Override public Future<RpcResult<CalculateSpanlossCurrentOutput>> calculateSpanlossCurrent(
+    @Override public ListenableFuture<RpcResult<CalculateSpanlossCurrentOutput>> calculateSpanlossCurrent(
         CalculateSpanlossCurrentInput input) {
         return null;
     }
 
-    @Override public Future<RpcResult<GetPmOutput>> getPm(GetPmInput input) {
+    @Override public ListenableFuture<RpcResult<GetPmOutput>> getPm(GetPmInput input) {
         GetPmOutput output = new GetPmOutputBuilder()
             .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
         return RpcResultBuilder.success(
             output).buildFuture();
     }
 
-    @Override public Future<RpcResult<ServicePowerTurndownOutput>> servicePowerTurndown(
+    @Override public ListenableFuture<RpcResult<ServicePowerTurndownOutput>> servicePowerTurndown(
         ServicePowerTurndownInput input) {
         return null;
     }
 
-    @Override public Future<RpcResult<CalculateSpanlossBaseOutput>> calculateSpanlossBase(
+    @Override public ListenableFuture<RpcResult<CalculateSpanlossBaseOutput>> calculateSpanlossBase(
         CalculateSpanlossBaseInput input) {
         return null;
     }
 
-    @Override public Future<RpcResult<ServicePowerResetOutput>> servicePowerReset(ServicePowerResetInput input) {
+    @Override public ListenableFuture<RpcResult<ServicePowerResetOutput>> servicePowerReset(ServicePowerResetInput input) {
         return null;
     }
 
-    @Override public Future<RpcResult<ServicePowerSetupOutput>> servicePowerSetup(ServicePowerSetupInput input) {
+    @Override public ListenableFuture<RpcResult<ServicePowerSetupOutput>> servicePowerSetup(ServicePowerSetupInput input) {
         return RpcResultBuilder.success(new ServicePowerSetupOutputBuilder().build()).buildFuture();
     }
 }
index 79690dce386dfe3814d1806bfaf49b7652252cbd..4a9dc7d42b8b4887f05930b3a4e97e0e5b8d5fd5 100644 (file)
@@ -65,7 +65,7 @@ public final class MountPointUtils {
                                        DeviceTransactionManager deviceTransactionManager) {
         try {
             MappingBuilder mappingBuilder = new MappingBuilder();
-            mappingBuilder.setKey(new MappingKey(logicalConnPoint));
+            mappingBuilder.withKey(new MappingKey(logicalConnPoint));
             mappingBuilder.setLogicalConnectionPoint(logicalConnPoint);
             mappingBuilder.setSupportingOms("OMS");
             mappingBuilder.setSupportingPort("8080");
index 39ea8650d54d9f1f4c5bc162cb156130a69ae2f5..99c65da5ddddeb2027e138c33c6850a3c94b103a 100644 (file)
@@ -51,7 +51,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer
 public final class ServiceDataUtils {
 
     public static Nodes createNode(String nodeId, String srcTp, String dstTp) {
-        return new NodesBuilder().setNodeId(nodeId).setKey(new NodesKey(nodeId)).setSrcTp(srcTp)
+        return new NodesBuilder().setNodeId(nodeId).withKey(new NodesKey(nodeId)).setSrcTp(srcTp)
                 .setDestTp(dstTp).build();
     }
 
@@ -115,9 +115,9 @@ public final class ServiceDataUtils {
         org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource
             .resource.resource.Node node2 = nodesBuilder.setNodeIdentifier(new NodeIdentifierBuilder()
             .setNodeId("XPONDER-1-2").build()).build();
-        AToZ atoZ = new AToZBuilder().setId("1").setKey(new AToZKey("1")).setResource(new ResourceBuilder()
+        AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
             .setResource(node1).build()).build();
-        AToZ atoZ2 = new AToZBuilder().setId("1").setKey(new AToZKey("1")).setResource(new ResourceBuilder()
+        AToZ atoZ2 = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
             .setResource(node2).build()).build();
         atoZList.add(atoZ);
         atoZList.add(atoZ2);
@@ -127,9 +127,9 @@ public final class ServiceDataUtils {
             .setAToZ(atoZList)
             .build();
         List<ZToA> ztoAList = new ArrayList<ZToA>();
-        ZToA ztoA = new ZToABuilder().setId("1").setKey(new ZToAKey("1")).setResource(new ResourceBuilder()
+        ZToA ztoA = new ZToABuilder().setId("1").withKey(new ZToAKey("1")).setResource(new ResourceBuilder()
             .setResource(node1).build()).build();
-        ZToA ztoA2 = new ZToABuilder().setId("1").setKey(new ZToAKey("1")).setResource(new ResourceBuilder()
+        ZToA ztoA2 = new ZToABuilder().setId("1").withKey(new ZToAKey("1")).setResource(new ResourceBuilder()
             .setResource(node2).build()).build();
         ztoAList.add(ztoA);
         ztoAList.add(ztoA2);
@@ -153,9 +153,9 @@ public final class ServiceDataUtils {
         TerminationPoint terminationPoint2 = terminationPointBuilder
             .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("XPONDER-1-2")
                 .setTpId("XPONDER-1-2-" + tpId).build()).build();
-        AToZ atoZ = new AToZBuilder().setId("1").setKey(new AToZKey("1")).setResource(new ResourceBuilder()
+        AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
             .setResource(terminationPoint).build()).build();
-        AToZ atoZ2 = new AToZBuilder().setId("2").setKey(new AToZKey("2")).setResource(new ResourceBuilder()
+        AToZ atoZ2 = new AToZBuilder().setId("2").withKey(new AToZKey("2")).setResource(new ResourceBuilder()
             .setResource(terminationPoint2).build()).build();
         atoZList.add(atoZ);
         atoZList.add(atoZ2);
@@ -165,9 +165,9 @@ public final class ServiceDataUtils {
             .setAToZ(atoZList)
             .build();
         List<ZToA> ztoAList = new ArrayList<ZToA>();
-        ZToA ztoA = new ZToABuilder().setId("1").setKey(new ZToAKey("1")).setResource(new ResourceBuilder()
+        ZToA ztoA = new ZToABuilder().setId("1").withKey(new ZToAKey("1")).setResource(new ResourceBuilder()
             .setResource(terminationPoint).build()).build();
-        ZToA ztoA2 = new ZToABuilder().setId("2").setKey(new ZToAKey("2")).setResource(new ResourceBuilder()
+        ZToA ztoA2 = new ZToABuilder().setId("2").withKey(new ZToAKey("2")).setResource(new ResourceBuilder()
             .setResource(terminationPoint).build()).build();
         ztoAList.add(ztoA);
         ztoAList.add(ztoA2);
@@ -190,9 +190,9 @@ public final class ServiceDataUtils {
             .build();
         Link link2 = new LinkBuilder().setLinkIdentifier(new LinkIdentifierBuilder().setLinkId("link 2").build())
             .build();
-        AToZ atoZ = new AToZBuilder().setId("1").setKey(new AToZKey("1")).setResource(new ResourceBuilder()
+        AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
             .setResource(link1).build()).build();
-        AToZ atoZ2 = new AToZBuilder().setId("1").setKey(new AToZKey("1")).setResource(new ResourceBuilder()
+        AToZ atoZ2 = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
             .setResource(link2).build()).build();
         atoZList.add(atoZ);
         atoZList.add(atoZ2);
@@ -202,9 +202,9 @@ public final class ServiceDataUtils {
             .setAToZ(atoZList)
             .build();
         List<ZToA> ztoAList = new ArrayList<ZToA>();
-        ZToA ztoA = new ZToABuilder().setId("1").setKey(new ZToAKey("1")).setResource(new ResourceBuilder()
+        ZToA ztoA = new ZToABuilder().setId("1").withKey(new ZToAKey("1")).setResource(new ResourceBuilder()
             .setResource(link1).build()).build();
-        ZToA ztoA2 = new ZToABuilder().setId("1").setKey(new ZToAKey("1")).setResource(new ResourceBuilder()
+        ZToA ztoA2 = new ZToABuilder().setId("1").withKey(new ZToAKey("1")).setResource(new ResourceBuilder()
             .setResource(link2).build()).build();
         ztoAList.add(ztoA);
         ztoAList.add(ztoA2);
index 6e385ca717fc4aef9a0a17eb20d20f5b21d0b7f4..e5b44c40de68057525f04a483066626357bbf1ba 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.transportpce.servicehandler;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Future;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.path.computation.request.input.ServiceAEnd;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.path.computation.request.input.ServiceAEndBuilder;
@@ -158,7 +158,7 @@ public final class ModelMappingUtils {
         return txDirectionBuilder.build();
     }
 
-    public static Future<RpcResult<ServiceDeleteOutput>> createDeleteServiceReply(ServiceDeleteInput input,
+    public static ListenableFuture<RpcResult<ServiceDeleteOutput>> createDeleteServiceReply(ServiceDeleteInput input,
         String finalAck, String message, String responseCode) {
         ConfigurationResponseCommonBuilder builder = new ConfigurationResponseCommonBuilder()
                 .setAckFinalIndicator(finalAck).setResponseMessage(message).setResponseCode(responseCode);
@@ -173,7 +173,7 @@ public final class ModelMappingUtils {
         return RpcResultBuilder.success(output).buildFuture();
     }
 
-    public static Future<RpcResult<ServiceCreateOutput>> createCreateServiceReply(ServiceCreateInput input,
+    public static ListenableFuture<RpcResult<ServiceCreateOutput>> createCreateServiceReply(ServiceCreateInput input,
                                                                String finalAck,
                                                                String message, String responseCode) {
         ResponseParametersBuilder responseParameters = new ResponseParametersBuilder();
@@ -253,8 +253,8 @@ public final class ModelMappingUtils {
                 for (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426
                     .path.description.atoz.direction.AToZ tmp : pathDescription.getAToZDirection().getAToZ()) {
 
-                    AToZKey key = new AToZKey(tmp.getKey().getId());
-                    AToZ atoz = new AToZBuilder().setId(tmp.getId()).setKey(key)
+                    AToZKey key = new AToZKey(tmp.key().getId());
+                    AToZ atoz = new AToZBuilder().setId(tmp.getId()).withKey(key)
                             // .setResource(tmp.getResource())
                             .build();
                     atozList.add(atoz);
@@ -263,8 +263,8 @@ public final class ModelMappingUtils {
                 for (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426
                         .path.description.ztoa.direction.ZToA
                         tmp : pathDescription.getZToADirection().getZToA()) {
-                    ZToAKey key = new ZToAKey(tmp.getKey().getId());
-                    ZToA ztoa = new ZToABuilder().setId(tmp.getId()).setKey(key)
+                    ZToAKey key = new ZToAKey(tmp.key().getId());
+                    ZToA ztoa = new ZToABuilder().setId(tmp.getId()).withKey(key)
                             // .setResource(tmp.getResource())
                             .build();
                     ztoaList.add(ztoa);
index 8ad06b26b47a303574e9aead95d8d89aaca063c4..f4bbc718d1e092ded0d44e57c0d2032e6660c078 100644 (file)
@@ -7,12 +7,12 @@
  */
 package org.opendaylight.transportpce.servicehandler.impl;
 
+import com.google.common.util.concurrent.ListenableFuture;
 import java.time.OffsetDateTime;
 import java.time.ZoneOffset;
 import java.time.format.DateTimeFormatter;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -102,7 +102,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
     }
 
     @Override
-    public Future<RpcResult<ServiceCreateOutput>> serviceCreate(ServiceCreateInput input) {
+    public ListenableFuture<RpcResult<ServiceCreateOutput>> serviceCreate(ServiceCreateInput input) {
         LOG.info("RPC service creation received");
         // Validation
         OperationResult validationResult = ServiceCreateValidation.validateServiceCreateRequest(input);
@@ -181,7 +181,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
     }
 
     @Override
-    public Future<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
+    public ListenableFuture<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
         LOG.info("RPC serviceDelete request received for {}", input.getServiceDeleteReqInfo().getServiceName());
         String message = "";
 
@@ -242,35 +242,35 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
     }
 
     @Override
-    public Future<RpcResult<ServiceFeasibilityCheckOutput>> serviceFeasibilityCheck(
+    public ListenableFuture<RpcResult<ServiceFeasibilityCheckOutput>> serviceFeasibilityCheck(
             ServiceFeasibilityCheckInput input) {
         throw new UnsupportedOperationException("Not implemented yet");
     }
 
     @Override
-    public Future<RpcResult<ServiceReconfigureOutput>> serviceReconfigure(ServiceReconfigureInput input) {
+    public ListenableFuture<RpcResult<ServiceReconfigureOutput>> serviceReconfigure(ServiceReconfigureInput input) {
         throw new UnsupportedOperationException("Not implemented yet");
     }
 
     @Override
-    public Future<RpcResult<ServiceRestorationOutput>> serviceRestoration(ServiceRestorationInput input) {
+    public ListenableFuture<RpcResult<ServiceRestorationOutput>> serviceRestoration(ServiceRestorationInput input) {
         throw new UnsupportedOperationException("Not implemented yet");
     }
 
     @Override
-    public Future<RpcResult<EquipmentNotificationOutput>> equipmentNotification(EquipmentNotificationInput input) {
+    public ListenableFuture<RpcResult<EquipmentNotificationOutput>> equipmentNotification(EquipmentNotificationInput input) {
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public Future<RpcResult<ServiceRerouteConfirmOutput>> serviceRerouteConfirm(ServiceRerouteConfirmInput input) {
+    public ListenableFuture<RpcResult<ServiceRerouteConfirmOutput>> serviceRerouteConfirm(ServiceRerouteConfirmInput input) {
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public Future<RpcResult<ServiceRerouteOutput>> serviceReroute(ServiceRerouteInput input) {
+    public ListenableFuture<RpcResult<ServiceRerouteOutput>> serviceReroute(ServiceRerouteInput input) {
         InstanceIdentifier<Services> servicesIID = InstanceIdentifier.create(ServiceList.class)
                 .child(Services.class, new ServicesKey(input.getServiceName()));
         ReadOnlyTransaction rtx = this.db.newReadOnlyTransaction();
@@ -330,31 +330,31 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
     }
 
     @Override
-    public Future<RpcResult<ServiceReversionOutput>> serviceReversion(ServiceReversionInput input) {
+    public ListenableFuture<RpcResult<ServiceReversionOutput>> serviceReversion(ServiceReversionInput input) {
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public Future<RpcResult<ServiceRollOutput>> serviceRoll(ServiceRollInput input) {
+    public ListenableFuture<RpcResult<ServiceRollOutput>> serviceRoll(ServiceRollInput input) {
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public Future<RpcResult<NetworkReOptimizationOutput>> networkReOptimization(NetworkReOptimizationInput input) {
+    public ListenableFuture<RpcResult<NetworkReOptimizationOutput>> networkReOptimization(NetworkReOptimizationInput input) {
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public Future<RpcResult<TempServiceDeleteOutput>> tempServiceDelete(TempServiceDeleteInput input) {
+    public ListenableFuture<RpcResult<TempServiceDeleteOutput>> tempServiceDelete(TempServiceDeleteInput input) {
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public Future<RpcResult<TempServiceCreateOutput>> tempServiceCreate(TempServiceCreateInput input) {
+    public ListenableFuture<RpcResult<TempServiceCreateOutput>> tempServiceCreate(TempServiceCreateInput input) {
         // TODO Auto-generated method stub
         return null;
     }
index fb4c6f7b79c6a64161219ef64f1a6ca16f475bf9..b9093fe6321e23c8e3dfaebb38758455d83ebf0e 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.transportpce.test.common;
 
+import com.google.common.collect.ClassToInstanceMap;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -17,6 +18,7 @@ import java.util.Optional;
 import java.util.ServiceLoader;
 import java.util.concurrent.Executors;
 import javassist.ClassPool;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
@@ -37,6 +39,7 @@ import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
 import org.opendaylight.mdsal.binding.generator.util.BindingRuntimeContext;
 import org.opendaylight.mdsal.binding.generator.util.JavassistUtils;
 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaServiceExtension;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider;
@@ -71,8 +74,8 @@ public class DataStoreContextImpl implements DataStoreContext {
         this.dataBroker = createDataBroker();
         this.notificationService = createNotificationService();
         this.notificationPublishService = createNotificationPublishService();
-        for (ListenerRegistration<SchemaContextListener> listener : mockedSchemaContext.listeners) {
-            listener.getInstance().onGlobalContextUpdated(mockedSchemaContext.schemaContext);
+        for (ListenerRegistration<SchemaContextListener> listener : this.mockedSchemaContext.listeners) {
+            listener.getInstance().onGlobalContextUpdated(this.mockedSchemaContext.schemaContext);
         }
     }
 
@@ -100,26 +103,26 @@ public class DataStoreContextImpl implements DataStoreContext {
 
     @Override
     public SchemaContext getSchemaContext() {
-        return mockedSchemaContext.schemaContext;
+        return this.mockedSchemaContext.schemaContext;
     }
 
     @Override
     public BindingNormalizedNodeCodecRegistry getBindingToNormalizedNodeCodec() {
-        return mockedSchemaContext.bindingStreamCodecs;
+        return this.mockedSchemaContext.bindingStreamCodecs;
     }
 
     @Override
     public NotificationService getNotificationService() {
-        return notificationService;
+        return this.notificationService;
     }
 
     @Override
     public NotificationPublishService getNotificationPublishService() {
-        return notificationPublishService;
+        return this.notificationPublishService;
     }
 
     private DOMDataBroker createDOMDataBroker() {
-        return new SerializedDOMDataBroker(datastores,
+        return new SerializedDOMDataBroker(this.datastores,
                 MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()));
     }
 
@@ -164,13 +167,13 @@ public class DataStoreContextImpl implements DataStoreContext {
             this.listeners = ListenerRegistry.create();
             this.bindingStreamCodecs = createBindingRegistry();
             GeneratedClassLoadingStrategy loading = GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy();
-            this.bindingToNormalized = new BindingToNormalizedNodeCodec(loading, bindingStreamCodecs);
+            this.bindingToNormalized = new BindingToNormalizedNodeCodec(loading, this.bindingStreamCodecs);
             registerSchemaContextListener(this.bindingToNormalized);
         }
 
         @Override
         public SchemaContext getSchemaContext() {
-            return schemaContext;
+            return this.schemaContext;
         }
 
         /**
@@ -180,9 +183,9 @@ public class DataStoreContextImpl implements DataStoreContext {
          * @return SchemaContext a schema context
          */
         private SchemaContext getSchemaContext(List<YangModuleInfo> moduleInfos) {
-            moduleInfoBackedCntxt.addModuleInfos(moduleInfos);
+            this.moduleInfoBackedCntxt.addModuleInfos(moduleInfos);
             Optional<SchemaContext> tryToCreateSchemaContext =
-                    moduleInfoBackedCntxt.tryToCreateSchemaContext().toJavaUtil();
+                    this.moduleInfoBackedCntxt.tryToCreateSchemaContext().toJavaUtil();
             if (!tryToCreateSchemaContext.isPresent()) {
                 LOG.error("Could not create the initial schema context. Schema context is empty");
                 throw new IllegalStateException();
@@ -192,18 +195,18 @@ public class DataStoreContextImpl implements DataStoreContext {
 
         @Override
         public SchemaContext getGlobalContext() {
-            return schemaContext;
+            return this.schemaContext;
         }
 
         @Override
         public SchemaContext getSessionContext() {
-            return schemaContext;
+            return this.schemaContext;
         }
 
         @Override
         public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
                 SchemaContextListener listener) {
-            return listeners.register(listener);
+            return this.listeners.register(listener);
         }
 
         /**
@@ -228,12 +231,21 @@ public class DataStoreContextImpl implements DataStoreContext {
          * @return BindingNormalizedNodeCodecRegistry the resulting binding registry
          */
         private BindingNormalizedNodeCodecRegistry createBindingRegistry() {
-            BindingRuntimeContext bindingContext = BindingRuntimeContext.create(moduleInfoBackedCntxt, schemaContext);
+            BindingRuntimeContext bindingContext = BindingRuntimeContext.create(this.moduleInfoBackedCntxt, this.schemaContext);
             BindingNormalizedNodeCodecRegistry bindingNormalizedNodeCodecRegistry =
                     new BindingNormalizedNodeCodecRegistry(
                             StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault())));
             bindingNormalizedNodeCodecRegistry.onBindingRuntimeContextUpdated(bindingContext);
             return bindingNormalizedNodeCodecRegistry;
         }
+
+        /* (non-Javadoc)
+         * @see org.opendaylight.mdsal.dom.api.DOMExtensibleService#getExtensions()
+         */
+        @Override
+        public @NonNull ClassToInstanceMap<DOMSchemaServiceExtension> getExtensions() {
+            // TODO Auto-generated method stub
+            return null;
+        }
     }
 }
index 755a4a0f3bf84576eac92e3dcd15eae3e205fe2a..fb612a0f619c2da29a6c28a6e48923489d97f664 100644 (file)
@@ -40,6 +40,25 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
       </plugin>
     </plugins>
   </build>
+  
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>1.8.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>
+        <scope>import</scope>
+        <type>pom</type>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
 
   <dependencies>
     <dependency>
@@ -72,6 +91,22 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
       <artifactId>transportpce-stubmodels</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller.model</groupId>
+      <artifactId>model-topology</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>sal-netconf-connector</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
 
     <!-- Testing Dependencies -->
     <dependency>
index 76e40b79a8ddf18908ab55820fbd9810526797d4..ab7304b368842b8dfcd3122ffac9327fd2ec0f91 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.transportpce.stubpce;
 
 import java.util.ArrayList;
 import java.util.List;
-
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.atoz.direction.AToZ;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.atoz.direction.AToZBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.atoz.direction.AToZKey;
@@ -51,10 +50,10 @@ public class TpNodeTp {
         this.tpOut = out;
         this.tpIn = in;
         this.node = node;
-        resources = new ArrayList<Resource>();
-        atoz = new ArrayList<AToZ>();
-        ztoa = new ArrayList<ZToA>();
-        ids = new ArrayList<String>();
+        this.resources = new ArrayList<Resource>();
+        this.atoz = new ArrayList<AToZ>();
+        this.ztoa = new ArrayList<ZToA>();
+        this.ids = new ArrayList<String>();
 
     }
 
@@ -62,19 +61,19 @@ public class TpNodeTp {
      * create resource List.
      */
     public void createListResource() {
-        ids.clear();
-        resources.clear();
-        atoz.clear();
-        ztoa.clear();
-
-        resources.add(new ResourceBuilder().setResource(tpIn).build());
-        ids.add(tpIn.getTerminationPointIdentifier().getNodeId().concat("-")
-                .concat(tpIn.getTerminationPointIdentifier().getTpId()));
-        resources.add(new ResourceBuilder().setResource(node).build());
-        ids.add(node.getNodeIdentifier().getNodeId());
-        resources.add(new ResourceBuilder().setResource(tpOut).build());
-        ids.add(tpOut.getTerminationPointIdentifier().getNodeId().concat("-")
-                .concat(tpOut.getTerminationPointIdentifier().getTpId()));
+        this.ids.clear();
+        this.resources.clear();
+        this.atoz.clear();
+        this.ztoa.clear();
+
+        this.resources.add(new ResourceBuilder().setResource(this.tpIn).build());
+        this.ids.add(this.tpIn.getTerminationPointIdentifier().getNodeId().concat("-")
+                .concat(this.tpIn.getTerminationPointIdentifier().getTpId()));
+        this.resources.add(new ResourceBuilder().setResource(this.node).build());
+        this.ids.add(this.node.getNodeIdentifier().getNodeId());
+        this.resources.add(new ResourceBuilder().setResource(this.tpOut).build());
+        this.ids.add(this.tpOut.getTerminationPointIdentifier().getNodeId().concat("-")
+                .concat(this.tpOut.getTerminationPointIdentifier().getTpId()));
     }
 
     /**
@@ -85,14 +84,14 @@ public class TpNodeTp {
         AToZ hop = null;
         AToZKey atozKey = null;
         createListResource();
-        for (Resource resource : resources) {
+        for (Resource resource : this.resources) {
             atozKey = new AToZKey(Integer.toString(odr));
             resource = new ResourceBuilder().setResource(resource.getResource()).build();
             hop = new AToZBuilder()
-                    .setKey(atozKey)
+                    .withKey(atozKey)
                     .setResource(resource)
                     .build();
-            atoz.add(hop);
+            this.atoz.add(hop);
             odr++;
         }
     }
@@ -105,50 +104,50 @@ public class TpNodeTp {
         ZToA hop = null;
         ZToAKey ztoaKey = null;
         createListResource();
-        for (Resource resource : resources) {
+        for (Resource resource : this.resources) {
             ztoaKey = new ZToAKey(Integer.toString(odr));
             resource = new ResourceBuilder().setResource(resource.getResource()).build();
             hop = new ZToABuilder()
-                    .setKey(ztoaKey)
+                    .withKey(ztoaKey)
                     .setResource(resource)
                     .build();
-            ztoa.add(hop);
+            this.ztoa.add(hop);
             odr++;
         }
     }
 
     public TpNodeTp reverse() {
-        return new TpNodeTp(tpOut, tpIn, node);
+        return new TpNodeTp(this.tpOut, this.tpIn, this.node);
     }
 
     @Override
     public String toString() {
         StringBuilder result = new StringBuilder("[ ");
-        result.append("tpIn : " + tpIn.getTerminationPointIdentifier().getTpId());
-        result.append(" - Node : " + node.getNodeIdentifier().getNodeId());
-        result.append(" - tpOut : " + tpOut.getTerminationPointIdentifier().getTpId());
+        result.append("tpIn : " + this.tpIn.getTerminationPointIdentifier().getTpId());
+        result.append(" - Node : " + this.node.getNodeIdentifier().getNodeId());
+        result.append(" - tpOut : " + this.tpOut.getTerminationPointIdentifier().getTpId());
         result.append(" ]");
         return result.toString();
 
     }
 
     public List<AToZ> getAToZ() {
-        return atoz;
+        return this.atoz;
     }
 
     public List<ZToA> getZToA() {
-        return ztoa;
+        return this.ztoa;
     }
 
     public Node getNode() {
-        return node;
+        return this.node;
     }
 
     public TerminationPoint getTpIn() {
-        return tpIn;
+        return this.tpIn;
     }
 
     public TerminationPoint getTpOut() {
-        return tpOut;
+        return this.tpOut;
     }
 }
index f8a63c2694186236718fe594cfbd053f1efe4578..a32b6d2fe5107d95156c2d7b952b5e616f3bcf86 100644 (file)
@@ -14,13 +14,11 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
-
 import java.util.Iterator;
 import java.util.SortedSet;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
@@ -94,7 +92,7 @@ public class StubpceImpl implements StubpceService {
     public StubpceImpl(NotificationPublishService notificationPublishService, DataBroker databroker) {
         this.notificationPublishService = notificationPublishService;
         this.db = databroker;
-        pathDescriptionBuilder = null;
+        this.pathDescriptionBuilder = null;
         if (initializePathDescriptionList(databroker)) {
             fillPathDesciptionList();
         }
@@ -105,7 +103,7 @@ public class StubpceImpl implements StubpceService {
     }
 
     @Override
-    public Future<RpcResult<CancelResourceReserveOutput>> cancelResourceReserve(CancelResourceReserveInput input) {
+    public ListenableFuture<RpcResult<CancelResourceReserveOutput>> cancelResourceReserve(CancelResourceReserveInput input) {
         LOG.info("RPC cancelResourceReserve  request received");
         String message = "";
         String responseCode = "";
@@ -113,7 +111,7 @@ public class StubpceImpl implements StubpceService {
         String serviceName = input.getServiceName();
         LOG.info("serviceName : {}", serviceName);
         if (serviceName != null) {
-            sendingPCE = new SendingPceRPCs(input,db,executor);
+            this.sendingPCE = new SendingPceRPCs(input,this.db,this.executor);
             FutureCallback<Boolean> pceCallback = new FutureCallback<Boolean>() {
                 String message = "";
                 ServicePathRpcResult notification = null;
@@ -121,12 +119,12 @@ public class StubpceImpl implements StubpceService {
                 @Override
                 public void onFailure(Throwable arg0) {
                     LOG.error("Cancel resource failed : {}", arg0);
-                    notification = new ServicePathRpcResultBuilder()
+                    this.notification = new ServicePathRpcResultBuilder()
                             .setNotificationType(ServicePathNotificationTypes.CancelResourceReserve)
                             .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
                             .setStatusMessage("Cancel resource request failed  : " + arg0.getMessage()).build();
                     try {
-                        notificationPublishService.putNotification(notification);
+                        StubpceImpl.this.notificationPublishService.putNotification(this.notification);
                     } catch (InterruptedException e) {
                         LOG.info("notification offer rejected : {}", e);
                     }
@@ -136,32 +134,32 @@ public class StubpceImpl implements StubpceService {
                 public void onSuccess(Boolean response) {
                     LOG.info("response : {}", response);
                     if (response) {
-                        message = "Resource cancelled !";
-                        notification = new ServicePathRpcResultBuilder()
+                        this.message = "Resource cancelled !";
+                        this.notification = new ServicePathRpcResultBuilder()
                                 .setNotificationType(ServicePathNotificationTypes.CancelResourceReserve)
                                 .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Successful)
-                                .setStatusMessage(message)
+                                .setStatusMessage(this.message)
                                 .build();
                     } else {
-                        message = sendingPCE.getError();
-                        notification = new ServicePathRpcResultBuilder()
+                        this.message = StubpceImpl.this.sendingPCE.getError();
+                        this.notification = new ServicePathRpcResultBuilder()
                                 .setNotificationType(ServicePathNotificationTypes.CancelResourceReserve)
                                 .setServiceName("")
-                                .setStatus(RpcStatusEx.Failed).setStatusMessage(message)
+                                .setStatus(RpcStatusEx.Failed).setStatusMessage(this.message)
                                 .build();
-                        message = "Cancel request failed !";
+                        this.message = "Cancel request failed !";
                     }
-                    LOG.info(notification.toString());
+                    LOG.info(this.notification.toString());
                     try {
-                        notificationPublishService.putNotification(notification);
+                        StubpceImpl.this.notificationPublishService.putNotification(this.notification);
                     } catch (InterruptedException e) {
                         LOG.info("notification offer rejected : {}", e);
                     }
-                    LOG.info(message);
+                    LOG.info(this.message);
                 }
             };
-            ListenableFuture<Boolean> pce = sendingPCE.cancelResourceReserve();
-            Futures.addCallback(pce, pceCallback, executor);
+            ListenableFuture<Boolean> pce = this.sendingPCE.cancelResourceReserve();
+            Futures.addCallback(pce, pceCallback, this.executor);
             LOG.info("Cancel Resource Request in progress ...");
             configurationResponseCommon = new ConfigurationResponseCommonBuilder()
                     .setAckFinalIndicator("No")
@@ -175,12 +173,12 @@ public class StubpceImpl implements StubpceService {
         } else {
             message = "serviceName / requestId is not correct !";
             responseCode = "500";
-            notification = new ServicePathRpcResultBuilder()
+            this.notification = new ServicePathRpcResultBuilder()
                     .setNotificationType(ServicePathNotificationTypes.CancelResourceReserve)
                     .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
                     .setStatusMessage(message).build();
             try {
-                notificationPublishService.putNotification(notification);
+                this.notificationPublishService.putNotification(this.notification);
             } catch (InterruptedException e) {
                 LOG.info("notification offer rejected : {}", e);
             }
@@ -196,15 +194,15 @@ public class StubpceImpl implements StubpceService {
     }
 
     @Override
-    public Future<RpcResult<PathComputationRequestOutput>> pathComputationRequest(PathComputationRequestInput input) {
+    public ListenableFuture<RpcResult<PathComputationRequestOutput>> pathComputationRequest(PathComputationRequestInput input) {
         LOG.info("RPC pathcomputation request received");
         String message = "";
         String responseCode = "";
         boolean coherencyHardSoft = false;
         boolean commonId = true;
         ConfigurationResponseCommonBuilder configurationResponseCommon = null;
-        compliancyCheck = new StubpceCompliancyCheck(input.getServiceName(), input.getServiceHandlerHeader());
-        if (compliancyCheck.check(false, true)) {
+        this.compliancyCheck = new StubpceCompliancyCheck(input.getServiceName(), input.getServiceHandlerHeader());
+        if (this.compliancyCheck.check(false, true)) {
             LOG.info("Service compliant !");
             /**
              * If compliant, service-request parameters are verified in order to
@@ -212,12 +210,12 @@ public class StubpceImpl implements StubpceService {
              * a path and implement a service.
              */
             LOG.info("checking Tx/Rx Info for AEnd ...");
-            txrxCheck = new StubpceTxRxCheck(input.getServiceAEnd(), 1);
-            if (txrxCheck.check()) {
+            this.txrxCheck = new StubpceTxRxCheck(input.getServiceAEnd(), 1);
+            if (this.txrxCheck.check()) {
                 LOG.info("Tx/Rx Info for AEnd checked !");
                 LOG.info("checking Tx/Rx Info for ZEnd ...");
-                txrxCheck = new StubpceTxRxCheck(input.getServiceZEnd(), 2);
-                if (txrxCheck.check()) {
+                this.txrxCheck = new StubpceTxRxCheck(input.getServiceZEnd(), 2);
+                if (this.txrxCheck.check()) {
                     LOG.info("Tx/Rx Info for ZEnd checked !");
                     /**
                      * If OK, common-id is verified in order to see if there is
@@ -226,11 +224,11 @@ public class StubpceImpl implements StubpceService {
                      * with hard/soft constraints provided in the input of the
                      * RPC.
                      */
-                    if (input.getHardConstraints() != null || input.getSoftConstraints() != null) {
+                    if ((input.getHardConstraints() != null) || (input.getSoftConstraints() != null)) {
                         LOG.info("Constraints specified !");
-                        checkCoherencyHardSoft = new CheckCoherencyHardSoft(input.getHardConstraints(),
+                        this.checkCoherencyHardSoft = new CheckCoherencyHardSoft(input.getHardConstraints(),
                                 input.getSoftConstraints());
-                        if (checkCoherencyHardSoft.check()) {
+                        if (this.checkCoherencyHardSoft.check()) {
                             LOG.info("hard/soft constraints coherent !");
                             coherencyHardSoft = true;
                         } else {
@@ -242,16 +240,16 @@ public class StubpceImpl implements StubpceService {
                         commonId = false;
                     }
                     if (!commonId || (commonId && coherencyHardSoft)) {
-                        notification = new ServicePathRpcResultBuilder()
+                        this.notification = new ServicePathRpcResultBuilder()
                                 .setNotificationType(ServicePathNotificationTypes.PathComputationRequest)
                                 .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Pending)
                                 .setStatusMessage("Service compliant, submitting pathComputation Request ...").build();
                         try {
-                            notificationPublishService.putNotification(notification);
+                            this.notificationPublishService.putNotification(this.notification);
                         } catch (InterruptedException e) {
                             LOG.info("notification offer rejected : {}", e);
                         }
-                        sendingPCE = new SendingPceRPCs(input,db,executor);
+                        this.sendingPCE = new SendingPceRPCs(input,this.db,this.executor);
                         FutureCallback<Boolean> pceCallback = new FutureCallback<Boolean>() {
                             String message = "";
                             ServicePathRpcResult notification = null;
@@ -260,11 +258,11 @@ public class StubpceImpl implements StubpceService {
                             public void onFailure(Throwable arg0) {
                                 LOG.error("Failure message : {}", arg0.toString());
                                 LOG.error("Path calculation failed !");
-                                notification = new ServicePathRpcResultBuilder()
+                                this.notification = new ServicePathRpcResultBuilder()
                                         .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
                                         .setStatusMessage("PCR Request failed  : " + arg0.getMessage()).build();
                                 try {
-                                    notificationPublishService.putNotification(notification);
+                                    StubpceImpl.this.notificationPublishService.putNotification(this.notification);
                                 } catch (InterruptedException e) {
                                     LOG.info("notification offer rejected : {}", e);
                                 }
@@ -274,44 +272,44 @@ public class StubpceImpl implements StubpceService {
                             public void onSuccess(Boolean response) {
                                 LOG.info("response : {}", response);
                                 if (response) {
-                                    message = "Path Computated !";
+                                    this.message = "Path Computated !";
                                     ServicePathRpcResultBuilder tmp = new ServicePathRpcResultBuilder()
                                             .setNotificationType(ServicePathNotificationTypes.PathComputationRequest)
                                             .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Successful)
-                                            .setStatusMessage(message);
-                                    pathDescriptionBuilder = sendingPCE.getPathDescription();
-                                    if (pathDescriptionBuilder != null) {
+                                            .setStatusMessage(this.message);
+                                    StubpceImpl.this.pathDescriptionBuilder = StubpceImpl.this.sendingPCE.getPathDescription();
+                                    if (StubpceImpl.this.pathDescriptionBuilder != null) {
                                         PathDescription pathDescription = new org.opendaylight.yang.gen.v1.http.org
                                                 .transportpce.b.c._interface.servicepath.rev170426.service.path
                                                 .rpc.result.PathDescriptionBuilder()
-                                                .setAToZDirection(pathDescriptionBuilder.getAToZDirection())
-                                                .setZToADirection(pathDescriptionBuilder.getZToADirection())
+                                                .setAToZDirection(StubpceImpl.this.pathDescriptionBuilder.getAToZDirection())
+                                                .setZToADirection(StubpceImpl.this.pathDescriptionBuilder.getZToADirection())
                                                 .build();
                                         tmp.setPathDescription(new PathDescriptionBuilder()
                                                 .setAToZDirection(pathDescription.getAToZDirection())
                                                 .setZToADirection(pathDescription.getZToADirection())
                                                 .build());
                                     }
-                                    notification = tmp.build();
+                                    this.notification = tmp.build();
                                 } else {
-                                    message = sendingPCE.getError();
-                                    notification = new ServicePathRpcResultBuilder()
+                                    this.message = StubpceImpl.this.sendingPCE.getError();
+                                    this.notification = new ServicePathRpcResultBuilder()
                                             .setNotificationType(ServicePathNotificationTypes.PathComputationRequest)
                                             .setServiceName("")
-                                            .setStatus(RpcStatusEx.Failed).setStatusMessage(message)
+                                            .setStatus(RpcStatusEx.Failed).setStatusMessage(this.message)
                                             .build();
-                                    message = "Path not calculated!";
+                                    this.message = "Path not calculated!";
                                 }
                                 try {
-                                    notificationPublishService.putNotification(notification);
+                                    StubpceImpl.this.notificationPublishService.putNotification(this.notification);
                                 } catch (InterruptedException e) {
                                     LOG.info("notification offer rejected : {}", e);
                                 }
-                                LOG.info(message);
+                                LOG.info(this.message);
                             }
                         };
-                        ListenableFuture<Boolean> pce = sendingPCE.pathComputation();
-                        Futures.addCallback(pce, pceCallback, executor);
+                        ListenableFuture<Boolean> pce = this.sendingPCE.pathComputation();
+                        Futures.addCallback(pce, pceCallback, this.executor);
                         LOG.info("PathComputation Request in progress ...");
                         configurationResponseCommon = new ConfigurationResponseCommonBuilder()
                                 .setAckFinalIndicator("No")
@@ -325,22 +323,22 @@ public class StubpceImpl implements StubpceService {
                     }
 
                 } else {
-                    message = txrxCheck.getMessage();
+                    message = this.txrxCheck.getMessage();
                     responseCode = "500";
                 }
             } else {
-                message = txrxCheck.getMessage();
+                message = this.txrxCheck.getMessage();
                 responseCode = "500";
             }
         } else {
-            message = compliancyCheck.getMessage();
+            message = this.compliancyCheck.getMessage();
             responseCode = "500";
-            notification = new ServicePathRpcResultBuilder()
+            this.notification = new ServicePathRpcResultBuilder()
                     .setNotificationType(ServicePathNotificationTypes.PathComputationRequest)
                     .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
                     .setStatusMessage("Service not compliant : " + message).build();
             try {
-                notificationPublishService.putNotification(notification);
+                this.notificationPublishService.putNotification(this.notification);
             } catch (InterruptedException e) {
                 LOG.info("notification offer rejected : {}", e);
             }
@@ -438,7 +436,7 @@ public class StubpceImpl implements StubpceService {
                 if (pathDesc != null) {
                     iid = InstanceIdentifier.create(PathDescriptionList.class)
                             .child(PathDescriptions.class, new PathDescriptionsKey(pathDesc.getPathName()));
-                    writeTx = db.newWriteOnlyTransaction();
+                    writeTx = this.db.newWriteOnlyTransaction();
                     writeTx.put(LogicalDatastoreType.OPERATIONAL, iid, pathDesc);
                     future = writeTx.submit();
                     try {
@@ -466,7 +464,7 @@ public class StubpceImpl implements StubpceService {
     @SuppressWarnings("unused")
     private Services readServiceList(String serviceName) {
         Services result = null;
-        ReadOnlyTransaction readTx = db.newReadOnlyTransaction();
+        ReadOnlyTransaction readTx = this.db.newReadOnlyTransaction();
         InstanceIdentifier<Services> iid = InstanceIdentifier.create(ServiceList.class).child(Services.class,
                 new ServicesKey(serviceName));
         Future<Optional<Services>> future = readTx.read(LogicalDatastoreType.OPERATIONAL,iid);
@@ -494,7 +492,7 @@ public class StubpceImpl implements StubpceService {
     @SuppressWarnings("unused")
     private ServicePaths readServicePathList(String serviceName) {
         ServicePaths result = null;
-        ReadOnlyTransaction readTx = db.newReadOnlyTransaction();
+        ReadOnlyTransaction readTx = this.db.newReadOnlyTransaction();
         InstanceIdentifier<ServicePaths> iid = InstanceIdentifier.create(ServicePathList.class)
                 .child(ServicePaths.class, new ServicePathsKey(serviceName));
         Future<Optional<ServicePaths>> future = readTx.read(LogicalDatastoreType.OPERATIONAL,iid);
@@ -522,7 +520,7 @@ public class StubpceImpl implements StubpceService {
     @SuppressWarnings("unused")
     private PathDescriptions readPathDescriptionList(String pathName) {
         PathDescriptions result = null;
-        ReadOnlyTransaction readTx = db.newReadOnlyTransaction();
+        ReadOnlyTransaction readTx = this.db.newReadOnlyTransaction();
         InstanceIdentifier<PathDescriptions> iid = InstanceIdentifier.create(PathDescriptionList.class)
                 .child(PathDescriptions.class, new PathDescriptionsKey(pathName));
         Future<Optional<PathDescriptions>> future = readTx.read(LogicalDatastoreType.OPERATIONAL,iid);
@@ -559,12 +557,12 @@ public class StubpceImpl implements StubpceService {
         org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service
             .path.PathDescriptionBuilder path = new org.opendaylight.yang.gen.v1.http.org.transportpce
             .b.c._interface.service.types.rev170426.service.path.PathDescriptionBuilder();
-        path.setAToZDirection(pathDescriptionBuilder.getAToZDirection());
-        path.setZToADirection(pathDescriptionBuilder.getZToADirection());
+        path.setAToZDirection(this.pathDescriptionBuilder.getAToZDirection());
+        path.setZToADirection(this.pathDescriptionBuilder.getZToADirection());
         ServicePaths service = new ServicePathsBuilder().setServicePathName(input.getServiceName())
                 .setSoftConstraints(input.getSoftConstraints()).setHardConstraints(input.getHardConstraints())
                 .setPathDescription(path.build()).build();
-        WriteTransaction writeTx = db.newWriteOnlyTransaction();
+        WriteTransaction writeTx = this.db.newWriteOnlyTransaction();
         writeTx.put(LogicalDatastoreType.OPERATIONAL, iid, service);
         Future<Void> future = writeTx.submit();
         try {
@@ -578,7 +576,7 @@ public class StubpceImpl implements StubpceService {
     }
 
     public PathDescriptionBuilder getPathDescriptionBuilder() {
-        return pathDescriptionBuilder;
+        return this.pathDescriptionBuilder;
     }
 
     public void setPathDescriptionBuilder(PathDescriptionBuilder pathDescriptionBuilder) {
index f5a18634eec4501ebdaa7d34ce2ac252c08d8cdf..0df5603c54060196c03e92f888d09586ff3c29cb 100644 (file)
 package org.opendaylight.transportpce.stubpce.topology;
 
 import com.google.common.collect.Lists;
-
 import java.util.ArrayList;
 import java.util.List;
 import java.util.ListIterator;
-
 import org.opendaylight.transportpce.stubpce.TpNodeTp;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.AToZDirection;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.AToZDirectionBuilder;
@@ -83,12 +81,12 @@ public class InterNodePath {
             Link link = path.getLink();
             AToZKey atozKey = new AToZKey(Integer.toString(order));
             Resource resource = new ResourceBuilder().setResource(link).build();
-            AToZ hop = new AToZBuilder().setId(atozKey.getId()).setKey(atozKey).setResource(resource).build();
+            AToZ hop = new AToZBuilder().setId(atozKey.getId()).withKey(atozKey).setResource(resource).build();
             atozList.add(hop);
             order++;
         }
         atozDirection.setRate((long) 100).setAToZWavelengthNumber((long) 200).setAToZ(atozList);
-        atoz.add(atozDirection.build());
+        this.atoz.add(atozDirection.build());
     }
 
     /**
@@ -111,12 +109,12 @@ public class InterNodePath {
             Link link = path.getLink();
             ZToAKey ztoaKey = new ZToAKey(Integer.toString(order));
             Resource resource = new ResourceBuilder().setResource(link).build();
-            ZToA hop = new ZToABuilder().setId(ztoaKey.getId()).setKey(ztoaKey).setResource(resource).build();
+            ZToA hop = new ZToABuilder().setId(ztoaKey.getId()).withKey(ztoaKey).setResource(resource).build();
             ztoaList.add(hop);
             order++;
         }
         ztoaDirection.setRate((long) 100).setZToAWavelengthNumber((long) 200).setZToA(ztoaList);
-        ztoa.add(ztoaDirection.build());
+        this.ztoa.add(ztoaDirection.build());
     }
 
     /**
@@ -141,7 +139,7 @@ public class InterNodePath {
             NodePath srg = null;
             NodePath deg1 = null;
             NodePath deg2 = null;
-            for (NodePath node : nodepaths) {
+            for (NodePath node : this.nodepaths) {
                 //LOG.info(node.toString());
                 String id = node.getNodeId();
                 if (id.contains("XPDR")) {
@@ -172,7 +170,7 @@ public class InterNodePath {
         LOG.info("buildDegToDeg ...");
         NodePath deg1 = null;
         NodePath deg2 = null;
-        for (NodePath node : nodepaths) {
+        for (NodePath node : this.nodepaths) {
             //LOG.info(node.toString());
             String nodeId = node.getNodeId();
             if (nodeId.contains("DEG1")) {
@@ -182,7 +180,7 @@ public class InterNodePath {
                 deg2 = node;
             }
         }
-        if (deg1 != null && deg2 != null) {
+        if ((deg1 != null) && (deg2 != null)) {
             List<Path> result =  new ArrayList<Path>();
             NodePath deb = deg1;
             NodePath end = deg2;
@@ -268,7 +266,7 @@ public class InterNodePath {
      */
     private void buildDegToSrgToXpdr(NodePath xpdr,NodePath srg,NodePath deg1,NodePath deg2,boolean reverse) {
         LOG.info("buildDegToSrgToXpr ...");
-        if (xpdr != null && srg != null && deg1 != null && deg2 != null) {
+        if ((xpdr != null) && (srg != null) && (deg1 != null) && (deg2 != null)) {
             buildDeg(xpdr, srg, deg1, reverse);
             buildDeg(xpdr, srg, deg2, reverse);
         } else {
@@ -289,7 +287,7 @@ public class InterNodePath {
      */
     private void buildXpdrToSrgToDeg(NodePath xpdr,NodePath srg,NodePath deg1,NodePath deg2,boolean reverse) {
         LOG.info("buildXpdrToSrgToDeg ...");
-        if (xpdr != null && srg != null && deg1 != null && deg2 != null) {
+        if ((xpdr != null) && (srg != null) && (deg1 != null) && (deg2 != null)) {
             List<Path> result =  new ArrayList<Path>();
             for (Path xpdrPath : xpdr.getPath()) {
                 TpNodeTp tmpxpdr = xpdrPath.getTpNodeTp();
@@ -361,7 +359,7 @@ public class InterNodePath {
                                 case 1: //last link
                                     if (res instanceof Link) {
                                         Link tp = (Link) res;
-                                        if (tp != null && tp.getLinkIdentifier().getLinkId().contains(endBy)) {
+                                        if ((tp != null) && tp.getLinkIdentifier().getLinkId().contains(endBy)) {
                                             result.add(tmp);
                                         }
                                     }
@@ -370,7 +368,7 @@ public class InterNodePath {
                                 case 2: //last tp
                                     if (res instanceof TerminationPoint) {
                                         TerminationPoint tp = (TerminationPoint) res;
-                                        if (tp != null && tp.getTerminationPointIdentifier().getTpId()
+                                        if ((tp != null) && tp.getTerminationPointIdentifier().getTpId()
                                                 .contains(endBy)) {
                                             result.add(tmp);
                                         }
@@ -426,17 +424,17 @@ public class InterNodePath {
                         if (atoz.getId().compareTo(id) == 0) {
                             org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription
                                 .rev170426.pce.resource.resource.Resource res = atoz.getResource().getResource();
-                            if (res != null  && res instanceof Link) {
+                            if ((res != null)  && (res instanceof Link)) {
                                 Link link = new LinkBuilder()
                                         .setLinkIdentifier(new LinkIdentifierBuilder()
                                                 .setLinkId(atozLink)
                                                 .build())
                                         .build();
-                                AToZKey atozKey = new AToZKey(atoz.getKey());
+                                AToZKey atozKey = new AToZKey(atoz.key());
                                 org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
                                     .pathdescription.rev170426.pce.resource.Resource resource = new ResourceBuilder()
                                     .setResource(link).build();
-                                AToZ hop = new AToZBuilder().setId(atozKey.getId()).setKey(atozKey)
+                                AToZ hop = new AToZBuilder().setId(atozKey.getId()).withKey(atozKey)
                                         .setResource(resource).build();
                                 it.remove();
                                 if (!remove) {
@@ -474,9 +472,9 @@ public class InterNodePath {
                     if (atoz.getId().compareTo(id) == 0) {
                         org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription
                             .rev170426.pce.resource.resource.Resource res = atoz.getResource().getResource();
-                        if (res != null  && res instanceof TerminationPoint) {
+                        if ((res != null)  && (res instanceof TerminationPoint)) {
                             TerminationPoint tp = (TerminationPoint) res;
-                            if (tp != null && tp.getTerminationPointIdentifier().getTpId().contains(beginBy)) {
+                            if ((tp != null) && tp.getTerminationPointIdentifier().getTpId().contains(beginBy)) {
                                 LOG.info("tmp : {}", tmp.toString());
                                 result.add(tmp);
                             }
@@ -499,14 +497,14 @@ public class InterNodePath {
      * @param zend path zend Supernode nodeId
      */
     public void buildPath(String zend) {
-        if (superNode != null) {
-            for (org.opendaylight.transportpce.stubpce.topology.Resource res : superNode.getResources()) {
-                NodePath path = new NodePath(res, superNode.getSuperNodeId(), superNode.isXpdrSrgAbsent());
+        if (this.superNode != null) {
+            for (org.opendaylight.transportpce.stubpce.topology.Resource res : this.superNode.getResources()) {
+                NodePath path = new NodePath(res, this.superNode.getSuperNodeId(), this.superNode.isXpdrSrgAbsent());
                 path.fill();
-                nodepaths.add(path);
+                this.nodepaths.add(path);
             }
-            LOG.info("nodepaths size : {}", nodepaths.size());
-            build(superNode.isXpdrSrgAbsent(),superNode.getSuperNodeId(), zend);
+            LOG.info("nodepaths size : {}", this.nodepaths.size());
+            build(this.superNode.isXpdrSrgAbsent(),this.superNode.getSuperNodeId(), zend);
         }
     }
 
@@ -524,7 +522,7 @@ public class InterNodePath {
     }
 
     public SuperNode getSuperNode() {
-        return superNode;
+        return this.superNode;
     }
 
     public void setSuperNode(SuperNode superNode) {
@@ -532,7 +530,7 @@ public class InterNodePath {
     }
 
     public List<AToZDirection> getAtoz() {
-        return atoz;
+        return this.atoz;
     }
 
     public void setAtoz(List<AToZDirection> atoz) {
@@ -540,7 +538,7 @@ public class InterNodePath {
     }
 
     public List<ZToADirection> getZtoa() {
-        return ztoa;
+        return this.ztoa;
     }
 
     public void setZtoa(List<ZToADirection> ztoa) {
@@ -548,7 +546,7 @@ public class InterNodePath {
     }
 
     public List<NodePath> getNodepaths() {
-        return nodepaths;
+        return this.nodepaths;
     }
 
     public void setNodepaths(List<NodePath> nodepaths) {
index d6d3b0a4c2875f4ed11dd44acc443df67fabe4a3..5c8e66ab3e579d3b209d1c1e643be9714b48be0b 100644 (file)
@@ -9,13 +9,11 @@
 package org.opendaylight.transportpce.stubpce.topology;
 
 import com.google.common.collect.Lists;
-
 import java.util.ArrayList;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.SortedSet;
 import java.util.TreeSet;
-
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubpce.rev170426.path.description.list.PathDescriptionsBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.AToZDirection;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.AToZDirectionBuilder;
@@ -71,7 +69,7 @@ public class SuperNodePath {
      */
     private Boolean endNode(String end, List<String> supernodes) {
         Boolean result = false;
-        if (end != null && end.compareTo(" ") != 0) {
+        if ((end != null) && (end.compareTo(" ") != 0)) {
             for (String node : supernodes) {
                 if (node.compareTo(end) == 0) {
                     result = true;
@@ -91,8 +89,8 @@ public class SuperNodePath {
      */
     public SuperNode getSuperNode(String nodeId) {
         SuperNode result = null;
-        if (network != null) {
-            for (SuperNode tmp : network.getSuperNodes()) {
+        if (this.network != null) {
+            for (SuperNode tmp : this.network.getSuperNodes()) {
                 if (tmp.getSuperNodeId().compareTo(nodeId) == 0) {
                     result = tmp;
                     break;
@@ -129,7 +127,7 @@ public class SuperNodePath {
                     if (tmp.startsWith(zend)) {
                         ztoalink = tmp;
                     }
-                    if (atozlink != null && ztoalink != null) {
+                    if ((atozlink != null) && (ztoalink != null)) {
                         result.add(atozlink.concat("/").concat(ztoalink));
                         atozlink = null;
                         ztoalink = null;
@@ -173,8 +171,8 @@ public class SuperNodePath {
      */
     private List<String> getSuperNodeId() {
         List<String> result = new ArrayList<String>();
-        if (network.getSuperNodes().size() > 0) {
-            for (SuperNode tmp : network.getSuperNodes()) {
+        if (this.network.getSuperNodes().size() > 0) {
+            for (SuperNode tmp : this.network.getSuperNodes()) {
                 result.add(tmp.getSuperNodeId());
             }
         }
@@ -189,8 +187,8 @@ public class SuperNodePath {
      */
     private List<String> getRoadmLinks() {
         List<String> result = new ArrayList<String>();
-        if (network.getRoadmToroadm().getLinks().size() > 0) {
-            for (String tmp : network.getRoadmToroadm().getLinks()) {
+        if (this.network.getRoadmToroadm().getLinks().size() > 0) {
+            for (String tmp : this.network.getRoadmToroadm().getLinks()) {
                 result.add(tmp);
             }
         }
@@ -221,9 +219,9 @@ public class SuperNodePath {
                     ztoa.add(split[1]);
                 }
             }
-            if (!atoz.isEmpty() && atoz.size() == ztoa.size()) {
+            if (!atoz.isEmpty() && (atoz.size() == ztoa.size())) {
                 NodeLinkNode node = new NodeLinkNode(aend, zend, atoz,ztoa,direct);
-                paths.add(node);
+                this.paths.add(node);
             }
 
         } else {
@@ -239,10 +237,10 @@ public class SuperNodePath {
      * @param zend ending extremity path
      */
     public void run(String aend, String zend) {
-        if (network != null) {
+        if (this.network != null) {
             List<String> supernodes = getSuperNodeId();
             List<String> roadmLinks = getRoadmLinks();
-            if (aend != null && zend != null) {
+            if ((aend != null) && (zend != null)) {
                 int size = supernodes.size();
                 String hop = null;
                 List<String> links = null;
@@ -298,12 +296,12 @@ public class SuperNodePath {
                     AToZ atoz = it.next();
                     org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription
                         .rev170426.pce.resource.resource.Resource res = atoz.getResource().getResource();
-                    int tmpkey = order + Integer.parseInt(atoz.getKey().getId());
+                    int tmpkey = order + Integer.parseInt(atoz.key().getId());
                     AToZKey atozKey = new AToZKey(Integer.toString(tmpkey));
                     org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
                         .pathdescription.rev170426.pce.resource.Resource resource = new ResourceBuilder()
                         .setResource(res).build();
-                    AToZ hop = new AToZBuilder().setId(atozKey.getId()).setKey(atozKey).setResource(resource).build();
+                    AToZ hop = new AToZBuilder().setId(atozKey.getId()).withKey(atozKey).setResource(resource).build();
                     it.remove();
                     it.add(hop);
                     tmpkey++;
@@ -375,7 +373,7 @@ public class SuperNodePath {
      */
     public List<String> getDeg(String atozLink, String ztoaLink) {
         List<String> result = new ArrayList<String>();
-        if (atozLink != null && ztoaLink != null) {
+        if ((atozLink != null) && (ztoaLink != null)) {
             String [] split = atozLink.split("-", 4);
             if (split.length == 4) {
                 result = Lists.newArrayList(split[1],split[3]);
@@ -470,7 +468,7 @@ public class SuperNodePath {
                     }
                     if (resource != null) {
                         hop = new ZToABuilder()
-                                .setKey(ztoaKey)
+                                .withKey(ztoaKey)
                                 .setResource(resource)
                                 .build();
                         ztoaList.add(hop);
@@ -511,7 +509,7 @@ public class SuperNodePath {
                     ztoadirList.add(ztodir);
                 }
             }
-            if (!ztoadirList.isEmpty() && size == ztoadirList.size()) {
+            if (!ztoadirList.isEmpty() && (size == ztoadirList.size())) {
                 LOG.info("building PathDescriptions ...");
                 int index = 1;
                 String pathName = null;
@@ -547,11 +545,11 @@ public class SuperNodePath {
             if (split.length == 4) {
                 String aend = split[0].replaceAll("ROADM", "Node");
                 String zend = split[2].replaceAll("ROADM", "Node");
-                if (aend != null && zend != null) {
+                if ((aend != null) && (zend != null)) {
                     LOG.info("getting super node for : {} and {}", aend, zend);
                     SuperNode aendSp = getSuperNode(aend);
                     SuperNode zendSp = getSuperNode(zend);
-                    if (aendSp != null && zendSp != null) {
+                    if ((aendSp != null) && (zendSp != null)) {
                         result.add(aendSp);
                         result.add(zendSp);
                     }
@@ -582,7 +580,7 @@ public class SuperNodePath {
                     String ztoaLink = null;
                     atozLink = tmp.getAtozLink().get(0);
                     ztoaLink = tmp.getZtoaLink().get(0);
-                    if (atozLink != null && ztoaLink != null) {
+                    if ((atozLink != null) && (ztoaLink != null)) {
                         LOG.info("atozlink : {}", atozLink);
                         LOG.info("ztoalink : {}", ztoaLink);
                         InterNodePath interAend = new InterNodePath(aendSp);
@@ -654,7 +652,7 @@ public class SuperNodePath {
                             int loop = 0;
                             while (loop < 2) {
                                 List<SuperNode> hop = getSuperNodeEndLink(atozLinks.get(loop));
-                                if (!hop.isEmpty() && hop.size() == 2) {
+                                if (!hop.isEmpty() && (hop.size() == 2)) {
                                     aendSp = hop.get(0);
                                     zendSp = hop.get(1);
                                     InterNodePath interAend = new InterNodePath(aendSp);
@@ -665,7 +663,7 @@ public class SuperNodePath {
                                     LOG.info("interZend : {}", interZend.getAtoz().toString());
                                     List<String> deg1 = getDeg(atozLinks.get(loop),ztoaLinks.get(loop));
                                     LOG.info("deg1 : {}", deg1.toString());
-                                    if (!deg1.isEmpty() && deg1.size() == 2) {
+                                    if (!deg1.isEmpty() && (deg1.size() == 2)) {
                                         List<AToZDirection> cleanInterA = null;
                                         List<AToZDirection> cleanInterZ = null;
                                         if (zendSp.getSuperNodeId().compareTo(zend) == 0) {
@@ -724,7 +722,7 @@ public class SuperNodePath {
     }
 
     public List<NodeLinkNode> getPaths() {
-        return paths;
+        return this.paths;
     }
 
     public void setPaths(List<NodeLinkNode> paths) {
index aa6e9eabc421bd5148919b6e342183c9f835f16f..56b4b33b57cf30d8f57387acb761dea3484d849e 100644 (file)
@@ -24,6 +24,25 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
   <version>0.2.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>1.8.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>
+        <scope>import</scope>
+        <type>pom</type>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
   <dependencies>
     <dependency>
       <groupId>${project.groupId}</groupId>
@@ -55,6 +74,14 @@ Author: Martial Coulibaly <martial.coulibaly@gfi.com> on behalf of Orange
       <artifactId>transportpce-stubmodels</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller.model</groupId>
+      <artifactId>model-topology</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>sal-netconf-connector</artifactId>
+    </dependency>
 
     <!-- Testing Dependencies -->
     <dependency>
index 23ae97628781b7df6f5f778733c618299f5395db..6e197d5daa18614f60aa135dd78df2efd98bb0df 100644 (file)
@@ -14,10 +14,7 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
-
 import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.transportpce.stubrenderer.SendingRendererRPCs;
 import org.opendaylight.transportpce.stubrenderer.StubrendererCompliancyCheck;
@@ -64,15 +61,15 @@ public class StubrendererImpl implements StubrendererService {
     }
 
     @Override
-    public Future<RpcResult<ServiceImplementationRequestOutput>> serviceImplementationRequest(
+    public ListenableFuture<RpcResult<ServiceImplementationRequestOutput>> serviceImplementationRequest(
             ServiceImplementationRequestInput input) {
         LOG.info("RPC  serviceImplementationRequest request received");
         String responseCode = "";
         String message = "";
         ConfigurationResponseCommonBuilder configurationResponseCommon = null;
 
-        compliancyCheck = new StubrendererCompliancyCheck(input.getServiceName(), input.getServiceHandlerHeader());
-        if (compliancyCheck.check(false, true)) {
+        this.compliancyCheck = new StubrendererCompliancyCheck(input.getServiceName(), input.getServiceHandlerHeader());
+        if (this.compliancyCheck.check(false, true)) {
             LOG.info("Service compliant !");
             /**
              * If compliant, service-request parameters are verified in order to
@@ -80,19 +77,19 @@ public class StubrendererImpl implements StubrendererService {
              * a path and implement a service.
              */
 
-            notification = new ServiceRpcResultSpBuilder()
+            this.notification = new ServiceRpcResultSpBuilder()
                     .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
                     .setServiceName(input.getServiceName())
                     .setStatus(RpcStatusEx.Pending)
                     .setStatusMessage("Service compliant, submitting serviceImplementation Request ...")
                     .build();
             try {
-                notificationPublishService.putNotification(notification);
+                this.notificationPublishService.putNotification(this.notification);
             } catch (InterruptedException e) {
                 LOG.info("notification offer rejected : {}", e);
             }
 
-            SendingRendererRPCs sendingRenderer = new SendingRendererRPCs(executor);
+            SendingRendererRPCs sendingRenderer = new SendingRendererRPCs(this.executor);
             FutureCallback<Boolean> rendererCallback =
                     new FutureCallback<Boolean>() {
                 String message = "";
@@ -102,12 +99,12 @@ public class StubrendererImpl implements StubrendererService {
                 public void onFailure(Throwable arg0) {
                     LOG.error("Failure message : {}", arg0.toString());
                     LOG.error("Service implementation failed !");
-                    notification = new ServiceRpcResultSpBuilder()
+                    this.notification = new ServiceRpcResultSpBuilder()
                             .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
                             .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
                             .setStatusMessage("PCR Request failed  : {}" + arg0.getMessage()).build();
                     try {
-                        notificationPublishService.putNotification(notification);
+                        StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
                     } catch (InterruptedException e) {
                         LOG.info("notification offer rejected : {}", e);
                     }
@@ -117,13 +114,13 @@ public class StubrendererImpl implements StubrendererService {
                 public void onSuccess(Boolean response) {
                     LOG.info("response : {}", response);
                     if (response) {
-                        message = "Service implemented !";
+                        this.message = "Service implemented !";
                         TopologyBuilder topo = sendingRenderer.getTopology();
                         ServiceRpcResultSpBuilder tmp = new ServiceRpcResultSpBuilder()
                                 .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
                                 .setServiceName(input.getServiceName())
                                 .setStatus(RpcStatusEx.Successful)
-                                .setStatusMessage(message);
+                                .setStatusMessage(this.message);
                         if (topo != null) {
                             PathTopology value = new PathTopologyBuilder()
                                     .setAToZ(topo.getAToZ())
@@ -131,26 +128,26 @@ public class StubrendererImpl implements StubrendererService {
                                     .build();
                             tmp.setPathTopology(value);
                         }
-                        notification = tmp.build();
+                        this.notification = tmp.build();
                     } else {
-                        message = "Service implementation failed : " + sendingRenderer.getError();
-                        notification = new ServiceRpcResultSpBuilder()
+                        this.message = "Service implementation failed : " + sendingRenderer.getError();
+                        this.notification = new ServiceRpcResultSpBuilder()
                                 .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
                                 .setServiceName("")
-                                .setStatus(RpcStatusEx.Failed).setStatusMessage(message)
+                                .setStatus(RpcStatusEx.Failed).setStatusMessage(this.message)
                                 .build();
                     }
-                    LOG.info(notification.toString());
+                    LOG.info(this.notification.toString());
                     try {
-                        notificationPublishService.putNotification(notification);
+                        StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
                     } catch (InterruptedException e) {
                         LOG.info("notification offer rejected : {}", e);
                     }
-                    LOG.info(message);
+                    LOG.info(this.message);
                 }
             };
             ListenableFuture<Boolean> renderer = sendingRenderer.serviceImplementation();
-            Futures.addCallback(renderer, rendererCallback, executor);
+            Futures.addCallback(renderer, rendererCallback, this.executor);
             LOG.info("Service implmentation Request in progress ");
             configurationResponseCommon = new ConfigurationResponseCommonBuilder()
                     .setAckFinalIndicator("Yes")
@@ -163,16 +160,16 @@ public class StubrendererImpl implements StubrendererService {
                     .build();
             return RpcResultBuilder.success(output).buildFuture();
         } else {
-            message = compliancyCheck.getMessage();
+            message = this.compliancyCheck.getMessage();
             responseCode = "500";
             LOG.info("Service not compliant caused by : {}", message);
-            notification = new ServiceRpcResultSpBuilder()
+            this.notification = new ServiceRpcResultSpBuilder()
                     .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
                     .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
                     .setStatusMessage("Service not compliant caused by : " + message)
                     .build();
             try {
-                notificationPublishService.putNotification(notification);
+                this.notificationPublishService.putNotification(this.notification);
             } catch (InterruptedException e) {
                 LOG.info("notification offer rejected : {}", e);
             }
@@ -190,13 +187,13 @@ public class StubrendererImpl implements StubrendererService {
     }
 
     @Override
-    public Future<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
+    public ListenableFuture<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
         String message = "";
         LOG.info("RPC serviceDelete request received");
         String responseCode = "";
         ConfigurationResponseCommonBuilder configurationResponseCommon = null;
-        compliancyCheck = new StubrendererCompliancyCheck(input.getServiceName(), input.getServiceHandlerHeader());
-        if (compliancyCheck.check(false, true)) {
+        this.compliancyCheck = new StubrendererCompliancyCheck(input.getServiceName(), input.getServiceHandlerHeader());
+        if (this.compliancyCheck.check(false, true)) {
             LOG.info("Service compliant !");
             /**
              * If compliant, service-request parameters are verified in order to
@@ -204,18 +201,18 @@ public class StubrendererImpl implements StubrendererService {
              * a path and implement a service.
              */
 
-            notification = new ServiceRpcResultSpBuilder()
+            this.notification = new ServiceRpcResultSpBuilder()
                     .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
                     .setServiceName(input.getServiceName())
                     .setStatus(RpcStatusEx.Pending)
                     .setStatusMessage("Service compliant, submitting serviceDelete Request ...")
                     .build();
             try {
-                notificationPublishService.putNotification(notification);
+                this.notificationPublishService.putNotification(this.notification);
             } catch (InterruptedException e) {
                 LOG.info("notification offer rejected : {}", e);
             }
-            SendingRendererRPCs sendingRenderer = new SendingRendererRPCs(executor);
+            SendingRendererRPCs sendingRenderer = new SendingRendererRPCs(this.executor);
             FutureCallback<Boolean> rendererCallback = new FutureCallback<Boolean>() {
                 String message = "";
                 ServiceRpcResultSp notification = null;
@@ -224,12 +221,12 @@ public class StubrendererImpl implements StubrendererService {
                 public void onFailure(Throwable arg0) {
                     LOG.error("Failure message : {}", arg0.toString());
                     LOG.error("Service delete failed !");
-                    notification = new ServiceRpcResultSpBuilder()
+                    this.notification = new ServiceRpcResultSpBuilder()
                             .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
                             .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
                             .setStatusMessage("PCR Request failed  : " + arg0.getMessage()).build();
                     try {
-                        notificationPublishService.putNotification(notification);
+                        StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
                     } catch (InterruptedException e) {
                         LOG.info("notification offer rejected : {}", e);
                     }
@@ -239,30 +236,30 @@ public class StubrendererImpl implements StubrendererService {
                 public void onSuccess(Boolean response) {
                     LOG.info("response : {}", response);
                     if (response) {
-                        message = "Service deleted !";
-                        notification = new ServiceRpcResultSpBuilder()
+                        this.message = "Service deleted !";
+                        this.notification = new ServiceRpcResultSpBuilder()
                                 .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
                                 .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Successful)
-                                .setStatusMessage(message).build();
+                                .setStatusMessage(this.message).build();
                     } else {
-                        message = "Service delete failed : " + sendingRenderer.getError();
-                        notification = new ServiceRpcResultSpBuilder()
+                        this.message = "Service delete failed : " + sendingRenderer.getError();
+                        this.notification = new ServiceRpcResultSpBuilder()
                                 .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
                                 .setServiceName("")
-                                .setStatus(RpcStatusEx.Failed).setStatusMessage(message)
+                                .setStatus(RpcStatusEx.Failed).setStatusMessage(this.message)
                                 .build();
                     }
-                    LOG.info(notification.toString());
+                    LOG.info(this.notification.toString());
                     try {
-                        notificationPublishService.putNotification(notification);
+                        StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
                     } catch (InterruptedException e) {
                         LOG.info("notification offer rejected : {}", e);
                     }
-                    LOG.info(message);
+                    LOG.info(this.message);
                 }
             };
             ListenableFuture<Boolean> renderer = sendingRenderer.serviceDelete();
-            Futures.addCallback(renderer, rendererCallback, executor);
+            Futures.addCallback(renderer, rendererCallback, this.executor);
             message = "Service delete Request in progress ...";
             LOG.info(message);
             configurationResponseCommon = new ConfigurationResponseCommonBuilder()
@@ -275,16 +272,16 @@ public class StubrendererImpl implements StubrendererService {
                     .build();
             return RpcResultBuilder.success(output).buildFuture();
         } else {
-            message = compliancyCheck.getMessage();
+            message = this.compliancyCheck.getMessage();
             LOG.info("Service not compliant caused by : {}", message);
             responseCode = "500";
-            notification = new ServiceRpcResultSpBuilder()
+            this.notification = new ServiceRpcResultSpBuilder()
                     .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
                     .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
                     .setStatusMessage("Service not compliant caused by : " + message)
                     .build();
             try {
-                notificationPublishService.putNotification(notification);
+                this.notificationPublishService.putNotification(this.notification);
             } catch (InterruptedException e) {
                 LOG.info("notification offer rejected : {}", e);
             }