-module org-transportpce-common-types {
+module transportpce-common-types {
namespace "http://org/transportpce/common-types";
prefix org-transportpce-common-types;
-module pce {
- yang-version 1;
+module transportpce-pce {
namespace "http://org/opendaylight/transportpce/pce";
prefix "org-opendaylight-transportpce-pce";
-
import ietf-yang-types {
prefix yang;
revision-date 2013-07-15;
revision 2017-04-26 {
description
"Version 1.5";
- }
+ }
rpc path-computation-request {
input {
module transportpce-pce {
- namespace "http://org/transportpce/B-interface/pce";
- prefix transportpce-pce;
+ namespace "http://org/opendaylight/transportpce/pce";
+ prefix "org-opendaylight-transportpce-pce";
import ietf-yang-types {
prefix yang;
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE";
+ revision 2017-04-26 {
+ description
+ "Version 1.5";
+ }
+
revision 2017-10-17 {
description
"Version 1.6";
-module renderer {
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:renderer";
- prefix "renderer";
+module transportpce-device-renderer {
+ namespace "http://org/opendaylight/transportpce/renderer/device";
+ prefix "org-opendaylight-transportpce-renderer-device";
- import org-transportpce-common-types {
+ import transportpce-common-types {
prefix org-transportpce-common-types;
revision-date 2017-09-07;
}
Shweta Vachhani ( sv111y@att.com )";
revision "2017-02-28" {
- description "Initial revision of renderer model";
+ description "Initial revision of renderer model version 1.5";
}
rpc service-path {
module transportpce-renderer {
- namespace "http://org/transportpce/C-interface/renderer";
- prefix transportpce-renderer;
+ namespace "http://org/opendaylight/transportpce/renderer";
+ prefix "org-opendaylight-transportpce-renderer";
import ietf-yang-types {
prefix yang;
}
import org-openroadm-common-service-types {
prefix org-openroadm-common-service-types;
+ revision-date 2016-10-14;
}
import transportpce-common-service-path-types {
prefix transportpce-common-service-path-types;
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE";
+ revision "2017-02-28" {
+ description "Initial revision of renderer model version 1.5";
+ }
+
revision 2017-10-17 {
description
"Version 1.6";
--- /dev/null
+module transportpce-servicepath {
+ namespace "http://org/transportpce/B-C-interface/servicepath";
+ prefix transportpce-servicepath;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import transportpce-common-service-path-types {
+ prefix transportpce-common-service-path-types;
+ revision-date 2017-10-16;
+ }
+
+ organization
+ "transportPCE";
+ contact
+ "transportPCE committers - ODL";
+ description
+ "YANG definitions for service-path (transportPCE). Adapted from service definition (openroadm)
+ Copyright © 2017 Orange, Inc. and others. All rights reserved.
+
+ openroadm copyright:
+ Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+ AT&T Intellectual Property. All other rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+ * Neither the Members of the Open ROADM MSA Agreement nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA AGREEMENT ''AS IS''
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA AGREEMENT BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE";
+
+ revision 2017-04-26 {
+ description
+ "Version 1.5";
+ }
+ revision 2017-10-17 {
+ description
+ "Version 1.6";
+ }
+
+ container service-path-list {
+ description
+ "List of service paths. Can only be created, deleted, modified, etc. using special RPCs.";
+ list service-paths {
+ key "service-path-name";
+ uses transportpce-common-service-path-types:service-path;
+ }
+ }
+
+}
-module servicehandler {
+module transportpce-servicehandler {
namespace "http://org/opendaylight/transportpce/servicehandler";
prefix "org-opendaylight-transportpce-servicehandler";
module transportpce-servicehandler {
- namespace "http://org/transportpce/B-C-interface/servicehandler";
- prefix transportpce-servicehandler;
+ namespace "http://org/opendaylight/transportpce/servicehandler";
+ prefix "org-opendaylight-transportpce-servicehandler";
import ietf-yang-types {
prefix yang;
description
"Version 1.6";
}
+
+ revision 2017-09-30 {
+ description
+ "Version 1.2";
+ }
+
+
notification service-rpc-result-sh{
description
"This Notification indicates result of service RPC";
-module alarmsuppression {
+module transportpce-alarmsuppression {
yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:alarmsuppression";
- prefix "alarmsuppression";
+ namespace "http://org/opendaylight/transportpce/alarmsuppression";
+ prefix "org-opendaylight-transportpce-alarmsuppression";
organization
"transportPCE";
-module networkutils {
+module transportpce-networkutils {
yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:networkutils";
- prefix "networkutils";
+ namespace "http://org/opendaylight/transportpce/networkutils";
+ prefix "org-opendaylight-transportpce-networkutils";
revision "2017-08-18" {
description "Initial revision of networkutils model";
-module olm {
+module transportpce-olm {
yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:olm";
- prefix "olm";
+ namespace "http://org/opendaylight/transportpce/olm";
+ prefix "org-opendaylight-transportpce-olm";
- import org-transportpce-common-types {
+ import transportpce-common-types {
prefix org-transportpce-common-types;
revision-date 2017-09-07;
}
revision "2017-04-18" {
description "Initial revision of olm model";
}
+
rpc get-pm{
description
"This RPC fetches from the device a list of pm measurements
-module portmapping {
+module transportpce-portmapping {
yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:portmapping";
- prefix "portmapping";
+ namespace "http://org/opendaylight/transportpce/portmapping";
+ prefix "org-opendaylight-transportpce-portmapping";
import org-openroadm-common-types {
prefix org-openroadm-common-types;
package org.opendaylight.transportpce.common.mapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
public interface PortMapping {
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.Network;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.NetworkBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegree;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegreeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegreeKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.NodeTypes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.CircuitPack;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.Port;
import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpenROADMOpticalMultiplex;
import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalTransport;
import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.Protocols1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.Lldp;
import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.PortConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.Network;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.NetworkBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.NodesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.NodesKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.CpToDegree;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.CpToDegreeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.CpToDegreeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.MappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.MappingKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
List<Mapping> portMapList = new ArrayList<>();
InstanceIdentifier<Info> infoIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(Info.class);
Optional<Info> deviceInfoOptional = this.deviceTransactionManager.getDataFromDevice(nodeId,
- LogicalDatastoreType.OPERATIONAL, infoIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ LogicalDatastoreType.OPERATIONAL, infoIID,
+ Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
Info deviceInfo;
if (deviceInfoOptional.isPresent()) {
for (ConnectionPorts cp : degreeConPorts) {
String circuitPackName = cp.getCircuitPackName();
String portName = cp.getPortName().toString();
- InstanceIdentifier<Ports> portIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
- CircuitPacks.class, new CircuitPacksKey(circuitPackName)).child(Ports.class, new PortsKey(portName));
+ InstanceIdentifier<Ports> portIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
+ .child(Ports.class, new PortsKey(portName));
LOG.info("Fetching logical Connection Point value for port {} at circuit pack {}", portName,
circuitPackName);
Optional<Ports> portObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
- LogicalDatastoreType.OPERATIONAL, portIID, Timeouts.DEVICE_READ_TIMEOUT,
- Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ LogicalDatastoreType.OPERATIONAL, portIID,
+ Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
if (portObject.isPresent()) {
Ports port = portObject.get();
if (port.getLogicalConnectionPoint() != null) {
- LOG.info("Logical Connection Point for {} {} is {}", circuitPackName, portName, port
- .getLogicalConnectionPoint());
- portMapList.add(createMappingObject(nodeId, port, circuitPackName, port
- .getLogicalConnectionPoint()));
+ LOG.info("Logical Connection Point for {} {} is {}", circuitPackName, portName,
+ port.getLogicalConnectionPoint());
+ portMapList.add(createMappingObject(nodeId, port, circuitPackName,
+ port.getLogicalConnectionPoint()));
} else {
- LOG.warn("Logical Connection Point value is missing for {} {}", circuitPackName, port
- .getPortName());
+ LOG.warn("Logical Connection Point value is missing for {} {}", circuitPackName,
+ port.getPortName());
}
} else {
LOG.warn("Port {} is not present in node {} in circuit pack {}!", portName, nodeId, circuitPackName);
for (int degreeCounter = 1; degreeCounter <= maxDegree; degreeCounter++) {
LOG.info("Getting Connection ports for Degree Number {}", degreeCounter);
- InstanceIdentifier<Degree> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
- Degree.class, new DegreeKey(degreeCounter));
+ InstanceIdentifier<Degree> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(Degree.class, new DegreeKey(degreeCounter));
Optional<Degree> ordmDegreeObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
- LogicalDatastoreType.CONFIGURATION, deviceIID, Timeouts.DEVICE_READ_TIMEOUT,
- Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ LogicalDatastoreType.CONFIGURATION,
+ deviceIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
if (ordmDegreeObject.isPresent()) {
degrees.add(ordmDegreeObject.get());
} else {
private boolean createPpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
// Creating mapping data for SRG's PP
- HashMap<Integer, List<
- org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks>> srgCps = getSrgCps(
- nodeId, deviceInfo);
- Set<Map.Entry<Integer, List<
- org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks>>> circuitPacks = srgCps
- .entrySet();
- for (Entry<Integer, List<
- org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks>> entry : circuitPacks) {
+ HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
+ .CircuitPacks>> srgCps = getSrgCps(nodeId, deviceInfo);
+ Set<Map.Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206
+ .srg.CircuitPacks>>> circuitPacks = srgCps.entrySet();
+ for (Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
+ .CircuitPacks>> entry : circuitPacks) {
Integer srgIndex = entry.getKey();
for (org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks cp : entry
.getValue()) {
String circuitPackName = cp.getCircuitPackName();
- InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
- CircuitPacks.class, new CircuitPacksKey(circuitPackName));
+ InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName));
Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
- LogicalDatastoreType.OPERATIONAL, cpIID, Timeouts.DEVICE_READ_TIMEOUT,
- Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ LogicalDatastoreType.OPERATIONAL, cpIID,
+ Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
if (!circuitPackObject.isPresent() || (circuitPackObject.get().getPorts() == null)) {
LOG.warn("{} : Circuit pack {} not found or without ports.", nodeId, circuitPackName);
if (port.getLogicalConnectionPoint() != null) {
String logicalConnectionPoint = getLogicalConnectionPort(port, srgIndex);
LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId, circuitPackName, port
- .getPortName(), logicalConnectionPoint);
+ .getPortName(),
+ logicalConnectionPoint);
portMapList.add(createMappingObject(nodeId, port, circuitPackName, logicalConnectionPoint));
} else if (Port.PortQual.RoadmInternal.equals(port.getPortQual())) {
LOG.info("Port is internal, skipping Logical Connection Point missing for {} {}",
- circuitPackName, port.getPortName());
+ circuitPackName,
+ port.getPortName());
} else if (port.getLogicalConnectionPoint() == null) {
LOG.info("Value missing, Skipping Logical Connection Point missing for {} {}", circuitPackName,
port.getPortName());
* @return List of circuit packs object belonging to- shared risk group
* subtree
*/
- private HashMap<Integer, List<
- org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks>> getSrgCps(String deviceId,
- Info ordmInfo) {
- HashMap<Integer, List<
- org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks>> cpPerSrg =
- new HashMap<>();
+ private HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
+ .CircuitPacks>> getSrgCps(String deviceId, Info ordmInfo) {
+ HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
+ .CircuitPacks>> cpPerSrg = new HashMap<>();
Integer maxSrg;
// Get value for max Srg from info subtree, required for iteration
// if not present assume to be 20 (temporary)
List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks> srgCps =
new ArrayList<>();
LOG.info("Getting Circuitpacks for Srg Number {}", srgCounter);
- InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
- SharedRiskGroup.class, new SharedRiskGroupKey(srgCounter));
+ InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(SharedRiskGroup.class, new SharedRiskGroupKey(srgCounter));
Optional<SharedRiskGroup> ordmSrgObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
- LogicalDatastoreType.CONFIGURATION, srgIID, Timeouts.DEVICE_READ_TIMEOUT,
- Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ LogicalDatastoreType.CONFIGURATION,
+ srgIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
if (ordmSrgObject.isPresent()) {
srgCps.addAll(ordmSrgObject.get().getCircuitPacks());
cpPerSrg.put(ordmSrgObject.get().getSrgNumber(), srgCps);
// Creating for Xponder Line and Client Ports
InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class);
Optional<OrgOpenroadmDevice> deviceObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
- LogicalDatastoreType.OPERATIONAL, deviceIID, Timeouts.DEVICE_READ_TIMEOUT,
- Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ LogicalDatastoreType.OPERATIONAL, deviceIID,
+ Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
// Variable to keep track of number of line ports
int line = 1;
if (Port.PortQual.XpdrNetwork.equals(port.getPortQual())) {
portMapList.add(createMappingObject(nodeId, port, circuitPackName,
"XPDR1-" + OpenRoadmInterfacesImpl.NETWORK_TOKEN + line));
- //String lcp = port.getLogicalConnectionPoint();
- //String regex = "XPDR[0-9]+-NETWORK[0-9]+";
- //checkLogicalConnectionPoint(regex, lcp, nodeId, portMapList, circuitPackName, port, "NETWORK", line);
line++;
} else if (Port.PortQual.XpdrClient.equals(port.getPortQual())) {
portMapList.add(createMappingObject(nodeId, port, circuitPackName,
"XPDR1-" + OpenRoadmInterfacesImpl.CLIENT_TOKEN + client));
- //String lcp = port.getLogicalConnectionPoint();
- //String regex = "XPDR[0-9]+-CLIENT[0-9]+";
- //checkLogicalConnectionPoint(regex, lcp, nodeId, portMapList, circuitPackName, port, "CLIENT", client);
client++;
} else {
- LOG.warn("Port type {} not supported", port.getPortQual());
+ LOG.warn("Not supported type of port! Port type: {}", port.getPortQual());
}
}
}
return true;
}
- private void checkLogicalConnectionPoint(String regex, String logicalConnectionPoint, String nodeId, List<
- Mapping> portMapList, String circuitPackName, Ports port, String portQual, int index) {
- if (logicalConnectionPoint.matches(regex)) {
- Mapping map = createMappingObject(nodeId, port, circuitPackName, logicalConnectionPoint);
- if (portMapList.stream().filter(mapping -> mapping.getLogicalConnectionPoint().equals(
- logicalConnectionPoint)).count() > 0) {
- LOG.warn("{} : logical connection point {} on {} {} already used. Port can not be used", nodeId,
- logicalConnectionPoint, circuitPackName, port.getPortName());
- } else {
- portMapList.add(map);
- LOG.info("{} : logical connection point for {} {} is {}", nodeId, circuitPackName, port.getPortName(),
- logicalConnectionPoint);
- }
- } else if (logicalConnectionPoint.isEmpty()) {
- String lcp = "XPDR0-" + portQual + index;
- Mapping map = createMappingObject(nodeId, port, circuitPackName, lcp);
- if (portMapList.contains(map)) {
- LOG.warn("{} : can not assign logical connection point {} to port {} of circuit pack {}. "
- + "Name is already used", nodeId, lcp, port.getPortName(), circuitPackName);
- } else {
- portMapList.add(createMappingObject(nodeId, port, circuitPackName, lcp));
- LOG.info("{} : no logical connection port on {} {}. Assigning {}.", nodeId, circuitPackName, port
- .getPortName(), lcp);
- }
- } else {
- LOG.warn("{} : logical connection point {} on {} {} does not respect OrgOpenRoadm recommendation. Port can "
- + "not be used.", nodeId, logicalConnectionPoint, circuitPackName, port.getPortName());
- }
- }
-
/**
* This private method builds the mapping object to be pushed in MD-SAL in
* order to save port mapping. In case of TTP ports, it also saves the
if (logicalConnectionPoint.contains(OpenRoadmInterfacesImpl.TTP_TOKEN) && (port.getInterfaces() != null)) {
for (Interfaces interfaces : port.getInterfaces()) {
try {
- Optional<Interface> openRoadmInterface = this.openRoadmInterfaces.getInterface(nodeId, interfaces
- .getInterfaceName());
+ Optional<Interface> openRoadmInterface = this.openRoadmInterfaces.getInterface(nodeId,
+ interfaces.getInterfaceName());
if (openRoadmInterface.isPresent()) {
Class<? extends InterfaceType> interfaceType = openRoadmInterface.get().getType();
// Check if interface type is OMS or OTS
}
private CpToDegree createCpToDegreeObject(String circuitPackName, String degreeNumber, String nodeId,
- Map<String, String> interfaceList) {
+ Map<String, String> interfaceList) {
String interfaceName = null;
if (interfaceList.get(circuitPackName) != null) {
interfaceName = interfaceList.get(circuitPackName);
}
return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
- .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
+ .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
}
private static List<ConnectionPorts> getDegreePorts(List<Degree> degrees) {
- return degrees.stream().filter(degree -> degree.getConnectionPorts() != null).flatMap(degree -> degree
- .getConnectionPorts().stream()).collect(Collectors.toList());
+ return degrees.stream().filter(degree -> degree.getConnectionPorts() != null)
+ .flatMap(degree -> degree.getConnectionPorts().stream()).collect(Collectors.toList());
}
private List<CpToDegree> getCpToDegreeList(List<Degree> degrees, String nodeId,
- Map<String, String> interfaceList) {
+ Map<String, String> interfaceList) {
List<CpToDegree> cpToDegreeList = new ArrayList<>();
for (Degree degree : degrees) {
if (degree.getCircuitPacks() != null) {
LOG.info("Inside CP to degree list");
cpToDegreeList.addAll(degree.getCircuitPacks().stream()
- .map(cp -> createCpToDegreeObject(cp.getCircuitPackName() ,
- degree.getDegreeNumber().toString(), nodeId ,interfaceList))
- .collect(Collectors.toList()));
+ .map(cp -> createCpToDegreeObject(cp.getCircuitPackName() ,
+ degree.getDegreeNumber().toString(), nodeId ,interfaceList))
+ .collect(Collectors.toList()));
}
}
return cpToDegreeList;
*
* @return Result true/false based on status of operation.
*/
- private boolean postPortMapping(Info deviceInfo, List<Mapping> portMapList, Integer nodeType, List<
- CpToDegree> cp2DegreeList) {
+ private boolean postPortMapping(Info deviceInfo, List<Mapping> portMapList, Integer nodeType,
+ List<CpToDegree> cp2DegreeList) {
NodesBuilder nodesBldr = new NodesBuilder();
nodesBldr.withKey(new NodesKey(deviceInfo.getNodeId())).setNodeId(deviceInfo.getNodeId());
nodesBldr.setNodeType(NodeTypes.forValue(nodeType));
}
return logicalConnectionPoint;
}
- LOG.warn("Unsupported port direction for port {} - {} - LogicalConnectionPoint is null", port, port
- .getPortDirection());
+ LOG.warn("Unsupported port direction for port {} - {} - LogicalConnectionPoint is null",
+ port, port.getPortDirection());
return null; // TODO return false or continue?
}
public void deleteMappingData(String nodeId) {
LOG.info("Deleting Mapping Data corresponding at node '{}'", nodeId);
WriteTransaction rw = this.dataBroker.newWriteOnlyTransaction();
- InstanceIdentifier<Nodes> nodesIID = InstanceIdentifier.create(Network.class).child(Nodes.class, new NodesKey(
- nodeId));
+ InstanceIdentifier<Nodes> nodesIID = InstanceIdentifier.create(Network.class)
+ .child(Nodes.class, new NodesKey(nodeId));
rw.delete(LogicalDatastoreType.CONFIGURATION, nodesIID);
try {
rw.submit().get(1, TimeUnit.SECONDS);
InstanceIdentifier<Ports> portIId = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
CircuitPacks.class, new CircuitPacksKey(oldMapping.getSupportingCircuitPackName())).child(Ports.class,
new PortsKey(oldMapping.getSupportingPort()));
- if (oldMapping != null && nodeId != null) {
+ if ((oldMapping != null) && (nodeId != null)) {
try {
Optional<Ports> portObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
LogicalDatastoreType.OPERATIONAL, portIId, Timeouts.DEVICE_READ_TIMEOUT,
LOG.error("Impossible to update mapping");
return false;
}
-
}
private Map<String, String> getEthInterfaceList(String nodeId) {
LOG.info("It is calling get ethernet interface");
Map<String, String> cpToInterfaceMap = new HashMap<>();
- InstanceIdentifier<Lldp> lldpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
- .child(Protocols.class).augmentation(Protocols1.class).child(Lldp.class);
- Optional<Lldp> lldpObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
- LogicalDatastoreType.OPERATIONAL, lldpIID, Timeouts.DEVICE_READ_TIMEOUT,
+ InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(Protocols.class);
+ Optional<Protocols> protocolObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+ LogicalDatastoreType.OPERATIONAL, protocolsIID, Timeouts.DEVICE_READ_TIMEOUT,
Timeouts.DEVICE_READ_TIMEOUT_UNIT);
- if (lldpObject.isPresent() && (lldpObject.get().getPortConfig() != null)) {
- for (PortConfig portConfig : lldpObject.get().getPortConfig()) {
+ if (!protocolObject.isPresent() || (protocolObject.get().augmentation(Protocols1.class) == null)) {
+ LOG.warn("LLDP subtree is missing : isolated openroadm device");
+ return cpToInterfaceMap;
+ }
+ List<PortConfig> portConfigList = protocolObject.get().augmentation(Protocols1.class).getLldp().getPortConfig();
+ if (!portConfigList.isEmpty()) {
+ for (PortConfig portConfig : portConfigList) {
if (portConfig.getAdminStatus().equals(PortConfig.AdminStatus.Txandrx)) {
InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
.child(Interface.class, new InterfaceKey(portConfig.getIfName()));
Optional<Interface> interfaceObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
LogicalDatastoreType.OPERATIONAL, interfaceIID, Timeouts.DEVICE_READ_TIMEOUT,
Timeouts.DEVICE_READ_TIMEOUT_UNIT);
- if (interfaceObject.isPresent() && (interfaceObject.get().getSupportingCircuitPackName() != null)) {
+ if (interfaceObject.isPresent()
+ && (interfaceObject.get().getSupportingCircuitPackName() != null)) {
String supportingCircuitPackName = interfaceObject.get().getSupportingCircuitPackName();
cpToInterfaceMap.put(supportingCircuitPackName, portConfig.getIfName());
- InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier.create(OrgOpenroadmDevice
- .class).child(CircuitPacks.class, new CircuitPacksKey(supportingCircuitPackName));
+ InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier
+ .create(OrgOpenroadmDevice.class).child(CircuitPacks.class,
+ new CircuitPacksKey(supportingCircuitPackName));
Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(
nodeId, LogicalDatastoreType.OPERATIONAL, circuitPacksIID, Timeouts
.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
- if (circuitPackObject.isPresent() && (circuitPackObject.get().getParentCircuitPack() != null)) {
- cpToInterfaceMap.put(circuitPackObject.get().getParentCircuitPack().getCircuitPackName() ,
- portConfig.getIfName());
+ if (circuitPackObject.isPresent()
+ && (circuitPackObject.get().getParentCircuitPack() != null)) {
+ cpToInterfaceMap.put(circuitPackObject.get().getParentCircuitPack()
+ .getCircuitPackName(), portConfig.getIfName());
}
}
+ } else {
+ LOG.warn("PortConfig Admi Status is not equal Txandrx");
}
}
} else {
import org.opendaylight.transportpce.networkmodel.util.ClliNetwork;
import org.opendaylight.transportpce.networkmodel.util.OpenRoadmNetwork;
import org.opendaylight.transportpce.networkmodel.util.OpenRoadmTopology;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.NetworkutilsService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.TransportpceNetworkutilsService;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.slf4j.Logger;
private final DataBroker dataBroker;
private final RpcProviderRegistry rpcProviderRegistry;
- private final NetworkutilsService networkutilsService;
+ private final TransportpceNetworkutilsService networkutilsService;
private final NetConfTopologyListener topologyListener;
private final OpenRoadmTopology openRoadmTopology;
private ListenerRegistration<NetConfTopologyListener> dataTreeChangeListenerRegistration;
- private BindingAwareBroker.RpcRegistration<NetworkutilsService> networkutilsServiceRpcRegistration;
+ private BindingAwareBroker.RpcRegistration<TransportpceNetworkutilsService> networkutilsServiceRpcRegistration;
public NetworkModelProvider(final DataBroker dataBroker, final RpcProviderRegistry rpcProviderRegistry,
- final NetworkutilsService networkutilsService, final NetConfTopologyListener topologyListener,
+ final TransportpceNetworkutilsService networkutilsService, final NetConfTopologyListener topologyListener,
OpenRoadmTopology openRoadmTopology) {
this.dataBroker = dataBroker;
this.rpcProviderRegistry = rpcProviderRegistry;
dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL,
InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), topologyListener);
networkutilsServiceRpcRegistration =
- rpcProviderRegistry.addRpcImplementation(NetworkutilsService.class, networkutilsService);
+ rpcProviderRegistry.addRpcImplementation(TransportpceNetworkutilsService.class, networkutilsService);
}
/**
import com.google.common.base.Optional;
import com.google.common.util.concurrent.ListenableFuture;
-
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;
import org.opendaylight.transportpce.common.NetworkUtils;
import org.opendaylight.transportpce.networkmodel.util.OpenRoadmTopology;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.DeleteLinkInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.DeleteLinkOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.DeleteLinkOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitRdmXpdrLinksInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitRdmXpdrLinksOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitRdmXpdrLinksOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitRoadmNodesInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitRoadmNodesOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitRoadmNodesOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitXpdrRdmLinksInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitXpdrRdmLinksOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitXpdrRdmLinksOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.TransportpceNetworkutilsService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.Network;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkId;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkKey;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.Network1;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.network.Link;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.network.LinkKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.DeleteLinkInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.DeleteLinkOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.DeleteLinkOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitRdmXpdrLinksInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitRdmXpdrLinksOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitRdmXpdrLinksOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitRoadmNodesInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitRoadmNodesOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitRoadmNodesOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitXpdrRdmLinksInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitXpdrRdmLinksOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitXpdrRdmLinksOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.NetworkutilsService;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class NetworkUtilsImpl implements NetworkutilsService {
+public class NetworkUtilsImpl implements TransportpceNetworkutilsService {
private static final Logger LOG = LoggerFactory.getLogger(NetworkUtilsImpl.class);
private final DataBroker dataBroker;
}
}
+ @Override
public ListenableFuture<RpcResult<InitRoadmNodesOutput>> initRoadmNodes(InitRoadmNodesInput input) {
boolean createRdmLinks = OrdLink.createRdm2RdmLinks(input,
this.openRoadmTopology,this.dataBroker);
package org.opendaylight.transportpce.networkmodel;
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;
import org.opendaylight.transportpce.common.NetworkUtils;
import org.opendaylight.transportpce.networkmodel.util.LinkIdUtil;
import org.opendaylight.transportpce.networkmodel.util.OpenRoadmTopology;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitRoadmNodesInput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Link1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Link1Builder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.link.OMSAttributesBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.network.Link;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.network.LinkBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.network.LinkKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitRoadmNodesInput;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.MountPoint;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
import org.opendaylight.transportpce.networkmodel.util.OpenRoadmTopology;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitRoadmNodesInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.Network;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegree;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev170929.Direction;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Protocols;
import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.NbrList;
import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.nbr.list.IfName;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitRoadmNodesInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.Network;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.NodesKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.CpToDegree;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
try (ReadOnlyTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
Optional<Nodes> nodesObject = readTx.read(LogicalDatastoreType.CONFIGURATION, nodesIID)
.get().toJavaUtil();
- if (nodesObject.isPresent() && nodesObject.get().getMapping() != null) {
+ if (nodesObject.isPresent() && (nodesObject.get().getMapping() != null)) {
List<Mapping> mappingList = nodesObject.get().getMapping();
mappingList = mappingList.stream().filter(mp -> mp.getLogicalConnectionPoint().contains("DEG"
+ degreeCounter)).collect(Collectors.toList());
try (ReadOnlyTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
Optional<Nodes> nodesObject = readTx.read(LogicalDatastoreType.CONFIGURATION, nodesIID)
.get().toJavaUtil();
- if (nodesObject.isPresent() && nodesObject.get().getCpToDegree() != null) {
+ if (nodesObject.isPresent() && (nodesObject.get().getCpToDegree() != null)) {
List<CpToDegree> cpToDeg = nodesObject.get().getCpToDegree();
Stream cpToDegStream = cpToDeg.stream().filter(cp -> cp.getInterfaceName() != null)
.filter(cp -> cp.getInterfaceName().equals(interfaceName));
if (cpToDegStream != null) {
Optional<CpToDegree> firstCpToDegree = cpToDegStream.findFirst();
- if (firstCpToDegree.isPresent() && firstCpToDegree != null) {
+ if (firstCpToDegree.isPresent() && (firstCpToDegree != null)) {
LOG.debug("Found and returning {}",firstCpToDegree.get().getDegreeNumber().intValue());
return firstCpToDegree.get().getDegreeNumber().intValue();
} else {
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.transportpce.common.NetworkUtils;
import org.opendaylight.transportpce.networkmodel.util.OpenRoadmTopology;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.links.input.grouping.LinksInput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Link1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Link1Builder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev170929.OpenroadmLinkType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.Network1;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.Network1Builder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.network.LinkBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.links.input.grouping.LinksInput;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.ServiceNodelist;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.service.nodelist.Nodelist;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.service.nodelist.nodelist.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.service.nodelist.nodelist.NodesBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev161014.AlarmNotification;
import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev161014.OrgOpenroadmAlarmListener;
import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev161014.alarm.ProbableCause;
import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev161014.resource.resource.resource.Service;
import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev161014.resource.resource.resource.Shelf;
import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev161014.resource.resource.resource.Srg;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.ServiceNodelist;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist.Nodelist;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist.nodelist.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist.nodelist.NodesBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.opendaylight.transportpce.networkmodel.util;
import java.text.MessageFormat;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.InitRoadmNodesInput;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.LinkId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.networkutils.rev170818.InitRoadmNodesInput;
public final class LinkIdUtil {
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;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossCurrentInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossCurrentOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerResetInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerResetOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
/**
* The Class OlmPowerServiceRpcImpl.
*/
-public class OlmPowerServiceRpcImpl implements OlmService {
+public class OlmPowerServiceRpcImpl implements TransportpceOlmService {
private final OlmPowerService olmPowerService;
public OlmPowerServiceRpcImpl(OlmPowerService olmPowerService) {
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.transportpce.olm.service.OlmPowerService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(OlmProvider.class);
private final RpcProviderRegistry rpcProviderRegistry;
private final OlmPowerService olmPowerService;
- private RpcRegistration<OlmService> olmRPCRegistration;
+ private RpcRegistration<TransportpceOlmService> olmRPCRegistration;
/**
* Instantiates a new olm provider.
public void init() {
LOG.info("OlmProvider Session Initiated");
// Initializing Notification module
- olmRPCRegistration = rpcProviderRegistry.addRpcImplementation(OlmService.class, new OlmPowerServiceRpcImpl(
- this.olmPowerService));
+ olmRPCRegistration = rpcProviderRegistry.addRpcImplementation(TransportpceOlmService.class,
+ new OlmPowerServiceRpcImpl(this.olmPowerService));
}
/**
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
import org.opendaylight.transportpce.olm.util.OlmUtils;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.NodeTypes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.OpticalControlMode;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.PowerDBm;
import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1Builder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.och.container.OchBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014.Interface1;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.MappingKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.opendaylight.transportpce.olm.service;
-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;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossCurrentOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerResetInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerResetOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutput;
public interface OlmPowerService {
import org.opendaylight.transportpce.olm.power.PowerMgmt;
import org.opendaylight.transportpce.olm.util.OlmUtils;
import org.opendaylight.transportpce.olm.util.OtsPmHolder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.calculate.spanloss.base.output.Spans;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.calculate.spanloss.base.output.SpansBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output.Measurements;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.RatioDB;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.LinkId;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.Network1;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.network.Link;
-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.CalculateSpanlossBaseOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossCurrentInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossCurrentOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossCurrentOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerResetInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerResetOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.calculate.spanloss.base.output.Spans;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.calculate.spanloss.base.output.SpansBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.Measurements;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
import org.slf4j.Logger;
private final PortMapping portMapping;
public OlmPowerServiceImpl(DataBroker dataBroker, PowerMgmt powerMgmt,
- DeviceTransactionManager deviceTransactionManager, PortMapping portMapping) {
+ DeviceTransactionManager deviceTransactionManager, PortMapping portMapping) {
this.dataBroker = dataBroker;
this.powerMgmt = powerMgmt;
this.portMapping = portMapping;
LOG.info("close ...");
}
+
@Override
public GetPmOutput getPm(GetPmInput pmInput) {
GetPmOutputBuilder pmOutputBuilder = OlmUtils.pmFetch(pmInput, this.deviceTransactionManager);
@Override
public ServicePowerTurndownOutput servicePowerTurndown(
- ServicePowerTurndownInput powerTurndownInput) {
+ ServicePowerTurndownInput powerTurndownInput) {
ServicePowerTurndownOutputBuilder powerTurnDownOutput = new ServicePowerTurndownOutputBuilder();
// TODO add flag or return failure instead of string
public CalculateSpanlossBaseOutput calculateSpanlossBase(CalculateSpanlossBaseInput spanlossBaseInput) {
LOG.info("CalculateSpanlossBase Request received for source type {}", spanlossBaseInput.getSrcType());
-
List<Link> networkLinks = getNetworkLinks();
if (networkLinks.isEmpty()) {
LOG.warn("Failed to get links form {} topology.", NetworkUtils.OVERLAY_NETWORK_ID);
return new CalculateSpanlossBaseOutputBuilder().setResult(FAILED).build();
}
- if (!CalculateSpanlossBaseInput.SrcType.All.equals(spanlossBaseInput.getSrcType())) {
+ if (! CalculateSpanlossBaseInput.SrcType.All.equals(spanlossBaseInput.getSrcType())) {
networkLinks = networkLinks.stream()
- .filter(link -> link.getLinkId().equals(spanlossBaseInput.getLinkId()))
- .collect(Collectors.toList());
+ .filter(link -> link.getLinkId().equals(spanlossBaseInput.getLinkId()))
+ .collect(Collectors.toList());
}
List<Link> roadmLinks = new ArrayList<>();
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);
+ link.getLinkId().getValue(), NetworkUtils.OVERLAY_NETWORK_ID);
continue;
}
if (OpenroadmLinkType.ROADMTOROADM.equals(roadmLinkAugmentation.getLinkType())) {
+ // Only calculate spanloss for Roadm-to-Roadm links
roadmLinks.add(link);
}
}
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);
+ link.getLinkId().getValue(), NetworkUtils.OVERLAY_NETWORK_ID);
continue;
}
if (OpenroadmLinkType.ROADMTOROADM.equals(roadmLinkAugmentation.getLinkType())) {
NetworkKey overlayTopologyKey = new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID));
InstanceIdentifier<Network1> networkIID = InstanceIdentifier.builder(Network.class, overlayTopologyKey)
- .augmentation(Network1.class)
- .build();
+ .augmentation(Network1.class)
+ .build();
Optional<Network1> networkOptional;
try (ReadOnlyTransaction rtx = this.dataBroker.newReadOnlyTransaction()) {
- // TODO change to constant from Timeouts class when it will be
- // merged.
+ //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();
+ TimeUnit.MILLISECONDS).toJavaUtil();
} catch (InterruptedException | ExecutionException | TimeoutException e) {
LOG.warn("Read of {} topology failed", NetworkUtils.OVERLAY_NETWORK_ID);
return Collections.emptyList();
}
- if (!networkOptional.isPresent()) {
+ if (! networkOptional.isPresent()) {
LOG.warn("Network augmentation with links data is not present in {} topology.",
- NetworkUtils.OVERLAY_NETWORK_ID);
+ NetworkUtils.OVERLAY_NETWORK_ID);
return Collections.emptyList();
}
}
/**
- * This method retrieves OTS PM from current PM list by nodeId and TPId:
- * Steps:
+ * This method retrieves OTS PM from current PM list by nodeId and TPId: Steps:
*
* <p>
- * 1. Get OTS interface name from port mapping by TPId 2. Call getPm RPC to
- * get OTS PM
+ * 1. Get OTS interface name from port mapping by TPId 2. Call getPm RPC to get OTS PM
*
* <p>
*
- * @param nodeId
- * Node-id of the NE.
- * @param tpID
- * Termination point Name.
- * @param pmName
- * PM name which need to be retrieved
+ * @param nodeId Node-id of the NE.
+ * @param tpID Termination point Name.
+ * @param pmName PM name which need to be retrieved
* @return reference to OtsPmHolder
*/
private OtsPmHolder getPmMeasurements(String nodeId, String tpID, String pmName) {
return null;
}
GetPmInput getPmInput = new GetPmInputBuilder().setNodeId(realNodeId)
- .setResourceType(ResourceTypeEnum.Interface).setGranularity(PmGranularity._15min)
- .setResourceIdentifier(
- new ResourceIdentifierBuilder().setResourceName(mapping.getSupportingOts()).build())
- .build();
+ .setResourceType(ResourceTypeEnum.Interface).setGranularity(PmGranularity._15min)
+ .setResourceIdentifier(
+ new ResourceIdentifierBuilder().setResourceName(mapping.getSupportingOts()).build())
+ .build();
GetPmOutput otsPmOutput = getPm(getPmInput);
if (otsPmOutput == null) {
for (Measurements measurement : otsPmOutput.getMeasurements()) {
if (pmName.equals(measurement.getPmparameterName())) {
return new OtsPmHolder(pmName, Double.parseDouble(measurement.getPmparameterValue()),
- mapping.getSupportingOts());
+ mapping.getSupportingOts());
}
}
} catch (NumberFormatException e) {
* <p>
* 2. Set spanloss
*
- * @param nodeId
- * nodeId of NE on which spanloss need to be updated
- * @param interfaceName
- * OTS interface for NE on which spanloss is cacluated
- * @param spanLoss
- * calculated spanloss value
- * @param direction
- * for which spanloss is calculated.It can be either Tx or Rx
+ * @param nodeId nodeId of NE on which spanloss need to be updated
+ * @param interfaceName OTS interface for NE on which spanloss is cacluated
+ * @param spanLoss calculated spanloss value
+ * @param direction for which spanloss is calculated.It can be either Tx or Rx
* @return true/false
*/
private boolean setSpanLoss(String nodeId, String interfaceName, BigDecimal spanLoss, String direction) {
String realNodeId = getRealNodeId(nodeId);
+ LOG.info("Setting Spanloss in device for {}, InterfaceName: {}", realNodeId, interfaceName);
switch (direction) {
case "TX":
LOG.info("Setting 'span-loss-transmit' in device: {}, Interface: {}", realNodeId, interfaceName);
break;
}
InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
- .child(Interface.class, new InterfaceKey(interfaceName));
+ .child(Interface.class, new InterfaceKey(interfaceName));
com.google.common.base.Optional<Interface> interfaceObject;
try {
Future<Optional<DeviceTransaction>> deviceTxFuture =
- this.deviceTransactionManager.getDeviceTransaction(realNodeId);
+ this.deviceTransactionManager.getDeviceTransaction(realNodeId);
java.util.Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
DeviceTransaction deviceTx;
if (deviceTxOpt.isPresent()) {
interfaceBuilder.addAugmentation(Interface1.class, intf1Builder.setOts(otsBuilder.build()).build());
deviceTx.put(LogicalDatastoreType.CONFIGURATION, interfacesIID, interfaceBuilder.build());
ListenableFuture<Void> submit =
- deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+ deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
submit.get();
LOG.info("Spanloss Value update completed successfully");
return true;
private String getRealNodeId(String mappedNodeId) {
KeyedInstanceIdentifier<Node, NodeKey> mappedNodeII =
- InstanceIdentifiers.OVERLAY_NETWORK_II.child(Node.class, new NodeKey(new NodeId(mappedNodeId)));
+ InstanceIdentifiers.OVERLAY_NETWORK_II.child(Node.class, new NodeKey(new NodeId(mappedNodeId)));
com.google.common.base.Optional<Node> realNode;
try (ReadOnlyTransaction readOnlyTransaction = this.dataBroker.newReadOnlyTransaction()) {
realNode = readOnlyTransaction.read(LogicalDatastoreType.CONFIGURATION, mappedNodeII).get();
}
if (!realNode.isPresent() || (realNode.get().getSupportingNode() == null)) {
throw new IllegalArgumentException(
- String.format("Could not find node %s, or supporting node is not present", mappedNodeId));
+ 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)
- && NetworkUtils.UNDERLAY_NETWORK_ID.equals(node.getNetworkRef().getValue())
- && (node.getNodeRef() != null) && !Strings.isNullOrEmpty(node.getNodeRef().getValue()))
- .collect(Collectors.toList());
+ .filter(node -> (node.getNetworkRef() != null)
+ && NetworkUtils.UNDERLAY_NETWORK_ID.equals(node.getNetworkRef().getValue())
+ && (node.getNodeRef() != null) && !Strings.isNullOrEmpty(node.getNodeRef().getValue()))
+ .collect(Collectors.toList());
if (collect.isEmpty() || (collect.size() > 1)) {
throw new IllegalArgumentException(String.format("Invalid support node count [%d] was found for node %s",
- collect.size(), mappedNodeId));
+ collect.size(), mappedNodeId));
}
return collect.iterator().next().getNodeRef().getValue();
}
package org.opendaylight.transportpce.olm.util;
import com.google.common.base.Strings;
-
import java.util.ArrayList;
import java.util.List;
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.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.transportpce.common.Timeouts;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output.MeasurementsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.Network;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev161014.CurrentPmlist;
import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev161014.current.pm.Measurements;
import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev161014.currentpmlist.CurrentPm;
import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceTypeEnum;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.get.pm.input.ResourceIdentifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.network.topology.topology.topology.types.TopologyNetconf;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.MeasurementsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.Network;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.NodesKey;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
.getDataFromDevice(input.getNodeId(), LogicalDatastoreType.OPERATIONAL, currentPmsIID,
Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
if (currentPmList.isPresent()) {
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output
- .Measurements> measurements = extractWantedMeasurements(currentPmList.get(),
+ List<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output
+ .Measurements> measurements = extractWantedMeasurements(currentPmList.get(),
input.getResourceType(), input.getResourceIdentifier(), input.getGranularity());
if (measurements.isEmpty()) {
LOG.error("No Matching PM data found for node: {}, " + "resource type: {}, resource name: {}",
}
}
- private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm
- .output.Measurements> extractWantedMeasurements(CurrentPmlist currentPmList,
+ private static List<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output
+ .Measurements> extractWantedMeasurements(CurrentPmlist currentPmList,
ResourceTypeEnum wantedResourceType, ResourceIdentifier wantedResourceIdentifier,
PmGranularity wantedGranularity) {
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm
- .output.Measurements> measurements = new ArrayList<>();
+ List<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output
+ .Measurements> measurements = new ArrayList<>();
for (CurrentPm pm : currentPmList.getCurrentPm()) {
ResourceTypeEnum currentResourceType = pm.getResource().getResourceType().getType();
if (currentResourceType.equals(wantedResourceType)) {
return measurements;
}
- private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm
- .output.Measurements> extractMeasurements(List<Measurements> measurementsFromDevice) {
- List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.Measurements>
- extractedMeasurements = new ArrayList<>();
+ private static List<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output
+ .Measurements> extractMeasurements(List<Measurements> measurementsFromDevice) {
+ List<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output
+ .Measurements> extractedMeasurements = new ArrayList<>();
for (Measurements measure : measurementsFromDevice) {
MeasurementsBuilder measurement = new MeasurementsBuilder();
if (!measure.getMeasurement().getPmParameterName().getType().equals(PmNamesEnum.VendorExtension)) {
PmGranularity wantedGranularity) {
boolean identifiersAreEqual = compareResourceIdentifiers(resource, wantedResourceType,
wantedResourceIdentifier);
- return identifiersAreEqual && granularity != null && granularity.equals(wantedGranularity);
+ return identifiersAreEqual && (granularity != null) && granularity.equals(wantedGranularity);
}
private static boolean compareResourceIdentifiers(Resource resource, ResourceTypeEnum wantedResourceType,
.map(port -> {
String portName = port.getPortName();
String circuitPackName = port.getCircuitPackName();
- return portName != null
- && circuitPackName != null
+ return (portName != null)
+ && (circuitPackName != null)
&& portName.equals(wantedResourceIdentifier.getResourceName())
&& circuitPackName.equals(wantedResourceIdentifier.getCircuitPackName());
})
+++ /dev/null
-/*
- * Copyright © 2017 AT&T and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.transportpce.olm.util;
-/**
- * The Class RoadmLinks.
- */
-public class RoadmLinks {
-
- /** The src node id. */
- private String srcNodeId;
-
- /** The src tp id. */
- private String srcTpId;
-
- /** The dest node id. */
- private String destNodeId;
-
- /** The dest tpid. */
- private String destTpid;
-
- /**
- * Gets the src node id.
- *
- * @return the src node id
- */
- public String getSrcNodeId() {
- return srcNodeId;
- }
-
- /**
- * Sets the src node id.
- *
- * @param srcNodeId the new src node id
- */
- public void setSrcNodeId(String srcNodeId) {
- this.srcNodeId = srcNodeId;
- }
-
- /**
- * Gets the src tp id.
- *
- * @return the src tp id
- */
- public String getSrcTpId() {
- return srcTpId;
- }
-
- /**
- * Sets the src tp id.
- *
- * @param srcTpId the new src tp id
- */
- public void setSrcTpId(String srcTpId) {
- this.srcTpId = srcTpId;
- }
-
- /**
- * Gets the dest node id.
- *
- * @return the dest node id
- */
- public String getDestNodeId() {
- return destNodeId;
- }
-
- /**
- * Sets the dest node id.
- *
- * @param destNodeId the new dest node id
- */
- public void setDestNodeId(String destNodeId) {
- this.destNodeId = destNodeId;
- }
-
- /**
- * Gets the dest tpid.
- *
- * @return the dest tpid
- */
- public String getDestTpid() {
- return destTpid;
- }
-
- /**
- * Sets the dest tpid.
- *
- * @param destTpid the new dest tpid
- */
- public void setDestTpid(String destTpid) {
- this.destTpid = destTpid;
- }
-
-}
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.transportpce.common.NetworkUtils;
import org.opendaylight.transportpce.common.ResponseCodes;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev170929.OpenroadmNodeType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.Network;
*/
package org.opendaylight.transportpce.pce;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
-
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.RoutingConstraintsSp;
-
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.opendaylight.transportpce.pce;
import com.google.common.base.Optional;
-
import java.util.ArrayList;
import java.util.List;
//import java.util.Optional;
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;
import org.opendaylight.transportpce.common.Timeouts;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestInput;
-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.pce.resource.resource.resource.Node;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.node.NodeIdentifier;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.RoutingConstraintsSp.PceMetric;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.CoRoutingOrGeneral;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.CoRouting;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.General;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.general.Diversity;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.general.Exclude;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.general.Latency;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.HardConstraints;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.SoftConstraints;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.path.PathDescription;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServicePathList;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePaths;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.Node;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp.PceMetric;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.CoRoutingOrGeneral;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.CoRouting;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.General;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.Diversity;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.Exclude;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.Latency;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.HardConstraints;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.SoftConstraints;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
return false;
}
return aToZ.getResource().getResource() instanceof Node;
- }).filter(aToZ -> {
+ }).map(aToZ -> {
Node node = (Node) aToZ.getResource().getResource();
- if (node.getNodeIdentifier() == null) {
+ if (node.getNodeId() == null) {
LOG.warn("Node in AToZ node {} contains null! Skipping this node!", aToZ.getId());
- return false;
+ return null;
}
- return true;
- }).map(aToZ -> {
- NodeIdentifier node = ((Node) aToZ.getResource().getResource()).getNodeIdentifier();
return node.getNodeId().toString();
}).collect(Collectors.toList());
}
private Optional<PathDescription> getPathDescriptionFromDatastore(String serviceName) {
- InstanceIdentifier<PathDescription> pathDescriptionIID = InstanceIdentifier.create(ServicePathList.class)
- .child(ServicePaths.class, new ServicePathsKey(serviceName)).child(PathDescription.class);
+ Optional<PathDescription> result = Optional.absent();
+ InstanceIdentifier<ServicePaths> pathDescriptionIID = InstanceIdentifier.create(ServicePathList.class)
+ .child(ServicePaths.class, new ServicePathsKey(serviceName));
ReadOnlyTransaction pathDescReadTx = this.dataBroker.newReadOnlyTransaction();
try {
LOG.info("PCE diversity constraints: Getting path description for service {}", serviceName);
- return pathDescReadTx.read(LogicalDatastoreType.CONFIGURATION, pathDescriptionIID)
- .get(Timeouts.DATASTORE_READ, TimeUnit.MILLISECONDS);
+ ServicePaths servicePaths = pathDescReadTx.read(LogicalDatastoreType.CONFIGURATION, pathDescriptionIID)
+ .get(Timeouts.DATASTORE_READ, TimeUnit.MILLISECONDS).get();
+ if (servicePaths != null) {
+ PathDescription path = servicePaths.getPathDescription();
+ if (path != null) {
+ result = Optional.of(path);
+ }
+ }
+// return pathDescReadTx.read(LogicalDatastoreType.CONFIGURATION, pathDescriptionIID)
+// .get(Timeouts.DATASTORE_READ, TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
LOG.warn(
"PCE diversity constraints: Exception while getting path description from datastore {} for service {}!",
pathDescriptionIID,serviceName, e);
- return Optional.absent();
+ return result;
}
+ return result;
}
private void readCoRoutingContrains(CoRouting tmpcoRouting, PceConstraints constraints) {
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;
-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;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToABuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToAKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.Resource;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.ResourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.LinkBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.NodeBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPointBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.link.LinkIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.node.NodeIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.termination.point.TerminationPointIdentifierBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToABuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToAKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.Resource;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.ResourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.LinkBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.NodeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.TerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.TerminationPointBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev150608.LinkId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
String tpName = path.get(0).getClient();
String xname = path.get(0).getSourceId().getValue();
TerminationPoint stp = new TerminationPointBuilder()
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
- .setNodeId(xname).setTpId(tpName).build())
+ .setTpId(tpName).setTpNodeId(xname)
.build();
AToZKey clientKey = new AToZKey(index.toString());
String srcName = pcelink.getSourceId().getValue();
// Nodes
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce
.resource.resource.resource.Node sourceNode = new NodeBuilder()
- .setNodeIdentifier(new NodeIdentifierBuilder().setNodeId(srcName).build())
+ .setNodeId(srcName)
.build();
// Source Resource
// source TP
tpName = pcelink.getSourceTP().toString();
stp = new TerminationPointBuilder()
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
- .setNodeId(srcName).setTpId(tpName).build())
+ .setTpNodeId(srcName).setTpId(tpName)
.build();
// Resource
String linkName = pcelink.getLinkId().getValue();
// Link
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce
.resource.resource.resource.Link atozLink = new LinkBuilder()
- .setLinkIdentifier(new LinkIdentifierBuilder().setLinkId(linkName).build())
+ .setLinkId(linkName)
.build();
// Link Resource
// target TP
tpName = pcelink.getDestTP().toString();
TerminationPoint dtp = new TerminationPointBuilder()
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
- .setNodeId(destName).setTpId(tpName).build())
+ .setTpNodeId(destName).setTpId(tpName)
.build();
// Resource
index++;
etoeList.add(ttpResource);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce
.resource.resource.resource.Node targetNode = new NodeBuilder()
- .setNodeIdentifier(new NodeIdentifierBuilder().setNodeId(destName).build())
+ .setNodeId(destName)
.build();
// Target Resource
tpName = lastLink.getClient();
xname = lastLink.getDestId().getValue();
stp = new TerminationPointBuilder()
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
- .setNodeId(xname).setTpId(tpName).build())
+ .setTpNodeId(xname).setTpId(tpName)
.build();
String tpName = pcelink.getClient();
String xname = pcelink.getSourceId().getValue();
TerminationPoint stp = new TerminationPointBuilder()
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
- .setNodeId(xname).setTpId(tpName).build())
+ .setTpNodeId(xname).setTpId(tpName)
.build();
ZToAKey clientKey = new ZToAKey(index.toString());
// Nodes
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce
.resource.resource.resource.Node sourceNode = new NodeBuilder()
- .setNodeIdentifier(new NodeIdentifierBuilder().setNodeId(srcName).build()).build();
-
+ .setNodeId(srcName).build();
// Source Resource
// source TP
tpName = pcelink.getSourceTP().toString();
stp = new TerminationPointBuilder()
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
- .setNodeId(srcName).setTpId(tpName).build())
+ .setTpNodeId(srcName).setTpId(tpName)
.build();
// Resource
String linkName = pcelink.getLinkId().getValue();
// Link
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce
.resource.resource.resource.Link ztoaLink = new LinkBuilder()
- .setLinkIdentifier(new LinkIdentifierBuilder().setLinkId(linkName).build()).build();
+ .setLinkId(linkName).build();
// Link Resource
ZToAKey linkKey = new ZToAKey(index.toString());
// target TP
tpName = pcelink.getDestTP().toString();
TerminationPoint ttp = new TerminationPointBuilder()
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
- .setNodeId(destName).setTpId(tpName).build())
- .build();
+ .setTpNodeId(destName).setTpId(tpName).build();
// Resource
ZToAKey destTPKey = new ZToAKey(index.toString());
etoelist.add(ttpResource);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce
.resource.resource.resource.Node targetNode = new NodeBuilder()
- .setNodeIdentifier(new NodeIdentifierBuilder().setNodeId(destName).build()).build();
+ .setNodeId(destName).build();
// Target Resource
ZToAKey targetKey = new ZToAKey(index.toString());
Resource nodeResource3 = new ResourceBuilder().setResource(targetNode).build();
tpName = lastLink.getClient();
xname = lastLink.getDestId().getValue();
stp = new TerminationPointBuilder()
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
- .setNodeId(xname).setTpId(tpName).build())
- .build();
+ .setTpNodeId(xname).setTpId(tpName).build();
index++;
package org.opendaylight.transportpce.pce;
import org.opendaylight.transportpce.common.ResponseCodes;
-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.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.transportpce.pce.PceResult.LocalCause;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestInput;
-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.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.RoutingConstraintsSp.PceMetric;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.response.parameters.sp.response.parameters.PathDescriptionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.service.path.rpc.result.PathDescriptionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp.PceMetric;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.transportpce.pce.service.PathComputationService;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PceService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.TransportpcePceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private final RpcProviderRegistry rpcRegistry;
private final PathComputationService pathComputationService;
- private BindingAwareBroker.RpcRegistration<PceService> rpcRegistration;
+ private BindingAwareBroker.RpcRegistration<TransportpcePceService> rpcRegistration;
public PceProvider(RpcProviderRegistry rpcProviderRegistry, PathComputationService pathComputationService) {
this.rpcRegistry = rpcProviderRegistry;
public void init() {
LOG.info("PceProvider Session Initiated");
final PceServiceRPCImpl consumer = new PceServiceRPCImpl(pathComputationService);
- rpcRegistration = rpcRegistry.addRpcImplementation(PceService.class, consumer);
+ rpcRegistration = rpcRegistry.addRpcImplementation(TransportpcePceService.class, consumer);
}
/*
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;
-/*
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.service.path.rpc.result.PathDescriptionBuilder;
-///// check well PathDescriptionBuilder import
-//---------------------------------------------
-*/
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.TransportpcePceService;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
/**
* PceService implementation.
*/
-public class PceServiceRPCImpl implements PceService {
+public class PceServiceRPCImpl implements TransportpcePceService {
private static final Logger LOG = LoggerFactory.getLogger(PceServiceRPCImpl.class);
*/
package org.opendaylight.transportpce.pce.service;
-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.rev171017.CancelResourceReserveInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
/**
* Path Computation Service.
import org.opendaylight.transportpce.pce.PceComplianceCheck;
import org.opendaylight.transportpce.pce.PceComplianceCheckResult;
import org.opendaylight.transportpce.pce.PceSendingPceRPCs;
-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.CancelResourceReserveOutputBuilder;
-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.PathComputationRequestOutputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.ServicePathRpcResult;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.ServicePathRpcResultBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.service.path.rpc.result.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.ServicePathRpcResult;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.ServicePathRpcResultBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.service.path.rpc.result.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.service.path.rpc.result.PathDescriptionBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
-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.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.RpcStatusEx;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.ServicePathNotificationTypes;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.response.parameters.sp.ResponseParametersBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.response.parameters.sp.response.parameters.PathDescriptionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.RpcStatusEx;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.ServicePathNotificationTypes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.response.parameters.sp.ResponseParametersBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
PathDescriptionBuilder path = null;
path = sendingPCE.getPathDescription();
+
LOG.info("PCE response: {} {}", message, responseCode);
if ((sendingPCE.getSuccess() == false) || (path == null)) {
configurationResponseCommon
.setStatus(RpcStatusEx.Successful)
.setStatusMessage(message);
PathDescription pathDescription = new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce
- .pce.rev170426.service.path.rpc.result.PathDescriptionBuilder()
+ .pce.rev171017.service.path.rpc.result.PathDescriptionBuilder()
.setAToZDirection(path.getAToZDirection())
.setZToADirection(path.getZToADirection())
.build();
}
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
- .rev170426.response.parameters.sp.response.parameters.PathDescription pathDescription1
+ .rev171016.response.parameters.sp.response.parameters.PathDescription pathDescription1
= new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
- .rev170426.response.parameters.sp.response.parameters.PathDescriptionBuilder()
+ .rev171016.response.parameters.sp.response.parameters.PathDescriptionBuilder()
.setAToZDirection(path.getAToZDirection())
.setZToADirection(path.getZToADirection())
.build();
//debug prints
AToZDirection atoz = pathDescription.getAToZDirection();
- if (atoz != null && atoz.getAToZ() != null) {
+ if ((atoz != null) && (atoz.getAToZ() != null)) {
LOG.info("Impl AtoZ Notification: [{}] elements in description", atoz.getAToZ().size());
for (int i = 0; i < atoz.getAToZ().size(); i++) {
LOG.info("Impl AtoZ Notification: [{}] {}", i, atoz.getAToZ().get(i));
}
}
ZToADirection ztoa = pathDescription.getZToADirection();
- if (ztoa != null && ztoa.getZToA() != null) {
+ if ((ztoa != null) && (ztoa.getZToA() != null)) {
LOG.info("Impl ZtoA Notification: [{}] elements in description", ztoa.getZToA().size());
for (int i = 0; i < ztoa.getZToA().size(); i++) {
LOG.info("Impl ZtoA Notification: [{}] {}", i, ztoa.getZToA().get(i));
import java.util.Arrays;
import java.util.Collection;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
import org.opendaylight.transportpce.renderer.NetworkModelWavelengthServiceImpl;
import org.opendaylight.transportpce.test.AbstractTest;
-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.rev171017.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
PceTestUtils.checkConfigurationResponse(output, expectedOutput);
if (ResponseCodes.RESPONSE_OK.equals(output.getConfigurationResponseCommon().getResponseCode())) {
- networkModelWavelengthService.useWavelengths(output.getResponseParameters().getPathDescription());
+ //networkModelWavelengthService.useWavelengths(output.getResponseParameters().getPathDescription());
PceTestUtils.checkCalculatedPath(output, expectedOutput);
}
}
import java.util.Arrays;
import java.util.Collection;
-
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
import org.opendaylight.transportpce.renderer.NetworkModelWavelengthServiceImpl;
import org.opendaylight.transportpce.test.AbstractTest;
-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.rev171017.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.opendaylight.transportpce.pce.utils;
import java.util.Arrays;
-
import org.opendaylight.transportpce.common.ResponseCodes;
-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.PathComputationRequestInputBuilder;
-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.PathComputationRequestOutputBuilder;
-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;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.path.computation.request.input.ServiceZEnd;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.path.computation.request.input.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.path.computation.request.input.ServiceAEnd;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.path.computation.request.input.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.path.computation.request.input.ServiceZEnd;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.path.computation.request.input.ServiceZEndBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.ConnectionType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.ServiceFormat;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommon;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.port.PortBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInputBuilder;
-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;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.RoutingConstraintsSp;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.GeneralBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.general.DiversityBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.general.ExcludeBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.diversity.existing.service.contraints.sp.ExistingServiceApplicability;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.diversity.existing.service.contraints.sp.ExistingServiceApplicabilityBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.HardConstraintsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.SoftConstraintsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.response.parameters.sp.ResponseParameters;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.response.parameters.sp.ResponseParametersBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.response.parameters.sp.response.parameters.PathDescription;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.response.parameters.sp.response.parameters.PathDescriptionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.RxDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.TxDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.handler.header.ServiceHandlerHeader;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.handler.header.ServiceHandlerHeaderBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp.PceMetric;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.GeneralBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.DiversityBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.ExcludeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.diversity.existing.service.contraints.sp.ExistingServiceApplicability;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.diversity.existing.service.contraints.sp.ExistingServiceApplicabilityBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.HardConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.SoftConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.response.parameters.sp.ResponseParameters;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.response.parameters.sp.ResponseParametersBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.response.parameters.sp.response.parameters.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.response.parameters.sp.response.parameters.PathDescriptionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.RxDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.TxDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.handler.header.ServiceHandlerHeader;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.handler.header.ServiceHandlerHeaderBuilder;
public final class PceTestData {
PathComputationRequestInput input = new PathComputationRequestInputBuilder()
.setServiceName("service1")
.setResourceReserve(true)
- .setPceMetric(RoutingConstraintsSp.PceMetric.HopCount)
+ .setPceMetric(PceMetric.HopCount)
.setLocallyProtectedLinks(true)
.setServiceHandlerHeader(serviceHandlerHeader)
.setServiceAEnd(serviceAEnd)
.setCustomerCode(Arrays.asList("Some customer-code"))
.setCoRoutingOrGeneral(new CoRoutingBuilder()
.setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
+ .rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
.setExistingService(Arrays.asList("Some existing-service"))
.build())
.build())
.setCustomerCode(Arrays.asList("Some customer-code"))
.setCoRoutingOrGeneral(new CoRoutingBuilder()
.setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
+ .rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
.setExistingService(Arrays.asList("Some existing-service"))
.build())
.build())
.setServiceHandlerHeader(serviceHandlerHeader)
.setServiceName("service 1")
.setResourceReserve(true)
- .setPceMetric(RoutingConstraintsSp.PceMetric.HopCount)
+ .setPceMetric(PceMetric.HopCount)
.setServiceAEnd(serviceAEnd)
.setServiceZEnd(serviceZEnd)
.build();
.setServiceHandlerHeader(serviceHandlerHeader)
.setServiceName("service 1")
.setResourceReserve(true)
- .setPceMetric(RoutingConstraintsSp.PceMetric.HopCount)
+ .setPceMetric(PceMetric.HopCount)
.setServiceAEnd(serviceAEnd)
.setServiceZEnd(serviceZEnd)
.setHardConstraints(new HardConstraintsBuilder()
.setServiceHandlerHeader(serviceHandlerHeader)
.setServiceName("service 1")
.setResourceReserve(true)
- .setPceMetric(RoutingConstraintsSp.PceMetric.HopCount)
+ .setPceMetric(PceMetric.HopCount)
.setServiceAEnd(serviceAEnd)
.setServiceZEnd(serviceZEnd)
.setHardConstraints(new HardConstraintsBuilder()
.setServiceHandlerHeader(serviceHandlerHeader)
.setServiceName("service 1")
.setResourceReserve(true)
- .setPceMetric(RoutingConstraintsSp.PceMetric.HopCount)
+ .setPceMetric(PceMetric.HopCount)
.setServiceAEnd(serviceAEnd)
.setServiceZEnd(serviceZEnd)
.build();
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
-
import org.junit.Assert;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.transportpce.binding.converter.api.DataObjectConverter;
import org.opendaylight.transportpce.common.NetworkUtils;
import org.opendaylight.transportpce.test.common.DataStoreContext;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
-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.pce.resource.resource.resource.Node;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.node.NodeIdentifier;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.Node;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.Network;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkId;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkKey;
return false;
}
return aToZ.getResource().getResource() instanceof Node;
- }).filter(aToZ -> {
+ }).map(aToZ -> {
Node node = (Node) aToZ.getResource().getResource();
- if (node.getNodeIdentifier() == null) {
+ if (node.getNodeId() == null) {
LOG.warn("Node in AToZ node {} contains null! Skipping this node!", aToZ.getId());
- return false;
+ return null;
}
- return true;
- }).map(aToZ -> {
- NodeIdentifier node = ((Node) aToZ.getResource().getResource()).getNodeIdentifier();
return node.getNodeId().toString();
}).collect(Collectors.toList());
}
import java.util.Map;
import java.util.TreeMap;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommon;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceDeleteInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.PathDescription;
-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.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.TerminationPoint;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.Nodes;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.NodesBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.NodesKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInputBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
}
public static ListenableFuture<RpcResult<ServiceImplementationRequestOutput>>
- createRpcResponse(ServiceImplementationRequestOutput payload) {
+ createServiceImplementationRpcResponse(ServiceImplementationRequestOutput payload) {
+ return RpcResultBuilder.success(payload).buildFuture();
+ }
+
+ public static ListenableFuture<RpcResult<ServiceDeleteOutput>>
+ createServiceDeleteRpcResponse(ServiceDeleteOutput payload) {
return RpcResultBuilder.success(payload).buildFuture();
}
try {
if (TERMINATION_POINT.equals(resourceType)) {
tp = (TerminationPoint) pathDesObj.getResource().getResource();
- LOG.info(" TP is {} {}", tp.getTerminationPointIdentifier().getTpId(),
- tp.getTerminationPointIdentifier().getNodeId());
- tpID = tp.getTerminationPointIdentifier().getTpId();
- nodeID = tp.getTerminationPointIdentifier().getNodeId();
+ LOG.info(" TP is {} {}", tp.getTpId(),
+ tp.getTpNodeId());
+ tpID = tp.getTpId();
+ nodeID = tp.getTpNodeId();
sortId = pathDesObj.getId();
//TODO: do not rely on ID to be in certain format
try {
if (TERMINATION_POINT.equals(resourceType)) {
tp = (TerminationPoint) pathDesObj.getResource().getResource();
- LOG.info(" TP is {} {}", tp.getTerminationPointIdentifier().getTpId(),
- tp.getTerminationPointIdentifier().getNodeId());
- tpID = tp.getTerminationPointIdentifier().getTpId();
- nodeID = tp.getTerminationPointIdentifier().getNodeId();
+ LOG.info(" TP is {} {}", tp.getTpId(),
+ tp.getTpNodeId());
+ tpID = tp.getTpId();
+ nodeID = tp.getTpNodeId();
sortId = pathDesObj.getId();
//TODO: do not rely on ID to be in certain format
*/
package org.opendaylight.transportpce.renderer;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.PathDescription;
public interface NetworkModelWavelengthService {
package org.opendaylight.transportpce.renderer;
import com.google.common.base.Optional;
-
import java.util.ArrayList;
import java.util.List;
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;
import org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev170929.srg.node.attributes.AvailableWavelengthsBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev170929.xpdr.port.connection.attributes.Wavelength;
import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev170929.xpdr.port.connection.attributes.WavelengthBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.PathDescription;
-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.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.termination.point.TerminationPointIdentifier;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.TerminationPoint;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.Network;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkId;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkKey;
return false;
}
return aToZ.getResource().getResource() instanceof TerminationPoint;
- }).filter(aToZ -> {
+ }).map(aToZ -> {
TerminationPoint tp = (TerminationPoint) aToZ.getResource().getResource();
- if ((tp.getTerminationPointIdentifier() == null)
- || (tp.getTerminationPointIdentifier().getNodeId() == null)
- || (tp.getTerminationPointIdentifier().getTpId() == null)) {
+ if ((tp == null) || (tp.getTpNodeId() == null) || (tp.getTpId() == null)) {
LOG.warn("Termination point in AToZ node {} contains nulls! Skipping this node!", aToZ.getId());
- return false;
+ return null;
}
- return true;
- }).map(aToZ -> {
- TerminationPointIdentifier tp =
- ((TerminationPoint) aToZ.getResource().getResource()).getTerminationPointIdentifier();
- return new NodeIdPair(tp.getNodeId(), tp.getTpId());
+ return new NodeIdPair(tp.getTpNodeId(), tp.getTpId());
}).collect(Collectors.toList());
}
return false;
}
return zToA.getResource().getResource() instanceof TerminationPoint;
- }).filter(zToA -> {
+ }).map(zToA -> {
TerminationPoint tp = (TerminationPoint) zToA.getResource().getResource();
- if ((tp.getTerminationPointIdentifier() == null)
- || (tp.getTerminationPointIdentifier().getNodeId() == null)
- || (tp.getTerminationPointIdentifier().getTpId() == null)) {
+ if ((tp == null) || (tp.getTpNodeId() == null) || (tp.getTpId() == null)) {
LOG.warn("Termination point in ZToA node {} contains nulls! Skipping this node!", zToA.getId());
- return false;
+ return null;
}
- return true;
- })
- .map(zToA -> {
- TerminationPointIdentifier tp =
- ((TerminationPoint) zToA.getResource().getResource()).getTerminationPointIdentifier();
- return new NodeIdPair(tp.getNodeId(), tp.getTpId());
+ return new NodeIdPair(tp.getTpNodeId(), tp.getTpId());
}).collect(Collectors.toList());
}
import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
import org.opendaylight.transportpce.renderer.rpcs.DeviceRendererRPCImpl;
import org.opendaylight.transportpce.renderer.rpcs.TransportPCEServicePathRPCImpl;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.RendererService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.TransportpceDeviceRendererService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.TransportpceRendererService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(RendererProvider.class);
private final RpcProviderRegistry rpcProviderRegistry;
- private RpcRegistration<RendererService> deviceRendererRegistration;
private DeviceRendererRPCImpl deviceRendererRPCImpl;
- private RpcRegistration<TransportpceServicepathService> tpceServiceRegistry;
+ private RpcRegistration<TransportpceDeviceRendererService> deviceRendererRegistration;
+ private RpcRegistration<TransportpceRendererService> tpceServiceRegistry;
private RendererServiceOperations rendererServiceOperations;
public RendererProvider(RpcProviderRegistry rpcProviderRegistry, DeviceRendererRPCImpl deviceRendererRPCImpl,
- RendererServiceOperations rendererServiceOperations) {
+ RendererServiceOperations rendererServiceOperations) {
this.rpcProviderRegistry = rpcProviderRegistry;
this.deviceRendererRPCImpl = deviceRendererRPCImpl;
this.rendererServiceOperations = rendererServiceOperations;
TransportPCEServicePathRPCImpl transportPCEServicePathRPCImpl =
new TransportPCEServicePathRPCImpl(this.rendererServiceOperations);
this.deviceRendererRegistration = this.rpcProviderRegistry
- .addRpcImplementation(RendererService.class, this.deviceRendererRPCImpl);
+ .addRpcImplementation(TransportpceDeviceRendererService.class, deviceRendererRPCImpl);
this.tpceServiceRegistry = this.rpcProviderRegistry
- .addRpcImplementation(TransportpceServicepathService.class, transportPCEServicePathRPCImpl);
+ .addRpcImplementation(TransportpceRendererService.class, transportPCEServicePathRPCImpl);
}
/**
*/
package org.opendaylight.transportpce.renderer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInput;
public class ServicePathInputData {
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.PowerDBm;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.OTU4;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.OtuAttributes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.otu.container.OtuBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
this.openRoadmInterfaces = openRoadmInterfaces;
}
- public String createOpenRoadmEthInterface(String nodeId, String logicalConnPoint,String serviceName)
+ public String createOpenRoadmEthInterface(String nodeId, String logicalConnPoint)
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
ethIfBuilder.setMtu(9000L);
InterfaceBuilder ethInterfaceBldr = createGenericInterfaceBuilder(portMap, EthernetCsmacd.class,
- logicalConnPoint + "-ETHERNET",serviceName);
+ logicalConnPoint + "-ETHERNET");
// Create Interface1 type object required for adding as augmentation
Interface1Builder ethIf1Builder = new Interface1Builder();
* This methods creates an OCH interface on the given termination point on
* Roadm.
*
- * @param waveNumber
- * wavelength number of the OCH interface.
+ * @param nodeId node ID
+ * @param logicalConnPoint logical Connection Point
+ * @param waveNumber wavelength number of the OCH interface
*
* @return Name of the interface if successful, otherwise return null.
+ * @throws OpenRoadmInterfaceException OpenRoadmInterfaceException
*/
- public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber,
- String serviceName)
+ public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber)
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
}
// Create generic interface
InterfaceBuilder ochInterfaceBldr = createGenericInterfaceBuilder(portMap, OpticalChannel.class,
- createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber),serviceName);
+ createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber));
// OCH interface specific data
OchBuilder ocIfBuilder = new OchBuilder();
}
public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber, Class<
- ? extends RateIdentity> rate, OchAttributes.ModulationFormat format,String serviceName)
- throws OpenRoadmInterfaceException {
+ ? extends RateIdentity> rate, OchAttributes.ModulationFormat format) throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
throw new OpenRoadmInterfaceException(String.format("Unable to get mapping from PortMapping for node %s and"
.interfaces.rev161014.Interface1Builder();
// Create generic interface
InterfaceBuilder ochInterfaceBldr = createGenericInterfaceBuilder(portMap, OpticalChannel.class,
- createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber),serviceName);
+ createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber));
ochInterfaceBldr.addAugmentation(
org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1.class,
ochIf1Builder.setOch(ocIfBuilder.build()).build());
/**
* This methods creates an ODU interface on the given termination point.
*
+ * @param nodeId node ID
+ * @param logicalConnPoint logical Connection Point
+ * @param supportingOtuInterface supporting OTU Interface
*
* @return Name of the interface if successful, otherwise return null.
+ * @throws OpenRoadmInterfaceException OpenRoadmInterfaceException
*/
- public String createOpenRoadmOdu4Interface(String nodeId, String logicalConnPoint, String supportingOtuInterface,
- String serviceName)
+ public String createOpenRoadmOdu4Interface(String nodeId, String logicalConnPoint, String supportingOtuInterface)
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
+ " logical connection port %s", nodeId, logicalConnPoint));
}
InterfaceBuilder oduInterfaceBldr = createGenericInterfaceBuilder(portMap, OtnOdu.class, logicalConnPoint
- + "-ODU",serviceName);
+ + "-ODU");
oduInterfaceBldr.setSupportingInterface(supportingOtuInterface);
// ODU interface specific data
/**
* This methods creates an OTU interface on the given termination point.
*
+ * @param nodeId node ID
+ * @param logicalConnPoint logical Connection Point
+ * @param supportOchInterface support OCH Interface
*
* @return Name of the interface if successful, otherwise return null.
* @throws OpenRoadmInterfaceException OpenRoadmInterfaceException
*/
- public String createOpenRoadmOtu4Interface(String nodeId, String logicalConnPoint, String supportOchInterface,
- String serviceName)
+ public String createOpenRoadmOtu4Interface(String nodeId, String logicalConnPoint, String supportOchInterface)
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
}
// Create generic interface
InterfaceBuilder otuInterfaceBldr = createGenericInterfaceBuilder(portMap, OtnOtu.class, logicalConnPoint
- + "-OTU",serviceName);
+ + "-OTU");
otuInterfaceBldr.setSupportingInterface(supportOchInterface);
// OTU interface specific data
if (mapping.getSupportingOts() == null) {
// Create generic interface
InterfaceBuilder otsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpticalTransport.class, "OTS-"
- + mapping.getLogicalConnectionPoint(),"");
+ + mapping.getLogicalConnectionPoint());
// OTS interface augmentation specific data
OtsBuilder otsIfBuilder = new OtsBuilder();
otsIfBuilder.setFiberType(FiberType.Smf);
if (mapping.getSupportingOms() == null) {
// Create generic interface
InterfaceBuilder omsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpenROADMOpticalMultiplex.class,
- "OMS-" + mapping.getLogicalConnectionPoint(),"");
+ "OMS-" + mapping.getLogicalConnectionPoint());
if (mapping.getSupportingOts() != null) {
omsInterfaceBldr.setSupportingInterface(mapping.getSupportingOts());
} else {
}
private InterfaceBuilder createGenericInterfaceBuilder(Mapping portMap, Class<? extends InterfaceType> type,
- String key,String serviceName) {
+ String key) {
InterfaceBuilder interfaceBuilder = new InterfaceBuilder();
interfaceBuilder.setDescription(" TBD ");
- interfaceBuilder.setCircuitId(serviceName);
+ interfaceBuilder.setCircuitId(" TBD ");
interfaceBuilder.setSupportingCircuitPackName(portMap.getSupportingCircuitPackName());
interfaceBuilder.setSupportingPort(portMap.getSupportingPort());
interfaceBuilder.setAdministrativeState(AdminStates.InService);
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServicePathDirection;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsOutput;
-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;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathOutput;
+
public interface DeviceRendererService {
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServiceListTopology;
import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServicePathDirection;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.ServiceNodelist;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.service.nodelist.NodelistBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.service.nodelist.NodelistKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.renderer.rollback.output.FailedToRollback;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.renderer.rollback.output.FailedToRollbackBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.renderer.rollback.output.FailedToRollbackKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.Topology;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.get.connection.port.trail.output.Ports;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.node.interfaces.NodeInterfaceBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.node.interfaces.NodeInterfaceKey;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.ServiceNodelist;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist.NodelistBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist.NodelistKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsOutputBuilder;
-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;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.RendererRollbackOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.renderer.rollback.output.FailedToRollback;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.renderer.rollback.output.FailedToRollbackBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.renderer.rollback.output.FailedToRollbackKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private final OpenRoadmInterfaces openRoadmInterfaces;
private final CrossConnect crossConnect;
private final PortMapping portMapping;
- private String serviceName;
public DeviceRendererServiceImpl(DataBroker dataBroker, DeviceTransactionManager deviceTransactionManager,
OpenRoadmInterfaceFactory openRoadmInterfaceFactory, OpenRoadmInterfaces openRoadmInterfaces,
this.openRoadmInterfaces = openRoadmInterfaces;
this.crossConnect = crossConnect;
this.portMapping = portMapping;
- serviceName = "Undefined";
}
@Override
public ServicePathOutput setupServicePath(ServicePathInput input, ServicePathDirection direction) {
- this.serviceName = input.getServiceName();
List<Nodes> nodes = input.getNodes();
// Register node for suppressing alarms
if (!alarmSuppressionNodeRegistration(input)) {
crossConnectFlag++;
// create OpenRoadm Xponder Line Interfaces
String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
- nodeId, destTp, waveNumber, R100G.class, ModulationFormat.DpQpsk, serviceName);
+ nodeId, destTp, waveNumber, R100G.class, ModulationFormat.DpQpsk);
createdOchInterfaces.add(supportingOchInterface);
String supportingOtuInterface = this.openRoadmInterfaceFactory
- .createOpenRoadmOtu4Interface(nodeId, destTp, supportingOchInterface, serviceName);
+ .createOpenRoadmOtu4Interface(nodeId, destTp, supportingOchInterface);
createdOtuInterfaces.add(supportingOtuInterface);
createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4Interface(nodeId,
- destTp, supportingOtuInterface, serviceName));
+ destTp, supportingOtuInterface));
}
if ((srcTp != null) && srcTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Client Interfaces
createdEthInterfaces.add(
- this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId, srcTp, serviceName));
+ this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId, srcTp));
}
if ((srcTp != null) && srcTp.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Line Interfaces
String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
- nodeId, srcTp, waveNumber, R100G.class, ModulationFormat.DpQpsk, serviceName);
+ nodeId, srcTp, waveNumber, R100G.class, ModulationFormat.DpQpsk);
createdOchInterfaces.add(supportingOchInterface);
String supportingOtuInterface = this.openRoadmInterfaceFactory
- .createOpenRoadmOtu4Interface(nodeId, srcTp, supportingOchInterface, serviceName);
+ .createOpenRoadmOtu4Interface(nodeId, srcTp, supportingOchInterface);
createdOtuInterfaces.add(supportingOtuInterface);
createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4Interface(nodeId,
- srcTp, supportingOtuInterface, serviceName));
+ srcTp, supportingOtuInterface));
}
if ((destTp != null) && destTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Client Interfaces
createdEthInterfaces.add(
- this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId, destTp, serviceName));
+ this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId, destTp));
}
if ((srcTp != null) && (srcTp.contains(OpenRoadmInterfacesImpl.TTP_TOKEN)
|| srcTp.contains(OpenRoadmInterfacesImpl.PP_TOKEN))) {
createdOchInterfaces.add(
this.openRoadmInterfaceFactory
- .createOpenRoadmOchInterface(nodeId, srcTp, waveNumber, serviceName));
+ .createOpenRoadmOchInterface(nodeId, srcTp, waveNumber));
}
if ((destTp != null) && (destTp.contains(OpenRoadmInterfacesImpl.TTP_TOKEN)
|| destTp.contains(OpenRoadmInterfacesImpl.PP_TOKEN))) {
createdOchInterfaces.add(
this.openRoadmInterfaceFactory
- .createOpenRoadmOchInterface(nodeId, destTp, waveNumber, serviceName));
+ .createOpenRoadmOchInterface(nodeId, destTp, waveNumber));
}
if (crossConnectFlag < 1) {
LOG.info("Creating cross connect between source {} and destination {} for node {}", srcTp,
NodelistBuilder nodeListBuilder = new NodelistBuilder();
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
+ List<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.service
.nodelist.nodelist.Nodes> nodeList =
new ArrayList<>();
for (Nodes node : input.getNodes()) {
nodeList.add(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102
+ new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102
.service.nodelist.nodelist.NodesBuilder()
.setNodeId(node.getNodeId()).build());
}
nodeListBuilder.setNodes(nodeList);
- InstanceIdentifier<
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service
- .nodelist.Nodelist> nodeListIID =
+ InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102
+ .service.nodelist.Nodelist> nodeListIID =
InstanceIdentifier.create(ServiceNodelist.class).child(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression
.rev171102.service.nodelist.Nodelist.class,
new NodelistKey(input.getServiceName()));
final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
}
}
- private boolean alarmSuppressionNodeRemoval(String name) {
- InstanceIdentifier<
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service
- .nodelist.Nodelist> nodeListIID =
+ private boolean alarmSuppressionNodeRemoval(String serviceName) {
+ InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102
+ .service.nodelist.Nodelist> nodeListIID =
InstanceIdentifier.create(ServiceNodelist.class).child(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression
.rev171102.service.nodelist.Nodelist.class,
- new NodelistKey(name));
+ new NodelistKey(serviceName));
final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
writeTransaction.delete(LogicalDatastoreType.CONFIGURATION, nodeListIID);
Future<Void> submit = writeTransaction.submit();
try {
submit.get(Timeouts.DATASTORE_DELETE, TimeUnit.MILLISECONDS);
- LOG.info("Nodes are unregister for alarm suppression for service: {}", name);
+ LOG.info("Nodes are unregister for alarm suppression for service: {}", serviceName);
return true;
} catch (InterruptedException | TimeoutException | ExecutionException e) {
- LOG.warn("Failed to alarm suppresslist for service: {}", name, e);
+ LOG.warn("Failed to alarm suppresslist for service: {}", serviceName, e);
return false;
}
}
*/
package org.opendaylight.transportpce.renderer.provisiondevice;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutput;
public interface RendererServiceOperations {
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
-
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
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.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.transportpce.renderer.provisiondevice.tasks.OlmPowerSetupRollbackTask;
import org.opendaylight.transportpce.renderer.provisiondevice.tasks.OlmPowerSetupTask;
import org.opendaylight.transportpce.renderer.provisiondevice.tasks.RollbackProcessor;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output.Measurements;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev161014.PmGranularity;
import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceTypeEnum;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.path.PathDescription;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServicePathList;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePaths;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.path.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.get.pm.input.ResourceIdentifierBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.Measurements;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
private static final int NUMBER_OF_THREADS = 4;
private final DeviceRendererService deviceRenderer;
- private final OlmService olmService;
+ private final TransportpceOlmService olmService;
private final DataBroker dataBroker;
private ListeningExecutorService executor;
private NetworkModelWavelengthService networkModelWavelengthService;
- public RendererServiceOperationsImpl(DeviceRendererService deviceRenderer, OlmService olmService,
+ public RendererServiceOperationsImpl(DeviceRendererService deviceRenderer, TransportpceOlmService olmService,
DataBroker dataBroker, NetworkModelWavelengthService networkModelWavelengthService) {
this.deviceRenderer = deviceRenderer;
this.olmService = olmService;
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.renderer.rollback.output.FailedToRollback;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.node.interfaces.NodeInterface;
-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.RendererRollbackInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.RendererRollbackOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.renderer.rollback.output.FailedToRollback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.concurrent.Callable;
-
import org.opendaylight.transportpce.renderer.ServicePathInputData;
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRenderingResult;
import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServicePathDirection;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathOutput;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.opendaylight.transportpce.renderer.provisiondevice.tasks;
import java.util.concurrent.Future;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(OlmPowerSetupRollbackTask.class);
private static final String FAILED = "Failed";
private final boolean isRollbackNecessary;
- private final OlmService olmService;
+ private final TransportpceOlmService olmService;
private final ServicePowerSetupInput powerSetupInput;
- public OlmPowerSetupRollbackTask(String id, boolean isRollbackNecessary, OlmService olmService,
+ public OlmPowerSetupRollbackTask(String id, boolean isRollbackNecessary, TransportpceOlmService olmService,
ServicePowerSetupInput powerSetupInput) {
super(id);
this.isRollbackNecessary = isRollbackNecessary;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
-
import org.opendaylight.transportpce.renderer.provisiondevice.OLMRenderingResult;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(OlmPowerSetupTask.class);
- private final OlmService olmService;
+ private final TransportpceOlmService olmService;
private final ServicePowerSetupInput input;
- public OlmPowerSetupTask(OlmService olmService, ServicePowerSetupInput input) {
+ public OlmPowerSetupTask(TransportpceOlmService olmService, ServicePowerSetupInput input) {
this.olmService = olmService;
this.input = input;
}
import com.google.common.util.concurrent.ListenableFuture;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsOutput;
-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;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.RendererService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.TransportpceDeviceRendererService;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class DeviceRendererRPCImpl implements RendererService {
+public class DeviceRendererRPCImpl implements TransportpceDeviceRendererService {
private static final Logger LOG = LoggerFactory.getLogger(DeviceRendererRPCImpl.class);
private DeviceRendererService deviceRenderer;
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;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.CancelResourceReserveOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.PathComputationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.PathComputationRequestOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.TransportpceRendererService;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class TransportPCEServicePathRPCImpl implements TransportpceServicepathService {
+public class TransportPCEServicePathRPCImpl implements TransportpceRendererService {
private static final Logger LOG = LoggerFactory.getLogger(TransportPCEServicePathRPCImpl.class);
this.rendererServiceOperations = rendererServiceOperations;
}
- @Override
- public ListenableFuture<RpcResult<CancelResourceReserveOutput>> cancelResourceReserve(
- CancelResourceReserveInput input) {
- // TODO Auto-generated method stub
- return null;
- }
-
@Override
public ListenableFuture<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
- // TODO Auto-generated method stub
- return null;
+ String serviceName = input.getServiceName();
+ LOG.info("Calling RPC service delete request {} {}", serviceName);
+ return ModelMappingUtils
+ .createServiceDeleteRpcResponse(this.rendererServiceOperations.serviceDelete(input));
}
@Override
ServiceImplementationRequestInput input) {
String serviceName = input.getServiceName();
LOG.info("Calling RPC service impl request {} {}", serviceName);
- return ModelMappingUtils.createRpcResponse(this.rendererServiceOperations.serviceImplementation(input));
- }
-
- @Override
- public ListenableFuture<RpcResult<PathComputationRequestOutput>> pathComputationRequest(
- PathComputationRequestInput input) {
- // TODO Auto-generated method stub
- return null;
+ return ModelMappingUtils
+ .createServiceImplementationRpcResponse(this.rendererServiceOperations.serviceImplementation(input));
}
}
<reference id="crossConnect" interface="org.opendaylight.transportpce.common.crossconnect.CrossConnect" />
<odl:rpc-service id="olmService"
- interface="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService"/>
+ interface="org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService"/>
<bean id="openRoadmInterfaceFactory" class="org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory" >
<argument ref="portMapping" />
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev170929.OpenroadmNodeType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev170929.OpenroadmTpType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev170929.xpdr.port.connection.attributes.WavelengthBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.PathDescription;
@RunWith(Parameterized.class)
public class NetworkModelWaveLengthServiceFreeTest extends AbstractTest {
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.XpdrPortAttributesBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev170929.OpenroadmNodeType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev170929.OpenroadmTpType;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.PathDescription;
@RunWith(Parameterized.class)
public class NetworkModelWaveLengthServiceUseTest extends AbstractTest {
import org.opendaylight.transportpce.renderer.utils.CreateOtsOmsDataUtils;
import org.opendaylight.transportpce.renderer.utils.MountPointUtils;
import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsOutput;
public class DeviceRendererServiceImplCreateOtsOmsTest extends AbstractTest {
import org.opendaylight.transportpce.renderer.utils.ServiceImplementationDataUtils;
import org.opendaylight.transportpce.renderer.utils.TransactionUtils;
import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.connection.DestinationBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.connection.SourceBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutput;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public class DeviceRendererServiceImplDeleteTest extends AbstractTest {
import org.opendaylight.transportpce.renderer.stub.MountPointStub;
import org.opendaylight.transportpce.renderer.utils.ServiceImplementationDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackOutput;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.node.interfaces.NodeInterface;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.node.interfaces.NodeInterfaceBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.node.interfaces.NodeInterfaceKey;
-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.RendererRollbackInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.RendererRollbackOutput;
public class DeviceRendererServiceImplRollbackTest extends AbstractTest {
import org.opendaylight.transportpce.renderer.utils.MountPointUtils;
import org.opendaylight.transportpce.renderer.utils.ServiceImplementationDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathOutput;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutput;
public class DeviceRendererServiceImplSetupTest extends AbstractTest {
import org.opendaylight.transportpce.renderer.utils.ServiceDeleteDataUtils;
import org.opendaylight.transportpce.renderer.utils.TransactionUtils;
import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.handler.header.ServiceHandlerHeaderBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServicePathList;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePaths;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutput;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.handler.header.ServiceHandlerHeaderBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
private PortMapping portMapping;
private CrossConnect crossConnect;
private NetworkModelWavelengthService networkModelWavelengthService;
- private OlmService olmService;
+ private TransportpceOlmService olmService;
private void setMountPoint(MountPoint mountPoint) {
MountPointService mountPointService = new MountPointServiceStub(mountPoint);
import org.opendaylight.transportpce.renderer.utils.MountPointUtils;
import org.opendaylight.transportpce.renderer.utils.ServiceDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output.Measurements;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output.MeasurementsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev161014.PmGranularity;
import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceTypeEnum;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.get.pm.input.ResourceIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.Measurements;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.MeasurementsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutputBuilder;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
public class RendererServiceOperationsImplTest extends AbstractTest {
private PortMapping portMapping;
private OpenRoadmInterfaceFactory openRoadmInterfaceFactory;
private CrossConnect crossConnect;
- private OlmService olmService;
+ private TransportpceOlmService olmService;
private NetworkModelWavelengthService networkModelWavelengthService;
private void setMountPoint(MountPoint mountPoint) {
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
-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;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.CalculateSpanlossCurrentOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerResetInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerResetOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-public class OlmServiceStub implements OlmService {
+public class OlmServiceStub implements TransportpceOlmService {
@Override public ListenableFuture<RpcResult<CalculateSpanlossCurrentOutput>> calculateSpanlossCurrent(
CalculateSpanlossCurrentInput input) {
package org.opendaylight.transportpce.renderer.utils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.CreateOtsOmsInputBuilder;
public final class CreateOtsOmsDataUtils {
import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.renderer.stub.MountPointStub;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.Network;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.GetConnectionPortTrailOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.GetConnectionPortTrailOutputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.OrgOpenroadmDeviceService;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.get.connection.port.trail.output.Ports;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.Network;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.NodesKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.MappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.MappingKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation.request.input.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation.request.input.PathDescriptionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation.request.input.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation.request.input.ServiceZEndBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.ServiceFormat;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.port.PortBuilder;
-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;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirectionBuilder;
-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;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToABuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToAKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.ResourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.Link;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.LinkBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.NodeBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPointBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.link.LinkIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.node.NodeIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.termination.point.TerminationPointIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.RxDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.TxDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.handler.header.ServiceHandlerHeaderBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation.request.input.PathDescription;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation.request.input.PathDescriptionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation.request.input.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation.request.input.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToABuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToAKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.ResourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.Link;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.LinkBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.NodeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.TerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.TerminationPointBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.RxDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.TxDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.handler.header.ServiceHandlerHeaderBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.Nodes;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.NodesBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.NodesKey;
-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.RendererRollbackInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInputBuilder;
public final class ServiceDataUtils {
private static PathDescription createPathDescriptionInvalidResource() {
List<AToZ> atoZList = new ArrayList<AToZ>();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource
.resource.resource.NodeBuilder nodesBuilder = new NodeBuilder();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource
- .resource.resource.Node node1 = nodesBuilder.setNodeIdentifier(new NodeIdentifierBuilder()
- .setNodeId("XPONDER-1-2").build()).build();
- 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();
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource
+ .resource.resource.Node node1 = nodesBuilder.setNodeId("XPONDER-1-2").build();
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource
+ .resource.resource.Node node2 = nodesBuilder.setNodeId("XPONDER-1-2").build();
AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
.setResource(node1).build()).build();
AToZ atoZ2 = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
Integer atozId = 1;
for (String nodeId : nodeIds) {
for (String otherNodeId : nodeIds) {
- TerminationPoint terminationPoint = terminationPointBuilder
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId(nodeId + '-'
- + tpId)
- .setTpId(tpId).build())
- .build();
+ TerminationPoint terminationPoint = terminationPointBuilder.setTpNodeId(nodeId + '-' + tpId)
+ .setTpId(tpId).build();
AToZ atoZ = new AToZBuilder().setId(atozId.toString())
.withKey(new AToZKey(atozId.toString())).setResource(new ResourceBuilder()
.setResource(terminationPoint).build()).build();
Integer ztoaId = 1;
for (String nodeId : nodeIds) {
for (String otherNodeId : nodeIds) {
- TerminationPoint terminationPoint = terminationPointBuilder
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId(nodeId + '-'
- + tpId)
- .setTpId(tpId).build())
- .build();
+ TerminationPoint terminationPoint = terminationPointBuilder.setTpNodeId(nodeId + '-' + tpId)
+ .setTpId(tpId).build();
ZToA ztoA = new ZToABuilder().setId(ztoaId.toString())
.withKey(new ZToAKey(ztoaId.toString())).setResource(new ResourceBuilder()
.setResource(terminationPoint).build()).build();
private static PathDescription createPathDescriptionLinkResource() {
List<AToZ> atoZList = new ArrayList<AToZ>();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource
- .resource.resource.NodeBuilder nodesBuilder = new NodeBuilder();
- Link link1 = new LinkBuilder().setLinkIdentifier(new LinkIdentifierBuilder().setLinkId("link 1").build())
- .build();
- Link link2 = new LinkBuilder().setLinkIdentifier(new LinkIdentifierBuilder().setLinkId("link 2").build())
- .build();
+ Link link1 = new LinkBuilder().setLinkId("link 1").build();
+ Link link2 = new LinkBuilder().setLinkId("link 2").build();
AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
.setResource(link1).build()).build();
AToZ atoZ2 = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
import java.util.List;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.ServiceFormat;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.port.PortBuilder;
-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;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirectionBuilder;
-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;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToABuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToAKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.ResourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPointBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.termination.point.TerminationPointIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.RxDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.TxDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.path.PathDescription;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.path.PathDescriptionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.path.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.path.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToABuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToAKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.ResourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.TerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.TerminationPointBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.RxDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.TxDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.path.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.path.PathDescriptionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.path.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.path.ServiceZEndBuilder;
public final class ServiceDeleteDataUtils {
public static PathDescription createTransactionPathDescription(String tpId) {
List<AToZ> atoZList = new ArrayList<AToZ>();
TerminationPointBuilder terminationPointBuilder = new TerminationPointBuilder();
- TerminationPoint terminationPoint = terminationPointBuilder
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("node2" + tpId)
- .setTpId(tpId).build()).build();
- TerminationPoint terminationPoint2 = terminationPointBuilder
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("node1" + tpId)
- .setTpId(tpId).build()).build();
+ TerminationPoint terminationPoint = terminationPointBuilder.setTpNodeId("node2" + tpId)
+ .setTpId(tpId).build();
+ TerminationPoint terminationPoint2 = terminationPointBuilder.setTpNodeId("node1" + tpId)
+ .setTpId(tpId).build();
AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
.setResource(terminationPoint).build()).build();
AToZ atoZ2 = new AToZBuilder().setId("2").withKey(new AToZKey("2")).setResource(new ResourceBuilder()
import java.util.ArrayList;
import java.util.List;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.RendererRollbackInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.device.rev170228.ServicePathInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation.request.input.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation.request.input.PathDescriptionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation.request.input.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation.request.input.ServiceZEndBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.ServiceFormat;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.port.PortBuilder;
-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;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirectionBuilder;
-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;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToABuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ztoa.direction.ZToAKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.ResourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.Link;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.LinkBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.NodeBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPointBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.link.LinkIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.node.NodeIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.termination.point.TerminationPointIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.RxDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.TxDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.handler.header.ServiceHandlerHeaderBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation.request.input.PathDescription;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation.request.input.PathDescriptionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation.request.input.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation.request.input.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToABuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ztoa.direction.ZToAKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.ResourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.Link;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.LinkBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.NodeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.TerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.TerminationPointBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.RxDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.TxDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.handler.header.ServiceHandlerHeaderBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.Nodes;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.NodesBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.renderer.input.NodesKey;
-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.RendererRollbackInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInputBuilder;
public final class ServiceImplementationDataUtils {
private static PathDescription createPathDescriptionInvalidResource() {
List<AToZ> atoZList = new ArrayList<AToZ>();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource
.resource.resource.NodeBuilder nodesBuilder = new NodeBuilder();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource
- .resource.resource.Node node1 = nodesBuilder.setNodeIdentifier(new NodeIdentifierBuilder()
- .setNodeId("XPONDER-1-2").build()).build();
- 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();
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource
+ .resource.resource.Node node1 = nodesBuilder.setNodeId("XPONDER-1-2").build();
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource
+ .resource.resource.Node node2 = nodesBuilder.setNodeId("XPONDER-1-2").build();
AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
.setResource(node1).build()).build();
AToZ atoZ2 = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
public static PathDescription createPathDescriptionTerminationPointResource(String tpId) {
List<AToZ> atoZList = new ArrayList<AToZ>();
TerminationPointBuilder terminationPointBuilder = new TerminationPointBuilder();
- TerminationPoint terminationPoint = terminationPointBuilder
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("XPONDER-1-2")
- .setTpId("XPONDER-1-2-" + tpId).build()).build();
- TerminationPoint terminationPoint2 = terminationPointBuilder
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("XPONDER-1-2")
- .setTpId("XPONDER-1-2-" + tpId).build()).build();
+ TerminationPoint terminationPoint = terminationPointBuilder.setTpNodeId("XPONDER-1-2")
+ .setTpId("XPONDER-1-2-" + tpId).build();
+ TerminationPoint terminationPoint2 = terminationPointBuilder.setTpNodeId("XPONDER-1-2")
+ .setTpId("XPONDER-1-2-" + tpId).build();
AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
.setResource(terminationPoint).build()).build();
AToZ atoZ2 = new AToZBuilder().setId("2").withKey(new AToZKey("2")).setResource(new ResourceBuilder()
private static PathDescription createPathDescriptionLinkResource() {
List<AToZ> atoZList = new ArrayList<AToZ>();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource
- .resource.resource.NodeBuilder nodesBuilder = new NodeBuilder();
- Link link1 = new LinkBuilder().setLinkIdentifier(new LinkIdentifierBuilder().setLinkId("link 1").build())
- .build();
- Link link2 = new LinkBuilder().setLinkIdentifier(new LinkIdentifierBuilder().setLinkId("link 2").build())
- .build();
+ Link link1 = new LinkBuilder().setLinkId("link 1").build();
+ Link link2 = new LinkBuilder().setLinkId("link 2").build();
AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
.setResource(link1).build()).build();
AToZ atoZ2 = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.general.Latency;
import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.HardConstraints;
import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.SoftConstraints;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.ConstraintsSp;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.general.DiversityBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.general.ExcludeBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.general.IncludeBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.constraints.sp.co.routing.or.general.general.LatencyBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.diversity.existing.service.contraints.sp.ExistingServiceApplicabilityBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.HardConstraintsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.SoftConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.ConstraintsSp;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.DiversityBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.ExcludeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.IncludeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.LatencyBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.diversity.existing.service.contraints.sp.ExistingServiceApplicabilityBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.HardConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.SoftConstraintsBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private HardConstraints serviceHardConstraints;
private SoftConstraints serviceSoftConstraints;
private org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.HardConstraints servicePathHardConstraints;
+ .routing.constraints.rev171017.routing.constraints.sp.HardConstraints servicePathHardConstraints;
private org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.SoftConstraints servicePathSoftConstraints;
+ .routing.constraints.rev171017.routing.constraints.sp.SoftConstraints servicePathSoftConstraints;
/**
* MappingConstraints class constructor
* @param soft SoftConstraints
*/
public MappingConstraints(org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.HardConstraints hard,
+ .routing.constraints.rev171017.routing.constraints.sp.HardConstraints hard,
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.SoftConstraints soft) {
+ .routing.constraints.rev171017.routing.constraints.sp.SoftConstraints soft) {
setServicePathHardConstraints(hard);
setServicePathSoftConstraints(soft);
}
CoRoutingOrGeneral coRoutingOrGeneral = null;
HardConstraintsBuilder tempHard = new HardConstraintsBuilder();
SoftConstraintsBuilder tempSoft = new SoftConstraintsBuilder();
- if (input != null && input instanceof Constraints) {
+ if ((input != null) && (input instanceof Constraints)) {
Constraints constraints = (Constraints)input;
coRoutingOrGeneral = constraints.getCoRoutingOrGeneral();
General tmpGeneral = null;
CoRouting tmpCoRouting = null;
if (coRoutingOrGeneral != null) {
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral =
+ .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral =
new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.GeneralBuilder();
+ .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder();
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting =
+ .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting =
new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder();
+ .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder();
if (coRoutingOrGeneral instanceof General) {
tmpGeneral = (General) coRoutingOrGeneral;
if (tmpGeneral != null) {
CoRouting tmpCoRouting = null;
if (coRoutingOrGeneral != null) {
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral =
+ .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral =
new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.GeneralBuilder();
+ .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder();
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting =
+ .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting =
new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder();
+ .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder();
if (coRoutingOrGeneral instanceof General) {
tmpGeneral = (General) coRoutingOrGeneral;
if (tmpGeneral != null) {
servicePathHardConstraints = tempHard.build();*/
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.routing.constraints.sp.HardConstraints tempHard = (org.opendaylight.yang.gen
- .v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing
+ .rev171017.routing.constraints.sp.HardConstraints tempHard = (org.opendaylight.yang.gen
+ .v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing
.constraints.sp.HardConstraints) getConstraints(serviceHardConstraints);
if (tempHard != null) {
servicePathHardConstraints = tempHard;
CoRouting tmpCoRouting = null;
if (coRoutingOrGeneral != null) {
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral =
+ .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral =
new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.GeneralBuilder();
+ .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder();
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting =
+ .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting =
new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder();
+ .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder();
if (coRoutingOrGeneral instanceof General) {
tmpGeneral = (General) coRoutingOrGeneral;
if (tmpGeneral != null) {
}
servicePathSoftConstraints = tempSoft.build();*/
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev170426.routing.constraints.sp.SoftConstraints tempSoft = (org.opendaylight.yang.gen
- .v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing
+ .rev171017.routing.constraints.sp.SoftConstraints tempSoft = (org.opendaylight.yang.gen
+ .v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing
.constraints.sp.SoftConstraints) getConstraints(serviceSoftConstraints);
if (tempSoft != null) {
servicePathSoftConstraints = tempSoft;
public org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.HardConstraints getServicePathHardConstraints() {
+ .routing.constraints.rev171017.routing.constraints.sp.HardConstraints getServicePathHardConstraints() {
return servicePathHardConstraints;
}
public void setServicePathHardConstraints(org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.HardConstraints servicePathHardConstraints) {
+ .routing.constraints.rev171017.routing.constraints.sp.HardConstraints servicePathHardConstraints) {
this.servicePathHardConstraints = servicePathHardConstraints;
}
public org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.SoftConstraints getServicePathSoftConstraints() {
+ .routing.constraints.rev171017.routing.constraints.sp.SoftConstraints getServicePathSoftConstraints() {
return servicePathSoftConstraints;
}
public void setServicePathSoftConstraints(org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.SoftConstraints servicePathSoftConstraints) {
+ .routing.constraints.rev171017.routing.constraints.sp.SoftConstraints servicePathSoftConstraints) {
this.servicePathSoftConstraints = servicePathSoftConstraints;
}
package org.opendaylight.transportpce.servicehandler;
import com.google.common.util.concurrent.ListenableFuture;
-
-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;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.path.computation.request.input.ServiceZEnd;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.path.computation.request.input.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.path.computation.request.input.ServiceAEnd;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.path.computation.request.input.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.path.computation.request.input.ServiceZEnd;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.path.computation.request.input.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommon;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.response.parameters.ResponseParametersBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceRerouteOutputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.Services;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.ServicesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.HardConstraintsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.SoftConstraintsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.RxDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.RxDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.TxDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.TxDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.handler.header.ServiceHandlerHeaderBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.path.PathDescriptionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePaths;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.HardConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.SoftConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.RxDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.RxDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.TxDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.endpoint.sp.TxDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.handler.header.ServiceHandlerHeaderBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.path.PathDescriptionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public final class ModelMappingUtils {
+ private static final Logger LOG = LoggerFactory.getLogger(ModelMappingUtils.class);
+
private ModelMappingUtils() {
}
ServiceImplementationRequestInputBuilder serviceImplementationRequestInputBuilder =
new ServiceImplementationRequestInputBuilder();
serviceImplementationRequestInputBuilder.setServiceName(input.getServiceName());
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation
- .request.input.ServiceAEndBuilder serviceAEnd =
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service
- .implementation.request.input.ServiceAEndBuilder();
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation
+ .request.input.ServiceAEndBuilder serviceAEnd = new org.opendaylight.yang.gen.v1.http.org.opendaylight
+ .transportpce.renderer.rev171017.service.implementation.request.input.ServiceAEndBuilder();
serviceAEnd.setServiceFormat(input.getServiceAEnd().getServiceFormat())
- .setServiceRate(input.getServiceAEnd().getServiceRate()).setClli(input.getServiceAEnd().getClli())
- .setNodeId(input.getServiceAEnd().getNodeId())
- .setTxDirection(
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426
- .service.endpoint.sp.TxDirectionBuilder()
- .setPort(input.getServiceAEnd().getTxDirection().getPort()).build())
- .setRxDirection(
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426
- .service.endpoint.sp.RxDirectionBuilder()
- .setPort(input.getServiceAEnd().getRxDirection().getPort()).build());
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation
- .request.input.ServiceZEndBuilder serviceZEnd =
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service
- .implementation.request.input.ServiceZEndBuilder();
+ .setServiceRate(input.getServiceAEnd().getServiceRate()).setClli(input.getServiceAEnd().getClli())
+ .setNodeId(input.getServiceAEnd().getNodeId())
+ .setTxDirection(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
+ .rev171016.service.endpoint.sp.TxDirectionBuilder()
+ .setPort(input.getServiceAEnd().getTxDirection().getPort()).build())
+ .setRxDirection(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
+ .rev171016.service.endpoint.sp.RxDirectionBuilder()
+ .setPort(input.getServiceAEnd().getRxDirection().getPort()).build());
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation
+ .request.input.ServiceZEndBuilder serviceZEnd = new org.opendaylight.yang.gen.v1.http.org.opendaylight
+ .transportpce.renderer.rev171017.service.implementation.request.input.ServiceZEndBuilder();
serviceZEnd.setServiceFormat(input.getServiceZEnd().getServiceFormat())
- .setServiceRate(input.getServiceZEnd().getServiceRate()).setClli(input.getServiceZEnd().getClli())
- .setNodeId(input.getServiceZEnd().getNodeId())
- .setTxDirection(
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426
- .service.endpoint.sp.TxDirectionBuilder()
- .setPort(input.getServiceZEnd().getTxDirection().getPort()).build())
- .setRxDirection(
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426
- .service.endpoint.sp.RxDirectionBuilder()
- .setPort(input.getServiceZEnd().getRxDirection().getPort()).build());
+ .setServiceRate(input.getServiceZEnd().getServiceRate()).setClli(input.getServiceZEnd().getClli())
+ .setNodeId(input.getServiceZEnd().getNodeId())
+ .setTxDirection(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
+ .rev171016.service.endpoint.sp.TxDirectionBuilder()
+ .setPort(input.getServiceZEnd().getTxDirection().getPort()).build())
+ .setRxDirection(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
+ .rev171016.service.endpoint.sp.RxDirectionBuilder()
+ .setPort(input.getServiceZEnd().getRxDirection().getPort()).build());
serviceImplementationRequestInputBuilder.setServiceAEnd(serviceAEnd.build());
serviceImplementationRequestInputBuilder.setServiceZEnd(serviceZEnd.build());
serviceImplementationRequestInputBuilder.setServiceHandlerHeader(
- new ServiceHandlerHeaderBuilder().setRequestId(input.getSdncRequestHeader().getRequestId()).build());
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.implementation
+ new ServiceHandlerHeaderBuilder().setRequestId(input.getSdncRequestHeader().getRequestId()).build());
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.service.implementation
.request.input.PathDescriptionBuilder pathDescBuilder = new org.opendaylight.yang.gen.v1.http.org
- .transportpce.b.c._interface.servicepath.rev170426.service.implementation.request.input
- .PathDescriptionBuilder();
- pathDescBuilder.setAToZDirection(pceResponse.getResponseParameters().getPathDescription().getAToZDirection());
- pathDescBuilder.setZToADirection(pceResponse.getResponseParameters().getPathDescription().getZToADirection());
+ .opendaylight.transportpce.renderer.rev171017.service.implementation.request.input
+ .PathDescriptionBuilder();
+ pathDescBuilder.setAToZDirection(pceResponse.getResponseParameters()
+ .getPathDescription().getAToZDirection());
+ pathDescBuilder.setZToADirection(pceResponse.getResponseParameters()
+ .getPathDescription().getZToADirection());
serviceImplementationRequestInputBuilder.setPathDescription(pathDescBuilder.build());
return serviceImplementationRequestInputBuilder.build();
}
- public static
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput
- createServiceDeleteInput(ServiceDeleteInput serviceDeleteInput) {
+
+ public static org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteInput createServiceDeleteInput(ServiceDeleteInput serviceDeleteInput) {
ServiceDeleteInputBuilder builder = new ServiceDeleteInputBuilder();
builder.setServiceName(serviceDeleteInput.getServiceDeleteReqInfo().getServiceName());
builder.setServiceHandlerHeader(new ServiceHandlerHeaderBuilder()
return builder.build();
}
- public static
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput
- createServiceDeleteInput(ServiceRerouteInput serviceRerouteInput, Services service) {
+ public static org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteInput createServiceDeleteInput(ServiceRerouteInput serviceRerouteinput, Services services) {
ServiceDeleteInputBuilder builder = new ServiceDeleteInputBuilder();
- builder.setServiceName(serviceRerouteInput.getServiceName());
- builder.setServiceHandlerHeader(
- new ServiceHandlerHeaderBuilder().setRequestId(service.getSdncRequestHeader().getRequestId()).build());
+ builder.setServiceName(serviceRerouteinput.getServiceName());
+ builder.setServiceHandlerHeader(new ServiceHandlerHeaderBuilder().setRequestId(
+ services.getSdncRequestHeader().getRequestId()).build());
return builder.build();
}
return RpcResultBuilder.success(output).buildFuture();
}
- public static ListenableFuture<RpcResult<ServiceRerouteOutput>> createRerouteServiceReply(ServiceRerouteInput input,
- String finalAck, String message, RpcStatus rpcStatus) {
- ServiceRerouteOutputBuilder output = new ServiceRerouteOutputBuilder().setHardConstraints(null)
- .setSoftConstraints(null).setStatusMessage(message).setStatus(rpcStatus);
- return RpcResultBuilder.success(output.build()).buildFuture();
- }
-
public static ListenableFuture<RpcResult<ServiceCreateOutput>> createCreateServiceReply(ServiceCreateInput input,
String finalAck, String message, String responseCode) {
ResponseParametersBuilder responseParameters = new ResponseParametersBuilder();
return RpcResultBuilder.success(output.build()).buildFuture();
}
+ public static ListenableFuture<RpcResult<ServiceRerouteOutput>> createRerouteServiceReply(ServiceRerouteInput input,
+ String finalAckYes, String message, RpcStatus status) {
+ ServiceRerouteOutputBuilder output = new ServiceRerouteOutputBuilder()
+ .setHardConstraints(null)
+ .setSoftConstraints(null)
+ .setStatus(status)
+ .setStatusMessage(message);
+ return RpcResultBuilder.success(output.build()).buildFuture();
+ }
+
/*
* Map Input (ServiceCreateInmput, ServiceReconfigureInput) & output
* (PathComputationRequestOutput) to Service.
ServiceReconfigureInput serviceReconfigureInput, PathComputationRequestOutput output) {
ServicePathsBuilder servicePathBuilder = new ServicePathsBuilder();
if (serviceCreateInput != null) {
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.path
- .ServiceAEndBuilder serviceAEnd = new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .service.types.rev170426.service.path.ServiceAEndBuilder();
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
+ .service.types.rev171016.service.path.ServiceAEndBuilder serviceAEnd =
+ new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
+ .service.types.rev171016.service.path.ServiceAEndBuilder();
serviceAEnd.setServiceFormat(serviceCreateInput.getServiceAEnd().getServiceFormat())
- .setServiceRate(serviceCreateInput.getServiceAEnd().getServiceRate())
- .setClli(serviceCreateInput.getServiceAEnd().getClli())
- .setNodeId(serviceCreateInput.getServiceAEnd().getNodeId())
- .setTxDirection(
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
- .rev170426.service.endpoint.sp.TxDirectionBuilder()
- .setPort(serviceCreateInput.getServiceAEnd().getTxDirection().getPort()).build())
- .setRxDirection(
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
- .rev170426.service.endpoint.sp.RxDirectionBuilder()
- .setPort(serviceCreateInput.getServiceAEnd().getRxDirection().getPort()).build());
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.path
- .ServiceZEndBuilder serviceZEnd =
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426
- .service.path.ServiceZEndBuilder();
+ .setServiceRate(serviceCreateInput.getServiceAEnd().getServiceRate())
+ .setClli(serviceCreateInput.getServiceAEnd().getClli())
+ .setNodeId(serviceCreateInput.getServiceAEnd().getNodeId())
+ .setTxDirection(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
+ .rev171016.service.endpoint.sp.TxDirectionBuilder()
+ .setPort(serviceCreateInput.getServiceAEnd().getTxDirection().getPort()).build())
+ .setRxDirection(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
+ .rev171016.service.endpoint.sp.RxDirectionBuilder()
+ .setPort(serviceCreateInput.getServiceAEnd().getRxDirection().getPort()).build());
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
+ .service.types.rev171016.service.path.ServiceZEndBuilder serviceZEnd =
+ new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
+ .service.types.rev171016.service.path.ServiceZEndBuilder();
serviceZEnd.setServiceFormat(serviceCreateInput.getServiceZEnd().getServiceFormat())
- .setServiceRate(serviceCreateInput.getServiceZEnd().getServiceRate())
- .setClli(serviceCreateInput.getServiceZEnd().getClli())
- .setNodeId(serviceCreateInput.getServiceZEnd().getNodeId())
- .setTxDirection(
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
- .rev170426.service.endpoint.sp.TxDirectionBuilder()
- .setPort(serviceCreateInput.getServiceZEnd().getTxDirection().getPort()).build())
- .setRxDirection(
- new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
- .rev170426.service.endpoint.sp.RxDirectionBuilder()
- .setPort(serviceCreateInput.getServiceZEnd().getRxDirection().getPort()).build());
+ .setServiceRate(serviceCreateInput.getServiceZEnd().getServiceRate())
+ .setClli(serviceCreateInput.getServiceZEnd().getClli())
+ .setNodeId(serviceCreateInput.getServiceZEnd().getNodeId())
+ .setTxDirection(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
+ .rev171016.service.endpoint.sp.TxDirectionBuilder()
+ .setPort(serviceCreateInput.getServiceZEnd().getTxDirection().getPort()).build())
+ .setRxDirection(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types
+ .rev171016.service.endpoint.sp.RxDirectionBuilder()
+ .setPort(serviceCreateInput.getServiceZEnd().getRxDirection().getPort()).build());
servicePathBuilder.setServiceAEnd(serviceAEnd.build());
servicePathBuilder.setServiceZEnd(serviceZEnd.build());
MappingConstraints mapConstraints = new MappingConstraints(serviceCreateInput.getHardConstraints(),
import org.opendaylight.transportpce.servicehandler.validation.ServiceCreateValidation;
import org.opendaylight.transportpce.servicehandler.validation.checks.ComplianceCheckResult;
import org.opendaylight.transportpce.servicehandler.validation.checks.ServicehandlerCompliancyCheck;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.RpcActions;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.sdnc.request.header.SdncRequestHeaderBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.RpcStatus;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.delete.input.ServiceDeleteReqInfo.TailRetention;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.delete.input.ServiceDeleteReqInfoBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.Services;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
ServiceImplementationRequestInput serviceImplementationRequest =
ModelMappingUtils.createServiceImplementationRequest(input, pceResponse);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
- .ServiceImplementationRequestOutput serviceImplementationRequestOutput = this.rendererServiceOperations
+ ServiceImplementationRequestOutput serviceImplementationRequestOutput = this.rendererServiceOperations
.serviceImplementation(serviceImplementationRequest);
if (ResponseCodes.RESPONSE_OK
.equals(serviceImplementationRequestOutput.getConfigurationResponseCommon().getResponseCode())) {
}
LOG.debug("Service '{}' present in datastore !", serviceName);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput
- serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(input);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteInput serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(input);
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
.ServiceDeleteOutput output = this.rendererServiceOperations.serviceDelete(serviceDeleteInput);
if (!ResponseCodes.RESPONSE_OK
return ModelMappingUtils.createRerouteServiceReply(input, ResponseCodes.FINAL_ACK_YES,
message, RpcStatus.Failed);
}
- ServiceRerouteOutputBuilder output = new ServiceRerouteOutputBuilder()
- .setHardConstraints(null).setSoftConstraints(null).setStatus(
- org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.RpcStatus.Successful)
- .setStatusMessage("Service reroute successfully !");
- return RpcResultBuilder.success(output).buildFuture();
+ message = "Service reroute successfully !";
+ return ModelMappingUtils.createRerouteServiceReply(input, ResponseCodes.FINAL_ACK_YES,
+ message, RpcStatus.Successful);
} else {
LOG.error("Service '{}' is not present", input.getServiceName());
message = "Service '" + input.getServiceName() + "' is not present";
import org.opendaylight.transportpce.pce.service.PathComputationService;
import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PceListener;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.TransportpcePceListener;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.OrgOpenroadmServiceService;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.slf4j.Logger;
private final DataBroker dataBroker;
private final RpcProviderRegistry rpcRegistry;
private final NotificationService notificationService;
- private ListenerRegistration<PceListener> pcelistenerRegistration;
+ private ListenerRegistration<TransportpcePceListener> pcelistenerRegistration;
private RpcRegistration<OrgOpenroadmServiceService> rpcRegistration;
private PathComputationService pathComputationService;
private RendererServiceOperations rendererServiceOperations;
final ServicehandlerImpl servicehandler = new ServicehandlerImpl(dataBroker, pathComputationService,
rendererServiceOperations);
final PceListenerImpl pceListener = new PceListenerImpl();
- pcelistenerRegistration = notificationService.registerNotificationListener(pceListener);
rpcRegistration = rpcRegistry.addRpcImplementation(OrgOpenroadmServiceService.class, servicehandler);
}
*/
package org.opendaylight.transportpce.servicehandler.listeners;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PceListener;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.ServicePathRpcResult;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.RpcStatusEx;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.ServicePathNotificationTypes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.ServicePathRpcResult;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.TransportpcePceListener;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.RpcStatusEx;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.ServicePathNotificationTypes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Deprecated
-public class PceListenerImpl implements PceListener {
+public class PceListenerImpl implements TransportpcePceListener {
private static final Logger LOG = LoggerFactory.getLogger(PceListenerImpl.class);
"Received '" + notification.getNotificationType() + "' StubPce notification " + "from service '"
+ notification.getServiceName() + "' " + "with status '" + notification.getStatus() + "'");
build.append(" with StatusMessage '" + notification.getStatusMessage() + "'");
- if (notification.getStatus() == RpcStatusEx.Successful && notification.getNotificationType()
- .getIntValue() == ServicePathNotificationTypes.PathComputationRequest.getIntValue()) {
+ if ((notification.getStatus() == RpcStatusEx.Successful) && (notification.getNotificationType()
+ .getIntValue() == ServicePathNotificationTypes.PathComputationRequest.getIntValue())) {
build.append(" PathDescription : " + notification.getPathDescription().toString());
/*
* switch (action.getIntValue()) { case 1: //service-create case
import org.opendaylight.transportpce.pce.service.PathComputationService;
import org.opendaylight.transportpce.servicehandler.MappingConstraints;
import org.opendaylight.transportpce.servicehandler.ModelMappingUtils;
-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.CancelResourceReserveInputBuilder;
-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.PathComputationRequestInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.sdnc.request.header.SdncRequestHeader;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.RoutingConstraintsSp;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.HardConstraints;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.SoftConstraints;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.handler.header.ServiceHandlerHeaderBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp.PceMetric;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.HardConstraints;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.SoftConstraints;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.handler.header.ServiceHandlerHeaderBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
.setServiceHandlerHeader(serviceHandlerHeader.build())
.setHardConstraints(hardConstraints)
.setSoftConstraints(softConstraints)
- .setPceMetric(RoutingConstraintsSp.PceMetric.TEMetric)
+ .setPceMetric(PceMetric.TEMetric)
.setServiceAEnd(ModelMappingUtils.createServiceAEnd(serviceCreateInput.getServiceAEnd()))
.setServiceZEnd(ModelMappingUtils.createServiceZEnd(serviceCreateInput.getServiceZEnd()))
.build();
import java.util.Optional;
import org.opendaylight.transportpce.common.OperationResult;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.State;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.Services;
import java.util.concurrent.Future;
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.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.transportpce.common.OperationResult;
import org.opendaylight.transportpce.common.Timeouts;
import org.opendaylight.transportpce.servicehandler.ModelMappingUtils;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.State;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceList;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.Services;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.ServicesBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.ServicesKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServicePathList;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePaths;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.ExecutionException;
import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutput;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.opendaylight.transportpce.servicehandler.stub;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.handler.header.ServiceHandlerHeader;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.handler.header.ServiceHandlerHeader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*/
public Boolean checkString(String value) {
Boolean result = false;
- if (value != null && value.compareTo("") != 0) {
+ if ((value != null) && (value.compareTo("") != 0)) {
result = true;
}
return result;
package org.opendaylight.transportpce.servicehandler.stub;
import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutputBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
public void serviceToServicePathConstarintsParameterizedConstructor() {
this.mappingConstraints = new MappingConstraints(
new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.HardConstraintsBuilder()
+ .routing.constraints.rev171017.routing.constraints.sp.HardConstraintsBuilder()
.setCustomerCode(Arrays.asList("Some customer-code"))
.setCoRoutingOrGeneral(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder()
+ .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder()
.setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev170426.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
+ .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
.setExistingService(Arrays.asList("Some existing-service"))
.build())
.build()).build(),
new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.SoftConstraintsBuilder()
+ .routing.constraints.rev171017.routing.constraints.sp.SoftConstraintsBuilder()
.setCustomerCode(Arrays.asList("Some customer-code"))
.setCoRoutingOrGeneral(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder()
+ .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder()
.setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev170426.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
+ .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
.setExistingService(Arrays.asList("Some existing-service"))
.build())
.build()).build());
this.mappingConstraints.serviceToServicePathConstarints();
Assert.assertEquals(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder()
+ .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder()
.setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev170426.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
+ .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
.setExistingService(Arrays.asList("Some existing-service"))
.build())
.build(), this.mappingConstraints.getServicePathHardConstraints().getCoRoutingOrGeneral());
Assert.assertEquals(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .routing.constraints.rev170426.routing.constraints.sp.SoftConstraintsBuilder()
+ .routing.constraints.rev171017.routing.constraints.sp.SoftConstraintsBuilder()
.setCustomerCode(Arrays.asList("Some customer-code"))
.setCoRoutingOrGeneral(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev170426.constraints.sp.co.routing.or.general.CoRoutingBuilder()
+ .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder()
.setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev170426.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
+ .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
.setExistingService(Arrays.asList("Some existing-service"))
.build())
.build()).build(), this.mappingConstraints.getServicePathSoftConstraints());
import org.opendaylight.transportpce.servicehandler.service.PCEServiceWrapper;
import org.opendaylight.transportpce.servicehandler.utils.ServiceDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.ConnectionType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.CoRoutingBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.HardConstraintsBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceReconfigureInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.Services;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.ServicesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePaths;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
import org.opendaylight.transportpce.servicehandler.utils.ServiceDataUtils;
import org.opendaylight.transportpce.servicehandler.validation.checks.ComplianceCheckResult;
import org.opendaylight.transportpce.test.AbstractTest;
-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.PathComputationRequestOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceDeleteOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.ServiceImplementationRequestOutputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.RpcActions;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommon;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.delete.input.ServiceDeleteReqInfoBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.Services;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.ServicesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutputBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
ServiceDeleteInput serviceDeleteInput = ServiceDataUtils.buildServiceDeleteInput();
Optional<Services> service = Optional.of(new ServicesBuilder().setServiceName("service 1").build());
Mockito.when(this.serviceDataStoreOperationsMock.getService("service 1")).thenReturn(service);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
- .ServiceDeleteInput input = ModelMappingUtils
- .createServiceDeleteInput(serviceDeleteInput);
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteInput input = ModelMappingUtils.createServiceDeleteInput(serviceDeleteInput);
ConfigurationResponseCommon configurationResponseCommon = new ConfigurationResponseCommonBuilder()
.setAckFinalIndicator(ResponseCodes.FINAL_ACK_YES).setRequestId("1")
.setResponseCode(ResponseCodes.RESPONSE_FAILED).setResponseMessage("success").build();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
- .ServiceDeleteOutput output = new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .servicepath.rev170426.ServiceDeleteOutputBuilder()
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteOutput output = new ServiceDeleteOutputBuilder()
.setConfigurationResponseCommon(configurationResponseCommon).build();
Mockito.when(this.rendererServiceOperationsMock.serviceDelete(input)).thenReturn(output);
ServiceDeleteOutput result = this.serviceHandlerImplMock.serviceDelete(serviceDeleteInput).get().getResult();
ServiceDeleteInput serviceDeleteInput = ServiceDataUtils.buildServiceDeleteInput();
Optional<Services> service = Optional.of(new ServicesBuilder().setServiceName("service 1").build());
Mockito.when(this.serviceDataStoreOperationsMock.getService("service 1")).thenReturn(service);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
- .ServiceDeleteInput input = ModelMappingUtils
- .createServiceDeleteInput(serviceDeleteInput);
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteInput input = ModelMappingUtils.createServiceDeleteInput(serviceDeleteInput);
ConfigurationResponseCommon configurationResponseCommon = new ConfigurationResponseCommonBuilder()
.setAckFinalIndicator(ResponseCodes.FINAL_ACK_YES).setRequestId("1")
.setResponseCode(ResponseCodes.RESPONSE_OK).setResponseMessage("success").build();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
- .ServiceDeleteOutput output = new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .servicepath.rev170426.ServiceDeleteOutputBuilder()
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteOutput output = new ServiceDeleteOutputBuilder()
.setConfigurationResponseCommon(configurationResponseCommon).build();
Mockito.when(this.rendererServiceOperationsMock.serviceDelete(input)).thenReturn(output);
Mockito.when(this.serviceDataStoreOperationsMock
ServiceDeleteInput serviceDeleteInput = ServiceDataUtils.buildServiceDeleteInput();
Optional<Services> service = Optional.of(new ServicesBuilder().setServiceName("service 1").build());
Mockito.when(this.serviceDataStoreOperationsMock.getService("service 1")).thenReturn(service);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
- .ServiceDeleteInput input = ModelMappingUtils
- .createServiceDeleteInput(serviceDeleteInput);
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteInput input = ModelMappingUtils.createServiceDeleteInput(serviceDeleteInput);
ConfigurationResponseCommon configurationResponseCommon = new ConfigurationResponseCommonBuilder()
.setAckFinalIndicator(ResponseCodes.FINAL_ACK_YES).setRequestId("1")
.setResponseCode(ResponseCodes.RESPONSE_OK).setResponseMessage("success").build();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
- .ServiceDeleteOutput output = new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .servicepath.rev170426.ServiceDeleteOutputBuilder()
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteOutput output = new ServiceDeleteOutputBuilder()
.setConfigurationResponseCommon(configurationResponseCommon).build();
Mockito.when(this.rendererServiceOperationsMock.serviceDelete(input)).thenReturn(output);
Mockito.when(this.serviceDataStoreOperationsMock
ServiceDeleteInput serviceDeleteInput = ServiceDataUtils.buildServiceDeleteInput();
Optional<Services> service = Optional.of(new ServicesBuilder().setServiceName("service 1").build());
Mockito.when(this.serviceDataStoreOperationsMock.getService("service 1")).thenReturn(service);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
.ServiceDeleteInput input = ModelMappingUtils.createServiceDeleteInput(serviceDeleteInput);
ConfigurationResponseCommon configurationResponseCommon = new ConfigurationResponseCommonBuilder()
.setAckFinalIndicator(ResponseCodes.FINAL_ACK_YES).setRequestId("1")
.setResponseCode(ResponseCodes.RESPONSE_OK).setResponseMessage("success").build();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
- .ServiceDeleteOutput output = new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .servicepath.rev170426.ServiceDeleteOutputBuilder()
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteOutput output = new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer
+ .rev171017.ServiceDeleteOutputBuilder()
.setConfigurationResponseCommon(configurationResponseCommon).build();
Mockito.when(this.rendererServiceOperationsMock.serviceDelete(input)).thenReturn(output);
Mockito.when(this.serviceDataStoreOperationsMock
Services serviceMock = ModelMappingUtils.mappingServices(serviceInput, null);
Optional<Services> service = Optional.of(serviceMock);
Mockito.when(this.serviceDataStoreOperationsMock.getService(any(String.class))).thenReturn(service);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
.ServiceDeleteInput input = ModelMappingUtils.createServiceDeleteInput(serviceRerouteinput, service.get());
ConfigurationResponseCommon configurationResponseCommon = new ConfigurationResponseCommonBuilder()
.setAckFinalIndicator(ResponseCodes.FINAL_ACK_YES).setRequestId("1")
.setResponseCode(ResponseCodes.RESPONSE_OK).setResponseMessage("success").build();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
- .ServiceDeleteOutput output = new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
- .servicepath.rev170426.ServiceDeleteOutputBuilder()
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteOutput output = new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer
+ .rev171017.ServiceDeleteOutputBuilder()
.setConfigurationResponseCommon(configurationResponseCommon).build();
Mockito.when(this.rendererServiceOperationsMock.serviceDelete(input)).thenReturn(output);
Mockito.when(this.serviceDataStoreOperationsMock
import org.junit.Test;
import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl;
import org.opendaylight.transportpce.servicehandler.utils.ServiceDataUtils;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.ServicePathRpcResult;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.ServicePathRpcResultBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.RpcStatusEx;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.ServicePathNotificationTypes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.ServicePathRpcResult;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.ServicePathRpcResultBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.RpcStatusEx;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.ServicePathNotificationTypes;
+
public class PceListenserImplTest {
import org.opendaylight.transportpce.pce.utils.NotificationPublishServiceMock;
import org.opendaylight.transportpce.servicehandler.utils.ServiceDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
-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.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.CancelResourceReserveInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.RpcActions;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.sdnc.request.header.SdncRequestHeader;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.sdnc.request.header.SdncRequestHeaderBuilder;
import org.opendaylight.transportpce.servicehandler.stub.StubRendererServiceOperations;
import org.opendaylight.transportpce.servicehandler.utils.ServiceDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.State;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInput;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.ServicePathRpcResult;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.ServicePathRpcResultBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.service.path.rpc.result.PathDescription;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.service.path.rpc.result.PathDescriptionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.ServicePathRpcResult;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.ServicePathRpcResultBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.service.path.rpc.result.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.service.path.rpc.result.PathDescriptionBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.ConnectionType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.RpcActions;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.ServiceFormat;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceRerouteInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.delete.input.ServiceDeleteReqInfo;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.delete.input.ServiceDeleteReqInfoBuilder;
-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;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.RpcStatusEx;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.ServicePathNotificationTypes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.RpcStatusEx;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.ServicePathNotificationTypes;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
public final class ServiceDataUtils {
-diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java
-index e5b44c4..a063b9e 100644
---- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java
-+++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java
-@@ -8,8 +8,6 @@
- package org.opendaylight.transportpce.servicehandler;
-
- import com.google.common.util.concurrent.ListenableFuture;
--import java.util.ArrayList;
--import java.util.List;
- 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;
-@@ -18,8 +16,6 @@ import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev17
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommon;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.response.parameters.ResponseParametersBuilder;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.Topology;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.TopologyBuilder;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.LifecycleState;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.State;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInput;
-@@ -31,12 +27,6 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.Service
- import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceReconfigureInput;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.Services;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.list.ServicesBuilder;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.AToZ;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.AToZBuilder;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.AToZKey;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.ZToA;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.ZToABuilder;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.ZToAKey;
- import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.HardConstraintsBuilder;
- import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.routing.constraints.sp.SoftConstraintsBuilder;
- import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.endpoint.sp.RxDirection;
-@@ -238,42 +228,6 @@ public final class ModelMappingUtils {
- .setSoftConstraints(serviceReconfigureInput.getSoftConstraints())
- .setLifecycleState(LifecycleState.Planned).setServiceAEnd(aend).setServiceZEnd(zend);
- }
--
-- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.response
-- .parameters.sp.ResponseParameters responseParameters = output.getResponseParameters();
-- if (responseParameters != null) {
-- // service.setPceMetric(responseParameters.getPceMetric());
-- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426
-- .response.parameters.sp.response.parameters.PathDescription pathDescription =
-- responseParameters.getPathDescription();
-- if (pathDescription != null) {
-- List<AToZ> atozList = new ArrayList<>();
-- List<ZToA> ztoaList = new ArrayList<>();
--
-- 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.key().getId());
-- AToZ atoz = new AToZBuilder().setId(tmp.getId()).withKey(key)
-- // .setResource(tmp.getResource())
-- .build();
-- atozList.add(atoz);
-- }
--
-- 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.key().getId());
-- ZToA ztoa = new ZToABuilder().setId(tmp.getId()).withKey(key)
-- // .setResource(tmp.getResource())
-- .build();
-- ztoaList.add(ztoa);
-- }
--
-- Topology topology = new TopologyBuilder().setAToZ(atozList).setZToA(ztoaList).build();
-- service.setTopology(topology);
-- }
-- }
- return service.build();
- }
-
diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java
-index b81e9b4..c5b5045 100644
+index ccd0f14..8219393 100644
--- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java
+++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImpl.java
-@@ -27,6 +27,7 @@ import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOper
+@@ -22,6 +22,7 @@ import org.opendaylight.transportpce.servicehandler.ModelMappingUtils;
+ import org.opendaylight.transportpce.servicehandler.service.PCEServiceWrapper;
+ import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
+ import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperationsImpl;
++import org.opendaylight.transportpce.servicehandler.stub.StubRendererServiceOperations;
import org.opendaylight.transportpce.servicehandler.validation.ServiceCreateValidation;
import org.opendaylight.transportpce.servicehandler.validation.checks.ComplianceCheckResult;
import org.opendaylight.transportpce.servicehandler.validation.checks.ServicehandlerCompliancyCheck;
-+import org.opendaylight.transportpce.stubrenderer.SendingRendererRPCs;
- import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.RpcActions;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.sdnc.request.header.SdncRequestHeaderBuilder;
-@@ -89,6 +90,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
+@@ -84,6 +85,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
+ private DataBroker db;
private ServiceDataStoreOperations serviceDataStoreOperations;
private RendererServiceOperations rendererServiceOperations;
++ private StubRendererServiceOperations stubRendererServiceOperations;
private PCEServiceWrapper pceServiceWrapper;
-+ private SendingRendererRPCs stubrendererService;
//TODO: remove private request fields as they are in global scope
-
-@@ -145,8 +147,9 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
+@@ -92,6 +94,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
+ RendererServiceOperations rendererServiceOperations) {
+ this.db = databroker;
+ this.rendererServiceOperations = rendererServiceOperations;
++ this.stubRendererServiceOperations = new StubRendererServiceOperations();
+ this.serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(this.db);
+ this.serviceDataStoreOperations.initialize();
+ this.pceServiceWrapper = new PCEServiceWrapper(pathComputationService);
+@@ -141,8 +144,8 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
ServiceImplementationRequestInput serviceImplementationRequest =
ModelMappingUtils.createServiceImplementationRequest(input, pceResponse);
-+ this.stubrendererService = new SendingRendererRPCs();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
-- .ServiceImplementationRequestOutput serviceImplementationRequestOutput = this.rendererServiceOperations
-+ .ServiceImplementationRequestOutput serviceImplementationRequestOutput = this.stubrendererService
- .serviceImplementation(serviceImplementationRequest);
+- ServiceImplementationRequestOutput serviceImplementationRequestOutput = this.rendererServiceOperations
+- .serviceImplementation(serviceImplementationRequest);
++ ServiceImplementationRequestOutput serviceImplementationRequestOutput = this.stubRendererServiceOperations
++ .serviceImplementation(serviceImplementationRequest);
if (ResponseCodes.RESPONSE_OK
.equals(serviceImplementationRequestOutput.getConfigurationResponseCommon().getResponseCode())) {
-@@ -215,8 +218,9 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
- LOG.debug("Service '{}' present in datastore !", serviceName);
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput
- serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(input);
-+ this.stubrendererService = new SendingRendererRPCs();
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426
+ String message = "Service rendered successfully !";
+@@ -216,8 +219,7 @@ public class ServicehandlerImpl implements OrgOpenroadmServiceService {
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
+ .ServiceDeleteInput serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(input);
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017
- .ServiceDeleteOutput output = this.rendererServiceOperations.serviceDelete(serviceDeleteInput);
-+ .ServiceDeleteOutput output = this.stubrendererService.serviceDelete(serviceDeleteInput);
-
+-
++ .ServiceDeleteOutput output = this.stubRendererServiceOperations.serviceDelete(serviceDeleteInput);
if (!ResponseCodes.RESPONSE_OK
.equals(output.getConfigurationResponseCommon().getResponseCode())) {
-diff --git a/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java b/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java
-index 6db468c..76e4a26 100644
---- a/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java
-+++ b/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java
-@@ -9,13 +9,8 @@ package org.opendaylight.transportpce.servicehandler.stub;
-
- import java.util.concurrent.ExecutionException;
- import java.util.concurrent.Future;
--
- import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
- import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
--import org.opendaylight.transportpce.servicehandler.mappers.ServiceDeleteInputConverter;
--import org.opendaylight.transportpce.servicehandler.mappers.ServiceDeleteOutputConverter;
--import org.opendaylight.transportpce.servicehandler.mappers.ServiceImplementationRequestInputConverter;
--import org.opendaylight.transportpce.servicehandler.mappers.ServiceImplementationRequestOutputConverter;
- import org.opendaylight.transportpce.stubrenderer.impl.StubrendererImpl;
- import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
- import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-@@ -30,16 +25,15 @@ public class StubRendererServiceOperations implements RendererServiceOperations
- private StubrendererImpl stubrenderer;
-
- public StubRendererServiceOperations(NotificationPublishService notificationPublishService) {
-- this.stubrenderer = new StubrendererImpl(notificationPublishService);
-+ this.stubrenderer = new StubrendererImpl();
- }
-
- @Override
- public ServiceImplementationRequestOutput serviceImplementation(ServiceImplementationRequestInput input) {
-- Future<RpcResult<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426
-- .ServiceImplementationRequestOutput>> rpcResultFuture = this.stubrenderer
-- .serviceImplementationRequest(ServiceImplementationRequestInputConverter.getStub(input));
-+ Future<RpcResult<ServiceImplementationRequestOutput>> rpcResultFuture = this.stubrenderer
-+ .serviceImplementationRequest(input);
- try {
-- return ServiceImplementationRequestOutputConverter.getConcrete(rpcResultFuture.get().getResult());
-+ return rpcResultFuture.get().getResult();
- } catch (InterruptedException e) {
- LOG.error("RPC serviceImplementation failed !",e);
- } catch (ExecutionException e) {
-@@ -50,11 +44,10 @@ public class StubRendererServiceOperations implements RendererServiceOperations
-
- @Override
- public ServiceDeleteOutput serviceDelete(ServiceDeleteInput input) {
-- Future<RpcResult<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426
-- .ServiceDeleteOutput>> rpcResultFuture = this.stubrenderer
-- .serviceDelete(ServiceDeleteInputConverter.getStub(input));
-+ Future<RpcResult<ServiceDeleteOutput>> rpcResultFuture = this.stubrenderer
-+ .serviceDelete(input);
- try {
-- return ServiceDeleteOutputConverter.getConcrete(rpcResultFuture.get().getResult());
-+ return rpcResultFuture.get().getResult();
- } catch (InterruptedException e) {
- LOG.error("RPC serviceDelete failed !",e);
- } catch (ExecutionException e) {
-diff --git a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/SendingRendererRPCs.java b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/SendingRendererRPCs.java
-index cdcdc0e..b43535f 100644
---- a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/SendingRendererRPCs.java
-+++ b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/SendingRendererRPCs.java
-@@ -8,16 +8,18 @@
-
- package org.opendaylight.transportpce.stubrenderer;
-
--import com.google.common.util.concurrent.ListenableFuture;
--import com.google.common.util.concurrent.ListeningExecutorService;
--
- import java.util.ArrayList;
- import java.util.List;
--import java.util.concurrent.Callable;
--
-+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.TopologyBuilder;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.AToZ;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev161014.topology.ZToA;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutputBuilder;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutputBuilder;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
-
-@@ -41,73 +43,78 @@ public class SendingRendererRPCs {
- private List<AToZ> atoz;
- private List<ZToA> ztoa;
- private String error;
-- private final ListeningExecutorService executor;
-
-- public SendingRendererRPCs(ListeningExecutorService executor) {
-- success = true;
-+ public SendingRendererRPCs() {
-+ this.success = true;
- setTopology(null);
-- this.executor = executor;
- setError("");
- }
-
- private void buildAtoZ() {
-- atoz = new ArrayList<AToZ>();
-+ this.atoz = new ArrayList<AToZ>();
- }
-
- private void buildZtoA() {
-- ztoa = new ArrayList<ZToA>();
-+ this.ztoa = new ArrayList<ZToA>();
- }
-
-- public ListenableFuture<Boolean> serviceDelete() {
-+ public ServiceDeleteOutput serviceDelete(ServiceDeleteInput input) {
-+ String message = "Service deleted !";
-+ String responseCode = "200";
- LOG.info("ServiceDelete request ...");
-- success = false;
-- return executor.submit(new Callable<Boolean>() {
-- @Override
-- public Boolean call() throws Exception {
-- Boolean output = true;
-- LOG.info("Wait for 10s til beginning the Renderer serviceDelete request");
-- try {
-- Thread.sleep(10000); //sleep for 10s
-- } catch (InterruptedException e) {
-- output = false;
-- LOG.error("Thread.sleep failed : {}", e.toString());
-- }
-- buildAtoZ();
-- buildZtoA();
-- success = true;
-- return output;
-- }
-- });
-+ LOG.info("Wait for 10s til beginning the Renderer serviceDelete request");
-+ try {
-+ Thread.sleep(1000); //sleep for 1s
-+ } catch (InterruptedException e) {
-+ message = "deleting service failed !";
-+ LOG.error(message);
-+ responseCode = "500";
-+ setError(message);
-+ }
-+ ConfigurationResponseCommonBuilder configurationResponseCommon = new ConfigurationResponseCommonBuilder()
-+ .setAckFinalIndicator("yes")
-+ .setRequestId(input.getServiceHandlerHeader().getRequestId())
-+ .setResponseCode(responseCode)
-+ .setResponseMessage(message);
-+ ServiceDeleteOutput output = new ServiceDeleteOutputBuilder()
-+ .setConfigurationResponseCommon(configurationResponseCommon.build())
-+ .build();
-+ return output;
- }
-
-- public ListenableFuture<Boolean> serviceImplementation() {
-+ public ServiceImplementationRequestOutput serviceImplementation(ServiceImplementationRequestInput input) {
-+ String message = "Service implemented !";
-+ String responseCode = "200";
-+ setSuccess(true);
- LOG.info("serviceImplementation request ...");
-- success = false;
-- return executor.submit(new Callable<Boolean>() {
-- @Override
-- public Boolean call() throws Exception {
-- Boolean output = true;
-- LOG.info("Wait for 10s til beginning the Renderer serviceDelete request");
-- try {
-- Thread.sleep(10000); //sleep for 10s
-- } catch (InterruptedException e) {
-- output = false;
-- LOG.error("Thread.sleep failed : {}", e.toString());
-- }
-- buildAtoZ();
-- buildZtoA();
-- setTopology(new TopologyBuilder()
-- .setAToZ(atoz)
-- .setZToA(ztoa));
-- output = true;
-- success = true;
-- return output;
-- }
-- });
-+ LOG.info("Wait for 10s til beginning the Renderer serviceDelete request");
-+ try {
-+ Thread.sleep(1000); //sleep for 1s
-+ } catch (InterruptedException e) {
-+ message = "implementing service failed !";
-+ LOG.error(message);
-+ setError(message);
-+ responseCode = "500";
-+ setSuccess(false);
-+ }
-+ buildAtoZ();
-+ buildZtoA();
-+ setTopology(new TopologyBuilder()
-+ .setAToZ(SendingRendererRPCs.this.atoz)
-+ .setZToA(SendingRendererRPCs.this.ztoa));
-+ ConfigurationResponseCommonBuilder configurationResponseCommon = new ConfigurationResponseCommonBuilder()
-+ .setAckFinalIndicator("yes")
-+ .setRequestId(input.getServiceHandlerHeader().getRequestId())
-+ .setResponseCode(responseCode)
-+ .setResponseMessage(message);
-+ ServiceImplementationRequestOutput output = new ServiceImplementationRequestOutputBuilder()
-+ .setConfigurationResponseCommon(configurationResponseCommon.build())
-+ .build();
-+ return output;
- }
-
- public Boolean getSuccess() {
-- return success;
-+ return this.success;
- }
-
- public void setSuccess(Boolean success) {
-@@ -115,7 +122,7 @@ public class SendingRendererRPCs {
- }
-
- public TopologyBuilder getTopology() {
-- return topology;
-+ return this.topology;
- }
-
- public void setTopology(TopologyBuilder topo) {
-@@ -123,7 +130,7 @@ public class SendingRendererRPCs {
- }
-
- public String getError() {
-- return error;
-+ return this.error;
- }
-
- public void setError(String error) {
-diff --git a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererImpl.java b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererImpl.java
-index 6e197d5..e3e1984 100644
---- a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererImpl.java
-+++ b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererImpl.java
-@@ -9,30 +9,21 @@
-
- package org.opendaylight.transportpce.stubrenderer.impl;
-
--import com.google.common.util.concurrent.FutureCallback;
--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 org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
- import org.opendaylight.transportpce.stubrenderer.SendingRendererRPCs;
- import org.opendaylight.transportpce.stubrenderer.StubrendererCompliancyCheck;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceDeleteInput;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceDeleteOutput;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceDeleteOutputBuilder;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceImplementationRequestInput;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceImplementationRequestOutput;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceImplementationRequestOutputBuilder;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceRpcResultSp;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.ServiceRpcResultSpBuilder;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.StubrendererService;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.service.rpc.result.sp.PathTopology;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.service.rpc.result.sp.PathTopologyBuilder;
- import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
--import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.service.TopologyBuilder;
--import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.RpcStatusEx;
--import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.ServicePathNotificationTypes;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.CancelResourceReserveInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.CancelResourceReserveOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.PathComputationRequestInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.PathComputationRequestOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutputBuilder;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutputBuilder;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService;
- import org.opendaylight.yangtools.yang.common.RpcResult;
- import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
- import org.slf4j.Logger;
-@@ -45,21 +36,12 @@ import org.slf4j.LoggerFactory;
- * @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
- *
- */
--public class StubrendererImpl implements StubrendererService {
-+public class StubrendererImpl implements TransportpceServicepathService {
- /** Logging. */
- private static final Logger LOG = LoggerFactory.getLogger(StubrendererImpl.class);
-- /** send notification. */
-- private NotificationPublishService notificationPublishService;
-- private ServiceRpcResultSp notification;
-- private final ListeningExecutorService executor = MoreExecutors
-- .listeningDecorator(Executors.newFixedThreadPool(10));
- /** check service sdnc-request-header compliancy. */
- private StubrendererCompliancyCheck compliancyCheck;
-
-- public StubrendererImpl(NotificationPublishService notificationPublishService) {
-- this.notificationPublishService = notificationPublishService;
-- }
--
- @Override
- public ListenableFuture<RpcResult<ServiceImplementationRequestOutput>> serviceImplementationRequest(
- ServiceImplementationRequestInput input) {
-@@ -77,102 +59,20 @@ public class StubrendererImpl implements StubrendererService {
- * a path and implement a service.
- */
-
-- this.notification = new ServiceRpcResultSpBuilder()
-- .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
-- .setServiceName(input.getServiceName())
-- .setStatus(RpcStatusEx.Pending)
-- .setStatusMessage("Service compliant, submitting serviceImplementation Request ...")
-- .build();
-- try {
-- this.notificationPublishService.putNotification(this.notification);
-- } catch (InterruptedException e) {
-- LOG.info("notification offer rejected : {}", e);
-+ SendingRendererRPCs sendingRenderer = new SendingRendererRPCs();
-+ sendingRenderer.serviceImplementation(input);
-+ if (sendingRenderer.getSuccess()) {
-+ message = "Service implemented !";
-+ LOG.info(message);
-+ responseCode = "200";
-+ } else {
-+ message = "Service implementation failed : " + sendingRenderer.getError();
-+ LOG.error(message);
-+ responseCode = "500";
- }
--
-- SendingRendererRPCs sendingRenderer = new SendingRendererRPCs(this.executor);
-- FutureCallback<Boolean> rendererCallback =
-- new FutureCallback<Boolean>() {
-- String message = "";
-- ServiceRpcResultSp notification = null;
--
-- @Override
-- public void onFailure(Throwable arg0) {
-- LOG.error("Failure message : {}", arg0.toString());
-- LOG.error("Service implementation failed !");
-- this.notification = new ServiceRpcResultSpBuilder()
-- .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
-- .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
-- .setStatusMessage("PCR Request failed : {}" + arg0.getMessage()).build();
-- try {
-- StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
-- } catch (InterruptedException e) {
-- LOG.info("notification offer rejected : {}", e);
-- }
-- }
--
-- @Override
-- public void onSuccess(Boolean response) {
-- LOG.info("response : {}", response);
-- if (response) {
-- this.message = "Service implemented !";
-- TopologyBuilder topo = sendingRenderer.getTopology();
-- ServiceRpcResultSpBuilder tmp = new ServiceRpcResultSpBuilder()
-- .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
-- .setServiceName(input.getServiceName())
-- .setStatus(RpcStatusEx.Successful)
-- .setStatusMessage(this.message);
-- if (topo != null) {
-- PathTopology value = new PathTopologyBuilder()
-- .setAToZ(topo.getAToZ())
-- .setZToA(topo.getZToA())
-- .build();
-- tmp.setPathTopology(value);
-- }
-- this.notification = tmp.build();
-- } else {
-- this.message = "Service implementation failed : " + sendingRenderer.getError();
-- this.notification = new ServiceRpcResultSpBuilder()
-- .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
-- .setServiceName("")
-- .setStatus(RpcStatusEx.Failed).setStatusMessage(this.message)
-- .build();
-- }
-- LOG.info(this.notification.toString());
-- try {
-- StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
-- } catch (InterruptedException e) {
-- LOG.info("notification offer rejected : {}", e);
-- }
-- LOG.info(this.message);
-- }
-- };
-- ListenableFuture<Boolean> renderer = sendingRenderer.serviceImplementation();
-- Futures.addCallback(renderer, rendererCallback, this.executor);
-- LOG.info("Service implmentation Request in progress ");
-- configurationResponseCommon = new ConfigurationResponseCommonBuilder()
-- .setAckFinalIndicator("Yes")
-- .setRequestId(input.getServiceHandlerHeader().getRequestId())
-- .setResponseCode("200")
-- .setResponseMessage("Service implementation Request in progress ");
--
-- ServiceImplementationRequestOutput output = new ServiceImplementationRequestOutputBuilder()
-- .setConfigurationResponseCommon(configurationResponseCommon.build())
-- .build();
-- return RpcResultBuilder.success(output).buildFuture();
- } else {
-- message = this.compliancyCheck.getMessage();
-+ message = "Service not compliant";
+ message = "Service delete failed!";
+diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererImpl.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererImpl.java
+index 630fb67..2cc2bdf 100644
+--- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererImpl.java
++++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubrendererImpl.java
+@@ -51,6 +51,8 @@ public final class StubrendererImpl {
+ LOG.error("deleting service failed !", e);
responseCode = "500";
-- LOG.info("Service not compliant caused by : {}", message);
-- this.notification = new ServiceRpcResultSpBuilder()
-- .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
-- .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
-- .setStatusMessage("Service not compliant caused by : " + message)
-- .build();
-- try {
-- this.notificationPublishService.putNotification(this.notification);
-- } catch (InterruptedException e) {
-- LOG.info("notification offer rejected : {}", e);
-- }
}
- configurationResponseCommon = new ConfigurationResponseCommonBuilder()
++ responseCode = "200";
++ message = "Service deleted";
+ ConfigurationResponseCommonBuilder configurationResponseCommon = new ConfigurationResponseCommonBuilder()
.setAckFinalIndicator("yes")
-@@ -201,90 +101,20 @@ public class StubrendererImpl implements StubrendererService {
- * a path and implement a service.
- */
-
-- this.notification = new ServiceRpcResultSpBuilder()
-- .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
-- .setServiceName(input.getServiceName())
-- .setStatus(RpcStatusEx.Pending)
-- .setStatusMessage("Service compliant, submitting serviceDelete Request ...")
-- .build();
-- try {
-- this.notificationPublishService.putNotification(this.notification);
-- } catch (InterruptedException e) {
-- LOG.info("notification offer rejected : {}", e);
-+ SendingRendererRPCs sendingRenderer = new SendingRendererRPCs();
-+ sendingRenderer.serviceDelete(input);
-+ if (sendingRenderer.getSuccess()) {
-+ message = "Service deleted !";
-+ responseCode = "200";
-+ LOG.info(message);
-+ } else {
-+ message = "Service implementation failed : " + sendingRenderer.getError();
-+ LOG.error(message);
-+ responseCode = "500";
- }
-- SendingRendererRPCs sendingRenderer = new SendingRendererRPCs(this.executor);
-- FutureCallback<Boolean> rendererCallback = new FutureCallback<Boolean>() {
-- String message = "";
-- ServiceRpcResultSp notification = null;
--
-- @Override
-- public void onFailure(Throwable arg0) {
-- LOG.error("Failure message : {}", arg0.toString());
-- LOG.error("Service delete failed !");
-- this.notification = new ServiceRpcResultSpBuilder()
-- .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
-- .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
-- .setStatusMessage("PCR Request failed : " + arg0.getMessage()).build();
-- try {
-- StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
-- } catch (InterruptedException e) {
-- LOG.info("notification offer rejected : {}", e);
-- }
-- }
--
-- @Override
-- public void onSuccess(Boolean response) {
-- LOG.info("response : {}", response);
-- if (response) {
-- this.message = "Service deleted !";
-- this.notification = new ServiceRpcResultSpBuilder()
-- .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
-- .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Successful)
-- .setStatusMessage(this.message).build();
-- } else {
-- this.message = "Service delete failed : " + sendingRenderer.getError();
-- this.notification = new ServiceRpcResultSpBuilder()
-- .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
-- .setServiceName("")
-- .setStatus(RpcStatusEx.Failed).setStatusMessage(this.message)
-- .build();
-- }
-- LOG.info(this.notification.toString());
-- try {
-- StubrendererImpl.this.notificationPublishService.putNotification(this.notification);
-- } catch (InterruptedException e) {
-- LOG.info("notification offer rejected : {}", e);
-- }
-- LOG.info(this.message);
-- }
-- };
-- ListenableFuture<Boolean> renderer = sendingRenderer.serviceDelete();
-- Futures.addCallback(renderer, rendererCallback, this.executor);
-- message = "Service delete Request in progress ...";
-- LOG.info(message);
-- configurationResponseCommon = new ConfigurationResponseCommonBuilder()
-- .setAckFinalIndicator("Yes")
-- .setRequestId(input.getServiceHandlerHeader().getRequestId())
-- .setResponseCode("200")
-- .setResponseMessage(message);
-- ServiceDeleteOutput output = new ServiceDeleteOutputBuilder()
-- .setConfigurationResponseCommon(configurationResponseCommon.build())
-- .build();
-- return RpcResultBuilder.success(output).buildFuture();
- } else {
-- message = this.compliancyCheck.getMessage();
-- LOG.info("Service not compliant caused by : {}", message);
-+ message = "Service not compliant";
+ .setRequestId(input.getServiceHandlerHeader().getRequestId())
+@@ -75,6 +77,8 @@ public final class StubrendererImpl {
+ LOG.error(message);
responseCode = "500";
-- this.notification = new ServiceRpcResultSpBuilder()
-- .setNotificationType(ServicePathNotificationTypes.ServiceDelete)
-- .setServiceName(input.getServiceName()).setStatus(RpcStatusEx.Failed)
-- .setStatusMessage("Service not compliant caused by : " + message)
-- .build();
-- try {
-- this.notificationPublishService.putNotification(this.notification);
-- } catch (InterruptedException e) {
-- LOG.info("notification offer rejected : {}", e);
-- }
}
- configurationResponseCommon = new ConfigurationResponseCommonBuilder()
++ responseCode = "200";
++ message = "Service implemented";
+ ConfigurationResponseCommonBuilder configurationResponseCommon = new ConfigurationResponseCommonBuilder()
.setAckFinalIndicator("yes")
-@@ -296,4 +126,24 @@ public class StubrendererImpl implements StubrendererService {
- .build();
- return RpcResultBuilder.success(output).buildFuture();
- }
-+
-+ /* (non-Javadoc)
-+ * @see org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService#pathComputationRequest(org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.PathComputationRequestInput)
-+ */
-+ @Override
-+ public ListenableFuture<RpcResult<PathComputationRequestOutput>> pathComputationRequest(
-+ PathComputationRequestInput input) {
-+ // TODO Auto-generated method stub
-+ return null;
-+ }
-+
-+ /* (non-Javadoc)
-+ * @see org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService#cancelResourceReserve(org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.CancelResourceReserveInput)
-+ */
-+ @Override
-+ public ListenableFuture<RpcResult<CancelResourceReserveOutput>> cancelResourceReserve(
-+ CancelResourceReserveInput input) {
-+ // TODO Auto-generated method stub
-+ return null;
-+ }
- }
-diff --git a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererProvider.java b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererProvider.java
-index 0beb087..92b20f5 100644
---- a/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererProvider.java
-+++ b/tests/stubrenderer/src/main/java/org/opendaylight/transportpce/stubrenderer/impl/StubrendererProvider.java
-@@ -13,9 +13,7 @@ import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService
- import org.opendaylight.controller.md.sal.binding.api.NotificationService;
- import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
- import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.StubrendererListener;
--import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.stubrenderer.rev170426.StubrendererService;
--import org.opendaylight.yangtools.concepts.ListenerRegistration;
-+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
-
-@@ -27,17 +25,13 @@ import org.slf4j.LoggerFactory;
- public class StubrendererProvider {
- private static final Logger LOG = LoggerFactory.getLogger(StubrendererProvider.class);
- private final RpcProviderRegistry rpcRegistry;
-- private final NotificationPublishService notificationPublishService;
-
--
-- private BindingAwareBroker.RpcRegistration<StubrendererService> rpcRegistration;
-- private ListenerRegistration<StubrendererListener> stubRendererlistenerRegistration;
-+ private BindingAwareBroker.RpcRegistration<TransportpceServicepathService> rpcRegistration;
-
- public StubrendererProvider(RpcProviderRegistry rpcProviderRegistry,
- NotificationService notificationService,
- NotificationPublishService notificationPublishService) {
- this.rpcRegistry = rpcProviderRegistry;
-- this.notificationPublishService = notificationPublishService;
- }
-
- /**
-@@ -45,8 +39,8 @@ public class StubrendererProvider {
- */
- public void init() {
- LOG.info("StubrendererProvider Session Initiated");
-- final StubrendererImpl consumer = new StubrendererImpl(this.notificationPublishService);
-- this.rpcRegistration = this.rpcRegistry.addRpcImplementation(StubrendererService.class, consumer);
-+ final StubrendererImpl consumer = new StubrendererImpl();
-+ this.rpcRegistration = this.rpcRegistry.addRpcImplementation(TransportpceServicepathService.class, consumer);
- }
-
- /**
+ .setRequestId(input.getServiceHandlerHeader().getRequestId())
time.sleep(20)
def test_05_connect_xprdA_to_roadmA(self):
- url = "{}/operations/networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
data = {
"networkutils:input": {
"networkutils:links-input": {
self.assertIn('Xponder Roadm Link created successfully', res["output"]["result"])
def test_06_connect_roadmA_to_xpdrA(self):
- url = "{}/operations/networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
data = {
"networkutils:input": {
"networkutils:links-input": {
self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
def test_07_connect_xprdC_to_roadmC(self):
- url = "{}/operations/networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
data = {
"networkutils:input": {
"networkutils:links-input": {
self.assertIn('Xponder Roadm Link created successfully', res["output"]["result"])
def test_08_connect_roadmC_to_xpdrC(self):
- url = "{}/operations/networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
data = {
"networkutils:input": {
"networkutils:links-input": {
self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
def test_09_create_OTS_ROADMA(self):
- url = "{}/operations/renderer:create-ots-oms".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-device-renderer:create-ots-oms".format(self.restconf_baseurl)
data = {
"input" : {
"node-id" : "ROADMA",
res["output"]["result"])
def test_10_create_OTS_ROADMC(self):
- url = "{}/operations/renderer:create-ots-oms".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-device-renderer:create-ots-oms".format(self.restconf_baseurl)
data = {
"input" : {
"node-id" : "ROADMC",
res["output"]["result"])
def test_11_get_PM_ROADMA(self):
- url = "{}/operations/olm:get-pm".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-olm:get-pm".format(self.restconf_baseurl)
data = {
"input": {
"node-id": "ROADMA",
}, res["output"]["measurements"])
def test_12_get_PM_ROADMC(self):
- url = "{}/operations/olm:get-pm".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-olm:get-pm".format(self.restconf_baseurl)
data = {
"input": {
"node-id": "ROADMC",
}, res["output"]["measurements"])
def test_13_calculate_span_loss_base_ROADMA_ROADMC(self):
- url = "{}/operations/olm:calculate-spanloss-base".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-olm:calculate-spanloss-base".format(self.restconf_baseurl)
data = {
"input": {
"src-type": "link",
time.sleep(5)
def test_14_calculate_span_loss_base_all(self):
- url = "{}/operations/olm:calculate-spanloss-base".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-olm:calculate-spanloss-base".format(self.restconf_baseurl)
data = {
"input": {
"src-type": "all"
self.assertEqual(6, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-receive'])
def test_17_servicePath_create_AToZ(self):
- url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
data = {
"input": {
"service-name": "test",
time.sleep(40)
def test_18_servicePath_create_ZToA(self):
- url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
data = {
"input": {
"service-name": "test",
time.sleep(40)
def test_19_service_power_setup_XPDRA_XPDRC(self):
- url = "{}/operations/olm:service-power-setup".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-olm:service-power-setup".format(self.restconf_baseurl)
data = {
"input": {
"service-name": "test",
self.assertEqual("power", res['roadm-connections'][0]['opticalControlMode'])
def test_23_service_power_setup_XPDRC_XPDRA(self):
- url = "{}/operations/olm:service-power-setup".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-olm:service-power-setup".format(self.restconf_baseurl)
data = {
"input": {
"service-name": "test",
self.assertEqual(2, res['roadm-connections'][0]['target-output-power'])
def test_26_service_power_turndown_XPDRA_XPDRC(self):
- url = "{}/operations/olm:service-power-turndown".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-olm:service-power-turndown".format(self.restconf_baseurl)
data = {
"input": {
"service-name": "test",
self.assertEqual("off", res['roadm-connections'][0]['opticalControlMode'])
def test_29_servicePath_delete_AToZ(self):
- url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
data = {
"input": {
"service-name": "test",
time.sleep(10)
def test_30_servicePath_delete_ZToA(self):
- url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
data = {
"input": {
"service-name": "test",
"""to test case where SRG where the xpdr is connected to has no optical range data"""
def test_31_connect_xprdA_to_roadmA(self):
- url = "{}/operations/networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-networkutils:init-xpdr-rdm-links".format(self.restconf_baseurl)
data = {
"networkutils:input": {
"networkutils:links-input": {
self.assertIn('Xponder Roadm Link created successfully', res["output"]["result"])
def test_32_connect_roadmA_to_xpdrA(self):
- url = "{}/operations/networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-networkutils:init-rdm-xpdr-links".format(self.restconf_baseurl)
data = {
"networkutils:input": {
"networkutils:links-input": {
self.assertIn('Roadm Xponder links created successfully', res["output"]["result"])
def test_33_servicePath_create_AToZ(self):
- url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
data = {
"input": {
"service-name": "test2",
self.assertEqual(2, res['org-openroadm-optical-channel-interfaces:och']['wavelength-number'])
def test_35_servicePath_delete_AToZ(self):
- url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
data = {
"input": {
"service-name": "test",
time.sleep(10)
def test_38_calculate_span_loss_current(self):
- url = "{}/operations/olm:calculate-spanloss-current".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-olm:calculate-spanloss-current".format(self.restconf_baseurl)
headers = {'content-type': 'application/json'}
response = requests.request(
"POST", url, headers=headers, auth=('admin', 'admin'))
# Path Computation success
def test_04_path_computation(self):
- url = ("{}/operations/pce:path-computation-request"
+ url = ("{}/operations/transportpce-pce:path-computation-request"
.format(self.restconf_baseurl))
body = {"input": {
"service-name": "service-1",
# Test failed path computation
def test_09_fail_path_computation(self):
- url = ("{}/operations/pce:path-computation-request"
+ url = ("{}/operations/transportpce-pce:path-computation-request"
.format(self.restconf_baseurl))
body = {"input": {
"service-handler-header": {
# Test1 success path computation
def test_10_success1_path_computation(self):
- url = ("{}/operations/pce:path-computation-request"
+ url = ("{}/operations/transportpce-pce:path-computation-request"
.format(self.restconf_baseurl))
body = {"input": {
"service-name": "service1",
# Test2 success path computation with path description
def test_11_success2_path_computation(self):
- url = ("{}/operations/pce:path-computation-request"
+ url = ("{}/operations/transportpce-pce:path-computation-request"
.format(self.restconf_baseurl))
body = {"input": {
"service-name": "service 1",
# Test3 success path computation with hard-constraints exclude
def test_12_success3_path_computation(self):
- url = ("{}/operations/pce:path-computation-request"
+ url = ("{}/operations/transportpce-pce:path-computation-request"
.format(self.restconf_baseurl))
body = {"input": {
"service-name": "service 1",
# 'connected')
def test_02_restconfAPI(self):
- url = ("{}/config/portmapping:network/nodes/controller-config".format(self.restconf_baseurl))
+ url = ("{}/config/transportpce-portmapping:network/nodes/controller-config".format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
response = requests.request(
"GET", url, headers=headers, auth=('admin', 'admin'))
time.sleep(10)
def test_05_rdm_portmapping_DEG1_TTP_TXRX(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/ROADMA/mapping/DEG1-TTP-TXRX"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['mapping'])
def test_06_rdm_portmapping_SRG1_PP7_TXRX(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/ROADMA/mapping/SRG1-PP7-TXRX"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['mapping'])
def test_07_rdm_portmapping_SRG3_PP1_TXRX(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/ROADMA/mapping/SRG3-PP1-TXRX"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
time.sleep(10)
def test_10_xpdr_portmapping_NETWORK1(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/XPDRA/mapping/XPDR1-NETWORK1"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['mapping'])
def test_11_xpdr_portmapping_NETWORK2(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/XPDRA/mapping/XPDR1-NETWORK2"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['mapping'])
def test_12_xpdr_portmapping_CLIENT1(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/XPDRA/mapping/XPDR1-CLIENT1"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['mapping'])
def test_13_xpdr_portmapping_CLIENT2(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/XPDRA/mapping/XPDR1-CLIENT2"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['mapping'])
def test_14_xpdr_portmapping_CLIENT4(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/XPDRA/mapping/XPDR1-CLIENT4"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['errors']['error'])
def test_17_xpdr_device_disconnected(self):
- url = ("{}/config/portmapping:network/nodes/XPDRA".format(self.restconf_baseurl))
+ url = ("{}/config/transportpce-portmapping:network/nodes/XPDRA".format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
response = requests.request(
"GET", url, headers=headers, auth=('admin', 'admin'))
res['errors']['error'])
def test_20_rdm_device_disconnected(self):
- url = ("{}/config/portmapping:network/nodes/ROADMA".format(self.restconf_baseurl))
+ url = ("{}/config/transportpce-portmapping:network/nodes/ROADMA".format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
response = requests.request(
"GET", url, headers=headers, auth=('admin', 'admin'))
time.sleep(20)
def test_03_rdm_portmapping(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/ROADMA"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['nodes'][0]['mapping'])
def test_04_xpdr_portmapping(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/XPDRA"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['nodes'][0]['mapping'])
def test_05_service_path_create(self):
- url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
data = {"renderer:input": {
"renderer:service-name": "service_test",
"renderer:wave-number": "7",
self.assertIn('not-reserved-inuse', res['circuit-packs'][0]["equipment-state"])
def test_14_service_path_delete(self):
- url = "{}/operations/renderer:service-path".format(self.restconf_baseurl)
+ url = "{}/operations/transportpce-device-renderer:service-path".format(self.restconf_baseurl)
data = {"renderer:input": {
"renderer:service-name": "service_test",
"renderer:wave-number": "7",
# Verify 'test' service deleted
def test_13_get_service(self):
- url = ("{}/operational/org-openroadm-service:service-list/services/test-new"
+ url = ("{}/operational/org-openroadm-service:service-list/services/test"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json',
"Accept": "application/json"}
for i in range(0,nbTP):
tp_id=res_topo['node'][0]['ietf-network-topology:termination-point'][i]['tp-id']
if(not "CP" in tp_id):
- url_map="{}/config/portmapping:network/nodes/ROADMA/mapping/"+tp_id
+ url_map="{}/config/transportpce-portmapping:network/nodes/ROADMA/mapping/"+tp_id
with open('./transportpce_tests/log/topoPortMap.log', 'a') as outfile1:
outfile1.write('Config: '+`i`+'/'+ `nbTP`+' : '+url_map+'\n')
url = (url_map.format(self.restconf_baseurl))
for i in range(0,nbTP):
tp_id=res_topo['node'][0]['ietf-network-topology:termination-point'][i]['tp-id']
if(not "CTP" in tp_id):
- url_map ="{}/config/portmapping:network/nodes/ROADMA/mapping/"+tp_id
+ url_map ="{}/config/transportpce-portmapping:network/nodes/ROADMA/mapping/"+tp_id
with open('./transportpce_tests/log/topoPortMap.log', 'a') as outfile1:
outfile1.write('Config: '+`i`+'/'+ `nbTP`+' : '+url_map+'\n')
url = (url_map.format(self.restconf_baseurl))
nbTP=len(res_topo['node'][0]['ietf-network-topology:termination-point'])
for i in range(0,nbTP):
tp_id=res_topo['node'][0]['ietf-network-topology:termination-point'][i]['tp-id']
- url_map = "{}/config/portmapping:network/nodes/XPDRA/mapping/"+tp_id
+ url_map = "{}/config/transportpce-portmapping:network/nodes/XPDRA/mapping/"+tp_id
with open('./transportpce_tests/log/topoPortMap.log', 'a') as outfile1:
outfile1.write('Config: '+`i`+'/'+ `nbTP`+' : '+url_map+'\n')
url = url_map.format(self.restconf_baseurl)
if("CLIENT" in tp_id):
#Verify the tail equipment id of the client
xpdr_client=res_topo['node'][0]['ietf-network-topology:termination-point'][i]["org-openroadm-network-topology:xpdr-client-attributes"]["tail-equipment-id"]
- url_map = "{}/config/portmapping:network/nodes/XPDRA/mapping/"+xpdr_client
+ url_map = "{}/config/transportpce-portmapping:network/nodes/XPDRA/mapping/"+xpdr_client
with open('./transportpce_tests/log/topoPortMap.log', 'a') as outfile1:
outfile1.write('Config: '+`i`+'/'+ `nbTP`+' : '+xpdr_client+'\n')
url = url_map.format(self.restconf_baseurl)
if("NETWORK" in tp_id):
#Verify the tail equipment id of the network
xpdr_network=res_topo['node'][0]['ietf-network-topology:termination-point'][i]["org-openroadm-network-topology:xpdr-network-attributes"]["tail-equipment-id"]
- url_map = "{}/config/portmapping:network/nodes/XPDRA/mapping/"+xpdr_network
+ url_map = "{}/config/transportpce-portmapping:network/nodes/XPDRA/mapping/"+xpdr_network
with open('./transportpce_tests/log/topoPortMap.log', 'a') as outfile1:
outfile1.write('Config: '+`i`+'/'+ `nbTP`+' : '+xpdr_network+'\n')
url = url_map.format(self.restconf_baseurl)
#Connect the tail XPDRA to ROADMA and vice versa
def test_10_connect_tail_xpdr_rdm(self):
#Connect the tail: XPDRA to ROADMA
- url = ("{}/operations/networkutils:init-xpdr-rdm-links"
+ url = ("{}/operations/transportpce-networkutils:init-xpdr-rdm-links"
.format(self.restconf_baseurl))
data = {"networkutils:input": {
"networkutils:links-input": {
def test_11_connect_tail_rdm_xpdr(self):
#Connect the tail: ROADMA to XPDRA
- url = ("{}/operations/networkutils:init-rdm-xpdr-links"
+ url = ("{}/operations/transportpce-networkutils:init-rdm-xpdr-links"
.format(self.restconf_baseurl))
data = {"networkutils:input": {
"networkutils:links-input": {