}
public static final String CLLI_NETWORK_ID = "clli-network";
+
public static final String UNDERLAY_NETWORK_ID = "openroadm-network";
+
public static final String OVERLAY_NETWORK_ID = "openroadm-topology";
public enum Operation {
public final class StringConstants {
public static final String OPENROADM_DEVICE_MODEL_NAME = "org-openroadm-device";
+
public static final String DEFAULT_NETCONF_NODEID = "controller-config";
+
public static final String OPENROADM_DEVICE_VERSION_2_2 = "(http://org/openroadm/device?revision=2017-12-15)org-openroadm-device";
+
public static final String OPENROADM_DEVICE_VERSION_1_2_1 = "(http://org/openroadm/device?revision=2017-02-06)org-openroadm-device";
- public static final String NETWORK_TOKEN = "XPDR1-NETWORK";
+
+ public static final String NETWORK_TOKEN = "NETWORK";
+
public static final String TTP_TOKEN = "TTP";
- public static final String CLIENT_TOKEN = "XPDR1-CLIENT";
+
+ public static final String CLIENT_TOKEN = "CLIENT";
+
public static final String PP_TOKEN = "PP";
private StringConstants() {
return StringConstants.OPENROADM_DEVICE_VERSION_1_2_1;
}
} else {
- LOG.warn("Could not find mapping for nodeId {}",
- nodeId);
+ LOG.warn("Could not find mapping for nodeId {}", nodeId);
+ return StringConstants.OPENROADM_DEVICE_VERSION_1_2_1;
}
} catch (InterruptedException | ExecutionException ex) {
LOG.error("Unable to read mapping for nodeId {}",nodeId, ex);
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
-import org.opendaylight.transportpce.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;
.setSupportingCircuitPackName(circuitPackName).setSupportingPort(port.getPortName());
// Get OMS and OTS interface provisioned on the TTP's
- if (logicalConnectionPoint.contains(OpenRoadmInterfacesImpl.TTP_TOKEN) && (port.getInterfaces() != null)) {
+ if (logicalConnectionPoint.contains(StringConstants.TTP_TOKEN) && (port.getInterfaces() != null)) {
for (Interfaces interfaces : port.getInterfaces()) {
try {
Optional<Interface> openRoadmInterface = this.openRoadmInterfaces.getInterface(nodeId,
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,
+ InstanceIdentifier<Protocols> protocolIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(Protocols.class);
+ Optional<Protocols> protocolOptional = this.deviceTransactionManager.getDataFromDevice(nodeId,
+ LogicalDatastoreType.OPERATIONAL, protocolIID,
Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
- if (lldpObject.isPresent() && (lldpObject.get().getPortConfig() != null)) {
- for (PortConfig portConfig : lldpObject.get().getPortConfig()) {
+ Lldp lldp = null;
+ if (protocolOptional.isPresent()) {
+ lldp = protocolOptional.get().augmentation(Protocols1.class).getLldp();
+ } else {
+ LOG.warn("Couldnt find protocol operational data for Node : {}", nodeId);
+ }
+
+ if (lldp != null && lldp.getPortConfig() != null) {
+ for (PortConfig portConfig : lldp.getPortConfig()) {
if (portConfig.getAdminStatus().equals(PortConfig.AdminStatus.Txandrx)) {
InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
.child(Interface.class, new InterfaceKey(portConfig.getIfName()));
for (Ports port : cp.getPorts()) {
if (Port.PortQual.XpdrNetwork.equals(port.getPortQual())) {
portMapList.add(createMappingObject(nodeId, port, circuitPackName,
- StringConstants.NETWORK_TOKEN + line));
+ "XPDR1-" + StringConstants.NETWORK_TOKEN + line));
line++;
} else if (Port.PortQual.XpdrClient.equals(port.getPortQual())) {
portMapList.add(createMappingObject(nodeId, port, circuitPackName,
- StringConstants.CLIENT_TOKEN + client));
+ "XPDR1-" + StringConstants.CLIENT_TOKEN + client));
client++;
} else {
LOG.warn("Not supported type of port! Port type: {}", port.getPortQual());
/*
- * Copyright © 2017 AT&T and others. All rights reserved.
+ * Copyright © 2017 Orange, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.transportpce.common.mapping;
import com.google.common.util.concurrent.CheckedFuture;
-
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
-import org.opendaylight.transportpce.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.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.SharedRiskGroup;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.SharedRiskGroupKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.port.Interfaces;
+
import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.InterfaceType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OpenROADMOpticalMultiplex;
import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OpticalTransport;
int line = 1;
// Variable to keep track of number of client ports
int client = 1;
- if (!deviceObject.isPresent() || (deviceObject.get().getCircuitPacks() == null)) {
+ if (!deviceObject.isPresent() || deviceObject.get().getCircuitPacks() == null) {
LOG.warn("Circuit Packs are not present for {}", nodeId);
return false; // TODO return false or continue?
}
for (Ports port : cp.getPorts()) {
if (Port.PortQual.XpdrNetwork.equals(port.getPortQual())) {
portMapList.add(createMappingObject(nodeId, port, circuitPackName,
- StringConstants.NETWORK_TOKEN + line));
+ "XPDR1-" + StringConstants.NETWORK_TOKEN + line));
line++;
} else if (Port.PortQual.XpdrClient.equals(port.getPortQual())) {
portMapList.add(createMappingObject(nodeId, port, circuitPackName,
- StringConstants.CLIENT_TOKEN + client));
+ "XPDR1-" + StringConstants.CLIENT_TOKEN + client));
client++;
} else {
LOG.warn("Not supported type of port! Port type: {}", port.getPortQual());
.setSupportingCircuitPackName(circuitPackName).setSupportingPort(port.getPortName());
// Get OMS and OTS interface provisioned on the TTP's
- if (logicalConnectionPoint.contains(OpenRoadmInterfacesImpl.TTP_TOKEN) && (port.getInterfaces() != null)) {
+ if (logicalConnectionPoint.contains(StringConstants.TTP_TOKEN) && (port.getInterfaces() != null)) {
for (Interfaces interfaces : port.getInterfaces()) {
try {
Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface>
- openRoadmInterface = this.openRoadmInterfaces
- .getInterface(nodeId, interfaces.getInterfaceName());
+ openRoadmInterface = this.openRoadmInterfaces.getInterface(nodeId,
+ interfaces.getInterfaceName());
if (openRoadmInterface.isPresent()) {
Class<? extends InterfaceType> interfaceType = (Class<? extends InterfaceType>)
openRoadmInterface.get().getType();
package org.opendaylight.transportpce.common.network;
import com.google.common.base.Optional;
+
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.ListenableFuture;
OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
MappingUtils mappingUtils;
- // TODO move somewhere to constants
- public static final String NETWORK_TOKEN = "NETWORK";
- public static final String TTP_TOKEN = "TTP";
- public static final String CLIENT_TOKEN = "CLIENT";
- public static final String PP_TOKEN = "PP";
-
-
public OpenRoadmInterfacesImpl(DeviceTransactionManager deviceTransactionManager,MappingUtils mappingUtils,
OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121,OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22) {
this.deviceTransactionManager = deviceTransactionManager;
and is available at http://www.eclipse.org/legal/epl-v10.html
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- odl:use-default-for-reference-types="true">
+ xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+ odl:use-default-for-reference-types="true">
<reference id="mountPointService" interface="org.opendaylight.controller.md.sal.binding.api.MountPointService" />
<reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" odl:type="default" />
<argument value="15000" />
</bean>
+ <bean id="mappingUtils" class="org.opendaylight.transportpce.common.mapping.MappingUtilsImpl" >
+ <argument ref="dataBroker" />
+ </bean>
+
+ <bean id="openRoadmInterfaces121" class="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121" >
+ <argument ref="deviceTransactionManager" />
+ </bean>
+
+ <bean id="openRoadmInterfaces22" class="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22" >
+ <argument ref="deviceTransactionManager" />
+ </bean>
+
<bean id="openRoadmInterfaces" class="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl" >
<argument ref="deviceTransactionManager" />
+ <argument ref="mappingUtils" />
+ <argument ref="openRoadmInterfaces121" />
+ <argument ref="openRoadmInterfaces22" />
</bean>
- <bean id="portMapping" class="org.opendaylight.transportpce.common.mapping.PortMappingImpl" >
+ <bean id="portMapping22" class="org.opendaylight.transportpce.common.mapping.PortMappingVersion22" >
<argument ref="dataBroker" />
<argument ref="deviceTransactionManager" />
<argument ref="openRoadmInterfaces" />
</bean>
- <bean id="mappingUtils" class="org.opendaylight.transportpce.common.mapping.MappingUtilsImpl" >
+ <bean id="requestProcessor" class="org.opendaylight.transportpce.common.network.RequestProcessor" scope="singleton" >
<argument ref="dataBroker" />
</bean>
- <bean id="crossConnect121" class="org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl1_2_1" >
+ <bean id="networkTransactionImpl" class="org.opendaylight.transportpce.common.network.NetworkTransactionImpl">
+ <argument ref="requestProcessor" />
+ </bean>
+
+ <bean id="portMapping121" class="org.opendaylight.transportpce.common.mapping.PortMappingVersion121" >
+ <argument ref="dataBroker" />
<argument ref="deviceTransactionManager" />
+ <argument ref="openRoadmInterfaces" />
</bean>
- <bean id="crossConnect22" class="org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl2_2" >
+ <bean id="portMapping" class="org.opendaylight.transportpce.common.mapping.PortMappingImpl" >
+ <argument ref="dataBroker" />
+ <argument ref="mappingUtils" />
+ <argument ref="portMapping22" />
+ <argument ref="portMapping121" />
+ </bean>
+
+ <bean id="crossConnect121" class="org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121" >
+ <argument ref="deviceTransactionManager" />
+ </bean>
+
+ <bean id="crossConnect22" class="org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22" >
<argument ref="deviceTransactionManager" />
</bean>
<argument ref="crossConnect22" />
</bean>
- <bean id="requestProcessor" class="org.opendaylight.transportpce.common.network.RequestProcessor" scope="singleton" >
- <argument ref="dataBroker" />
- </bean>
-
- <bean id="networkTransactionImpl" class="org.opendaylight.transportpce.common.network.NetworkTransactionImpl">
- <argument ref="requestProcessor" />
- </bean>
-
- <bean id="FixedFlexImpl" class="org.opendaylight.transportpce.common.FixedFlex.FixedFlexImpl" >
+ <bean id="FixedFlexImpl" class="org.opendaylight.transportpce.common.fixedflex.FixedFlexImpl" >
</bean>
<service ref="deviceTransactionManager" interface="org.opendaylight.transportpce.common.device.DeviceTransactionManager" />
+
<service ref="networkTransactionImpl" interface="org.opendaylight.transportpce.common.network.NetworkTransactionService" />
- <service ref="mappingUtils" interface="org.opendaylight.transportpce.common.mapping.MappingUtils" />
+
<service ref="openRoadmInterfaces" interface="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces" />
+
<service ref="portMapping" interface="org.opendaylight.transportpce.common.mapping.PortMapping" />
- <service ref="crossConnect" interface="org.opendaylight.transportpce.common.crossconnect.CrossConnect" />
- <service ref="FixedFlexImpl" interface="org.opendaylight.transportpce.common.FixedFlex.FixedFlexInterface"/>
+ <service ref="crossConnectImpl" interface="org.opendaylight.transportpce.common.crossconnect.CrossConnect" />
+
+ <service ref="mappingUtils" interface="org.opendaylight.transportpce.common.mapping.MappingUtils" />
+
+ <service ref="FixedFlexImpl" interface="org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface"/>
-</blueprint>
+</blueprint>
\ No newline at end of file
--- /dev/null
+module org-openroadm-amplifier {
+ namespace "http://org/openroadm/amplifier";
+ prefix amp;
+
+ import org-openroadm-common-types {
+ prefix org-openroadm-common-types;
+ revision-date 2017-12-15;
+ }
+
+ organization
+ "Open ROADM MSA";
+ contact
+ "OpenROADM.org.";
+ description
+ "YANG definitions for an amplifier in Network Model
+
+
+ Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2017,
+ 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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+ revision 2017-07-28 {
+ description
+ "Version 2.0.1 - added revision-date to imports";
+ }
+ revision 2017-06-17 {
+ description
+ "Version 2.0";
+ }
+
+ grouping amplifier-node-attributes {
+ description
+ "Defines the group of amplifier attributes";
+ leaf amp-type {
+ type org-openroadm-common-types:amplifier-types;
+ config true;
+ mandatory true;
+ description
+ "Amplifier type";
+ }
+ leaf amp-gain-range {
+ type org-openroadm-common-types:amplifier-gain-range;
+ config true;
+ description
+ "Amplifier gain-range (gain-range 1 to 4 for switched gain amplifiers)
+ gain-range-1 for standard amplifiers";
+ }
+ leaf ingress-span-loss-aging-margin {
+ type org-openroadm-common-types:ratio-dB;
+ config true;
+ description
+ "Span-loss margin used to set optical amplifier gain and output-voa
+ extracted from corresponding device OTS interface container, optional
+ since it concerns only line facing amp";
+ }
+ leaf gain {
+ type org-openroadm-common-types:ratio-dB;
+ config true;
+ mandatory true;
+ description
+ "Overall Amplifier Signal gain, excluding ASE, including VOA attenuation
+ retrieved from operational value (PM)";
+ }
+ leaf initially-planned-gain {
+ type org-openroadm-common-types:ratio-dB;
+ config true;
+ description
+ "Overall Amplifier Signal gain, excluding ASE, including VOA attenuation:
+ value coming from planning tool initial design";
+ }
+ leaf tilt {
+ type org-openroadm-common-types:ratio-dB;
+ config true;
+ description
+ "Tilt of smart EDFA retrieved from operational value (PM)";
+ }
+ leaf initially-planned-tilt {
+ type org-openroadm-common-types:ratio-dB;
+ config true;
+ description
+ "Tilt of smart EDFA:
+ value coming from planning tool initial design";
+ }
+ leaf out-voa-att {
+ type org-openroadm-common-types:ratio-dB;
+ config true;
+ description
+ "output VOA attenuation";
+ }
+ leaf initially-planned-out-voa-att {
+ type org-openroadm-common-types:ratio-dB;
+ config true;
+ description
+ "output VOA attenuation: value coming from planning tool initial design.
+ As in R2.0, output VOA can not be configured by controller, this parameter may be used by the controller
+ to check that value set by amplifiers is in the range of calculated value and take relevant decision if not";
+ }
+ leaf eol-max-load-pIn {
+ type org-openroadm-common-types:power-dBm;
+ config true;
+ description
+ "End Of Life Total input power at maximum load used for amplifier and VOA setting
+ extracted from corresponding device OTS interface container";
+ }
+ }
+}
--- /dev/null
+module org-openroadm-degree {
+ namespace "http://org/openroadm/degree";
+ prefix dgr;
+
+ import org-openroadm-common-types {
+ prefix org-openroadm-common-types;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-network-types {
+ prefix org-openroadm-network-types;
+ revision-date 2017-12-15;
+ }
+
+ organization
+ "Open ROADM MSA";
+ contact
+ "OpenROADM.org.";
+ description
+ "YANG definitions for a Degree in Network Model
+
+
+ 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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+ revision 2017-07-28 {
+ description
+ "Version 2.0.1 - added revision-date to imports";
+ }
+ revision 2017-06-26 {
+ description
+ "Version 2.0";
+ }
+ revision 2016-10-14 {
+ description
+ "Version 1.2";
+ }
+
+ grouping degree-used-wavelengths {
+ description
+ "This list is created to accommodate fixed grid (1.2.1) as well as flex grid (2.0 above). In case of fixed grid
+ index number will refer to one of the 96 WL defined in the wavelength map file. In case of flex grid this
+ will hold list of used spectrums";
+ list used-wavelengths {
+ key "index";
+ uses org-openroadm-network-types:wavelengths;
+ }
+ }
+
+ grouping degree-node-attributes {
+ description
+ "Defines the group of degree attributes";
+ leaf degree-number {
+ type uint16;
+ }
+ leaf max-wavelengths {
+ type uint32;
+ description
+ "maximum # of wavelengths";
+ }
+ list available-wavelengths {
+ key "index";
+ description
+ "This list is created to accommodate fixed grid (1.2.1) as well as flex grid (2.0 above). In case of fixed grid
+ index number will refer to one of the 96 WL defined in the wavelength map file. In case of flex grid this
+ will hold list of available spectrums";
+ uses org-openroadm-network-types:wavelengths;
+ }
+ leaf ingress-span-loss-aging-margin {
+ type org-openroadm-common-types:ratio-dB;
+ config true;
+ description
+ "Span-loss margin extracted from corresponding device OTS interface container, optional";
+ }
+ leaf eol-max-load-pIn {
+ type org-openroadm-common-types:power-dBm;
+ config true;
+ description
+ "End Of Life Total input power at maximum load extracted from corresponding device OTS interface container";
+ }
+ }
+}
--- /dev/null
+module org-openroadm-external-pluggable {
+ namespace "http://org/openroadm/external/pluggable";
+ prefix plg;
+
+ import org-openroadm-common-types {
+ prefix org-openroadm-common-types;
+ revision-date 2017-12-15;
+ }
+
+ organization
+ "OPEN ROADM MSA";
+ contact
+ "OpenROADM.org.";
+ description
+ "YANG definitions for External Pluggable
+
+
+ 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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+ revision 2017-07-28 {
+ description
+ "Version 2.0.1 - added revision-date to imports";
+ }
+ revision 2017-06-26 {
+ description
+ "Version 2.0";
+ }
+ revision 2016-10-14 {
+ description
+ "Version 1.2";
+ }
+
+ grouping pluggable-node-attributes {
+ leaf pluggable-id {
+ type string;
+ description
+ "Network-wide unique identifier for a pluggable";
+ }
+ leaf customer-code {
+ type string;
+ description
+ "Owner of the pluggable";
+ }
+ container tail {
+ leaf client-equipment {
+ type string;
+ }
+ leaf client-equipment-id {
+ type string;
+ }
+ leaf clfi {
+ type string;
+ }
+ }
+ }
+
+ grouping pluggable-tp-attributes {
+ leaf rate {
+ type identityref {
+ base org-openroadm-common-types:och-rate-identity;
+ }
+ description
+ "rate";
+ }
+ leaf modulation-format {
+ type org-openroadm-common-types:modulation-format;
+ }
+ leaf optic {
+ type org-openroadm-common-types:optic-types;
+ }
+ leaf state {
+ type org-openroadm-common-types:state;
+ description
+ "A xponder can be in one of the following
+ states";
+ }
+ }
+}
--- /dev/null
+module org-openroadm-link {
+ namespace "http://org/openroadm/link";
+ prefix link;
+
+ import org-openroadm-common-types {
+ prefix org-openroadm-common-types;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-amplifier {
+ prefix org-openroadm-amplifier;
+ revision-date 2017-12-15;
+ }
+
+ organization
+ "Open ROADM MSA";
+ contact
+ "OpenROADM.org.";
+ description
+ "YANG definitions for an amplifier in Network Model
+
+
+ Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2017,
+ 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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+ revision 2017-07-28 {
+ description
+ "Version 2.0.1 - added revision-date to imports";
+ }
+ revision 2017-06-17 {
+ description
+ "Version 2.0";
+ }
+
+ grouping OMS-attributes {
+ leaf TE-metric {
+ type uint32;
+ }
+ }
+
+ grouping span-attributes {
+ leaf clfi {
+ type string;
+ }
+ leaf auto-spanloss {
+ type boolean;
+ default "true";
+ description
+ "Flag to enable/disable automatic spanloss measurement";
+ }
+ leaf spanloss-base {
+ type org-openroadm-common-types:ratio-dB;
+ description
+ "Baseline ROADM span loss measured and accepted during
+ degree turn-up. May be re-set to current value after a fiber repair or change.";
+ }
+ leaf spanloss-current {
+ type org-openroadm-common-types:ratio-dB;
+ description
+ "Current ROADM span loss measured and accepted during
+ degree turn-up. Updated periodically if auto-spanloss is enabled.";
+ }
+ leaf engineered-spanloss {
+ type org-openroadm-common-types:ratio-dB;
+ description
+ "ROADM span loss provided by an external system";
+ }
+ list link-concatenation {
+ key "SRLG-Id";
+ leaf SRLG-Id {
+ type uint32;
+ description
+ "unique identifier for SRLG";
+ }
+ leaf fiber-type {
+ type enumeration {
+ enum "smf" {
+ value 0;
+ description
+ "Single Mode Fiber";
+ }
+ enum "eleaf" {
+ value 1;
+ description
+ "ELEAF";
+ }
+ enum "oleaf" {
+ value 2;
+ description
+ "OLEAF";
+ }
+ enum "dsf" {
+ value 3;
+ description
+ "DSF";
+ }
+ enum "truewave" {
+ value 4;
+ description
+ "TRUEWAVE Reduced Slope";
+ }
+ enum "truewavec" {
+ value 5;
+ description
+ "TRUEWAVE Classic";
+ }
+ enum "nz-dsf" {
+ value 6;
+ description
+ "NZ-DSF";
+ }
+ enum "ull" {
+ value 7;
+ description
+ "Ultra Low Loss (ULL)";
+ }
+ }
+ }
+ leaf SRLG-length {
+ type uint32;
+ description
+ "fiber length in meters";
+ }
+ leaf pmd {
+ type org-openroadm-common-types:fiber-pmd;
+ description
+ "Total PMD";
+ }
+ }
+ }
+
+ grouping amplified-link-attributes {
+ list amplified-link {
+ key "section-elt-number";
+ description
+ "defines the spans and the amplifier blocks of the amplified lines";
+ leaf section-elt-number {
+ type uint16;
+ description
+ "Id of the section element (whether it's a Span or an Amp)";
+ }
+ container section-element {
+ choice section-element {
+ case ila {
+ container ila {
+ uses org-openroadm-amplifier:amplifier-node-attributes;
+ leaf node-id {
+ type org-openroadm-common-types:node-id-type;
+ mandatory true;
+ description
+ "Node id corresponding to the amplifier ";
+ }
+ leaf administrative-state {
+ type org-openroadm-common-types:state;
+ }
+ }
+ }
+ case span {
+ container span {
+ uses link:span-attributes;
+ leaf administrative-state {
+ type org-openroadm-common-types:state;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+module org-openroadm-network-topology-types {
+ namespace "http://org/openroadm/network/topology/types";
+ prefix org-openroadm-network-topology-types;
+
+ import ietf-network {
+ prefix nd;
+ revision-date 2015-06-08;
+ }
+ import ietf-network-topology {
+ prefix nwt;
+ revision-date 2015-06-08;
+ }
+ import org-openroadm-switching-pool-types {
+ prefix org-openroadm-switching-pool-types;
+ revision-date 2017-12-15;
+ }
+
+ organization
+ "OPEN ROADM MSA";
+ contact
+ "www.OpenROADM.org.";
+ description
+ "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-12-15 {
+ description
+ "Version 2.2";
+ }
+
+ grouping xpdr-tp-bandwidth-sharing {
+ list tp-bandwidth-sharing {
+ key "tp-sharing-id";
+ leaf tp-sharing-id {
+ type uint16;
+ }
+ leaf-list tp-list {
+ type nwt:tp-id;
+ }
+ leaf shared-bandwidth {
+ type uint16;
+ units "Gbps";
+ }
+ }
+ }
+
+ grouping xpdr-odu-switching-pools {
+ list odu-switching-pools {
+ key "switching-pool-number";
+ leaf switching-pool-number {
+ type uint16;
+ description
+ "Unique identifier for this odu-switching-pool";
+ }
+ leaf switching-pool-type {
+ type org-openroadm-switching-pool-types:switching-pool-types;
+ }
+ list non-blocking-list {
+ key "nbl-number";
+ description
+ "List of ports in a non-blocking switch element";
+ leaf nbl-number {
+ type uint16;
+ description
+ "Identifier for this non-blocking-list. Unique within odu-switching-pool";
+ }
+ leaf interconnect-bandwidth-unit {
+ type uint32;
+ description
+ "Switch fabric interconnect bandwidth unit rate in bits per second.
+ Represents granularity of switch fabric";
+ }
+ leaf capable-interconnect-bandwidth {
+ type uint32;
+ description
+ "Total interconnect bandwidth for a non-blocking element expressed as
+ number of inter-connect-bandwidth units";
+ }
+ leaf available-interconnect-bandwidth {
+ type uint32;
+ description
+ "Total interconnect bandwidth available for a non-blocking element can use as
+ number of inter-connect-bandwidth units";
+ }
+ leaf-list tp-list {
+ type nwt:tp-id;
+ description
+ "Termination point. Unique within device";
+ }
+ }
+ }
+ }
+
+ grouping xpdr-otn-tail-attributes {
+ leaf tp-id {
+ type nwt:tp-id;
+ }
+ leaf network-ref {
+ type leafref {
+ path "/nd:network/nd:network-id";
+ }
+ description
+ "Used to reference a network, for example an underlay
+ network.";
+ }
+ leaf node-ref {
+ type leafref {
+ path "/nd:network[nd:network-id=current()/../network-ref]/nd:node/nd:node-id";
+ }
+ description
+ "Used to reference a node.
+ Nodes are identified relative to the network they are
+ contained in.";
+ }
+ }
+}
--- /dev/null
+module org-openroadm-network-topology {
+ namespace "http://org/openroadm/network/topology";
+ prefix topo;
+
+ import ietf-network {
+ prefix nd;
+ revision-date 2015-06-08;
+ }
+ import ietf-network-topology {
+ prefix nwt;
+ revision-date 2015-06-08;
+ }
+ import org-openroadm-network-types {
+ prefix org-openroadm-network-types;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-srg {
+ prefix srg;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-degree {
+ prefix dgr;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-xponder {
+ prefix xpdr;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-external-pluggable {
+ prefix plg;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-link {
+ prefix link;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-common-types {
+ prefix ct;
+ revision-date 2017-12-15;
+ }
+
+ organization
+ "OPEN ROADM MSA";
+ contact
+ "OpenROADM.org.";
+ description
+ "YANG definitions for network view of a ROADM
+
+ 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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+ revision 2017-07-28 {
+ description
+ "Version 2.0.1 - added revision-date to imports";
+ }
+ revision 2017-06-26 {
+ description
+ "Version 2.0";
+ }
+
+ augment "/nd:network/nd:network-types" {
+ description
+ "Introduce new network type for the Open ROADM optical
+ ` network topology";
+ container openroadm-topology {
+ presence "indicates optical network topology for Open ROADMs";
+ }
+ }
+ augment "/nd:network/nd:node" {
+ when "../nd:network-types/openroadm-topology";
+ description
+ "This augmentations adds the ROADM Node type to the generic node
+ definition and defines node-sepcific attributes for each node type
+ in the ROADM Topology.";
+ leaf node-type {
+ type org-openroadm-network-types:openroadm-node-type;
+ must
+ "(../node-type = 'DEGREE' or ../node-type = 'SRG' or ../node-type = 'TPDR' or ../node-type = 'SWITCH' or
+ ../node-type = 'REGEN' or ../node-type = 'REGEN-UNI' or ../node-type = 'EXT-PLUGGABLE' or
+ ../node-type = 'MUXPDR')" {
+ error-message "Invalid node type for openroadm-topology";
+ }
+ description
+ "The type of a node in the ROADM topology. Valid node types are 'SRG', 'DEGREE',
+ 'TPDR', 'SWITCH', 'REGEN', 'REGEN-UNI', 'EXT-PLUGGABLE' and 'MUXPDR'";
+ }
+ container srg-attributes {
+ when "../node-type = 'SRG'";
+ description
+ "Topology-related attributes for SRG nodes";
+ uses srg:srg-node-attributes;
+ }
+ container degree-attributes {
+ when "../node-type = 'DEGREE'";
+ description
+ "Topology-related attributes for degree nodes";
+ uses dgr:degree-node-attributes;
+ }
+ container xpdr-attributes {
+ when
+ "../node-type = 'TPDR' or ../node-type = 'MUXPDR' or ../node-type = 'REGEN' or
+ ../node-type = 'REGEN-UNI' or ../node-type = 'SWITCH'";
+ description
+ "Topology-related attributes for Xponder nodes";
+ uses xpdr:xpdr-topo-node-attributes;
+ }
+ }
+ augment "/nd:network/nd:node/nwt:termination-point" {
+ when "../../nd:network-types/openroadm-topology";
+ description
+ "Defines the type of a termination point in the ROADM topology and
+ TP-specific attributes for each termination point type.";
+ leaf tp-type {
+ type org-openroadm-network-types:openroadm-tp-type;
+ must
+ "../../topo:node-type != 'DEGREE' or (../../topo:node-type = 'DEGREE' and
+ (../topo:tp-type = 'DEGREE-TX-TTP' or ../topo:tp-type = 'DEGREE-RX-TTP' or ../topo:tp-type = 'DEGREE-TXRX-TTP' or
+ ../topo:tp-type = 'DEGREE-TX-CTP' or ../topo:tp-type = 'DEGREE-RX-CTP' or ../topo:tp-type = 'DEGREE-TXRX-CTP'))" {
+ error-message "Invalid TP for node type 'DEGREE'";
+ }
+ must
+ "../../topo:node-type != 'SRG' or (../../topo:node-type = 'SRG' and
+ (../topo:tp-type = 'SRG-TX-CP' or ../topo:tp-type = 'SRG-RX-CP' or ../topo:tp-type = 'SRG-TXRX-CP' or
+ ../topo:tp-type = 'SRG-RX-PP' or ../topo:tp-type = 'SRG-TX-PP' or ../topo:tp-type = 'SRG-TXRX-PP'))" {
+ error-message "Invalid TP for node type 'SRG'";
+ }
+ must
+ " (../../topo:node-type != 'TPDR' and ../../topo:node-type != 'MUXPDR' and ../../topo:node-type != 'REGEN' and
+ ../../topo:node-type != 'REGEN-UNI' and ../../topo:node-type != 'SWITCH')
+ or ((../../topo:node-type = 'TPDR' or ../../topo:node-type = 'MUXPDR' or ../../topo:node-type = 'REGEN' or
+ ../../topo:node-type = 'REGEN-UNI' or ../../topo:node-type = 'SWITCH') and
+ (../topo:tp-type = 'XPONDER-NETWORK' or ../topo:tp-type = 'XPONDER-CLIENT' or ../topo:tp-type = 'XPONDER-PORT'))" {
+ error-message "Invalid TP for node type 'XPONDER'";
+ }
+ must "../../topo:node-type != 'EXT-PLUGGABLE' or (../../topo:node-type = 'EXT-PLUGGABLE' and ../topo:tp-type = 'EXT-PLUGGABLE-TP')" {
+ error-message "Invalid TP for node type 'EXT-PLUGGABLE'";
+ }
+ description
+ "The TP type; also defines which TP types can be instantiated
+ on which Node types";
+ }
+ container tx-ttp-attributes {
+ when "../tp-type = 'DEGREE-TX-TTP' or ../tp-type = 'DEGREE-TXRX-TTP'";
+ description
+ "There must be only one TP of type DEGREE-TX-TTP in any given
+ degree node";
+ uses dgr:degree-used-wavelengths;
+ }
+ container rx-ttp-attributes {
+ when "../tp-type = 'DEGREE-RX-TTP'";
+ description
+ "There must be only one TP of type DEGREE-RX-TTP in any given
+ degree node";
+ uses dgr:degree-used-wavelengths;
+ }
+ container ctp-attributes {
+ when "../tp-type = 'DEGREE-TX-CTP' or ../tp-type = 'DEGREE-RX-CTP' or ../tp-type = 'DEGREE-TXRX-CTP'";
+ uses dgr:degree-used-wavelengths;
+ }
+ container cp-attributes {
+ when "../tp-type = 'SRG-TX-CP' or ../tp-type = 'SRG-RX-CP' or ../tp-type = 'SRG-TXRX-CP'";
+ description
+ "This list is created to accommodate fixed grid (1.2.1) as well as flex grid (2.0 above). In case of fixed grid
+ index number will refer to one of the 96 WL defined in the wavelength map file. In case of flex grid this
+ will hold list of used spectrums";
+ list used-wavelengths {
+ key "index";
+ uses org-openroadm-network-types:wavelengths;
+ }
+ }
+ container pp-attributes {
+ when "../tp-type = 'SRG-TXRX-PP' or ../tp-type = 'SRG-TX-PP' or ../tp-type = 'SRG-RX-PP' ";
+ description
+ "This list is created to accommodate fixed grid (1.2.1) as well as flex grid (2.0 above). In case of fixed grid
+ index number will refer to one of the 96 WL defined in the wavelength map file. In case of flex grid this
+ will hold list of used spectrums";
+ list used-wavelength {
+ key "index";
+ uses org-openroadm-network-types:wavelengths;
+ }
+ }
+ leaf eqpt-srg-id {
+ when
+ "../tp-type = 'XPONDER-CLIENT' or ../tp-type = 'XPONDER-NETWORK' or ../tp-type = 'EXT-PLUGGABLE-TP' or
+ ../tp-type = 'XPONDER-PORT'";
+ type uint32;
+ description
+ "Shared Risk Group identifier. All ports in a circuit-pack will have same srg-id";
+ }
+ container xpdr-client-attributes {
+ when "../tp-type = 'XPONDER-CLIENT'";
+ uses xpdr:xpdr-connection-attributes;
+ uses xpdr:xpdr-port-connection-attributes;
+ }
+ container xpdr-network-attributes {
+ when "../tp-type = 'XPONDER-NETWORK'";
+ uses xpdr:xpdr-connection-attributes;
+ uses xpdr:xpdr-port-connection-attributes;
+ }
+ container xpdr-port-attributes {
+ when "../tp-type = 'XPONDER-PORT'";
+ uses xpdr:xpdr-connection-attributes;
+ uses xpdr:xpdr-port-connection-attributes;
+ }
+ container ext-pluggable-attributes {
+ when "../tp-type = 'EXT-PLUGGABLE-TP'";
+ uses plg:pluggable-tp-attributes;
+ }
+ }
+ augment "/nd:network/nwt:link" {
+ when "../nd:network-types/openroadm-topology";
+ description
+ "This augmentation defines ROADM link types in the ROADM topology";
+ leaf link-type {
+ type org-openroadm-network-types:openroadm-link-type;
+ must
+ "(../link-type = 'ROADM-TO-ROADM' or ../link-type = 'ADD-LINK' or ../link-type = 'DROP-LINK' or
+ ../link-type = 'EXPRESS-LINK' or ../link-type = 'XPONDER-INPUT' or ../link-type = 'XPONDER-OUTPUT')" {
+ error-message "Invalid link type for openroadm-topology";
+ }
+ }
+ leaf link-length {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+ leaf administrative-group {
+ type uint32;
+ description
+ "according to RFC 3630 definition";
+ }
+ leaf operational-state {
+ type ct:state;
+ }
+ leaf administrative-state {
+ type ct:state;
+ }
+ leaf link-latency {
+ type uint32;
+ description
+ "Latency of a link";
+ }
+ leaf amplified {
+ when "../link-type = 'ROADM-TO-ROADM'";
+ type boolean;
+ description
+ "defines whether an ROADM-TO-ROADM Link includes line amplifiers or not";
+ }
+ container OMS-attributes {
+ when "../link-type = 'ROADM-TO-ROADM'";
+ description
+ "";
+ uses link:OMS-attributes;
+ leaf opposite-link {
+ type leafref {
+ path "../../../nwt:link/nwt:link-id";
+ }
+ description
+ "optional - pointer to reverse link in case of bidirectional link";
+ }
+ container span {
+ when "../../amplified = 'false'";
+ description
+ "";
+ uses link:span-attributes;
+ }
+ container amplified-link {
+ when "../../amplified = 'true'";
+ description
+ "when amplified is set to true, rather than a simple OMS section
+ we have an amplified link";
+ uses link:amplified-link-attributes;
+ }
+ }
+ }
+}
--- /dev/null
+module org-openroadm-network-types {
+ namespace "http://org/openroadm/network/types";
+ prefix nt;
+
+ import ietf-yang-types {
+ prefix yang;
+ revision-date 2013-07-15;
+ }
+ import org-openroadm-common-types {
+ prefix org-openroadm-common-types;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-port-types {
+ prefix org-openroadm-port-types;
+ revision-date 2017-12-15;
+ }
+
+ organization
+ "OPEN ROADM MSA";
+ contact
+ "www.OpenROADM.org.";
+ description
+ "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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+ revision 2017-07-28 {
+ description
+ "Version 2.0.1 - added revision-date to imports";
+ }
+ revision 2017-06-26 {
+ description
+ "Version 2.0";
+ }
+
+ typedef openroadm-node-type {
+ type enumeration {
+ enum "ROADM" {
+ value 1;
+ }
+ enum "DEGREE" {
+ value 11;
+ }
+ enum "SRG" {
+ value 12;
+ }
+ enum "XPONDER" {
+ value 3;
+ }
+ enum "EXT-PLUGGABLE" {
+ value 4;
+ }
+ enum "TPDR" {
+ value 13;
+ }
+ enum "MUXPDR" {
+ value 14;
+ }
+ enum "REGEN" {
+ value 15;
+ }
+ enum "REGEN-UNI" {
+ value 16;
+ }
+ enum "SWITCH" {
+ value 17;
+ }
+ }
+ }
+
+ typedef openroadm-tp-type {
+ type enumeration {
+ enum "DEGREE-TX-TTP" {
+ value 1;
+ }
+ enum "DEGREE-RX-TTP" {
+ value 2;
+ }
+ enum "DEGREE-TX-CTP" {
+ value 3;
+ }
+ enum "DEGREE-RX-CTP" {
+ value 4;
+ }
+ enum "SRG-TX-CP" {
+ value 5;
+ }
+ enum "SRG-RX-CP" {
+ value 6;
+ }
+ enum "SRG-TXRX-PP" {
+ value 7;
+ }
+ enum "SRG-RX-PP" {
+ value 8;
+ }
+ enum "SRG-TX-PP" {
+ value 9;
+ }
+ enum "XPONDER-NETWORK" {
+ value 10;
+ }
+ enum "XPONDER-CLIENT" {
+ value 11;
+ }
+ enum "EXT-PLUGGABLE-TP" {
+ value 12;
+ }
+ enum "DEGREE-TXRX-TTP" {
+ value 13;
+ }
+ enum "SRG-TXRX-CP" {
+ value 14;
+ }
+ enum "XPONDER-PORT" {
+ value 15;
+ }
+ enum "DEGREE-TXRX-CTP" {
+ value 16;
+ }
+ }
+ }
+
+ typedef openroadm-link-type {
+ type enumeration {
+ enum "EXPRESS-LINK" {
+ value 1;
+ }
+ enum "ADD-LINK" {
+ value 2;
+ }
+ enum "DROP-LINK" {
+ value 3;
+ }
+ enum "ROADM-TO-ROADM" {
+ value 4;
+ }
+ enum "XPONDER-INPUT" {
+ value 5;
+ }
+ enum "XPONDER-OUTPUT" {
+ value 6;
+ }
+ enum "OTN-LINK" {
+ value 7;
+ }
+ }
+ }
+
+ typedef openroadm-node-status {
+ type enumeration {
+ enum "PLANNED" {
+ value 1;
+ }
+ enum "DEPLOYED" {
+ value 2;
+ }
+ enum "MAINTENANCE" {
+ value 3;
+ }
+ }
+ }
+
+ grouping wavelengths {
+ leaf index {
+ type uint32;
+ }
+ uses flex-wave;
+ }
+
+ grouping flex-wave {
+ leaf frequency {
+ type org-openroadm-common-types:frequency-THz;
+ config true;
+ description
+ "Center Frequency in THz";
+ }
+ leaf width {
+ type org-openroadm-common-types:frequency-GHz;
+ config true;
+ description
+ "Frequency width in GHz.";
+ }
+ }
+
+ grouping xpdr-tp-supported-interfaces {
+ list supported-interface-capability {
+ key "if-cap-type";
+ description
+ "Supported interface capability on the port.";
+ leaf if-cap-type {
+ type identityref {
+ base org-openroadm-port-types:supported-if-capability;
+ }
+ description
+ "Interface type/hierarchy/rate supported on this port";
+ }
+ }
+ }
+
+ grouping node-due-date-list {
+ list due-dates {
+ key "id";
+ leaf id {
+ type uint16;
+ }
+ leaf start-date {
+ type yang:date-and-time;
+ description
+ "date and time node will begin maintenance status or date when node is planned";
+ }
+ leaf end-date {
+ type yang:date-and-time;
+ description
+ "date and time node will end maintenance or date when node is deployed";
+ }
+ }
+ }
+}
--- /dev/null
+module org-openroadm-network {
+ namespace "http://org/openroadm/network";
+ prefix net;
+
+ import ietf-network {
+ prefix nd;
+ revision-date 2015-06-08;
+ }
+ import org-openroadm-network-types {
+ prefix nt;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-roadm {
+ prefix roadm;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-external-pluggable {
+ prefix plg;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-xponder {
+ prefix xpdr;
+ revision-date 2017-12-15;
+ }
+ import ietf-inet-types {
+ prefix inet;
+ revision-date 2013-07-15;
+ }
+
+ organization
+ "OPEN ROADM MSA";
+ contact
+ "www.OpenROADM.org.";
+ description
+ "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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+ revision 2017-07-28 {
+ description
+ "Version 2.0.1 - added revision-date to imports";
+ }
+ revision 2017-06-26 {
+ description
+ "Version 2.0";
+ }
+ revision 2016-10-14 {
+ description
+ "Version 1.2";
+ }
+
+ augment "/nd:network/nd:network-types" {
+ description
+ "Introduce new network type for the Open ROADM optical network";
+ container openroadm-network {
+ presence "indicates optical network of Open ROADMs";
+ description
+ "The presence of the container node indicates Open ROADM
+ network";
+ }
+ }
+ augment "/nd:network/nd:node" {
+ when "../nd:network-types/openroadm-network";
+ description
+ "Augment the generic network node with Open ROADM attributes.";
+ leaf node-type {
+ type nt:openroadm-node-type;
+ must "(../node-type = 'ROADM' or ../node-type = 'XPONDER' or ../node-type = 'EXT-PLUGGABLE')" {
+ error-message "Invalid node type for openroadm-network";
+ }
+ description
+ "A component of the network topology.
+ Valid node types are XPONDER, EXT-PLUGGABLE and ROADM.
+ Once the node-type is configured, it should not be modified.";
+ }
+ leaf software-version {
+ type string;
+ description
+ "Vendor software version";
+ }
+ leaf openroadm-version {
+ type string;
+ description
+ "OpenROADM software version";
+ }
+ leaf vendor {
+ type string;
+ description
+ "Identifier of the supplier";
+ }
+ leaf model {
+ type string;
+ description
+ "Identifier of the supplier's equipment";
+ }
+ leaf domain-subnetwork {
+ type string;
+ description
+ "Specific Domain-Subnetwork in which the node resides";
+ }
+ leaf ip {
+ type inet:ip-address;
+ description
+ "IP address assigned to the node";
+ }
+ leaf relay-rack {
+ type string;
+ description
+ "Frame Identification Code (FIC)";
+ }
+ leaf shelf {
+ type string;
+ }
+ leaf node-status {
+ type nt:openroadm-node-status;
+ }
+ container roadm-attributes {
+ when "../node-type = 'ROADM'";
+ description
+ "Attributes for the ROADM Node.";
+ uses roadm:roadm-node-attributes;
+ }
+ container xpdr-attributes {
+ when "../node-type = 'XPONDER'";
+ uses xpdr:xpdr-node-attributes;
+ }
+ container pluggable-attributes {
+ when "../node-type = 'EXT-PLUGGABLE'";
+ uses plg:pluggable-node-attributes;
+ }
+ container plan-due-dates {
+ uses nt:node-due-date-list;
+ }
+ container node-maintenance-schedule {
+ uses nt:node-due-date-list;
+ }
+ }
+}
--- /dev/null
+module org-openroadm-otn-network-topology {
+ namespace "http://org/openroadm/otn/network/topology";
+ prefix otn-topo;
+
+ import ietf-network {
+ prefix nd;
+ revision-date 2015-06-08;
+ }
+ import ietf-network-topology {
+ prefix nwt;
+ revision-date 2015-06-08;
+ }
+ import org-openroadm-network-types {
+ prefix org-openroadm-network-types;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-network-topology-types {
+ prefix org-openroadm-network-topology-types;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-xponder {
+ prefix xpdr;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-common-types {
+ prefix ct;
+ revision-date 2017-12-15;
+ }
+
+ organization
+ "OPEN ROADM MSA";
+ contact
+ "OpenROADM.org.";
+ description
+ "YANG definitions for network view of a ROADM
+
+ 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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+
+ augment "/nd:network/nd:network-types" {
+ description
+ "Introduce new network type for the Open ROADM OTN
+ ` network topology";
+ container otn-topology {
+ presence "indicates OTN topology for Muxponder, Switchponder and OTN-switch";
+ }
+ }
+ augment "/nd:network/nd:node" {
+ when "../nd:network-types/otn-topology";
+ description
+ "This augmentations adds the OTN Node type to the generic node
+ definition and defines node-sepcific attributes for each node type
+ in the OTN Topology.";
+ leaf node-type {
+ type org-openroadm-network-types:openroadm-node-type;
+ must "(../node-type = 'SWITCH' or ../node-type = 'MUXPDR')" {
+ error-message "Invalid node type for otn-topology";
+ }
+ description
+ "The type of a node in the OTN topology. Valid node types are 'MUXPDR' and 'SWITCH'";
+ }
+ container tp-bandwidth-sharing {
+ when "../node-type = 'MUXPDR' or ../node-type = 'SWITCH'";
+ uses org-openroadm-network-topology-types:xpdr-tp-bandwidth-sharing;
+ }
+ container switching-pools {
+ when "../node-type = 'MUXPDR' or ../node-type = 'SWITCH'";
+ description
+ "ODU Switching pool";
+ uses org-openroadm-network-topology-types:xpdr-odu-switching-pools;
+ }
+ container xpdr-attributes {
+ when "../node-type = 'MUXPDR' or ../node-type = 'SWITCH'";
+ description
+ "Topology-related attributes for Xponder nodes";
+ uses xpdr:xpdr-topo-node-attributes;
+ }
+ }
+ augment "/nd:network/nd:node/nwt:termination-point" {
+ when "../../nd:network-types/otn-topology";
+ description
+ "Defines the type of a termination point in the OTN topology and
+ TP-specific attributes for each termination point type.";
+ leaf tp-type {
+ type org-openroadm-network-types:openroadm-tp-type;
+ must
+ "(../../otn-topo:node-type != 'MUXPDR' and ../../otn-topo:node-type != 'SWITCH') or
+ ((../../otn-topo:node-type = 'MUXPDR' or ../../otn-topo:node-type = 'SWITCH') and
+ (../otn-topo:tp-type = 'XPONDER-NETWORK' or ../otn-topo:tp-type = 'XPONDER-CLIENT' or ../otn-topo:tp-type = 'XPONDER-PORT'))" {
+ error-message "Invalid TP for node type Xponder";
+ }
+ description
+ "The TP type; also defines which TP types can be instantiated
+ on which Node types";
+ }
+ leaf eqpt-srg-id {
+ type uint32;
+ description
+ "Shared Risk Group identifier. All ports in a circuit-pack will have same srg-id";
+ }
+ container tp-supported-interfaces {
+ when "../tp-type = 'XPONDER-NETWORK' or ../tp-type = 'XPONDER-CLIENT' or ../tp-type = 'XPONDER-PORT'";
+ description
+ "Supported interface capability on the port.";
+ uses org-openroadm-network-types:xpdr-tp-supported-interfaces;
+ }
+ container xpdr-tp-port-connection-attributes {
+ when "../tp-type = 'XPONDER-NETWORK' or ../tp-type = 'XPONDER-CLIENT' or ../tp-type = 'XPONDER-PORT'";
+ description
+ "Topology-related attributes for Xpdr nodes";
+ uses xpdr:xpdr-otn-tp-attributes;
+ uses xpdr:xpdr-port-connection-attributes;
+ uses org-openroadm-network-topology-types:xpdr-otn-tail-attributes;
+ }
+ }
+ augment "/nd:network/nwt:link" {
+ when "../nd:network-types/otn-topology";
+ description
+ "This augmentation defines Logical link types in the OTN topology connecting OTN elements";
+ leaf link-type {
+ type org-openroadm-network-types:openroadm-link-type;
+ must "(../link-type = 'OTN-LINK')" {
+ error-message "Invalid link type for otn-topology";
+ }
+ }
+ leaf administrative-group {
+ type uint32;
+ description
+ "according to RFC 3630 definition";
+ }
+ leaf operational-state {
+ type ct:state;
+ }
+ leaf administrative-state {
+ type ct:state;
+ }
+ leaf available-bandwidth {
+ type uint32;
+ description
+ "Availabled bandwidth between OTN elements";
+ }
+ leaf used-bandwidth {
+ type uint32;
+ description
+ "Used bandwidth between OTN elements";
+ }
+ leaf ODU-protected {
+ type boolean;
+ description
+ "ODU protection flag";
+ }
+ }
+}
--- /dev/null
+module org-openroadm-roadm {
+ namespace "http://org/openroadm/roadm";
+ prefix roadm;
+
+ organization
+ "OPEN ROADM MSA";
+ contact
+ "OpenROADM.org.";
+ description
+ "YANG definitions for network view of a ROADM
+
+ 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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+ revision 2017-06-26 {
+ description
+ "Version 2.0";
+ }
+ revision 2016-10-14 {
+ description
+ "Version 1.2";
+ }
+
+ grouping roadm-node-attributes {
+ leaf max-degrees {
+ type uint16;
+ description
+ "Max no. of degrees supported by the node";
+ }
+ leaf max-srgs {
+ type uint16;
+ description
+ "Max no. of SRGs supported by the node";
+ }
+ leaf current-degrees {
+ type uint16;
+ description
+ "Current no. of degrees supported by the node";
+ }
+ leaf current-srgs {
+ type uint16;
+ description
+ "Current no. of SRGs supported by the node";
+ }
+ }
+}
--- /dev/null
+module org-openroadm-srg {
+ namespace "http://org/openroadm/srg";
+ prefix srg;
+
+ import org-openroadm-network-types {
+ prefix org-openroadm-network-types;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-common-types {
+ prefix org-openroadm-common-types;
+ revision-date 2017-12-15;
+ }
+
+ organization
+ "OPEN ROADM MSA";
+ contact
+ "OpenROADM.org.";
+ description
+ "YANG definitions for an Add/Drop group in Network Model
+
+ 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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+ revision 2017-07-28 {
+ description
+ "Version 2.0.1 - added revision-date to imports";
+ }
+ revision 2017-06-26 {
+ description
+ "Version 2.0";
+ }
+ revision 2016-10-14 {
+ description
+ "Version 1.2";
+ }
+
+ grouping srg-node-attributes {
+ leaf srg-number {
+ type uint16;
+ }
+ leaf max-pp {
+ type uint32;
+ description
+ "Maximum number of add/drop port pairs in an SRG";
+ }
+ leaf current-provisioned-pp {
+ type uint32;
+ description
+ "current provisioned number of port pair in a given SRG";
+ }
+ list available-wavelengths {
+ key "index";
+ description
+ "This list is created to accommodate fix grid (1.2.1) as well as flex grid (2.0 above). In case of fixed grid
+ index number will refer to one of the 96 WL defined in the wavelength map file. In case of flex grid this
+ will hold list of available spectrums";
+ uses org-openroadm-network-types:wavelengths;
+ }
+ leaf wavelength-duplication {
+ type org-openroadm-common-types:wavelength-duplication-type;
+ }
+ }
+}
--- /dev/null
+module org-openroadm-xponder {
+ namespace "http://org/openroadm/xponder";
+ prefix xpndr;
+
+ import org-openroadm-network-types {
+ prefix org-openroadm-network-types;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-common-types {
+ prefix org-openroadm-common-types;
+ revision-date 2017-12-15;
+ }
+ import org-openroadm-otn-common-types {
+ prefix org-openroadm-otn-common-types;
+ revision-date 2017-12-15;
+ }
+
+ organization
+ "OPEN ROADM MSA";
+ contact
+ "OpenROADM.org.";
+ description
+ "YANG definitions for xponder
+
+ 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-12-15 {
+ description
+ "Version 2.2";
+ }
+ revision 2017-09-29 {
+ description
+ "Version 2.1";
+ }
+ revision 2017-07-28 {
+ description
+ "Version 2.0.1 - added revision-date to imports";
+ }
+ revision 2017-06-26 {
+ description
+ "Version 2.0";
+ }
+ revision 2016-10-14 {
+ description
+ "Version 1.2";
+ }
+
+ grouping xpdr-node-attributes {
+ leaf customer-code {
+ type string;
+ description
+ "Owner of the xponder";
+ }
+ }
+
+ grouping xpdr-topo-node-attributes {
+ leaf xpdr-number {
+ type uint16;
+ }
+ }
+
+ grouping xpdr-connection-attributes {
+ leaf local-lgx {
+ type string;
+ }
+ leaf rate {
+ type identityref {
+ base org-openroadm-common-types:och-rate-identity;
+ }
+ description
+ "rate";
+ }
+ leaf modulation-format {
+ type org-openroadm-common-types:modulation-format;
+ }
+ leaf optic {
+ type org-openroadm-common-types:optic-types;
+ }
+ leaf state {
+ type org-openroadm-common-types:state;
+ description
+ "A xponder can be in one of the following
+ states";
+ }
+ }
+
+ grouping xpdr-port-connection-attributes {
+ container wavelength {
+ uses org-openroadm-network-types:wavelengths;
+ }
+ leaf tail-equipment {
+ type string;
+ }
+ leaf tail-equipment-id {
+ type string;
+ }
+ leaf tail-clfi {
+ type string;
+ }
+ }
+
+ grouping xpdr-otn-tp-attributes {
+ leaf rate {
+ type identityref {
+ base org-openroadm-otn-common-types:odu-rate-identity;
+ }
+ description
+ "rate identity of the ODU. 'identityref' is used
+ to allow to extend for future higher rates";
+ }
+ list odtu-tpn-pool {
+ key "odtu-type";
+ leaf odtu-type {
+ type identityref {
+ base org-openroadm-otn-common-types:odtu-type-identity;
+ }
+ description
+ "ODTU type, part of the MSI (Multiplex Structure Identifier)";
+ }
+ leaf-list tpn-pool {
+ type uint16;
+ description
+ "Tributary Port Number (0-based), part of the MSI";
+ }
+ }
+ leaf-list ts-pool {
+ type uint16;
+ description
+ "Timeslots used by port";
+ }
+ }
+}
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+
+import org.opendaylight.transportpce.common.StringConstants;
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;
if (tpID.contains("CTP") || tpID.contains("CP")) {
continue;
}
- if (!tpID.contains(OpenRoadmInterfacesImpl.TTP_TOKEN)
- && !tpID.contains(OpenRoadmInterfacesImpl.PP_TOKEN)
- && !tpID.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)
- && !tpID.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
+ if (!tpID.contains(StringConstants.TTP_TOKEN)
+ && !tpID.contains(StringConstants.PP_TOKEN)
+ && !tpID.contains(StringConstants.NETWORK_TOKEN)
+ && !tpID.contains(StringConstants.CLIENT_TOKEN)) {
continue;
}
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.transportpce.common.NetworkUtils;
import org.opendaylight.transportpce.common.Timeouts;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev170929.degree.node.attributes.AvailableWavelengthsKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev170929.degree.used.wavelengths.UsedWavelengths;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev170929.degree.used.wavelengths.UsedWavelengthsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev170929.degree.used.wavelengths.UsedWavelengthsKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.TerminationPoint1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.TerminationPoint1Builder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.DegreeAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.DegreeAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.SrgAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.SrgAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.CpAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.CpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.CtpAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.CtpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.PpAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.PpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.RxTtpAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.RxTtpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.TxTtpAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.TxTtpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.XpdrClientAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.XpdrClientAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.XpdrNetworkAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.XpdrNetworkAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.XpdrPortAttributes;
-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.topology.rev170929.network.node.termination.point.pp.attributes.UsedWavelength;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.pp.attributes.UsedWavelengthBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.pp.attributes.UsedWavelengthKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev170929.OpenroadmTpType;
-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.openroadm.degree.rev171215.degree.node.attributes.AvailableWavelengthsKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev171215.degree.used.wavelengths.UsedWavelengths;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev171215.degree.used.wavelengths.UsedWavelengthsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev171215.degree.used.wavelengths.UsedWavelengthsKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.Node1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.Node1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.TerminationPoint1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.TerminationPoint1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.DegreeAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.DegreeAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.SrgAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.SrgAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.CpAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.CpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.CtpAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.CtpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.PpAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.PpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.RxTtpAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.RxTtpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.TxTtpAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.TxTtpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrClientAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrClientAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrNetworkAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrNetworkAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrPortAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrPortAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.pp.attributes.UsedWavelength;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.pp.attributes.UsedWavelengthBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.pp.attributes.UsedWavelengthKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev171215.OpenroadmTpType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev171215.srg.node.attributes.AvailableWavelengthsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev171215.xpdr.port.connection.attributes.Wavelength;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev171215.xpdr.port.connection.attributes.WavelengthBuilder;
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;
.builder(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
.child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608
.network.Node.class, new NodeKey(new NodeId(nodeId)))
- .augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929
- .Node1.class)
+ .augmentation(Node1.class)
.build();
}
private Optional<Node1> getNode1FromDatastore(String nodeId) {
- InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1>
+ InstanceIdentifier<Node1>
nodeIID = createNode1IID(nodeId);
- Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1> nodeOpt;
+ Optional<Node1> nodeOpt;
try (ReadOnlyTransaction nodeReadTx = this.dataBroker.newReadOnlyTransaction()) {
nodeOpt = nodeReadTx.read(LogicalDatastoreType.CONFIGURATION, nodeIID)
.get(Timeouts.DATASTORE_READ, TimeUnit.MILLISECONDS);
private void addAvailableWL(List<String> nodeIds, Long wavelengthNumber) {
WriteTransaction nodeWriteTx = this.dataBroker.newWriteOnlyTransaction();
for (String nodeId : nodeIds) {
- Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1> nodeOpt =
+ Optional<Node1> nodeOpt =
getNode1FromDatastore(nodeId);
- org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1 node;
+ Node1 node;
if (nodeOpt.isPresent()) {
node = nodeOpt.get();
} else {
continue;
}
- org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1Builder
- node1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929
- .Node1Builder(node);
+ Node1Builder node1Builder = new Node1Builder(node);
switch (node.getNodeType()) {
case DEGREE:
} else {
degreeAttributesBuilder = new DegreeAttributesBuilder(degreeAttributes);
}
- List<org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev170929.degree.node.attributes
+ List<org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev171215.degree.node.attributes
.AvailableWavelengths> availableDegreeWLs =
degreeAttributesBuilder.getAvailableWavelengths();
if (availableDegreeWLs == null) {
availableDegreeWLs = new ArrayList<>();
degreeAttributesBuilder.setAvailableWavelengths(availableDegreeWLs);
}
- availableDegreeWLs.add(new org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev170929.degree
+ availableDegreeWLs.add(new org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev171215.degree
.node.attributes.AvailableWavelengthsBuilder().setIndex(wavelengthNumber).build());
node1Builder.setDegreeAttributes(degreeAttributesBuilder.build());
break;
} else {
srgAttributesBuilder = new SrgAttributesBuilder(srgAttributes);
}
- List<org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev170929.srg.node.attributes
+ List<org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev171215.srg.node.attributes
.AvailableWavelengths> availableSrgWLs = srgAttributesBuilder.getAvailableWavelengths();
if (availableSrgWLs == null) {
availableSrgWLs = new ArrayList<>();
private void deleteAvailableWL(List<String> nodeIds, Long wavelengthNumber) {
WriteTransaction nodeWriteTx = this.dataBroker.newWriteOnlyTransaction();
for (String nodeId : nodeIds) {
- Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1> nodeOpt =
- getNode1FromDatastore(nodeId);
- org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1 node;
+ Optional<Node1> nodeOpt = getNode1FromDatastore(nodeId);
+ Node1 node;
if (nodeOpt.isPresent()) {
node = nodeOpt.get();
} else {
switch (node.getNodeType()) {
case DEGREE:
availableWlIID = nodeIIDBuilder.child(DegreeAttributes.class)
- .child(org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev170929.degree.node
+ .child(org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev171215.degree.node
.attributes.AvailableWavelengths.class,
new AvailableWavelengthsKey(wavelengthNumber))
.build();
break;
case SRG:
availableWlIID = nodeIIDBuilder.child(SrgAttributes.class)
- .child(org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev170929.srg.node.attributes
+ .child(org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev171215.srg.node.attributes
.AvailableWavelengths.class,
- new org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev170929.srg.node
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev171215.srg.node
.attributes.AvailableWavelengthsKey(wavelengthNumber))
.build();
break;
case SRGRXCP:
case SRGTXRXCP:
usedWlIID = usedWlIIDBuilder.child(CpAttributes.class).child(org.opendaylight.yang.gen.v1.http.org
- .openroadm.network.topology.rev170929.network.node.termination.point.cp.attributes
+ .openroadm.network.topology.rev171215.network.node.termination.point.cp.attributes
.UsedWavelengths.class,
- new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node
.termination.point.cp.attributes.UsedWavelengthsKey(
wavelengthIndex)).build();
break;
} else {
cpAttributesBuilder = new CpAttributesBuilder(cpAttributes);
}
- List<org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node
+ List<org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node
.termination.point.cp.attributes.UsedWavelengths> usedDegreeCpWls =
cpAttributesBuilder.getUsedWavelengths();
if (usedDegreeCpWls == null) {
usedDegreeCpWls = new ArrayList<>();
cpAttributesBuilder.setUsedWavelengths(usedDegreeCpWls);
}
- usedDegreeCpWls.add(new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929
+ usedDegreeCpWls.add(new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215
.network.node.termination.point.cp.attributes.UsedWavelengthsBuilder()
.setIndex(wavelengthIndex).build());
tp1Builder.setCpAttributes(cpAttributesBuilder.build());
--- /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.renderer.openroadminterface;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.opendaylight.transportpce.common.StringConstants;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
+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.equipment.states.types.rev161014.AdminStates;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.EthAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.Interface1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.Interface1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.ethernet.container.EthernetBuilder;
+
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.EthernetCsmacd;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.InterfaceType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpenROADMOpticalMultiplex;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalChannel;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalTransport;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OtnOdu;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OtnOtu;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.OchAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.RateIdentity;
+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.OtsAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014.ots.container.OtsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.ODU4;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.OduAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.odu.container.OduBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.opu.OpuBuilder;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class OpenRoadmInterface121 {
+ private final PortMapping portMapping;
+ private final OpenRoadmInterfaces openRoadmInterfaces;
+ private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfaceFactory.class);
+
+ public OpenRoadmInterface121(PortMapping portMapping, OpenRoadmInterfaces openRoadmInterfaces) {
+ this.portMapping = portMapping;
+ this.openRoadmInterfaces = openRoadmInterfaces;
+ }
+
+ public String createOpenRoadmEthInterface(String nodeId, String logicalConnPoint)
+ 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 % and"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+
+ // Ethernet interface specific data
+ EthernetBuilder ethIfBuilder = new EthernetBuilder();
+ ethIfBuilder.setAutoNegotiation(EthAttributes.AutoNegotiation.Enabled);
+ ethIfBuilder.setDuplex(EthAttributes.Duplex.Full);
+ ethIfBuilder.setFec(EthAttributes.Fec.Off);
+ ethIfBuilder.setSpeed(100000L);
+ ethIfBuilder.setMtu(9000L);
+
+ InterfaceBuilder ethInterfaceBldr = createGenericInterfaceBuilder(portMap, EthernetCsmacd.class,
+ logicalConnPoint + "-ETHERNET");
+
+ // Create Interface1 type object required for adding as augmentation
+ Interface1Builder ethIf1Builder = new Interface1Builder();
+ ethInterfaceBldr.addAugmentation(Interface1.class, ethIf1Builder.setEthernet(ethIfBuilder.build()).build());
+
+ // Post interface on the device
+ this.openRoadmInterfaces.postInterface(nodeId, ethInterfaceBldr);
+
+ // Post the equipment-state change on the device circuit-pack
+ this.openRoadmInterfaces.postEquipmentState(nodeId, portMap.getSupportingCircuitPackName(), true);
+
+ return ethInterfaceBldr.getName();
+ }
+
+ private InterfaceBuilder createGenericInterfaceBuilder(Mapping portMap, Class<? extends InterfaceType> type,
+ String key) {
+ InterfaceBuilder interfaceBuilder = new InterfaceBuilder();
+ interfaceBuilder.setDescription(" TBD ");
+ interfaceBuilder.setCircuitId(" TBD ");
+ interfaceBuilder.setSupportingCircuitPackName(portMap.getSupportingCircuitPackName());
+ interfaceBuilder.setSupportingPort(portMap.getSupportingPort());
+ interfaceBuilder.setAdministrativeState(AdminStates.InService);
+ interfaceBuilder.setType(type);
+ interfaceBuilder.setName(key);
+ interfaceBuilder.withKey(new InterfaceKey(key));
+ return interfaceBuilder;
+ }
+ /**
+ * 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)
+ 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 % and"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+ // Create generic interface
+ InterfaceBuilder otuInterfaceBldr = createGenericInterfaceBuilder(portMap, OtnOtu.class, logicalConnPoint
+ + "-OTU");
+ otuInterfaceBldr.setSupportingInterface(supportOchInterface);
+
+ // OTU interface specific data
+ OtuBuilder otuIfBuilder = new OtuBuilder();
+ otuIfBuilder.setFec(OtuAttributes.Fec.Scfec);
+ otuIfBuilder.setRate(OTU4.class);
+
+ // Create Interface1 type object required for adding as augmentation
+ // TODO look at imports of different versions of class
+ org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder otuIf1Builder =
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder();
+ otuInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1.class,
+ otuIf1Builder.setOtu(otuIfBuilder.build()).build());
+
+ // Post interface on the device
+ this.openRoadmInterfaces.postInterface(nodeId, otuInterfaceBldr);
+ return otuInterfaceBldr.getName();
+ }
+
+ /**
+ * 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)
+ 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 % and"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+ InterfaceBuilder oduInterfaceBldr = createGenericInterfaceBuilder(portMap, OtnOdu.class, logicalConnPoint
+ + "-ODU");
+ oduInterfaceBldr.setSupportingInterface(supportingOtuInterface);
+
+ // ODU interface specific data
+ OduBuilder oduIfBuilder = new OduBuilder();
+ oduIfBuilder.setRate(ODU4.class);
+ oduIfBuilder.setMonitoringMode(OduAttributes.MonitoringMode.Terminated);
+
+ // Set Opu attributes
+ OpuBuilder opuBldr = new OpuBuilder();
+ opuBldr.setPayloadType("07");
+ opuBldr.setExpPayloadType("07");
+ oduIfBuilder.setOpu(opuBldr.build());
+
+ // Create Interface1 type object required for adding as augmentation
+ // TODO look at imports of different versions of class
+ org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1Builder oduIf1Builder =
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1Builder();
+ oduInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1.class,
+ oduIf1Builder.setOdu(oduIfBuilder.build()).build());
+
+ // Post interface on the device
+ this.openRoadmInterfaces.postInterface(nodeId, oduInterfaceBldr);
+ return oduInterfaceBldr.getName();
+ }
+ /**
+ * This methods creates an OCH interface on the given termination point on
+ * Roadm.
+ *
+ * @param waveNumber wavelength number of the OCH interface.
+ * @return Name of the interface if successful, otherwise return null.
+ */
+
+ public List<String> createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber)
+ throws OpenRoadmInterfaceException {
+
+ Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
+ if (portMap == null) {
+ throw new OpenRoadmInterfaceException(String.format("Unable to get mapping from PortMapping for node %s and"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+ // Create generic interface
+ InterfaceBuilder ochInterfaceBldr = createGenericInterfaceBuilder(portMap, OpticalChannel.class,
+ createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber));
+
+ // OCH interface specific data
+ OchBuilder ocIfBuilder = new OchBuilder();
+ ocIfBuilder.setWavelengthNumber(waveNumber);
+
+ // Add supporting OMS interface
+ if (portMap.getSupportingOms() != null) {
+ ochInterfaceBldr.setSupportingInterface(portMap.getSupportingOms());
+ }
+ // Create Interface1 type object required for adding as augmentation
+ // TODO look at imports of different versions of class
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1Builder
+ ochIf1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces
+ .rev161014.Interface1Builder();
+ ochInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1.class,
+ ochIf1Builder.setOch(ocIfBuilder.build()).build());
+
+ List<String> interfacesCreated = new ArrayList<>();
+ // Post interface on the device
+ openRoadmInterfaces.postInterface(nodeId, ochInterfaceBldr);
+ interfacesCreated.add(ochInterfaceBldr.getName());
+ return interfacesCreated;
+ }
+
+ public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber, Class<
+ ? 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"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+
+ // OCH interface specific data
+ OchBuilder ocIfBuilder = new OchBuilder();
+ ocIfBuilder.setWavelengthNumber(waveNumber);
+ ocIfBuilder.setModulationFormat(format);
+ ocIfBuilder.setRate(rate);
+ ocIfBuilder.setTransmitPower(new PowerDBm(new BigDecimal("-5")));
+
+ // Create Interface1 type object required for adding as augmentation
+ // TODO look at imports of different versions of class
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014
+ .Interface1Builder ochIf1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel
+ .interfaces.rev161014.Interface1Builder();
+ // Create generic interface
+ InterfaceBuilder ochInterfaceBldr = createGenericInterfaceBuilder(portMap, OpticalChannel.class,
+ createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber));
+ ochInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1.class,
+ ochIf1Builder.setOch(ocIfBuilder.build()).build());
+
+ // Post interface on the device
+ this.openRoadmInterfaces.postInterface(nodeId, ochInterfaceBldr);
+
+ // Post the equipment-state change on the device circuit-pack if xpdr node
+ if (portMap.getLogicalConnectionPoint().contains(StringConstants.NETWORK_TOKEN)) {
+ this.openRoadmInterfaces.postEquipmentState(nodeId, portMap.getSupportingCircuitPackName(), true);
+ }
+ return ochInterfaceBldr.getName();
+ }
+
+ public String createOpenRoadmOchInterfaceName(String logicalConnectionPoint, Long waveNumber) {
+ return logicalConnectionPoint + "-" + waveNumber;
+ }
+
+ public String createOpenRoadmOmsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
+ if (mapping.getSupportingOms() == null) {
+ // Create generic interface
+ InterfaceBuilder omsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpenROADMOpticalMultiplex.class,
+ "OMS-" + mapping.getLogicalConnectionPoint());
+ if (mapping.getSupportingOts() != null) {
+ omsInterfaceBldr.setSupportingInterface(mapping.getSupportingOts());
+ } else {
+ LOG.error("Unable to get ots interface from mapping {} - {}", nodeId,
+ mapping.getLogicalConnectionPoint());
+ return null;
+ }
+ this.openRoadmInterfaces.postInterface(nodeId, omsInterfaceBldr);
+ this.portMapping.updateMapping(nodeId, mapping);
+ return omsInterfaceBldr.build().getName();
+ } else {
+ return mapping.getSupportingOms();
+ }
+ }
+
+ public String createOpenRoadmOtsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
+ if (mapping.getSupportingOts() == null) {
+ // Create generic interface
+ InterfaceBuilder otsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpticalTransport.class, "OTS-"
+ + mapping.getLogicalConnectionPoint());
+ // OTS interface augmentation specific data
+ OtsBuilder otsIfBuilder = new OtsBuilder();
+ otsIfBuilder.setFiberType(OtsAttributes.FiberType.Smf);
+
+ // Create Interface1 type object required for adding as
+ // augmentation
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014
+ .Interface1Builder otsIf1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm
+ .optical.transport.interfaces.rev161014.Interface1Builder();
+ otsInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014
+ .Interface1.class,
+ otsIf1Builder.setOts(otsIfBuilder.build()).build());
+ this.openRoadmInterfaces.postInterface(nodeId, otsInterfaceBldr);
+ this.portMapping.updateMapping(nodeId, mapping);
+ return otsInterfaceBldr.build().getName();
+ } else {
+ return mapping.getSupportingOts();
+ }
+ }
+}
--- /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.renderer.openroadminterface;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
+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.rev171215.FrequencyGHz;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev171215.FrequencyTHz;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev171215.ModulationFormat;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev171215.PowerDBm;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev171215.R100G;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.interfaces.grp.InterfaceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.interfaces.grp.InterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev171215.AdminStates;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev171215.EthAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev171215.Interface1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev171215.Interface1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev171215.ethernet.container.EthernetBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.EthernetCsmacd;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.InterfaceType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.MediaChannelTrailTerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.NetworkMediaChannelConnectionTerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OpenROADMOpticalMultiplex;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OpticalChannel;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OpticalTransport;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OtnOdu;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OtnOtu;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.media.channel.interfaces.rev171215.mc.ttp.container.McTtpBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev171215.nmc.ctp.container.NmcCtpBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev171215.och.container.OchBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev171215.OtsAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev171215.ots.container.OtsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev171215.ODU4;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev171215.OTU4;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev171215.PayloadTypeDef;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev171215.OduAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev171215.odu.container.OduBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev171215.opu.OpuBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev171215.OtuAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev171215.otu.container.OtuBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
+public class OpenRoadmInterface22 {
+ private final PortMapping portMapping;
+ private final OpenRoadmInterfaces openRoadmInterfaces;
+ private FixedFlexInterface fixedFlex;
+ private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfaceFactory.class);
+
+ public OpenRoadmInterface22(PortMapping portMapping, OpenRoadmInterfaces openRoadmInterfaces,
+ FixedFlexInterface fixedFlex) {
+ this.portMapping = portMapping;
+ this.openRoadmInterfaces = openRoadmInterfaces;
+ this.fixedFlex = fixedFlex;
+ }
+
+ public String createOpenRoadmEthInterface(String nodeId,
+ String logicalConnPoint) throws OpenRoadmInterfaceException {
+ Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
+ if (portMap == null) {
+ throw new OpenRoadmInterfaceException(String.format("Unable to get mapping from PortMapping for node % and"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+
+ // Ethernet interface specific data
+ EthernetBuilder ethIfBuilder = new EthernetBuilder();
+ ethIfBuilder.setAutoNegotiation(EthAttributes.AutoNegotiation.Enabled);
+ ethIfBuilder.setDuplex(EthAttributes.Duplex.Full);
+ ethIfBuilder.setFec(EthAttributes.Fec.Off);
+ ethIfBuilder.setSpeed(100000L);
+ ethIfBuilder.setMtu(9000L);
+
+ InterfaceBuilder ethInterfaceBldr = createGenericInterfaceBuilder(portMap, EthernetCsmacd.class,
+ logicalConnPoint + "-ETHERNET");
+ // Create Interface1 type object required for adding as augmentation
+ Interface1Builder ethIf1Builder = new Interface1Builder();
+ ethInterfaceBldr.addAugmentation(Interface1.class, ethIf1Builder.setEthernet(ethIfBuilder.build()).build());
+
+ // Post interface on the device
+ openRoadmInterfaces.postInterface(nodeId, ethInterfaceBldr);
+ return ethInterfaceBldr.getName();
+ }
+
+ /**
+ * This methods creates an OCH interface on the given termination point on
+ * Roadm.
+ *
+ * @param waveNumber wavelength number of the OCH interface.
+ * @return Name of the interface if successful, otherwise return null.
+ */
+
+ public List<String> createFlexOCH(String nodeId, String logicalConnPoint, Long waveNumber)
+ throws OpenRoadmInterfaceException {
+
+ List<String> interfacesCreated = new ArrayList<>();
+
+ String nmcInterfaceCreated = createNMCInterface(nodeId,logicalConnPoint,waveNumber);
+ interfacesCreated.add(nmcInterfaceCreated);
+
+ String mcInterfaceCreated = createMCInterface(nodeId, logicalConnPoint, waveNumber);
+ interfacesCreated.add(mcInterfaceCreated);
+
+ return interfacesCreated;
+ }
+
+ public String createMCInterface(String nodeId, String logicalConnPoint, Long waveNumber)
+ throws OpenRoadmInterfaceException {
+
+ //TODO : Check this method
+
+ fixedFlex = fixedFlex.getFixedFlexWaveMapping(waveNumber.shortValue());
+
+ Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
+ if (portMap == null) {
+ throw new OpenRoadmInterfaceException(String.format("Unable to get mapping from PortMapping for node % and"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+
+ //TODO : Check this method
+
+ InterfaceBuilder mcInterfaceBldr = createGenericInterfaceBuilder(portMap,
+ MediaChannelTrailTerminationPoint.class, logicalConnPoint + "-mc");
+ mcInterfaceBldr.setSupportingInterface(portMap.getSupportingOms());
+
+ McTtpBuilder mcTtpBuilder = new McTtpBuilder();
+ mcTtpBuilder.setMinFreq(FrequencyTHz.getDefaultInstance(String.valueOf(fixedFlex.getStart())));
+ mcTtpBuilder.setMaxFreq(FrequencyTHz.getDefaultInstance(String.valueOf(fixedFlex.getStop())));
+
+ // Create Interface1 type object required for adding as augmentation
+ org.opendaylight.yang.gen.v1.http.org.openroadm.media.channel.interfaces.rev171215.Interface1Builder
+ interface1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm.media.channel
+ .interfaces.rev171215.Interface1Builder();
+ interface1Builder.setMcTtp(mcTtpBuilder.build());
+ mcInterfaceBldr.addAugmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.media.channel
+ .interfaces.rev171215.Interface1.class,interface1Builder.build());
+
+ // Post interface on the device
+ openRoadmInterfaces.postInterface(nodeId, mcInterfaceBldr);
+ return mcInterfaceBldr.getName();
+ }
+
+ public String createNMCInterface(String nodeId, String logicalConnPoint, Long waveNumber)
+ throws OpenRoadmInterfaceException {
+
+ //TODO : Check this method
+
+ fixedFlex = fixedFlex.getFixedFlexWaveMapping(waveNumber.shortValue());
+
+ Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
+ if (portMap == null) {
+ throw new OpenRoadmInterfaceException(String.format("Unable to get mapping from PortMapping for node % and"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+
+ //TODO : Check this method
+ InterfaceBuilder nmcInterfaceBldr = createGenericInterfaceBuilder(portMap,
+ NetworkMediaChannelConnectionTerminationPoint.class, logicalConnPoint + "-nmc");
+ nmcInterfaceBldr.setSupportingInterface(logicalConnPoint + "-mc");
+
+ NmcCtpBuilder nmcCtpIfBuilder = new NmcCtpBuilder();
+
+ nmcCtpIfBuilder.setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(fixedFlex.getCenterFrequency())));
+ nmcCtpIfBuilder.setWidth(FrequencyGHz.getDefaultInstance(String.valueOf(fixedFlex.getWavelength())));
+
+ // Create Interface1 type object required for adding as augmentation
+ org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev171215
+ .Interface1Builder nmcCtpI1fBuilder = new org.opendaylight.yang.gen.v1.http
+ .org.openroadm.network.media.channel.interfaces.rev171215.Interface1Builder();
+ nmcCtpI1fBuilder.setNmcCtp(nmcCtpIfBuilder.build());
+ nmcInterfaceBldr.addAugmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.network
+ .media.channel.interfaces.rev171215.Interface1.class,nmcCtpI1fBuilder.build());
+
+ // Post interface on the device
+ openRoadmInterfaces.postInterface(nodeId, nmcInterfaceBldr);
+ return nmcInterfaceBldr.getName();
+ }
+
+ public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber)
+ throws OpenRoadmInterfaceException {
+ //TODO : Check this method
+
+ fixedFlex = fixedFlex.getFixedFlexWaveMapping(waveNumber.shortValue());
+
+ Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
+ if (portMap == null) {
+ throw new OpenRoadmInterfaceException(String.format("Unable to get mapping from PortMapping for node %s and"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+
+ // OCH interface specific data
+ OchBuilder ocIfBuilder = new OchBuilder();
+
+ ocIfBuilder.setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(fixedFlex.getCenterFrequency())));
+ ocIfBuilder.setWidth(FrequencyGHz.getDefaultInstance(String.valueOf(fixedFlex.getWavelength())));
+ ocIfBuilder.setModulationFormat(ModulationFormat.DpQpsk);
+ ocIfBuilder.setRate(R100G.class);
+ ocIfBuilder.setTransmitPower(new PowerDBm(new BigDecimal("-5")));
+
+ // Create generic interface
+ InterfaceBuilder ochInterfaceBldr = createGenericInterfaceBuilder(portMap, OpticalChannel.class,
+ createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber));
+ // Create Interface1 type object required for adding as augmentation
+ // TODO look at imports of different versions of class
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev171215.Interface1Builder
+ ochIf1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces
+ .rev171215.Interface1Builder();
+ ochInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev171215.Interface1.class,
+ ochIf1Builder.setOch(ocIfBuilder.build()).build());
+
+ // Post interface on the device
+ openRoadmInterfaces.postInterface(nodeId, ochInterfaceBldr);
+ return ochInterfaceBldr.getName();
+ }
+
+ public String createOpenRoadmOdu4Interface(String nodeId, String logicalConnPoint, String supportingOtuInterface)
+ throws OpenRoadmInterfaceException {
+ Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
+ if (portMap == null) {
+ throw new OpenRoadmInterfaceException(String.format("Unable to get mapping from PortMapping for node % and"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+ InterfaceBuilder oduInterfaceBldr = createGenericInterfaceBuilder(portMap, OtnOdu.class,
+ logicalConnPoint + "-ODU");
+ oduInterfaceBldr.setSupportingInterface(supportingOtuInterface);
+
+ // ODU interface specific data
+ OduBuilder oduIfBuilder = new OduBuilder();
+ oduIfBuilder.setRate(ODU4.class);
+ oduIfBuilder.setMonitoringMode(OduAttributes.MonitoringMode.Terminated);
+
+ //Set Opu attributes
+ OpuBuilder opuBldr = new OpuBuilder();
+ opuBldr.setPayloadType(PayloadTypeDef.getDefaultInstance("07"));
+ opuBldr.setExpPayloadType(PayloadTypeDef.getDefaultInstance("07"));
+ oduIfBuilder.setOpu(opuBldr.build());
+
+
+ // Create Interface1 type object required for adding as augmentation
+ // TODO look at imports of different versions of class
+ org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev171215.Interface1Builder oduIf1Builder =
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev171215.Interface1Builder();
+ oduInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev171215.Interface1.class,
+ oduIf1Builder.setOdu(oduIfBuilder.build()).build());
+
+ // Post interface on the device
+ openRoadmInterfaces.postInterface(nodeId, oduInterfaceBldr);
+ return oduInterfaceBldr.getName();
+ }
+
+ public String createOpenRoadmOtu4Interface(String nodeId, String logicalConnPoint, String supportOchInterface)
+ throws OpenRoadmInterfaceException {
+ Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
+ if (portMap == null) {
+ throw new OpenRoadmInterfaceException(String.format("Unable to get mapping from PortMapping for node % and"
+ + " logical connection port %s", nodeId, logicalConnPoint));
+ }
+ // Create generic interface
+ InterfaceBuilder otuInterfaceBldr = createGenericInterfaceBuilder(portMap, OtnOtu.class,
+ logicalConnPoint + "-OTU");
+ otuInterfaceBldr.setSupportingInterface(supportOchInterface);
+
+ // OTU interface specific data
+ OtuBuilder otuIfBuilder = new OtuBuilder();
+ otuIfBuilder.setFec(OtuAttributes.Fec.Scfec);
+ otuIfBuilder.setRate(OTU4.class);
+
+ // Create Interface1 type object required for adding as augmentation
+ // TODO look at imports of different versions of class
+ org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev171215.Interface1Builder otuIf1Builder =
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev171215.Interface1Builder();
+ otuInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev171215.Interface1.class,
+ otuIf1Builder.setOtu(otuIfBuilder.build()).build());
+
+ // Post interface on the device
+ openRoadmInterfaces.postInterface(nodeId, otuInterfaceBldr);
+ return otuInterfaceBldr.getName();
+ }
+
+ public String createOpenRoadmOchInterfaceName(String logicalConnectionPoint, Long waveNumber) {
+ return logicalConnectionPoint + "-" + waveNumber;
+ }
+
+ private InterfaceBuilder createGenericInterfaceBuilder(Mapping portMap, Class<? extends InterfaceType> type,
+ String key) {
+ InterfaceBuilder interfaceBuilder = new InterfaceBuilder();
+ interfaceBuilder.setDescription(" TBD ");
+ interfaceBuilder.setCircuitId(" TBD ");
+ interfaceBuilder.setSupportingCircuitPackName(portMap.getSupportingCircuitPackName());
+ interfaceBuilder.setSupportingPort(portMap.getSupportingPort());
+ interfaceBuilder.setAdministrativeState(AdminStates.InService);
+ interfaceBuilder.setType(type);
+ interfaceBuilder.setName(key);
+ interfaceBuilder.withKey(new InterfaceKey(key));
+ return interfaceBuilder;
+ }
+
+ public String createOpenRoadmOmsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
+ if (mapping.getSupportingOms() == null) {
+ // Create generic interface
+ InterfaceBuilder omsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpenROADMOpticalMultiplex.class,
+ "OMS-" + mapping.getLogicalConnectionPoint());
+ if (mapping.getSupportingOts() != null) {
+ omsInterfaceBldr.setSupportingInterface(mapping.getSupportingOts());
+ } else {
+ LOG.error("Unable to get ots interface from mapping {} - {}", nodeId,
+ mapping.getLogicalConnectionPoint());
+ return null;
+ }
+ this.openRoadmInterfaces.postInterface(nodeId, omsInterfaceBldr);
+ this.portMapping.updateMapping(nodeId, mapping);
+ return omsInterfaceBldr.build().getName();
+ } else {
+ return mapping.getSupportingOms();
+ }
+ }
+
+ public String createOpenRoadmOtsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
+ if (mapping.getSupportingOts() == null) {
+ // Create generic interface
+ InterfaceBuilder otsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpticalTransport.class, "OTS-"
+ + mapping.getLogicalConnectionPoint());
+ // OTS interface augmentation specific data
+ OtsBuilder otsIfBuilder = new OtsBuilder();
+ otsIfBuilder.setFiberType(OtsAttributes.FiberType.Smf);
+
+ // Create Interface1 type object required for adding as
+ // augmentation
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev171215
+ .Interface1Builder otsIf1Builder = new org.opendaylight.yang.gen.v1.http.org
+ .openroadm.optical.transport
+ .interfaces.rev171215.Interface1Builder();
+ otsInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev171215
+ .Interface1.class,
+ otsIf1Builder.setOts(otsIfBuilder.build()).build());
+ this.openRoadmInterfaces.postInterface(nodeId, otsInterfaceBldr);
+ this.portMapping.updateMapping(nodeId, mapping);
+ return otsInterfaceBldr.build().getName();
+ } else {
+ return mapping.getSupportingOts();
+ }
+ }
+
+}
package org.opendaylight.transportpce.renderer.openroadminterface;
-import java.math.BigDecimal;
-import org.opendaylight.transportpce.common.mapping.PortMapping;
+import java.util.List;
+
+import org.opendaylight.transportpce.common.StringConstants;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
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.equipment.states.types.rev161014.AdminStates;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.EthAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.Interface1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.Interface1Builder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.ethernet.container.EthernetBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.EthernetCsmacd;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.InterfaceType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpenROADMOpticalMultiplex;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalChannel;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalTransport;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OtnOdu;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OtnOtu;
import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.OchAttributes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.RateIdentity;
-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.OtsAttributes.FiberType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014.ots.container.OtsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.ODU4;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.OduAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.odu.container.OduBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.opu.OpuBuilder;
-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.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public class OpenRoadmInterfaceFactory {
- private final PortMapping portMapping;
- private final OpenRoadmInterfaces openRoadmInterfaces;
- private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfaceFactory.class);
-
- public OpenRoadmInterfaceFactory(PortMapping portMapping, OpenRoadmInterfaces openRoadmInterfaces) {
- this.portMapping = portMapping;
- this.openRoadmInterfaces = openRoadmInterfaces;
- }
-
- public String createOpenRoadmEthInterface(String nodeId, String logicalConnPoint)
- 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 % and"
- + " logical connection port %s", nodeId, logicalConnPoint));
- }
-
- // Ethernet interface specific data
- EthernetBuilder ethIfBuilder = new EthernetBuilder();
- ethIfBuilder.setAutoNegotiation(EthAttributes.AutoNegotiation.Enabled);
- ethIfBuilder.setDuplex(EthAttributes.Duplex.Full);
- ethIfBuilder.setFec(EthAttributes.Fec.Off);
- ethIfBuilder.setSpeed(100000L);
- ethIfBuilder.setMtu(9000L);
- InterfaceBuilder ethInterfaceBldr = createGenericInterfaceBuilder(portMap, EthernetCsmacd.class,
- logicalConnPoint + "-ETHERNET");
+ private final MappingUtils mappingUtils;
+ private final OpenRoadmInterface121 openRoadmInterface121;
+ private final OpenRoadmInterface22 openRoadmInterface22;
- // Create Interface1 type object required for adding as augmentation
- Interface1Builder ethIf1Builder = new Interface1Builder();
- ethInterfaceBldr.addAugmentation(Interface1.class, ethIf1Builder.setEthernet(ethIfBuilder.build()).build());
- // Post interface on the device
- this.openRoadmInterfaces.postInterface(nodeId, ethInterfaceBldr);
+ public OpenRoadmInterfaceFactory(MappingUtils mappingUtils, OpenRoadmInterface121 openRoadmInterface121,
+ OpenRoadmInterface22 openRoadmInterface22) {
+ this.mappingUtils = mappingUtils;
+ this.openRoadmInterface121 = openRoadmInterface121;
+ this.openRoadmInterface22 = openRoadmInterface22;
+ }
- // Post the equipment-state change on the device circuit-pack
- this.openRoadmInterfaces.postEquipmentState(nodeId, portMap.getSupportingCircuitPackName(), true);
+ public String createOpenRoadmEthInterface(String nodeId,
+ String logicalConnPoint) throws OpenRoadmInterfaceException {
- return ethInterfaceBldr.getName();
+ switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+ case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+ return openRoadmInterface121.createOpenRoadmEthInterface(nodeId, logicalConnPoint);
+ case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
+ return openRoadmInterface22.createOpenRoadmEthInterface(nodeId, logicalConnPoint);
+ default:
+ return null;
+ }
}
+
/**
* This methods creates an OCH interface on the given termination point on
* Roadm.
*
- * @param nodeId node ID
- * @param logicalConnPoint logical Connection Point
- * @param waveNumber wavelength number of the OCH interface
- *
+ * @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)
+ public List<String> createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber)
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"
- + " logical connection port %s", nodeId, logicalConnPoint));
- }
- // Create generic interface
- InterfaceBuilder ochInterfaceBldr = createGenericInterfaceBuilder(portMap, OpticalChannel.class,
- createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber));
-
- // OCH interface specific data
- OchBuilder ocIfBuilder = new OchBuilder();
- ocIfBuilder.setWavelengthNumber(waveNumber);
- // Add supporting OMS interface
- if (portMap.getSupportingOms() != null) {
- ochInterfaceBldr.setSupportingInterface(portMap.getSupportingOms());
- }
- // Create Interface1 type object required for adding as augmentation
- // TODO look at imports of different versions of class
- org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014
- .Interface1Builder ochIf1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel
- .interfaces.rev161014.Interface1Builder();
- ochInterfaceBldr.addAugmentation(
- org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1.class,
- ochIf1Builder.setOch(ocIfBuilder.build()).build());
-
- // Post interface on the device
- this.openRoadmInterfaces.postInterface(nodeId, ochInterfaceBldr);
-
- // Post the equipment-state change on the device circuit-pack if xpdr node
- if (portMap.getLogicalConnectionPoint().contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
- this.openRoadmInterfaces.postEquipmentState(nodeId, portMap.getSupportingCircuitPackName(), true);
+ switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+ case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+ return openRoadmInterface121.createOpenRoadmOchInterface(nodeId, logicalConnPoint,waveNumber);
+ case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
+ return openRoadmInterface22.createFlexOCH(nodeId, logicalConnPoint,waveNumber);
+ default:
+ return null;
}
- return ochInterfaceBldr.getName();
}
- public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber, Class<
- ? 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"
- + " logical connection port %s", nodeId, logicalConnPoint));
- }
-
- // OCH interface specific data
- OchBuilder ocIfBuilder = new OchBuilder();
- ocIfBuilder.setWavelengthNumber(waveNumber);
- ocIfBuilder.setModulationFormat(format);
- ocIfBuilder.setRate(rate);
- ocIfBuilder.setTransmitPower(new PowerDBm(new BigDecimal("-5")));
-
- // Create Interface1 type object required for adding as augmentation
- // TODO look at imports of different versions of class
- org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014
- .Interface1Builder ochIf1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel
- .interfaces.rev161014.Interface1Builder();
- // Create generic interface
- InterfaceBuilder ochInterfaceBldr = createGenericInterfaceBuilder(portMap, OpticalChannel.class,
- createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber));
- ochInterfaceBldr.addAugmentation(
- org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1.class,
- ochIf1Builder.setOch(ocIfBuilder.build()).build());
- // Post interface on the device
- this.openRoadmInterfaces.postInterface(nodeId, ochInterfaceBldr);
-
- // Post the equipment-state change on the device circuit-pack if xpdr node
- if (portMap.getLogicalConnectionPoint().contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
- this.openRoadmInterfaces.postEquipmentState(nodeId, portMap.getSupportingCircuitPackName(), true);
+ public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber,
+ Class<? extends RateIdentity> rate, OchAttributes.ModulationFormat format) throws OpenRoadmInterfaceException {
+ switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+ case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+ return openRoadmInterface121.createOpenRoadmOchInterface(nodeId, logicalConnPoint, waveNumber,
+ rate, format);
+ case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
+ return openRoadmInterface22.createOpenRoadmOchInterface(nodeId,logicalConnPoint,waveNumber);
+ default:
+ return null;
}
- return ochInterfaceBldr.getName();
- }
-
- public String createOpenRoadmOchInterfaceName(String logicalConnectionPoint, Long waveNumber) {
- return logicalConnectionPoint + "-" + waveNumber;
}
/**
* 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)
- 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 % and"
- + " logical connection port %s", nodeId, logicalConnPoint));
+ throws OpenRoadmInterfaceException {
+ switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+ case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+ return openRoadmInterface121.createOpenRoadmOdu4Interface(nodeId, logicalConnPoint,
+ supportingOtuInterface);
+ case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
+ return openRoadmInterface22.createOpenRoadmOdu4Interface(nodeId, logicalConnPoint,
+ supportingOtuInterface);
+ default:
+ return null;
}
- InterfaceBuilder oduInterfaceBldr = createGenericInterfaceBuilder(portMap, OtnOdu.class, logicalConnPoint
- + "-ODU");
- oduInterfaceBldr.setSupportingInterface(supportingOtuInterface);
-
- // ODU interface specific data
- OduBuilder oduIfBuilder = new OduBuilder();
- oduIfBuilder.setRate(ODU4.class);
- oduIfBuilder.setMonitoringMode(OduAttributes.MonitoringMode.Terminated);
-
- // Set Opu attributes
- OpuBuilder opuBldr = new OpuBuilder();
- opuBldr.setPayloadType("07");
- opuBldr.setExpPayloadType("07");
- oduIfBuilder.setOpu(opuBldr.build());
-
- // Create Interface1 type object required for adding as augmentation
- // TODO look at imports of different versions of class
- org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1Builder oduIf1Builder =
- new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1Builder();
- oduInterfaceBldr.addAugmentation(
- org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1.class, oduIf1Builder
- .setOdu(oduIfBuilder.build()).build());
-
- // Post interface on the device
- this.openRoadmInterfaces.postInterface(nodeId, oduInterfaceBldr);
- return oduInterfaceBldr.getName();
}
/**
* 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)
- 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 % and"
- + " logical connection port %s", nodeId, logicalConnPoint));
+ throws OpenRoadmInterfaceException {
+ switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+ case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+ return openRoadmInterface121.createOpenRoadmOtu4Interface(nodeId,
+ logicalConnPoint,supportOchInterface);
+ case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
+ return openRoadmInterface22.createOpenRoadmOtu4Interface(nodeId,logicalConnPoint, supportOchInterface);
+ default:
+ return null;
}
- // Create generic interface
- InterfaceBuilder otuInterfaceBldr = createGenericInterfaceBuilder(portMap, OtnOtu.class, logicalConnPoint
- + "-OTU");
- otuInterfaceBldr.setSupportingInterface(supportOchInterface);
-
- // OTU interface specific data
- OtuBuilder otuIfBuilder = new OtuBuilder();
- otuIfBuilder.setFec(OtuAttributes.Fec.Scfec);
- otuIfBuilder.setRate(OTU4.class);
-
- // Create Interface1 type object required for adding as augmentation
- // TODO look at imports of different versions of class
- org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder otuIf1Builder =
- new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder();
- otuInterfaceBldr.addAugmentation(
- org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1.class, otuIf1Builder
- .setOtu(otuIfBuilder.build()).build());
-
- // Post interface on the device
- this.openRoadmInterfaces.postInterface(nodeId, otuInterfaceBldr);
- return otuInterfaceBldr.getName();
}
- public String createOpenRoadmOtsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
- if (mapping.getSupportingOts() == null) {
- // Create generic interface
- InterfaceBuilder otsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpticalTransport.class, "OTS-"
- + mapping.getLogicalConnectionPoint());
- // OTS interface augmentation specific data
- OtsBuilder otsIfBuilder = new OtsBuilder();
- otsIfBuilder.setFiberType(FiberType.Smf);
-
- // Create Interface1 type object required for adding as
- // augmentation
- org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014
- .Interface1Builder otsIf1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport
- .interfaces.rev161014.Interface1Builder();
- otsInterfaceBldr.addAugmentation(
- org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014.Interface1.class,
- otsIf1Builder.setOts(otsIfBuilder.build()).build());
- this.openRoadmInterfaces.postInterface(nodeId, otsInterfaceBldr);
- this.portMapping.updateMapping(nodeId, mapping);
- return otsInterfaceBldr.build().getName();
- } else {
- return mapping.getSupportingOts();
- }
+ public String createOpenRoadmOchInterfaceName(String logicalConnectionPoint, Long waveNumber) {
+ return logicalConnectionPoint + "-" + waveNumber;
}
public String createOpenRoadmOmsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
- if (mapping.getSupportingOms() == null) {
- // Create generic interface
- InterfaceBuilder omsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpenROADMOpticalMultiplex.class,
- "OMS-" + mapping.getLogicalConnectionPoint());
- if (mapping.getSupportingOts() != null) {
- omsInterfaceBldr.setSupportingInterface(mapping.getSupportingOts());
- } else {
- LOG.error("Unable to get ots interface from mapping {} - {}", nodeId,
- mapping.getLogicalConnectionPoint());
+ switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+ case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+ return openRoadmInterface121.createOpenRoadmOmsInterface(nodeId,mapping);
+ case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
+ return openRoadmInterface22.createOpenRoadmOmsInterface(nodeId,mapping);
+ default:
return null;
- }
- this.openRoadmInterfaces.postInterface(nodeId, omsInterfaceBldr);
- this.portMapping.updateMapping(nodeId, mapping);
- return omsInterfaceBldr.build().getName();
- } else {
- return mapping.getSupportingOms();
}
}
- private InterfaceBuilder createGenericInterfaceBuilder(Mapping portMap, Class<? extends InterfaceType> type,
- String key) {
- InterfaceBuilder interfaceBuilder = new InterfaceBuilder();
- interfaceBuilder.setDescription(" TBD ");
- interfaceBuilder.setCircuitId(" TBD ");
- interfaceBuilder.setSupportingCircuitPackName(portMap.getSupportingCircuitPackName());
- interfaceBuilder.setSupportingPort(portMap.getSupportingPort());
- interfaceBuilder.setAdministrativeState(AdminStates.InService);
- interfaceBuilder.setType(type);
- interfaceBuilder.setName(key);
- interfaceBuilder.withKey(new InterfaceKey(key));
- return interfaceBuilder;
+ public String createOpenRoadmOtsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
+ switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+ case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+ return openRoadmInterface121.createOpenRoadmOtsInterface(nodeId,mapping);
+ case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
+ return openRoadmInterface22.createOpenRoadmOtsInterface(nodeId,mapping);
+ default:
+ return null;
+ }
}
+
+
+
+
+
}
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.Timeouts;
import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.mapping.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.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServiceListTopology;
import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServicePathDirection;
String srcTp = node.getSrcTp();
String destTp = node.getDestTp();
Long waveNumber = input.getWaveNumber();
- if ((destTp != null) && destTp.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
+ if ((destTp != null) && destTp.contains(StringConstants.NETWORK_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Line Interfaces
String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4Interface(nodeId,
destTp, supportingOtuInterface));
}
- if ((srcTp != null) && srcTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
+ if ((srcTp != null) && srcTp.contains(StringConstants.CLIENT_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Client Interfaces
createdEthInterfaces.add(
this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId, srcTp));
}
- if ((srcTp != null) && srcTp.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
+ if ((srcTp != null) && srcTp.contains(StringConstants.NETWORK_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Line Interfaces
String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4Interface(nodeId,
srcTp, supportingOtuInterface));
}
- if ((destTp != null) && destTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
+ if ((destTp != null) && destTp.contains(StringConstants.CLIENT_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Client Interfaces
createdEthInterfaces.add(
this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId, destTp));
}
- if ((srcTp != null) && (srcTp.contains(OpenRoadmInterfacesImpl.TTP_TOKEN)
- || srcTp.contains(OpenRoadmInterfacesImpl.PP_TOKEN))) {
- createdOchInterfaces.add(
+ if ((srcTp != null) && (srcTp.contains(StringConstants.TTP_TOKEN)
+ || srcTp.contains(StringConstants.PP_TOKEN))) {
+ createdOchInterfaces.addAll(
this.openRoadmInterfaceFactory
.createOpenRoadmOchInterface(nodeId, srcTp, waveNumber));
}
- if ((destTp != null) && (destTp.contains(OpenRoadmInterfacesImpl.TTP_TOKEN)
- || destTp.contains(OpenRoadmInterfacesImpl.PP_TOKEN))) {
- createdOchInterfaces.add(
+ if ((destTp != null) && (destTp.contains(StringConstants.TTP_TOKEN)
+ || destTp.contains(StringConstants.PP_TOKEN))) {
+ createdOchInterfaces.addAll(
this.openRoadmInterfaceFactory
.createOpenRoadmOchInterface(nodeId, destTp, waveNumber));
}
}
// if the node is currently mounted then proceed.
if (this.deviceTransactionManager.isDeviceMounted(nodeId)) {
- if (destTp.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)
- || srcTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)
- || srcTp.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)
- || destTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
- if (destTp.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
+ if (destTp.contains(StringConstants.NETWORK_TOKEN)
+ || srcTp.contains(StringConstants.CLIENT_TOKEN)
+ || srcTp.contains(StringConstants.NETWORK_TOKEN)
+ || destTp.contains(StringConstants.CLIENT_TOKEN)) {
+ if (destTp.contains(StringConstants.NETWORK_TOKEN)) {
interfacesToDelete.add(destTp + "-ODU");
interfacesToDelete.add(destTp + "-OTU");
interfacesToDelete.add(
this.openRoadmInterfaceFactory.createOpenRoadmOchInterfaceName(destTp, waveNumber));
}
- if (srcTp.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
+ if (srcTp.contains(StringConstants.NETWORK_TOKEN)) {
interfacesToDelete.add(srcTp + "-ODU");
interfacesToDelete.add(srcTp + "-OTU");
interfacesToDelete
.add(this.openRoadmInterfaceFactory.createOpenRoadmOchInterfaceName(srcTp, waveNumber));
}
- if (srcTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
+ if (srcTp.contains(StringConstants.CLIENT_TOKEN)) {
interfacesToDelete.add(srcTp + "-ETHERNET");
}
- if (destTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
+ if (destTp.contains(StringConstants.CLIENT_TOKEN)) {
interfacesToDelete.add(destTp + "-ETHERNET");
}
} else {
import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.transportpce.common.OperationResult;
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.transportpce.b.c._interface.service.types.rev171016.service.path.PathDescription;
public interface RendererServiceOperations {
ListenableFuture<ServiceDeleteOutput> serviceDelete(ServiceDeleteInput input);
+ OperationResult reserveResource(PathDescription pathDescription);
+
+ OperationResult freeResource(PathDescription pathDescription);
+
}
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.OperationResult;
import org.opendaylight.transportpce.common.ResponseCodes;
+import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.Timeouts;
-import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
import org.opendaylight.transportpce.renderer.ModelMappingUtils;
import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
import org.opendaylight.transportpce.renderer.ServicePathInputData;
}
}
+/* @Override
+ public ServiceImplementationRequestOutput serviceImplementation(ServiceImplementationRequestInput input) {
+ LOG.info("Calling service impl request {} {}", input.getServiceName());
+ RollbackProcessor rollbackProcessor = new RollbackProcessor();
+
+ ServicePathInputData servicePathInputDataAtoZ
+ = ModelMappingUtils.rendererCreateServiceInputAToZ(input.getServiceName(),
+ input.getPathDescription());
+ ServicePathInputData servicePathInputDataZtoA
+ = ModelMappingUtils.rendererCreateServiceInputZToA(input.getServiceName(),
+ input.getPathDescription());
+ List<DeviceRenderingResult> renderingResults = deviceRendering(rollbackProcessor, servicePathInputDataAtoZ,
+ servicePathInputDataZtoA);
+ if (rollbackProcessor.rollbackAllIfNecessary() > 0) {
+ return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED, OPERATION_FAILED);
+ }
+
+ ServicePowerSetupInput olmPowerSetupInputAtoZ = ModelMappingUtils.createServicePowerSetupInput(
+ renderingResults.get(0).getOlmList(), input);
+ ServicePowerSetupInput olmPowerSetupInputZtoA = ModelMappingUtils.createServicePowerSetupInput(
+ renderingResults.get(1).getOlmList(), input);
+ olmPowerSetup(rollbackProcessor, olmPowerSetupInputAtoZ, olmPowerSetupInputZtoA);
+ if (rollbackProcessor.rollbackAllIfNecessary() > 0) {
+ return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED, OPERATION_FAILED);
+ }
+
+ // run service activation test twice - once on source node and once on destination node
+ List<Nodes> nodes = servicePathInputDataAtoZ.getServicePathInput().getNodes();
+ Nodes sourceNode = nodes.get(0);
+ Nodes destNode = nodes.get(nodes.size() - 1);
+
+ String srcNetworkTp;
+ String dstNetowrkTp;
+
+ if (sourceNode.getDestTp().contains(StringConstants.NETWORK_TOKEN)) {
+ srcNetworkTp = sourceNode.getDestTp();
+ } else {
+ srcNetworkTp = sourceNode.getSrcTp();
+ }
+ if (destNode.getDestTp().contains(StringConstants.NETWORK_TOKEN)) {
+ dstNetowrkTp = destNode.getDestTp();
+ } else {
+ dstNetowrkTp = destNode.getSrcTp();
+ }
+
+ if (!isServiceActivated(sourceNode.getNodeId(), srcNetworkTp)
+ || !isServiceActivated(destNode.getNodeId(), dstNetowrkTp)) {
+ rollbackProcessor.rollbackAll();
+ return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED, OPERATION_FAILED);
+ }
+ } */
+
@Override
public ListenableFuture<ServiceImplementationRequestOutput>
serviceImplementation(ServiceImplementationRequestInput input) {
Nodes destNode = nodes.get(nodes.size() - 1);
String srcNetworkTp;
String dstNetowrkTp;
- if (sourceNode.getDestTp().contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
+ //if (sourceNode.getDestTp().contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
+ if (sourceNode.getDestTp().contains(StringConstants.NETWORK_TOKEN)) {
srcNetworkTp = sourceNode.getDestTp();
} else {
srcNetworkTp = sourceNode.getSrcTp();
}
- if (destNode.getDestTp().contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
+ //if (destNode.getDestTp().contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
+ if (destNode.getDestTp().contains(StringConstants.NETWORK_TOKEN)) {
dstNetowrkTp = destNode.getDestTp();
} else {
dstNetowrkTp = destNode.getSrcTp();
}
+ @SuppressWarnings("checkstyle:IllegalCatch")
+ public OperationResult reserveResource(PathDescription pathDescription) {
+
+ try {
+ LOG.info("Reserving resources in network model");
+ networkModelWavelengthService.useWavelengths(pathDescription);
+ } catch (Exception e) {
+ LOG.warn("Reserving resources in network model failed");
+ return OperationResult.failed("Resources reserve failed in network model");
+ }
+ return OperationResult.ok("Resources reserved successfully in network model");
+ }
+
+ @SuppressWarnings("checkstyle:IllegalCatch")
+ public OperationResult freeResource(PathDescription pathDescription) {
+
+ try {
+ networkModelWavelengthService.freeWavelengths(pathDescription);
+ } catch (Exception e) {
+ return OperationResult.failed("Resources reserve failed in network model");
+ }
+ return OperationResult.ok("Resources reserved successfully in network model");
+ }
+
@Override
public ListenableFuture<ServiceDeleteOutput> serviceDelete(ServiceDeleteInput input) {
String serviceName = input.getServiceName();
private final ServicePowerSetupInput powerSetupInput;
public OlmPowerSetupRollbackTask(String id, boolean isRollbackNecessary, TransportpceOlmService olmService,
- ServicePowerSetupInput powerSetupInput) {
+ ServicePowerSetupInput powerSetupInput) {
super(id);
this.isRollbackNecessary = isRollbackNecessary;
this.olmService = olmService;
<reference id="openRoadmInterfaces" interface="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces" />
<reference id="portMapping" interface="org.opendaylight.transportpce.common.mapping.PortMapping" />
<reference id="crossConnect" interface="org.opendaylight.transportpce.common.crossconnect.CrossConnect" />
+ <reference id="mappingUtils" interface="org.opendaylight.transportpce.common.mapping.MappingUtils"/>
+ <reference id="FixedFlexImpl" interface="org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface"/>
<odl:rpc-service id="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" />
- <argument ref="openRoadmInterfaces" />
+ <bean id="openRoadmInterface121"
+ class="org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface121">
+ <argument ref="portMapping"/>
+ <argument ref="openRoadmInterfaces"/>
+ </bean>
+
+ <bean id="openRoadmInterface22"
+ class="org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface22">
+ <argument ref="portMapping"/>
+ <argument ref="openRoadmInterfaces"/>
+ <argument ref="FixedFlexImpl"/>
+ </bean>
+
+ <bean id="openRoadmInterfaceFactory"
+ class="org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory">
+ <argument ref="mappingUtils"/>
+ <argument ref="openRoadmInterface121"/>
+ <argument ref="openRoadmInterface22"/>
</bean>
<bean id="deviceRenderer" class="org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererServiceImpl" >
<argument ref="portMapping" />
</bean>
- <bean id="deviceRendererRPCImpl" class="org.opendaylight.transportpce.renderer.rpcs.DeviceRendererRPCImpl" >
+ <bean id="deviceRendererRPCImpl" class="org.opendaylight.transportpce.renderer.rpcs.DeviceRendererRPCImpl" >
<argument ref="deviceRenderer" />
</bean>
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
import org.opendaylight.transportpce.renderer.utils.ServiceDeleteDataUtils;
import org.opendaylight.transportpce.renderer.utils.WaveLengthServiceUtils;
import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev170929.degree.used.wavelengths.UsedWavelengthsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1Builder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.TerminationPoint1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.TerminationPoint1Builder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.DegreeAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.SrgAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.CpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.CtpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.PpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.RxTtpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.TxTtpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.XpdrClientAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.XpdrNetworkAttributesBuilder;
-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.topology.rev170929.network.node.termination.point.pp.attributes.UsedWavelengthBuilder;
-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.openroadm.degree.rev171215.degree.used.wavelengths.UsedWavelengthsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.Node1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.Node1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.TerminationPoint1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.DegreeAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.TerminationPoint1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.DegreeAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.SrgAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.CpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.CtpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.PpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.RxTtpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.TxTtpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrClientAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrNetworkAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrPortAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.pp.attributes.UsedWavelengthBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev171215.OpenroadmNodeType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev171215.OpenroadmTpType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev171215.xpdr.port.connection.attributes.WavelengthBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.PathDescription;
@RunWith(Parameterized.class)
List<Object[]> parameters = new ArrayList<>();
PathDescription pathDescription =
- ServiceDeleteDataUtils.createTransactionPathDescription(OpenRoadmInterfacesImpl.TTP_TOKEN);
+ ServiceDeleteDataUtils.createTransactionPathDescription(StringConstants.TTP_TOKEN);
TerminationPoint1Builder terminationPoint1Builder = new TerminationPoint1Builder();
terminationPoint1Builder.setCtpAttributes((new CtpAttributesBuilder()).setUsedWavelengths(Collections
.singletonList((new UsedWavelengthsBuilder()).setIndex(WAVE_LENGTH).build())).build());
terminationPoint1Builder.setCpAttributes((new CpAttributesBuilder()).setUsedWavelengths(Collections
- .singletonList((new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network
+ .singletonList((new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network
.node.termination.point.cp.attributes.UsedWavelengthsBuilder())
.setIndex(WAVE_LENGTH).build())).build());
terminationPoint1Builder.setTxTtpAttributes((new TxTtpAttributesBuilder()).setUsedWavelengths(Collections
@Test
public void freeWavelengthsTest() throws ExecutionException, InterruptedException {
- WaveLengthServiceUtils.putTerminationPoint1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
- OpenRoadmInterfacesImpl.TTP_TOKEN,
+ WaveLengthServiceUtils.putTerminationPoint1ToDatastore("node1" + StringConstants.TTP_TOKEN,
+ StringConstants.TTP_TOKEN,
this.terminationPoint1, this.deviceTransactionManager);
- WaveLengthServiceUtils.putNode1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN, this.node1,
+ WaveLengthServiceUtils.putNode1ToDatastore("node1" + StringConstants.TTP_TOKEN, this.node1,
this.deviceTransactionManager);
this.networkModelWavelengthService.freeWavelengths(this.pathDescription);
- Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1" + StringConstants.TTP_TOKEN,
this.deviceTransactionManager);
TerminationPoint1 updatedTerminationPoint1 =
- WaveLengthServiceUtils.getTerminationPoint1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
- OpenRoadmInterfacesImpl.TTP_TOKEN, this.deviceTransactionManager);
+ WaveLengthServiceUtils.getTerminationPoint1FromDatastore("node1" + StringConstants.TTP_TOKEN,
+ StringConstants.TTP_TOKEN, this.deviceTransactionManager);
switch (updatedTerminationPoint1.getTpType()) {
case DEGREETXRXCTP:
case DEGREETXCTP:
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
import org.opendaylight.transportpce.renderer.utils.ServiceDeleteDataUtils;
import org.opendaylight.transportpce.renderer.utils.WaveLengthServiceUtils;
import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev170929.degree.node.attributes.AvailableWavelengthsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1Builder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.TerminationPoint1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.TerminationPoint1Builder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.DegreeAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.SrgAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.CpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.CtpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.PpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.RxTtpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.TxTtpAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.XpdrClientAttributesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.network.node.termination.point.XpdrNetworkAttributesBuilder;
-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.openroadm.degree.rev171215.degree.node.attributes.AvailableWavelengthsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.Node1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.Node1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.TerminationPoint1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.TerminationPoint1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.DegreeAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.SrgAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.CpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.CtpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.PpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.RxTtpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.TxTtpAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrClientAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrNetworkAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.network.node.termination.point.XpdrPortAttributesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev171215.OpenroadmNodeType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev171215.OpenroadmTpType;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.path.PathDescription;
@RunWith(Parameterized.class)
List<Object[]> parameters = new ArrayList<>();
PathDescription pathDescription =
- ServiceDeleteDataUtils.createTransactionPathDescription(OpenRoadmInterfacesImpl.TTP_TOKEN);
+ ServiceDeleteDataUtils.createTransactionPathDescription(StringConstants.TTP_TOKEN);
TerminationPoint1Builder terminationPoint1Builder = new TerminationPoint1Builder();
terminationPoint1Builder
.setAvailableWavelengths(Collections.singletonList(new AvailableWavelengthsBuilder().setIndex(20L).build()))
.build());
node1Builder.setSrgAttributes((new SrgAttributesBuilder()).setAvailableWavelengths(Collections.singletonList(
- new org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev170929.srg.node.attributes
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev171215.srg.node.attributes
.AvailableWavelengthsBuilder().setIndex(20L).build())).build());
for (OpenroadmNodeType nodeType : Arrays
@Test
public void freeWavelengthsTest() throws ExecutionException, InterruptedException {
WaveLengthServiceUtils
- .putTerminationPoint1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
- OpenRoadmInterfacesImpl.TTP_TOKEN,
+ .putTerminationPoint1ToDatastore("node1" + StringConstants.TTP_TOKEN,
+ StringConstants.TTP_TOKEN,
this.terminationPoint1, this.deviceTransactionManager);
- WaveLengthServiceUtils.putNode1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN, this.node1,
+ WaveLengthServiceUtils.putNode1ToDatastore("node1" + StringConstants.TTP_TOKEN, this.node1,
this.deviceTransactionManager);
this.networkModelWavelengthService.useWavelengths(this.pathDescription);
- Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1" + StringConstants.TTP_TOKEN,
this.deviceTransactionManager);
TerminationPoint1 updatedTerminationPoint1 = WaveLengthServiceUtils
- .getTerminationPoint1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
- OpenRoadmInterfacesImpl.TTP_TOKEN,
+ .getTerminationPoint1FromDatastore("node1" + StringConstants.TTP_TOKEN,
+ StringConstants.TTP_TOKEN,
this.deviceTransactionManager);
switch (updatedTerminationPoint1.getTpType()) {
import org.mockito.Mockito;
import org.opendaylight.controller.md.sal.binding.api.MountPoint;
import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface;
import org.opendaylight.transportpce.common.mapping.MappingUtils;
import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
import org.opendaylight.transportpce.common.mapping.PortMapping;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface121;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface22;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
import org.opendaylight.transportpce.renderer.utils.CreateOtsOmsDataUtils;
this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(this.deviceTransactionManager);
this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(this.deviceTransactionManager);
this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+ this.mappingUtils = Mockito.spy(MappingUtils.class);
+
+ Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(mappingUtils)
+ .getOpenRoadmVersion(Mockito.anyString());
this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
- openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+ openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
this.portMappingVersion22 = new PortMappingVersion22(getDataBroker(), this.deviceTransactionManager,
- this.openRoadmInterfaces);
+ this.openRoadmInterfaces);
this.portMappingVersion121 = new PortMappingVersion121(getDataBroker(), this.deviceTransactionManager,
- this.openRoadmInterfaces);
+ this.openRoadmInterfaces);
PortMapping portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
- this.portMappingVersion121);
- this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping, this.openRoadmInterfaces);
+ this.portMappingVersion121);
+ FixedFlexInterface fixedFlexInterface = new FixedFlexImpl();
+ OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping,openRoadmInterfaces);
+ OpenRoadmInterface22 openRoadmInterface22 = new OpenRoadmInterface22(portMapping,openRoadmInterfaces,
+ fixedFlexInterface);
+ this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(this.mappingUtils,openRoadmInterface121,
+ openRoadmInterface22);
+
this.crossConnectImpl121 = new CrossConnectImpl121(this.deviceTransactionManager);
this.crossConnectImpl22 = new CrossConnectImpl22(this.deviceTransactionManager);
this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager, this.mappingUtils,
- this.crossConnectImpl121, this.crossConnectImpl22);
+ this.crossConnectImpl121, this.crossConnectImpl22);
this.crossConnect = Mockito.spy(this.crossConnect);
this.deviceRendererService = new DeviceRendererServiceImpl(this.getDataBroker(),
this.deviceTransactionManager, this.openRoadmInterfaceFactory, this.openRoadmInterfaces,
CreateOtsOmsOutput result = this.deviceRendererService.createOtsOms(input);
Assert.assertFalse(result.isSuccess());
Assert.assertEquals("node 1 is not mounted on the controller",
- result.getResult());
+ result.getResult());
}
@Test
);
}
-}
+}
\ No newline at end of file
import org.opendaylight.controller.md.sal.binding.api.MountPoint;
import org.opendaylight.controller.md.sal.binding.api.MountPointService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface;
import org.opendaylight.transportpce.common.mapping.MappingUtils;
import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
import org.opendaylight.transportpce.common.mapping.PortMapping;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface121;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface22;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
import org.opendaylight.transportpce.renderer.utils.MountPointUtils;
this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(this.deviceTransactionManager);
this.mappingUtils = new MappingUtilsImpl(getDataBroker());
this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
- openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+ openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
this.portMappingVersion22 = new PortMappingVersion22(getDataBroker(), this.deviceTransactionManager,
- this.openRoadmInterfaces);
+ this.openRoadmInterfaces);
this.portMappingVersion121 = new PortMappingVersion121(getDataBroker(), this.deviceTransactionManager,
- this.openRoadmInterfaces);
+ this.openRoadmInterfaces);
PortMapping portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
- this.portMappingVersion121);
- this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping, this.openRoadmInterfaces);
+ this.portMappingVersion121);
+ FixedFlexInterface fixedFlexInterface = new FixedFlexImpl();
+ OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping,openRoadmInterfaces);
+ OpenRoadmInterface22 openRoadmInterface22 = new OpenRoadmInterface22(portMapping,openRoadmInterfaces,
+ fixedFlexInterface);
+ this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(this.mappingUtils,openRoadmInterface121,
+ openRoadmInterface22);
+
this.crossConnectImpl121 = new CrossConnectImpl121(this.deviceTransactionManager);
this.crossConnectImpl22 = new CrossConnectImpl22(this.deviceTransactionManager);
this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager, this.mappingUtils,
- this.crossConnectImpl121, this.crossConnectImpl22);
+ this.crossConnectImpl121, this.crossConnectImpl22);
this.crossConnect = Mockito.spy(this.crossConnect);
this.deviceRendererService = new DeviceRendererServiceImpl(this.getDataBroker(),
this.deviceTransactionManager, this.openRoadmInterfaceFactory, this.openRoadmInterfaces,
ServicePathOutput servicePathOutput = deviceRendererService.deleteServicePath(servicePathInput);
Assert.assertFalse(servicePathOutput.isSuccess());
Assert.assertEquals("node1 is not mounted on the controller",
- servicePathOutput.getResult());
+ servicePathOutput.getResult());
}
@Test
public void testDeleteServiceSuccess() throws OpenRoadmInterfaceException {
setMountPoint(MountPointUtils.getMountPoint(new ArrayList<>(), getDataBroker()));
String [] interfaceTokens = {
- OpenRoadmInterfacesImpl.NETWORK_TOKEN,
- OpenRoadmInterfacesImpl.CLIENT_TOKEN,
- OpenRoadmInterfacesImpl.TTP_TOKEN,
- OpenRoadmInterfacesImpl.PP_TOKEN
+ StringConstants.NETWORK_TOKEN,
+ StringConstants.CLIENT_TOKEN,
+ StringConstants.TTP_TOKEN,
+ StringConstants.PP_TOKEN
};
String nodeId = "node1";
public void testDeleteServiceFailure() throws OpenRoadmInterfaceException {
setMountPoint(MountPointUtils.getMountPoint(new ArrayList<>(), getDataBroker()));
String [] interfaceTokens = {
- OpenRoadmInterfacesImpl.NETWORK_TOKEN,
- OpenRoadmInterfacesImpl.CLIENT_TOKEN,
- OpenRoadmInterfacesImpl.TTP_TOKEN,
- OpenRoadmInterfacesImpl.PP_TOKEN
- };
-
+ StringConstants.NETWORK_TOKEN,
+ StringConstants.CLIENT_TOKEN,
+ StringConstants.TTP_TOKEN,
+ StringConstants.PP_TOKEN };
String nodeId = "node1";
Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect(Mockito.eq(nodeId), Mockito.anyString());
Mockito.doThrow(OpenRoadmInterfaceException.class).when(this.openRoadmInterfaces)
String nodeId = "node1";
Mockito.doReturn(false).when(this.crossConnect).deleteCrossConnect(Mockito.eq(nodeId), Mockito.anyString());
Mockito.doThrow(OpenRoadmInterfaceException.class).when(this.openRoadmInterfaces)
- .deleteInterface(Mockito.eq(nodeId), Mockito.anyString());
+ .deleteInterface(Mockito.eq(nodeId), Mockito.anyString());
List<Nodes> nodes = new ArrayList<>();
nodes.add(ServiceImplementationDataUtils.createNode(nodeId, null, null));
- nodes.add(ServiceImplementationDataUtils.createNode(nodeId, "src-" + OpenRoadmInterfacesImpl.PP_TOKEN, null));
+ nodes.add(ServiceImplementationDataUtils.createNode(nodeId, "src-" + StringConstants.PP_TOKEN, null));
ServicePathInput servicePathInput = ServiceImplementationDataUtils.buildServicePathInputs(nodes);
ServicePathOutput servicePathOutput = deviceRendererService.deleteServicePath(servicePathInput);
Mockito.doReturn(false).when(this.crossConnect).deleteCrossConnect(Mockito.eq(nodeId), Mockito.anyString());
Mockito.doNothing().when(this.openRoadmInterfaces).deleteInterface(Mockito.eq(nodeId), Mockito.anyString());
- String srcTP = "src-" + OpenRoadmInterfacesImpl.TTP_TOKEN;
- String dstTp = "dst-" + OpenRoadmInterfacesImpl.PP_TOKEN;
+ String srcTP = "src-" + StringConstants.TTP_TOKEN;
+ String dstTp = "dst-" + StringConstants.PP_TOKEN;
List<Nodes> nodes = new ArrayList<>();
nodes.add(ServiceImplementationDataUtils.createNode(nodeId, srcTP, dstTp));
Mockito.doThrow(OpenRoadmInterfaceException.class).when(this.openRoadmInterfaces)
.deleteInterface(Mockito.eq(nodeId), Mockito.anyString());
- String srcTp = "src-" + OpenRoadmInterfacesImpl.PP_TOKEN;
- String dstTp = "dst-" + OpenRoadmInterfacesImpl.TTP_TOKEN;
+ String srcTp = "src-" + StringConstants.PP_TOKEN;
+ String dstTp = "dst-" + StringConstants.TTP_TOKEN;
Long waveNumber = 20L;
String connectionNumber = dstTp + "-" + srcTp + "-" + waveNumber;
roadmConnectionsBuilder.setWavelengthNumber(20L);
roadmConnectionsBuilder.setDestination((new DestinationBuilder()).setDstIf(interfaceName).build());
InstanceIdentifier<RoadmConnections> xciid = InstanceIdentifier.create(OrgOpenroadmDevice.class)
- .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber));
+ .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber));
TransactionUtils.writeTransaction(this.deviceTransactionManager, nodeId, LogicalDatastoreType.CONFIGURATION,
xciid, roadmConnectionsBuilder.build());
Assert.assertTrue(servicePathOutput.isSuccess());
Assert.assertEquals("Request processed", servicePathOutput.getResult());
}
-}
+}
\ No newline at end of file
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface;
import org.opendaylight.transportpce.common.mapping.MappingUtils;
import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
import org.opendaylight.transportpce.common.mapping.PortMapping;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface121;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface22;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
import org.opendaylight.transportpce.renderer.stub.MountPointStub;
this.mappingUtils = new MappingUtilsImpl(getDataBroker());
this.mappingUtils = Mockito.spy(this.mappingUtils);
this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
- openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+ openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
this.portMappingVersion22 =
- new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+ new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
this.portMappingVersion121 = new PortMappingVersion121(getDataBroker(), deviceTransactionManager,
- this.openRoadmInterfaces);
+ this.openRoadmInterfaces);
this.crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
this.crossConnectImpl22 = new CrossConnectImpl22(deviceTransactionManager);
this.crossConnect = new CrossConnectImpl(deviceTransactionManager, this.mappingUtils, this.crossConnectImpl121,
- this.crossConnectImpl22);
+ this.crossConnectImpl22);
this.crossConnect = Mockito.spy(this.crossConnect);
PortMapping portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
- this.portMappingVersion121);
- OpenRoadmInterfaceFactory openRoadmInterfaceFactory =
- new OpenRoadmInterfaceFactory(portMapping, this.openRoadmInterfaces);
+ this.portMappingVersion121);
+ FixedFlexInterface fixedFlexInterface = new FixedFlexImpl();
+ OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping,openRoadmInterfaces);
+ OpenRoadmInterface22 openRoadmInterface22 = new OpenRoadmInterface22(portMapping,openRoadmInterfaces,
+ fixedFlexInterface);
+ OpenRoadmInterfaceFactory openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(this.mappingUtils,
+ openRoadmInterface121,openRoadmInterface22);
+
+
this.deviceRendererService = new DeviceRendererServiceImpl(this.getDataBroker(),
- deviceTransactionManager, openRoadmInterfaceFactory, this.openRoadmInterfaces, this.crossConnect,
+ deviceTransactionManager, openRoadmInterfaceFactory, this.openRoadmInterfaces, this.crossConnect,
portMapping);
}
setMountPoint(new MountPointStub(getDataBroker()));
RendererRollbackInput rendererRollbackInput = ServiceImplementationDataUtils.buildRendererRollbackInput();
RendererRollbackOutput rendererRollbackOutput =
- this.deviceRendererService.rendererRollback(rendererRollbackInput);
+ this.deviceRendererService.rendererRollback(rendererRollbackInput);
Assert.assertTrue(rendererRollbackOutput.isSuccess());
Assert.assertTrue(rendererRollbackOutput.getFailedToRollback().isEmpty());
}
RendererRollbackInputBuilder rendererRollbackInputBuilder = new RendererRollbackInputBuilder();
rendererRollbackInputBuilder.setNodeInterface(nodeInterfaces);
Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
- .getOpenRoadmVersion("node1");
+ .getOpenRoadmVersion("node1");
RendererRollbackOutput rendererRollbackOutput =
- this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
+ this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
Assert.assertFalse(rendererRollbackOutput.isSuccess());
Assert.assertEquals(1, rendererRollbackOutput.getFailedToRollback().size());
Assert.assertEquals("node1", rendererRollbackOutput.getFailedToRollback().get(0).getNodeId());
Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect("node1", connectionID.get(0));
RendererRollbackOutput rendererRollbackOutput =
- this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
+ this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
Assert.assertTrue("Rollback must success when cross connect returns true", rendererRollbackOutput.isSuccess());
Assert.assertEquals(1, rendererRollbackOutput.getFailedToRollback().size());
Assert.assertTrue("There must not be any failed interfaces when cross connect returns true",
Mockito.doReturn(false).when(this.crossConnect).deleteCrossConnect("node1", connectionID.get(0));
rendererRollbackOutput =
- this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
+ this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
Assert.assertFalse("Rollback must fail when cross connect returns false",rendererRollbackOutput.isSuccess());
Assert.assertEquals(1, rendererRollbackOutput.getFailedToRollback().size());
Assert.assertFalse(rendererRollbackOutput.getFailedToRollback().get(0).getInterface().isEmpty());
nodeInterfaceBuilder.withKey(new NodeInterfaceKey("node1"));
nodeInterfaceBuilder.setConnectionId(new ArrayList<>());
List<String> oduInterfacesId = new ArrayList<>();
- oduInterfacesId.add("node1-" + OpenRoadmInterfacesImpl.NETWORK_TOKEN + "-ODU");
+ oduInterfacesId.add("node1-" + StringConstants.NETWORK_TOKEN + "-ODU");
nodeInterfaceBuilder.setOduInterfaceId(oduInterfacesId);
List<String> otuInterfacesId = new ArrayList<>();
- otuInterfacesId.add("node1-" + OpenRoadmInterfacesImpl.NETWORK_TOKEN + "-OTU");
+ otuInterfacesId.add("node1-" + StringConstants.NETWORK_TOKEN + "-OTU");
nodeInterfaceBuilder.setOtuInterfaceId(otuInterfacesId);
List<String> ochInterfacesId = new ArrayList<>();
- ochInterfacesId.add("node1-" + OpenRoadmInterfacesImpl.NETWORK_TOKEN + "-20");
+ ochInterfacesId.add("node1-" + StringConstants.NETWORK_TOKEN + "-20");
nodeInterfaceBuilder.setOchInterfaceId(ochInterfacesId);
List<NodeInterface> nodeInterfaces = new ArrayList<>();
nodeInterfaces.add(nodeInterfaceBuilder.build());
Mockito.doNothing().when(this.openRoadmInterfaces).deleteInterface(Mockito.eq("node1"), Mockito.anyString());
RendererRollbackOutput rendererRollbackOutput =
- this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
+ this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
Assert.assertTrue(rendererRollbackOutput.isSuccess());
Assert.assertFalse(rendererRollbackOutput.getFailedToRollback().isEmpty());
Assert.assertTrue(rendererRollbackOutput.getFailedToRollback().get(0).getInterface().isEmpty());
nodeInterfaceBuilder.withKey(new NodeInterfaceKey("node1"));
nodeInterfaceBuilder.setConnectionId(new ArrayList<>());
List<String> ethInterfacesId = new ArrayList<>();
- ethInterfacesId.add("node1-" + OpenRoadmInterfacesImpl.CLIENT_TOKEN + "-ETHERNET");
+ ethInterfacesId.add("node1-" + StringConstants.CLIENT_TOKEN + "-ETHERNET");
nodeInterfaceBuilder.setEthInterfaceId(ethInterfacesId);
List<NodeInterface> nodeInterfaces = new ArrayList<>();
nodeInterfaces.add(nodeInterfaceBuilder.build());
Mockito.doThrow(OpenRoadmInterfaceException.class).when(this.openRoadmInterfaces)
.deleteInterface(Mockito.eq("node1"), Mockito.anyString());
RendererRollbackOutput rendererRollbackOutput =
- this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
+ this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
Assert.assertFalse(rendererRollbackOutput.isSuccess());
Assert.assertEquals(1,rendererRollbackOutput.getFailedToRollback().size());
Assert.assertEquals(1, rendererRollbackOutput.getFailedToRollback().get(0).getInterface().size());
Mockito.verify(this.openRoadmInterfaces, Mockito.times(1))
.deleteInterface("node1",ethInterfacesId.get(0));
}
-}
+}
\ No newline at end of file
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface;
import org.opendaylight.transportpce.common.mapping.MappingUtils;
-import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
import org.opendaylight.transportpce.common.mapping.PortMapping;
import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface121;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface22;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServicePathDirection;
import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(deviceTransactionManager);
this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(deviceTransactionManager);
- this.mappingUtils = new MappingUtilsImpl(getDataBroker());
- this.mappingUtils = Mockito.spy(this.mappingUtils);
+ this.mappingUtils = Mockito.spy(MappingUtils.class);
+
+ Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(mappingUtils)
+ .getOpenRoadmVersion(Mockito.anyString());
+
this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
- openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+ openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
this.portMappingVersion22 =
- new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+ new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
this.portMappingVersion121 =
- new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+ new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
- this.portMappingVersion121);
+ this.portMappingVersion121);
this.portMapping = Mockito.spy(this.portMapping);
this.crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
this.crossConnectImpl22 = new CrossConnectImpl22(deviceTransactionManager);
this.crossConnect = new CrossConnectImpl(deviceTransactionManager, this.mappingUtils, this.crossConnectImpl121,
- this.crossConnectImpl22);
+ this.crossConnectImpl22);
this.crossConnect = Mockito.spy(this.crossConnect);
- OpenRoadmInterfaceFactory openRoadmInterfaceFactory =
- new OpenRoadmInterfaceFactory(this.portMapping, this.openRoadmInterfaces);
+
+
+ FixedFlexInterface fixedFlexInterface = new FixedFlexImpl();
+ OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping,openRoadmInterfaces);
+ OpenRoadmInterface22 openRoadmInterface22 = new OpenRoadmInterface22(portMapping,openRoadmInterfaces,
+ fixedFlexInterface);
+ OpenRoadmInterfaceFactory openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(this.mappingUtils,
+ openRoadmInterface121,openRoadmInterface22);
+
this.deviceRendererService = new DeviceRendererServiceImpl(this.getDataBroker(),
- this.deviceTransactionManager, openRoadmInterfaceFactory, openRoadmInterfaces, crossConnect,
+ this.deviceTransactionManager, openRoadmInterfaceFactory, openRoadmInterfaces, crossConnect,
portMapping);
}
public void testSetupServicemptyPorts() {
setMountPoint(MountPointUtils.getMountPoint(new ArrayList<>(), getDataBroker()));
String nodeId = "node1";
- String srcTP = OpenRoadmInterfacesImpl.TTP_TOKEN;
- String dstTp = OpenRoadmInterfacesImpl.PP_TOKEN;
+ String srcTP = StringConstants.TTP_TOKEN;
+ String dstTp = StringConstants.PP_TOKEN;
List<Nodes> nodes = new ArrayList<>();
nodes.add(ServiceImplementationDataUtils.createNode(nodeId, srcTP, dstTp));
ServicePathInput servicePathInput = ServiceImplementationDataUtils.buildServicePathInputs(nodes);
for (ServicePathDirection servicePathDirection : ServicePathDirection.values()) {
ServicePathOutput servicePathOutput = deviceRendererService.setupServicePath(servicePathInput,
- servicePathDirection);
+ servicePathDirection);
Assert.assertFalse(servicePathOutput.isSuccess());
}
}
public void testSetupServiceCannotCrossConnect() {
setMountPoint(MountPointUtils.getMountPoint(new ArrayList<>(), getDataBroker()));
String nodeId = "node1";
- String srcTP = OpenRoadmInterfacesImpl.TTP_TOKEN;
- String dstTp = OpenRoadmInterfacesImpl.PP_TOKEN;
+ String srcTP = StringConstants.TTP_TOKEN;
+ String dstTp = StringConstants.PP_TOKEN;
MountPointUtils.writeMapping(nodeId, srcTP, this.deviceTransactionManager);
MountPointUtils.writeMapping(nodeId, dstTp, this.deviceTransactionManager);
List<Nodes> nodes = new ArrayList<>();
nodes.add(ServiceImplementationDataUtils.createNode(nodeId, srcTP, dstTp));
ServicePathInput servicePathInput = ServiceImplementationDataUtils.buildServicePathInputs(nodes);
Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
- .getOpenRoadmVersion("node1");
+ .getOpenRoadmVersion("node1");
Mockito.doReturn(java.util.Optional.empty()).when(this.crossConnect).postCrossConnect(nodeId, 20L, srcTP,
dstTp);
ServicePathOutput servicePathOutput = deviceRendererService.setupServicePath(servicePathInput,
- ServicePathDirection.A_TO_Z);
+ ServicePathDirection.A_TO_Z);
Assert.assertFalse(servicePathOutput.isSuccess());
}
Mockito.doNothing().when(this.openRoadmInterfaces).postEquipmentState(Mockito.anyString(),
Mockito.anyString(), Mockito.anyBoolean());
String [] interfaceTokens = {
- OpenRoadmInterfacesImpl.NETWORK_TOKEN,
- OpenRoadmInterfacesImpl.CLIENT_TOKEN,
- OpenRoadmInterfacesImpl.TTP_TOKEN,
- OpenRoadmInterfacesImpl.PP_TOKEN
+ StringConstants.NETWORK_TOKEN,
+ StringConstants.CLIENT_TOKEN,
+ StringConstants.TTP_TOKEN,
+ StringConstants.PP_TOKEN
};
String nodeId = "node1";
MountPointUtils.writeMapping(nodeId, dstTp, this.deviceTransactionManager);
boolean connectingUsingCrossConnect = true;
- if (OpenRoadmInterfacesImpl.NETWORK_TOKEN.equals(srcToken)
- || OpenRoadmInterfacesImpl.CLIENT_TOKEN.equals(srcToken)) {
+ if (StringConstants.NETWORK_TOKEN.equals(srcToken)
+ || StringConstants.CLIENT_TOKEN.equals(srcToken)) {
connectingUsingCrossConnect = false;
}
- if (OpenRoadmInterfacesImpl.NETWORK_TOKEN.equals(dstToken)
- || OpenRoadmInterfacesImpl.CLIENT_TOKEN.equals(dstToken)) {
+ if (StringConstants.NETWORK_TOKEN.equals(dstToken)
+ || StringConstants.CLIENT_TOKEN.equals(dstToken)) {
connectingUsingCrossConnect = false;
}
nodes.add(ServiceImplementationDataUtils.createNode(nodeId, srcTP, dstTp));
ServicePathInput servicePathInput = ServiceImplementationDataUtils.buildServicePathInputs(nodes);
Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
- .getOpenRoadmVersion("node1");
+ .getOpenRoadmVersion("node1");
for (ServicePathDirection servicePathDirection : ServicePathDirection.values()) {
ServicePathOutput servicePathOutput = deviceRendererService.setupServicePath(servicePathInput,
- servicePathDirection);
+ servicePathDirection);
Assert.assertTrue(servicePathOutput.isSuccess());
String expectedResult = "Roadm-connection successfully created for nodes: ";
if (connectingUsingCrossConnect) {
nodes.add(ServiceImplementationDataUtils.createNode(nodeId, srcTP, dstTp));
ServicePathInput servicePathInput = ServiceImplementationDataUtils.buildServicePathInputs(nodes);
Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
- .getOpenRoadmVersion("node1");
+ .getOpenRoadmVersion("node1");
for (ServicePathDirection servicePathDirection : ServicePathDirection.values()) {
ServicePathOutput servicePathOutput = deviceRendererService.setupServicePath(servicePathInput,
- servicePathDirection);
+ servicePathDirection);
Assert.assertTrue(servicePathOutput.isSuccess());
String expectedResult = "Roadm-connection successfully created for nodes: ";
expectedResult = expectedResult + nodeId;
Assert.assertEquals(nodeId, servicePathOutput.getNodeInterface().get(0).getNodeId());
}
}
-}
+}
\ No newline at end of file
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.transportpce.common.ResponseCodes;
+import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface;
import org.opendaylight.transportpce.common.mapping.MappingUtils;
import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
import org.opendaylight.transportpce.common.mapping.PortMapping;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
import org.opendaylight.transportpce.renderer.NetworkModelWavelengthServiceImpl;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface121;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface22;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
import org.opendaylight.transportpce.renderer.stub.MountPointStub;
this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(deviceTransactionManager);
this.mappingUtils = new MappingUtilsImpl(getDataBroker());
this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
- openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+ openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
this.portMappingVersion22 =
- new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+ new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
this.portMappingVersion121 =
- new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+ new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
- this.portMappingVersion121);
+ this.portMappingVersion121);
this.crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
this.crossConnectImpl22 = new CrossConnectImpl22(deviceTransactionManager);
this.crossConnect = new CrossConnectImpl(deviceTransactionManager, this.mappingUtils, this.crossConnectImpl121,
- this.crossConnectImpl22);
+ this.crossConnectImpl22);
this.crossConnect = Mockito.spy(crossConnect);
- OpenRoadmInterfaceFactory openRoadmInterfaceFactory =
- new OpenRoadmInterfaceFactory(portMapping, openRoadmInterfaces);
+ FixedFlexInterface fixedFlexInterface = new FixedFlexImpl();
+ OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping,openRoadmInterfaces);
+ OpenRoadmInterface22 openRoadmInterface22 = new OpenRoadmInterface22(portMapping,openRoadmInterfaces,
+ fixedFlexInterface);
+ OpenRoadmInterfaceFactory openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(this.mappingUtils,
+ openRoadmInterface121,openRoadmInterface22);
+
this.deviceRenderer = new DeviceRendererServiceImpl(this.getDataBroker(),
- this.deviceTransactionManager, openRoadmInterfaceFactory, openRoadmInterfaces, crossConnect,
+ this.deviceTransactionManager, openRoadmInterfaceFactory, openRoadmInterfaces, crossConnect,
this.portMapping);
}
this.olmService = new OlmServiceStub();
this.olmService = Mockito.spy(this.olmService);
ListeningExecutorService executor =
- MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(NUMBER_OF_THREADS));
+ MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(NUMBER_OF_THREADS));
this.networkModelWavelengthService = new NetworkModelWavelengthServiceImpl(getDataBroker());
NotificationPublishService notificationPublishService = new NotificationPublishServiceMock();
this.rendererServiceOperations = new RendererServiceOperationsImpl(this.deviceRenderer, olmService,
ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
serviceDeleteInputBuilder.setServiceName("service 1");
serviceDeleteInputBuilder.setServiceHandlerHeader((new ServiceHandlerHeaderBuilder())
- .setRequestId("request1").build());
+ .setRequestId("request1").build());
Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect(Mockito.anyString(), Mockito.anyString());
ServiceDeleteOutput serviceDeleteOutput
= this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build()).get();
Assert.assertEquals(ResponseCodes.RESPONSE_OK,
- serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+ serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
Mockito.verify(this.crossConnect, Mockito.times(2)).deleteCrossConnect(Mockito.any(), Mockito.any());
}
ServiceDeleteOutput serviceDeleteOutput
= this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build()).get();
Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
- serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+ serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.any(), Mockito.any());
}
public void serviceDeleteOperationTearDownFailedAtoZ() throws ExecutionException, InterruptedException {
Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect(Mockito.anyString(), Mockito.anyString());
Mockito.doReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
- .setResult("Failed").build()).buildFuture()).when(this.olmService).servicePowerTurndown(Mockito.any());
+ .setResult("Failed").build()).buildFuture()).when(this.olmService).servicePowerTurndown(Mockito.any());
writePathDescription();
ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
public void serviceDeleteOperationTearDownFailedZtoA() throws ExecutionException, InterruptedException {
Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect(Mockito.anyString(), Mockito.anyString());
Mockito.when(this.olmService.servicePowerTurndown(Mockito.any()))
- .thenReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
- .setResult("Success").build()).buildFuture())
- .thenReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
- .setResult("Failed").build()).buildFuture());
+ .thenReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
+ .setResult("Success").build()).buildFuture())
+ .thenReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
+ .setResult("Failed").build()).buildFuture());
writePathDescription();
ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
serviceDeleteInputBuilder.setServiceName("service 1");
serviceDeleteInputBuilder.setServiceHandlerHeader((new ServiceHandlerHeaderBuilder())
- .setRequestId("request1").build());
+ .setRequestId("request1").build());
ServiceDeleteOutput serviceDeleteOutput =
this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build()).get();
Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
- serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+ serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
Mockito.verify(this.olmService, Mockito.times(2)).servicePowerTurndown(Mockito.any());
Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.eq("node1"), Mockito.any());
Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.eq("node2"), Mockito.any());
private void writePathDescription() throws ExecutionException, InterruptedException {
ServicePathsBuilder servicePathsBuilder = new ServicePathsBuilder();
servicePathsBuilder.setPathDescription(ServiceDeleteDataUtils
- .createTransactionPathDescription(OpenRoadmInterfacesImpl.PP_TOKEN));
+ .createTransactionPathDescription(StringConstants.PP_TOKEN));
servicePathsBuilder.setServiceAEnd(ServiceDeleteDataUtils.getServiceAEndBuild().build())
.setServiceZEnd(ServiceDeleteDataUtils.getServiceZEndBuild().build());
servicePathsBuilder.withKey(new ServicePathsKey("service 1"));
InstanceIdentifier<ServicePaths> servicePathsInstanceIdentifier = InstanceIdentifier.create(
ServicePathList.class).child(ServicePaths.class, new ServicePathsKey("service 1"));
TransactionUtils.writeTransaction(
- this.deviceTransactionManager,
- "node1" + OpenRoadmInterfacesImpl.PP_TOKEN,
- LogicalDatastoreType.OPERATIONAL,
- servicePathsInstanceIdentifier,
- servicePathsBuilder.build());
+ this.deviceTransactionManager,
+ "node1" + StringConstants.PP_TOKEN,
+ LogicalDatastoreType.OPERATIONAL,
+ servicePathsInstanceIdentifier,
+ servicePathsBuilder.build());
}
}
import org.opendaylight.controller.md.sal.binding.api.MountPointService;
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.transportpce.common.ResponseCodes;
+import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexImpl;
+import org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface;
import org.opendaylight.transportpce.common.mapping.MappingUtils;
import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
import org.opendaylight.transportpce.common.mapping.PortMapping;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
import org.opendaylight.transportpce.renderer.NetworkModelWavelengthServiceImpl;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface121;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface22;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
import org.opendaylight.transportpce.renderer.stub.MountPointStub;
this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(deviceTransactionManager);
this.mappingUtils = new MappingUtilsImpl(getDataBroker());
this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
- openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+ openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
this.portMappingVersion22 =
- new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+ new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
this.portMappingVersion121 =
- new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+ new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
- this.portMappingVersion121);
- this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
- openRoadmInterfaces);
+ this.portMappingVersion121);
+ FixedFlexInterface fixedFlexInterface = new FixedFlexImpl();
+ OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping,openRoadmInterfaces);
+ OpenRoadmInterface22 openRoadmInterface22 = new OpenRoadmInterface22(portMapping,openRoadmInterfaces,
+ fixedFlexInterface);
+ this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(this.mappingUtils,openRoadmInterface121,
+ openRoadmInterface22);
this.crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
this.crossConnectImpl22 = new CrossConnectImpl22(deviceTransactionManager);
this.crossConnect = new CrossConnectImpl(deviceTransactionManager, this.mappingUtils, this.crossConnectImpl121,
- this.crossConnectImpl22);
+ this.crossConnectImpl22);
}
@Before
public void serviceImplementationTerminationPointAsResourceTtp() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.TTP_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.TTP_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.TTP_TOKEN);
+ writePortMapping(input, StringConstants.TTP_TOKEN);
ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
.setSuccess(true);
Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
public void serviceImplementationTerminationPointAsResourceTtp2() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.TTP_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.TTP_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.TTP_TOKEN);
+ writePortMapping(input, StringConstants.TTP_TOKEN);
ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
.setSuccess(true);
Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
public void serviceImplementationTerminationPointAsResourcePp() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.PP_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.PP_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.PP_TOKEN);
+ writePortMapping(input, StringConstants.PP_TOKEN);
ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
.setSuccess(true);
Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.NETWORK_TOKEN);
+ writePortMapping(input, StringConstants.NETWORK_TOKEN);
ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
.setSuccess(true);
Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.CLIENT_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.CLIENT_TOKEN);
+ // .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.CLIENT_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.CLIENT_TOKEN);
+ // writePortMapping(input, OpenRoadmInterfacesImpl.CLIENT_TOKEN);
+ writePortMapping(input, StringConstants.CLIENT_TOKEN);
ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input).get();
Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
}
throws InterruptedException, ExecutionException {
String[] interfaceTokens = {
- OpenRoadmInterfacesImpl.NETWORK_TOKEN,
- OpenRoadmInterfacesImpl.CLIENT_TOKEN,
- OpenRoadmInterfacesImpl.TTP_TOKEN,
- OpenRoadmInterfacesImpl.PP_TOKEN
+ StringConstants.NETWORK_TOKEN,
+ StringConstants.CLIENT_TOKEN,
+ StringConstants.TTP_TOKEN,
+ StringConstants.PP_TOKEN
};
ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("failed")
ServiceImplementationRequestOutput result =
this.rendererServiceOperations.serviceImplementation(input).get();
Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
- result.getConfigurationResponseCommon().getResponseCode());
+ result.getConfigurationResponseCommon().getResponseCode());
}
}
this.deviceTransactionManager
);
MountPointUtils.writeMapping(
- input.getServiceZEnd().getNodeId(),
- input.getServiceZEnd().getNodeId() + "-"
- + input.getServiceAEnd().getNodeId() + "-" + tpToken,
- this.deviceTransactionManager
+ input.getServiceZEnd().getNodeId(),
+ input.getServiceZEnd().getNodeId() + "-"
+ + input.getServiceAEnd().getNodeId() + "-" + tpToken,
+ this.deviceTransactionManager
);
MountPointUtils.writeMapping(
- input.getServiceAEnd().getNodeId(),
- input.getServiceAEnd().getNodeId() + "-"
- + input.getServiceZEnd().getNodeId() + "-" + tpToken,
- this.deviceTransactionManager
+ input.getServiceAEnd().getNodeId(),
+ input.getServiceAEnd().getNodeId() + "-"
+ + input.getServiceZEnd().getNodeId() + "-" + tpToken,
+ this.deviceTransactionManager
);
MountPointUtils.writeMapping(
input.getServiceZEnd().getNodeId(),
public void serviceImplementationRollbackAllNecessary() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.NETWORK_TOKEN);
+ writePortMapping(input, StringConstants.NETWORK_TOKEN);
Mockito.doReturn(RpcResultBuilder.failed().buildFuture()).when(this.olmService)
.servicePowerSetup(Mockito.any());
ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input).get();
public void serviceImplementationServiceInActive() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.NETWORK_TOKEN);
+ writePortMapping(input, StringConstants.NETWORK_TOKEN);
Measurements measurements = new MeasurementsBuilder().setPmparameterName("FECUncorrectableBlocks")
.setPmparameterValue("1").build();
List<Measurements> measurementsList = new ArrayList<Measurements>();
public void serviceImplementationServiceInActive2() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.NETWORK_TOKEN);
+ writePortMapping(input, StringConstants.NETWORK_TOKEN);
Measurements measurements = new MeasurementsBuilder().setPmparameterName("FECUncorrectableBlocks")
.setPmparameterValue("1").build();
List<Measurements> measurementsList = new ArrayList<Measurements>();
public void serviceImplementationServiceInActive3() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.NETWORK_TOKEN);
+ writePortMapping(input, StringConstants.NETWORK_TOKEN);
Measurements measurements = new MeasurementsBuilder().setPmparameterName("FECUncorrectableBlocks")
.setPmparameterValue("1").build();
List<Measurements> measurementsList = new ArrayList<Measurements>();
measurementsList.add(measurements);
GetPmOutput getPmOutput = new GetPmOutputBuilder()
- .setNodeId("node1").setMeasurements(measurementsList).build();
+ .setNodeId("node1").setMeasurements(measurementsList).build();
GetPmOutput getPmOutput2 = new GetPmOutputBuilder()
- .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
+ .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
GetPmInput getPmInputZ = createGetPmInput("XPONDER-2-3",
- OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ StringConstants.NETWORK_TOKEN);
GetPmInput getPmInputA = createGetPmInput("XPONDER-1-2",
- OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ StringConstants.NETWORK_TOKEN);
Mockito.when(this.olmService.getPm(Mockito.eq(getPmInputZ)))
.thenReturn(RpcResultBuilder.success(getPmOutput2).buildFuture());
public void serviceImplementationServiceActive() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.NETWORK_TOKEN);
+ writePortMapping(input, StringConstants.NETWORK_TOKEN);
GetPmOutput getPmOutput = new GetPmOutputBuilder()
.setNodeId("node1").setMeasurements(new ArrayList<>()).build();
GetPmOutput getPmOutput1 = null;
public void serviceImplementationServiceActive2() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.NETWORK_TOKEN);
+ writePortMapping(input, StringConstants.NETWORK_TOKEN);
GetPmOutput getPmOutput = new GetPmOutputBuilder().setMeasurements(new ArrayList<>()).build();
Mockito.when(this.olmService.getPm(Mockito.any())).thenReturn(RpcResultBuilder.success(getPmOutput)
.buildFuture());
public void serviceImplementationServiceInActive4() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.NETWORK_TOKEN);
+ writePortMapping(input, StringConstants.NETWORK_TOKEN);
Measurements measurements = new MeasurementsBuilder().setPmparameterName("preFECCorrectedErrors")
.setPmparameterValue("1").build();
List<Measurements> measurementsList = new ArrayList<Measurements>();
public void serviceImplementationServiceInActive5() throws InterruptedException, ExecutionException {
ServiceImplementationRequestInput input = ServiceDataUtils
- .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.NETWORK_TOKEN);
+ writePortMapping(input, StringConstants.NETWORK_TOKEN);
Measurements measurements = new MeasurementsBuilder().setPmparameterName("preFECCorrectedErrors")
.setPmparameterValue("112000000000d").build();
List<Measurements> measurementsList = new ArrayList<Measurements>();
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.transportpce.common.NetworkUtils;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.TerminationPoint1;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.TerminationPoint1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.Node1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.TerminationPoint1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev171215.TerminationPoint1Builder;
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;
.builder(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
.child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608
.network.Node.class, new NodeKey(new NodeId(nodeId)))
- .augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929
- .Node1.class)
+ .augmentation(Node1.class)
.build();
}
public static void putNode1ToDatastore(String nodeId, Node1 node1,
DeviceTransactionManager deviceTransactionManager)
throws ExecutionException, InterruptedException {
- InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1>
+ InstanceIdentifier<Node1>
nodeIID = createNode1IID(nodeId);
TransactionUtils
.writeTransaction(deviceTransactionManager, nodeId,
public static Node1 getNode1FromDatastore(String nodeId, DeviceTransactionManager deviceTransactionManager)
throws ExecutionException, InterruptedException {
- InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev170929.Node1>
+ InstanceIdentifier<Node1>
nodeIID = createNode1IID(nodeId);
return (Node1) TransactionUtils
.readTransaction(deviceTransactionManager, nodeId, LogicalDatastoreType.CONFIGURATION, nodeIID);
import org.opendaylight.transportpce.common.ResponseCodes;
import org.opendaylight.transportpce.common.Timeouts;
import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
+
+import org.opendaylight.transportpce.common.OperationResult;
import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
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.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev171016.service.path.PathDescription;
+import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public void setIsnetworkModelWlService(Boolean isnetworkModelWlService) {
this.isnetworkModelWlService = isnetworkModelWlService;
}
+
+ @Override
+ public OperationResult reserveResource(PathDescription pathDescription) {
+ return null;
+ }
+
+ @Override
+ public OperationResult freeResource(PathDescription pathDescription) {
+ return null;
+ }
}