--- /dev/null
+/*
+ * Copyright © 2020 AT&T, 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.fixedflex;
+
+public class FlexGridImpl implements FlexGridInterface {
+ private double start;
+ private double stop;
+ static final double PRECISION = 100000d;
+
+ public FlexGridImpl(double start, double stop) {
+ this.start = start;
+ this.stop = stop;
+ }
+
+ public FlexGridImpl() {
+ this.start = 0;
+ this.stop = 0;
+ }
+
+ @Override
+ public FlexGridImpl getFlexWaveMapping(float centerFrequency, float slotwidth) {
+ FlexGridImpl flexGridImpl = new FlexGridImpl();
+ flexGridImpl.start = centerFrequency - (slotwidth / 2) / 1000.0;
+ flexGridImpl.start = Math.round(flexGridImpl.start * PRECISION) / PRECISION;
+ flexGridImpl.stop = centerFrequency + (slotwidth / 2) / 1000.0;
+ flexGridImpl.stop = Math.round(flexGridImpl.stop * PRECISION) / PRECISION;
+ return flexGridImpl;
+ }
+
+ public double getStart() {
+ return start;
+ }
+
+ public double getStop() {
+ return stop;
+ }
+}
+
--- /dev/null
+/*
+ * Copyright © 2020 AT&T, 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.fixedflex;
+
+public interface FlexGridInterface {
+
+ FlexGridImpl getFlexWaveMapping(float centerFrequency, float slotwidth);
+
+ double getStart();
+
+ double getStop();
+}
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.Nodes;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.McCapabilities;
public interface PortMapping {
*/
Mapping getMapping(String nodeId, String logicalConnPoint);
+ /**
+ * This method for a given node's media channel-capabilities returns the
+ * object based on portmapping.yang model stored in the MD-SAL data store
+ * which is created when the node is connected for the first time. The
+ * mapping object basically contains the following attributes of interest:
+ *
+ * <p>
+ * 1. slot width granularity
+ *
+ * <p>
+ * 2. center frequency granularity
+ *
+ * <p>
+ * 3. Supporting OMS interface (if port on ROADM) 4. Supporting OTS
+ * interface (if port on ROADM)
+ *
+ * @param nodeId
+ * Unique Identifier for the node of interest.
+ * @param mcLcp
+ * Name of the MC-capability
+ *
+ * @return Result McCapabilities.
+ */
+ McCapabilities getMcCapbilities(String nodeId, String mcLcp);
+
boolean updateMapping(String nodeId, Mapping mapping);
/**
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.Mapping;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.MappingBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.MappingKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.McCapabilities;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.McCapabilitiesKey;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.NodeInfo.OpenroadmVersion;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
return portMappingVersion121.createMappingData(nodeId);
} else if (nodeVersion.equals(OPENROADM_DEVICE_VERSION_2_2_1)) {
return portMappingVersion22.createMappingData(nodeId);
- } else {
- LOG.error("Unable to create mapping data for unmanaged openroadm device version");
- return false;
}
+ LOG.error("Unable to create mapping data for unmanaged openroadm device version");
+ return false;
}
Mapping mapping = mapObject.get();
LOG.info("Found mapping for {} - {}. Mapping: {}", nodeId, logicalConnPoint, mapping.toString());
return mapping;
- } else {
- LOG.warn("Could not find mapping for logical connection point {} for nodeId {}", logicalConnPoint,
- nodeId);
}
+ LOG.warn("Could not find mapping for logical connection point {} for nodeId {}", logicalConnPoint, nodeId);
} catch (InterruptedException | ExecutionException ex) {
LOG.error("Unable to read mapping for logical connection point : {} for nodeId {}", logicalConnPoint,
nodeId, ex);
}
+ @Override
+ public McCapabilities getMcCapbilities(String nodeId, String mcLcp) {
+ /*
+ * Getting physical mapping corresponding to logical connection point
+ */
+ InstanceIdentifier<McCapabilities> mcCapabilitiesIID = InstanceIdentifier.builder(Network.class)
+ .child(Nodes.class, new NodesKey(nodeId)).child(McCapabilities.class, new McCapabilitiesKey(mcLcp)).build();
+ try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
+ Optional<McCapabilities> mcCapObject = readTx.read(LogicalDatastoreType.CONFIGURATION,
+ mcCapabilitiesIID).get();
+ if (mcCapObject.isPresent()) {
+ McCapabilities mcCap = mcCapObject.get();
+ LOG.info("Found MC-cap for {} - {}. Mapping: {}", nodeId, mcLcp, mcCap.toString());
+ return mcCap;
+ }
+ LOG.warn("Could not find mapping for logical connection point {} for nodeId {}", mcLcp, nodeId);
+ } catch (InterruptedException | ExecutionException ex) {
+ LOG.error("Unable to read mapping for logical connection point : {} for nodeId {}", mcLcp,
+ nodeId, ex);
+ }
+ return null;
+ }
@Override
OpenroadmVersion openROADMversion = this.getNode(nodeId).getNodeInfo().getOpenroadmVersion();
if (openROADMversion.getIntValue() == 1) {
return portMappingVersion121.updateMapping(nodeId,oldMapping);
- }
- else if (openROADMversion.getIntValue() == 2) {
+ } else if (openROADMversion.getIntValue() == 2) {
org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes
.MappingBuilder oldMapping2Bldr = new MappingBuilder().setLogicalConnectionPoint(oldMapping
.getLogicalConnectionPoint()).setPortDirection(oldMapping.getPortDirection());
}
return portMappingVersion22.updateMapping(nodeId, oldMapping2Bldr.build());
}
-
- else {
- return false;
- }
+ return false;
}
@Override
Nodes node = nodePortMapObject.get();
LOG.info("Found node {} in portmapping.", nodeId);
return node;
- } else {
- LOG.warn("Could not find node {} in portmapping.", nodeId);
}
+ LOG.warn("Could not find node {} in portmapping.", nodeId);
} catch (InterruptedException | ExecutionException ex) {
LOG.error("Unable to get node {} in portmapping", nodeId);
}
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.Mapping;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.MappingBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.MappingKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.McCapabilities;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.McCapabilitiesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.McCapabilitiesKey;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.NodeInfo;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.NodeInfo.OpenroadmVersion;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.NodeInfoBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.switching.pool.lcp.NonBlockingList;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200827.network.nodes.switching.pool.lcp.NonBlockingListBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.Direction;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.FrequencyGHz;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.PortQual;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.XpdrNodeTypes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.CircuitPack;
import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev181019.lldp.container.Lldp;
import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev181019.lldp.container.lldp.PortConfig;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public boolean createMappingData(String nodeId) {
LOG.info("Create Mapping Data for node 2.2.1 {}", nodeId);
List<Mapping> portMapList = new ArrayList<>();
+ List<McCapabilities> mcCapabilitiesList = new ArrayList<>();
InstanceIdentifier<Info> infoIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(Info.class);
Optional<Info> deviceInfoOptional = this.deviceTransactionManager.getDataFromDevice(
nodeId, LogicalDatastoreType.OPERATIONAL, infoIID,
return false;
}
deviceInfo = deviceInfoOptional.get();
- nodeInfo = createNodeInfo(deviceInfo);
+ nodeInfo = createNodeInfo(deviceInfo, nodeId);
if (nodeInfo == null) {
return false;
}
- postPortMapping(nodeId, nodeInfo, null, null, null);
+ postPortMapping(nodeId, nodeInfo, null, null, null, null);
switch (deviceInfo.getNodeType()) {
LOG.warn("Unable to create mapping for PP's on node {}", nodeId);
return false;
}
+ // Get MC capabilities
+ if (!createMcCapabilitiesList(nodeId, deviceInfo, mcCapabilitiesList)) {
+ // return false if MC capabilites failed
+ LOG.warn("Unable to create MC capabilities on node {}", nodeId);
+ return false;
+ }
break;
case Xpdr:
if (!createXpdrPortMapping(nodeId, portMapList)) {
break;
}
- return postPortMapping(nodeId, nodeInfo, portMapList, null, null);
+ return postPortMapping(nodeId, nodeInfo, portMapList, null, null, mcCapabilitiesList);
}
public boolean updateMapping(String nodeId, Mapping oldMapping) {
.build();
switchingPoolList.add(splBldr);
}
- postPortMapping(nodeId, null, null, null, switchingPoolList);
+ postPortMapping(nodeId, null, null, null, switchingPoolList, null);
}
if (!mappingMap.isEmpty()) {
}
}
+
private HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.srg
.CircuitPacks>> getSrgCps(String deviceId, Info ordmInfo) {
HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.srg
= new ArrayList<>();
LOG.info("Getting Circuitpacks for Srg Number {}", srgCounter);
InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
- .child(SharedRiskGroup.class, new SharedRiskGroupKey(srgCounter));
+ .child(SharedRiskGroup.class, new SharedRiskGroupKey(Uint16.valueOf(srgCounter)));
Optional<SharedRiskGroup> ordmSrgObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
LogicalDatastoreType.OPERATIONAL, srgIID,
Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
// Creating mapping data for SRG's PP
HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.srg.CircuitPacks>> srgCps
= getSrgCps(nodeId, deviceInfo);
-
for (Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.srg.CircuitPacks>> srgCpEntry : srgCps.entrySet()) {
List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.srg.CircuitPacks> cpList =
srgCps.get(srgCpEntry.getKey());
String logicalConnectionPoint = createLogicalConnectionPort(port, srgCpEntry.getKey(), portIndex);
LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId, circuitPackName,
port.getPortName(), logicalConnectionPoint);
- portMapList.add(createMappingObject(nodeId, port, circuitPackName, logicalConnectionPoint));
+ portMapList.add(createMappingObject(nodeId, port, circuitPackName,
+ logicalConnectionPoint));
portIndex++;
keys.add(currentKey);
} else if (PortQual.RoadmExternal.getIntValue() == port.getPortQual().getIntValue()
for (int degreeCounter = 1; degreeCounter <= maxDegree; degreeCounter++) {
LOG.info("Getting Connection ports for Degree Number {}", degreeCounter);
InstanceIdentifier<Degree> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
- .child(Degree.class, new DegreeKey(degreeCounter));
+ .child(Degree.class, new DegreeKey(Uint16.valueOf(degreeCounter)));
Optional<Degree> ordmDegreeObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
LogicalDatastoreType.OPERATIONAL, deviceIID,
Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
return degrees;
}
+ private List<SharedRiskGroup> getSrgs(String deviceId, Info ordmInfo) {
+ List<SharedRiskGroup> srgs = new ArrayList<>();
+
+ Integer maxSrg;
+ // Get value for max Srg from info subtree, required for iteration
+ // if not present assume to be 20 (temporary)
+ if (ordmInfo.getMaxSrgs() != null) {
+ maxSrg = ordmInfo.getMaxSrgs().toJava();
+ } else {
+ maxSrg = 20;
+ }
+ for (int srgCounter = 1; srgCounter <= maxSrg; srgCounter++) {
+ InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(SharedRiskGroup.class, new SharedRiskGroupKey(Uint16.valueOf(srgCounter)));
+ Optional<SharedRiskGroup> ordmSrgObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
+ LogicalDatastoreType.OPERATIONAL, srgIID,
+ Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ if (ordmSrgObject.isPresent()) {
+ srgs.add(ordmSrgObject.get());
+
+ }
+ }
+ return srgs;
+ }
+
private Map<Integer, List<ConnectionPorts>> getPerDegreePorts(String deviceId, Info ordmInfo) {
Map<Integer, List<ConnectionPorts>> conPortMap = new HashMap<>();
Integer maxDegree;
for (int degreeCounter = 1; degreeCounter <= maxDegree; degreeCounter++) {
LOG.info("Getting Connection ports for Degree Number {}", degreeCounter);
InstanceIdentifier<Degree> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
- .child(Degree.class, new DegreeKey(degreeCounter));
+ .child(Degree.class, new DegreeKey(Uint16.valueOf(degreeCounter)));
Optional<Degree> ordmDegreeObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
LogicalDatastoreType.OPERATIONAL, deviceIID,
Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
return cpToDegreeList;
}
+ private List<McCapabilities> getMcCapabilitiesList(List<Degree> degrees, List<SharedRiskGroup> srgs,
+ String nodeId) {
+ LOG.info("Getting the MC capabilities for degrees of node {}", nodeId);
+ List<McCapabilities> mcCapabilitiesList = degrees.stream().map(degree ->
+ createMcCapDegreeObject(degree, nodeId)).collect(Collectors.toList());
+ // Add the SRG mc-capabilities
+ LOG.info("Getting the MC capabilities for SRGs of node {}", nodeId);
+ mcCapabilitiesList.addAll(srgs.stream().map(srg -> createMcCapSrgObject(srg, nodeId))
+ .collect(Collectors.toList()));
+ return mcCapabilitiesList;
+ }
+
private boolean postPortMapping(String nodeId, NodeInfo nodeInfo, List<Mapping> portMapList,
- List<CpToDegree> cp2DegreeList, List<SwitchingPoolLcp> splList) {
+ List<CpToDegree> cp2DegreeList, List<SwitchingPoolLcp> splList, List<McCapabilities> mcCapList) {
NodesBuilder nodesBldr = new NodesBuilder().withKey(new NodesKey(nodeId)).setNodeId(nodeId);
if (nodeInfo != null) {
nodesBldr.setNodeInfo(nodeInfo);
if (splList != null) {
nodesBldr.setSwitchingPoolLcp(splList);
}
+ if (mcCapList != null) {
+ nodesBldr.setMcCapabilities(mcCapList);
+ }
List<Nodes> nodesList = new ArrayList<>();
nodesList.add(nodesBldr.build());
interfaceName = interfaceList.get(circuitPackName);
}
return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
- .setDegreeNumber(Long.valueOf(degreeNumber)).setInterfaceName(interfaceName).build();
+ .setDegreeNumber(Uint32.valueOf(degreeNumber)).setInterfaceName(interfaceName).build();
+ }
+
+ private McCapabilities createMcCapDegreeObject(Degree degree, String nodeId) {
+ String mcNodeName = "DEG" + degree.getDegreeNumber().toString() + "-TTP";
+ McCapabilitiesBuilder mcCapabilitiesBuilder = new McCapabilitiesBuilder()
+ .withKey(new McCapabilitiesKey(mcNodeName))
+ .setMcNodeName(mcNodeName);
+ if (degree.getMcCapabilities() != null) {
+ mcCapabilitiesBuilder
+ .setCenterFreqGranularity(degree.getMcCapabilities().getCenterFreqGranularity())
+ .setSlotWidthGranularity(degree.getMcCapabilities().getSlotWidthGranularity());
+ }
+ else {
+ LOG.warn("Media channel capabilities are not advertised for degree {} of {}", degree.getDegreeNumber(),
+ nodeId);
+ LOG.info("Assuming the fixed grid capabilities for degree {} of {}", degree.getDegreeNumber(),
+ nodeId);
+ mcCapabilitiesBuilder
+ .setCenterFreqGranularity(FrequencyGHz.getDefaultInstance("50"))
+ .setSlotWidthGranularity(FrequencyGHz.getDefaultInstance("50"));
+ }
+ return mcCapabilitiesBuilder.build();
+ }
+
+ private McCapabilities createMcCapSrgObject(SharedRiskGroup srg, String nodeId) {
+ String mcNodeName = "SRG" + srg.getSrgNumber().toString() + "-PP";
+ McCapabilitiesBuilder mcCapabilitiesBuilder = new McCapabilitiesBuilder()
+ .withKey(new McCapabilitiesKey(mcNodeName))
+ .setMcNodeName(mcNodeName);
+ if (srg.getMcCapabilities() != null) {
+ mcCapabilitiesBuilder
+ .setCenterFreqGranularity(srg.getMcCapabilities().getCenterFreqGranularity())
+ .setSlotWidthGranularity(srg.getMcCapabilities().getSlotWidthGranularity());
+ }
+ else {
+ LOG.warn("Media channel capabilities are not advertised for SRG {} of {}", srg.getSrgNumber(),
+ nodeId);
+ LOG.info("Assuming the fixed grid capabilities for SRG {} of {}", srg.getSrgNumber(),
+ nodeId);
+ mcCapabilitiesBuilder
+ .setCenterFreqGranularity(FrequencyGHz.getDefaultInstance("50"))
+ .setSlotWidthGranularity(FrequencyGHz.getDefaultInstance("50"));
+ }
+ return mcCapabilitiesBuilder.build();
}
private Mapping createMappingObject(String nodeId, Ports port, String circuitPackName,
return mpBldr.build();
}
+
+ private boolean createMcCapabilitiesList(String nodeId, Info deviceInfo, List<McCapabilities> mcCapabilitiesList) {
+ List<Degree> degrees = getDegrees(nodeId, deviceInfo);
+ List<SharedRiskGroup> srgs = getSrgs(nodeId, deviceInfo);
+ mcCapabilitiesList.addAll(getMcCapabilitiesList(degrees, srgs, nodeId));
+
+ return true;
+ }
+
//some LOG messages are too long
@SuppressWarnings("checkstyle:linelength")
@SuppressFBWarnings("DM_CONVERT_CASE")
Map<String, String> interfaceList = getEthInterfaceList(nodeId);
List<CpToDegree> cpToDegreeList = getCpToDegreeList(degrees, nodeId, interfaceList);
LOG.info("Map looks like this {}", interfaceList);
- postPortMapping(nodeId, null, null, cpToDegreeList, null);
+ postPortMapping(nodeId, null, null, cpToDegreeList, null, null);
Map<Integer, List<ConnectionPorts>> connectionPortMap = getPerDegreePorts(nodeId, deviceInfo);
for (Entry<Integer, List<ConnectionPorts>> cpMapEntry : connectionPortMap.entrySet()) {
connectionPortMap.get(cpMapEntry.getKey()).get(0).getCircuitPackName(), port.getPortName(),
logicalConnectionPoint);
portMapList.add(createMappingObject(nodeId, port,
- connectionPortMap.get(cpMapEntry.getKey()).get(0).getCircuitPackName(), logicalConnectionPoint));
+ connectionPortMap.get(cpMapEntry.getKey()).get(0).getCircuitPackName(),
+ logicalConnectionPoint));
} else {
LOG.error(
"Impossible to create logical connection point for port {} of {} on node {}"
return true;
}
- private NodeInfo createNodeInfo(Info deviceInfo) {
+ private NodeInfo createNodeInfo(Info deviceInfo, String nodeId) {
NodeInfoBuilder nodeInfoBldr = new NodeInfoBuilder();
- if (deviceInfo.getNodeType() != null) {
- nodeInfoBldr.setOpenroadmVersion(OpenroadmVersion._221).setNodeType(deviceInfo.getNodeType());
- if (deviceInfo.getClli() != null && !deviceInfo.getClli().isEmpty()) {
- nodeInfoBldr.setNodeClli(deviceInfo.getClli());
- } else {
- nodeInfoBldr.setNodeClli("defaultCLLI");
- }
- if (deviceInfo.getModel() != null) {
- nodeInfoBldr.setNodeModel(deviceInfo.getModel());
- }
- if (deviceInfo.getVendor() != null) {
- nodeInfoBldr.setNodeVendor(deviceInfo.getVendor());
- }
- if (deviceInfo.getIpAddress() != null) {
- nodeInfoBldr.setNodeIpAddress(deviceInfo.getIpAddress());
- }
- } else {
- // TODO make mandatory in yang
+ if (deviceInfo.getNodeType() == null) {
+ // TODO make mandatory in yang
LOG.error("Node type field is missing");
return null;
}
+
+ nodeInfoBldr.setOpenroadmVersion(OpenroadmVersion._221).setNodeType(deviceInfo.getNodeType());
+ if (deviceInfo.getClli() != null && !deviceInfo.getClli().isEmpty()) {
+ nodeInfoBldr.setNodeClli(deviceInfo.getClli());
+ } else {
+ nodeInfoBldr.setNodeClli("defaultCLLI");
+ }
+
+ if (deviceInfo.getModel() != null) {
+ nodeInfoBldr.setNodeModel(deviceInfo.getModel());
+ }
+
+ if (deviceInfo.getVendor() != null) {
+ nodeInfoBldr.setNodeVendor(deviceInfo.getVendor());
+ }
+
+ if (deviceInfo.getIpAddress() != null) {
+ nodeInfoBldr.setNodeIpAddress(deviceInfo.getIpAddress());
+ }
+
return nodeInfoBldr.build();
}
<bean id="FixedFlexImpl" class="org.opendaylight.transportpce.common.fixedflex.FixedFlexImpl" >
</bean>
+ <bean id="FlexGridImpl" class="org.opendaylight.transportpce.common.fixedflex.FlexGridImpl" >
+ </bean>
+
<service ref="deviceTransactionManager" interface="org.opendaylight.transportpce.common.device.DeviceTransactionManager" />
<service ref="networkTransactionImpl" interface="org.opendaylight.transportpce.common.network.NetworkTransactionService" />
<service ref="FixedFlexImpl" interface="org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface"/>
+ <service ref="FlexGridImpl" interface="org.opendaylight.transportpce.common.fixedflex.FlexGridInterface"/>
+
</blueprint>
import org.opendaylight.transportpce.common.Timeouts;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface;
+import org.opendaylight.transportpce.common.fixedflex.FlexGridInterface;
import org.opendaylight.transportpce.common.mapping.PortMapping;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
private final PortMapping portMapping;
private final OpenRoadmInterfaces openRoadmInterfaces;
private FixedFlexInterface fixedFlex;
+ private FlexGridInterface flexGrid;
private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterface221.class);
public OpenRoadmInterface221(PortMapping portMapping, OpenRoadmInterfaces openRoadmInterfaces,
- FixedFlexInterface fixedFlex) {
+ FixedFlexInterface fixedFlex, FlexGridInterface flexGrid) {
this.portMapping = portMapping;
this.openRoadmInterfaces = openRoadmInterfaces;
this.fixedFlex = fixedFlex;
+ this.flexGrid = flexGrid;
}
public String createOpenRoadmEthInterface(String nodeId, String logicalConnPoint)
return ethInterfaceBldr.getName();
}
+ public List<String> createFlexOCH(String nodeId, String logicalConnPoint, Long bitmapIndex,
+ BigDecimal centerFreq, BigDecimal slotWidth)
+ 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));
+ }
+
+ List<String> interfacesCreated = new ArrayList<>();
+
+ if (logicalConnPoint.contains("DEG")) {
+ String mcInterfaceCreated = createMCInterface(nodeId, logicalConnPoint, centerFreq, slotWidth, bitmapIndex);
+ interfacesCreated.add(mcInterfaceCreated);
+ }
+ String mcInterfaceCreated = createNMCInterface(nodeId, logicalConnPoint, centerFreq, slotWidth, bitmapIndex);
+ interfacesCreated.add(mcInterfaceCreated);
+ return interfacesCreated;
+ }
+
/**
* This methods creates an OCH interface on the given termination point on
* Roadm.
public List<String> createFlexOCH(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 % and logical connection port %s",
+ nodeId, logicalConnPoint));
+ }
List<String> interfacesCreated = new ArrayList<>();
String mcInterfaceCreated = createMCInterface(nodeId, logicalConnPoint, waveNumber);
interfacesCreated.add(mcInterfaceCreated);
}
-
String nmcInterfaceCreated = createNMCInterface(nodeId, logicalConnPoint, waveNumber);
interfacesCreated.add(nmcInterfaceCreated);
-
return interfacesCreated;
}
+
public String createMCInterface(String nodeId, String logicalConnPoint, Long waveNumber)
throws OpenRoadmInterfaceException {
return mcInterfaceBldr.getName();
}
- public String createNMCInterface(String nodeId, String logicalConnPoint, Long waveNumber)
+ public String createMCInterface(String nodeId, String logicalConnPoint,
+ BigDecimal centerFrequency, BigDecimal slotWidth, Long bitmapIndex)
throws OpenRoadmInterfaceException {
// TODO : Check this method
- fixedFlex = fixedFlex.getFixedFlexWaveMapping(waveNumber.shortValue());
+ flexGrid = flexGrid.getFlexWaveMapping(centerFrequency.floatValue(), slotWidth.floatValue());
Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
nodeId, logicalConnPoint));
}
- LOG.info(" Freq Start {} and Freq End {} and center-Freq {}",
- String.valueOf(fixedFlex.getStart()), String.valueOf(fixedFlex.getStop()),
- String.valueOf(fixedFlex.getCenterFrequency()));
+ // TODO : Check this method
+ LOG.info("MC interface Freq Start {} and Freq End {} and center-Freq {}",
+ flexGrid.getStart(), flexGrid.getStop(), centerFrequency);
+ InterfaceBuilder mcInterfaceBldr = createGenericInterfaceBuilder(portMap,
+ MediaChannelTrailTerminationPoint.class, logicalConnPoint + "-mc" + "-" + bitmapIndex)
+ .setSupportingInterface(portMap.getSupportingOms());
+
+ McTtpBuilder mcTtpBuilder = new McTtpBuilder()
+ .setMinFreq(FrequencyTHz.getDefaultInstance(String.valueOf(flexGrid.getStart())))
+ .setMaxFreq(FrequencyTHz.getDefaultInstance(String.valueOf(flexGrid.getStop())));
+
+ // Create Interface1 type object required for adding as augmentation
+ org.opendaylight.yang.gen.v1.http.org.openroadm.media.channel.interfaces.rev181019.Interface1Builder
+ interface1Builder =
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.media.channel.interfaces.rev181019.Interface1Builder()
+ .setMcTtp(mcTtpBuilder.build());
+
+ mcInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.media.channel.interfaces.rev181019.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));
+ }
+ LOG.info("Freq Start {} and Freq End {} and center-Freq {}",
+ fixedFlex.getStart(), fixedFlex.getStop(), fixedFlex.getCenterFrequency());
//TODO : Check this method
InterfaceBuilder nmcInterfaceBldr = createGenericInterfaceBuilder(portMap,
NetworkMediaChannelConnectionTerminationPoint.class, logicalConnPoint + "-nmc" + "-" + waveNumber);
}
NmcCtpBuilder nmcCtpIfBuilder = new NmcCtpBuilder()
- .setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(fixedFlex.getCenterFrequency())))
- .setWidth(FrequencyGHz.getDefaultInstance("40"));
+ .setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(fixedFlex.getCenterFrequency())))
+ .setWidth(FrequencyGHz.getDefaultInstance("40"));
// Create Interface1 type object required for adding as augmentation
org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019.Interface1Builder
nmcCtpI1fBuilder =
- new org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019
- .Interface1Builder().setNmcCtp(nmcCtpIfBuilder.build());
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019
+ .Interface1Builder().setNmcCtp(nmcCtpIfBuilder.build());
nmcInterfaceBldr.addAugmentation(
org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019.Interface1.class,
nmcCtpI1fBuilder.build());
return nmcInterfaceBldr.getName();
}
+ public String createNMCInterface(String nodeId, String logicalConnPoint,
+ BigDecimal centerFrequency, BigDecimal slotWidth, Long bitmapIndex)
+ throws OpenRoadmInterfaceException {
+ LOG.info("This is the central frequency {}", centerFrequency.floatValue());
+ LOG.info("This is the slot-width {}", slotWidth.floatValue());
+ // TODO : Check this method
+ flexGrid = flexGrid.getFlexWaveMapping(centerFrequency.floatValue(), slotWidth.floatValue());
+ 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));
+ }
+
+ LOG.info("Freq Start {} and Freq End {} and center-Freq {}", flexGrid.getStart(),
+ flexGrid.getStop(),centerFrequency);
+ //TODO : Check this method
+ InterfaceBuilder nmcInterfaceBldr = createGenericInterfaceBuilder(portMap,
+ NetworkMediaChannelConnectionTerminationPoint.class, logicalConnPoint + "-nmc" + "-" + bitmapIndex);
+ if (logicalConnPoint.contains("DEG")) {
+ nmcInterfaceBldr.setSupportingInterface(logicalConnPoint + "-mc" + "-" + bitmapIndex);
+ }
+ NmcCtpBuilder nmcCtpIfBuilder;
+
+ // From the logicalConnPoint, get the substring and for that associated substring find the mc-cap
+ String mcLcp = "";
+ if (logicalConnPoint.contains("-PP")) {
+ mcLcp = logicalConnPoint.substring(0, logicalConnPoint.indexOf("-")) + "-PP";
+ }
+ else if (logicalConnPoint.contains("-TTP")) {
+ mcLcp = logicalConnPoint.substring(0, logicalConnPoint.indexOf("-")) + "-TTP";
+ }
+ try {
+ double slotWidthGran = portMapping.getMcCapbilities(nodeId, mcLcp)
+ .getSlotWidthGranularity().getValue().doubleValue();
+
+ // Dead-band is constant (Ref: WP)
+ double deadBand = 8; // In GHz
+ double guardBand = Math.ceil(deadBand / slotWidthGran) * slotWidthGran;
+
+ nmcCtpIfBuilder = new NmcCtpBuilder()
+ .setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(centerFrequency)))
+ .setWidth(FrequencyGHz.getDefaultInstance(String.valueOf(slotWidth.doubleValue() - guardBand)));
+
+ // Create Interface1 type object required for adding as augmentation
+ org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019.Interface1Builder
+ nmcCtpI1fBuilder =
+ new org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019
+ .Interface1Builder().setNmcCtp(nmcCtpIfBuilder.build());
+ nmcInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019
+ .Interface1.class, nmcCtpI1fBuilder.build());
+
+ // Post interface on the device
+ openRoadmInterfaces.postInterface(nodeId, nmcInterfaceBldr);
+
+ }
+ catch (NullPointerException e) {
+ LOG.error("Port mapping could not find {}", mcLcp);
+ LOG.error("Check the port mapping to verify {}", mcLcp);
+ }
+ return nmcInterfaceBldr.getName();
+ }
+
public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber)
throws OpenRoadmInterfaceException {
// TODO : Check this method
return ochInterfaceBldr.getName();
}
+ public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint,
+ Long waveNumber, BigDecimal centerFrequency, BigDecimal slotWidth)
+ throws OpenRoadmInterfaceException {
+ // TODO : Check this method
+
+ // OCH interface specific data
+ OchBuilder ocIfBuilder = new OchBuilder()
+ .setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(centerFrequency)))
+ .setRate(R100G.class)
+ .setTransmitPower(new PowerDBm(new BigDecimal("-5")))
+ .setModulationFormat(ModulationFormat.DpQpsk);
+
+ // In Flex-grid, slot-width could be other than 50 GHz
+ if ((centerFrequency != null) && (slotWidth != null)) {
+ ocIfBuilder.setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(centerFrequency)));
+ ocIfBuilder.setWidth(FrequencyGHz.getDefaultInstance(String.valueOf(slotWidth)));
+ }
+ else {
+ // Use fixed grid to find the
+ fixedFlex = fixedFlex.getFixedFlexWaveMapping(waveNumber.shortValue());
+ ocIfBuilder.setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(fixedFlex.getCenterFrequency())));
+ }
+ 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));
+ // 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.rev181019.Interface1Builder
+ ochIf1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev181019
+ .Interface1Builder();
+ ochInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev181019.Interface1.class,
+ ochIf1Builder.setOch(ocIfBuilder.build()).build());
+
+ // Post interface on the device
+ 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 createOpenRoadmOdu4Interface(String nodeId, String logicalConnPoint, String supportingOtuInterface)
throws OpenRoadmInterfaceException {
Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
package org.opendaylight.transportpce.renderer.openroadminterface;
+import java.math.BigDecimal;
import java.util.List;
import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
}
}
+ public List<String> createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber,
+ BigDecimal centerFreq, BigDecimal slotWidth)
+ throws OpenRoadmInterfaceException {
+ 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_1:
+ return openRoadmInterface221.createFlexOCH(nodeId, logicalConnPoint, waveNumber,
+ centerFreq, slotWidth);
+ default:
+ return null;
+ }
+ }
/**
* This methods creates an OCH interface on the given termination point on
* @return Name of the interface if successful, otherwise return null.
* @throws OpenRoadmInterfaceException OpenRoadm interface exception
*/
-
public List<String> createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber)
throws OpenRoadmInterfaceException {
-
switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
return openRoadmInterface121.createOpenRoadmOchInterface(nodeId, logicalConnPoint, waveNumber);
}
}
+ public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber,
+ OchAttributes.ModulationFormat format, BigDecimal centerFreq, BigDecimal slotWidth)
+ throws OpenRoadmInterfaceException {
+ switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+ case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+ return openRoadmInterface121.createOpenRoadmOchInterface(nodeId, logicalConnPoint, waveNumber, format);
+ case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+ return openRoadmInterface221.createOpenRoadmOchInterface(nodeId, logicalConnPoint, waveNumber,
+ centerFreq, slotWidth);
+ default:
+ return null;
+ }
+ }
public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber,
- OchAttributes.ModulationFormat format)
+ OchAttributes.ModulationFormat format)
throws OpenRoadmInterfaceException {
switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
*/
public String createOpenRoadmOdu4Interface(String anodeId, String alogicalConnPoint, String asupportingOtuInterface,
- String znodeId, String zlogicalConnPoint)
- throws OpenRoadmInterfaceException {
+ String znodeId, String zlogicalConnPoint)
+ throws OpenRoadmInterfaceException {
switch (mappingUtils.getOpenRoadmVersion(anodeId)) {
case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
return openRoadmInterface121.createOpenRoadmOdu4Interface(anodeId, alogicalConnPoint,
}
public boolean isUsedByOtnXc(String nodeId, String interfaceName, String xc,
- DeviceTransactionManager deviceTransactionManager) {
+ DeviceTransactionManager deviceTransactionManager) {
switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
LOG.error(OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_1_2_1_MSG);
}
public String createOpenRoadmOtnOdu4Interface(String anodeId, String alogicalConnPoint,
- String asupportingOtuInterface, String znodeId, String zlogicalConnPoint)
- throws OpenRoadmInterfaceException {
+ String asupportingOtuInterface, String znodeId, String zlogicalConnPoint)
+ throws OpenRoadmInterfaceException {
switch (mappingUtils.getOpenRoadmVersion(anodeId)) {
case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
return openRoadmInterface221
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.FluentFuture;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
ServiceListTopology topology = new ServiceListTopology();
AtomicBoolean success = new AtomicBoolean(true);
ForkJoinPool forkJoinPool = new ForkJoinPool();
-
ForkJoinTask forkJoinTask = forkJoinPool.submit(() -> nodes.parallelStream().forEach(node -> {
String nodeId = node.getNodeId();
// take the index of the node
try {
// if the node is currently mounted then proceed
if (this.deviceTransactionManager.isDeviceMounted(nodeId)) {
+ // TODO: In the case of flex-grid, the wave-number becomes bitmap index
+ // TODO: need to update transportpce-common-types accordingly, to a more, generic-term
+ Long waveNumber = input.getWaveNumber().toJava();
+ BigDecimal centerFreq = null;
+ BigDecimal slotWidth = null;
+ if (input.getCenterFreq() != null) {
+ centerFreq = input.getCenterFreq().getValue();
+ }
+ if (input.getSlotWidth() != null) {
+ slotWidth = input.getSlotWidth().getValue();
+ }
String srcTp = node.getSrcTp();
String destTp = node.getDestTp();
- Long waveNumber = input.getWaveNumber().toJava();
if ((destTp != null) && destTp.contains(StringConstants.NETWORK_TOKEN)) {
crossConnectFlag++;
- String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
+ String supportingOchInterface;
+ if ((centerFreq != null) && (slotWidth != null)) {
+ supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
+ nodeId, destTp, waveNumber, ModulationFormat.DpQpsk, centerFreq, slotWidth);
+ }
+ else {
+ supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
nodeId, destTp, waveNumber, ModulationFormat.DpQpsk);
+ }
createdOchInterfaces.add(supportingOchInterface);
// Here we pass logical connection-point of z-end to set SAPI and DAPI
Nodes tgtNode = null;
if ((srcTp != null) && srcTp.contains(StringConstants.NETWORK_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Line Interfaces
- String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
+ String supportingOchInterface;
+ if ((centerFreq != null) && (slotWidth != null)) {
+ supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
+ nodeId, srcTp, waveNumber, ModulationFormat.DpQpsk, centerFreq, slotWidth);
+ }
+ else {
+ supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
nodeId, srcTp, waveNumber, ModulationFormat.DpQpsk);
+ }
createdOchInterfaces.add(supportingOchInterface);
String supportingOtuInterface = this.openRoadmInterfaceFactory
.createOpenRoadmOtu4Interface(nodeId, srcTp, supportingOchInterface);
}
if ((srcTp != null) && (srcTp.contains(StringConstants.TTP_TOKEN)
|| srcTp.contains(StringConstants.PP_TOKEN))) {
- createdOchInterfaces.addAll(
- this.openRoadmInterfaceFactory
- .createOpenRoadmOchInterface(nodeId, srcTp, waveNumber));
+ if ((centerFreq != null) && (slotWidth != null)) {
+ createdOchInterfaces.addAll(
+ this.openRoadmInterfaceFactory
+ .createOpenRoadmOchInterface(nodeId, srcTp, waveNumber, centerFreq, slotWidth));
+ }
+ else {
+ createdOchInterfaces.addAll(
+ this.openRoadmInterfaceFactory
+ .createOpenRoadmOchInterface(nodeId, srcTp, waveNumber));
+ }
}
if ((destTp != null) && (destTp.contains(StringConstants.TTP_TOKEN)
|| destTp.contains(StringConstants.PP_TOKEN))) {
- createdOchInterfaces.addAll(
- this.openRoadmInterfaceFactory
- .createOpenRoadmOchInterface(nodeId, destTp, waveNumber));
+
+ if ((centerFreq != null) && (slotWidth != null)) {
+ createdOchInterfaces.addAll(
+ this.openRoadmInterfaceFactory
+ .createOpenRoadmOchInterface(nodeId, destTp, waveNumber, centerFreq, slotWidth));
+ }
+ else {
+ createdOchInterfaces.addAll(
+ this.openRoadmInterfaceFactory
+ .createOpenRoadmOchInterface(nodeId, destTp, waveNumber));
+ }
+
}
if (crossConnectFlag < 1) {
LOG.info("Creating cross connect between source {} and destination {} for node {}", srcTp,
<reference id="mappingUtils" interface="org.opendaylight.transportpce.common.mapping.MappingUtils"/>
<reference id="FixedFlexImpl" interface="org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface"/>
<reference id="networkModelService" interface="org.opendaylight.transportpce.networkmodel.service.NetworkModelService"/>
+ <reference id="FlexGridImpl" interface="org.opendaylight.transportpce.common.fixedflex.FlexGridInterface"/>
<odl:rpc-service id="olmService"
interface="org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService"/>
<argument ref="portMapping"/>
<argument ref="openRoadmInterfaces"/>
<argument ref="FixedFlexImpl"/>
+ <argument ref="FlexGridImpl"/>
</bean>
<bean id="openRoadmOtnInterface"
import org.mockito.Mockito;
import org.opendaylight.transportpce.common.fixedflex.FixedFlexImpl;
import org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface;
+import org.opendaylight.transportpce.common.fixedflex.FlexGridImpl;
import org.opendaylight.transportpce.common.mapping.PortMapping;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
private final PortMapping portMapping = Mockito.mock(PortMapping.class);
private final FixedFlexInterface fixedFlex = Mockito.spy(FixedFlexInterface.class);
+ private final FlexGridImpl flexGrid = Mockito.spy(FlexGridImpl.class);
private OpenRoadmInterface221 openRoadMInterface221;
private final String nodeId = "node1";
public void setup() {
OpenRoadmInterfaces openRoadmInterfaces = Mockito.spy(OpenRoadmInterfaces.class);
- this.openRoadMInterface221 = new OpenRoadmInterface221(portMapping, openRoadmInterfaces, fixedFlex);
+ this.openRoadMInterface221 = new OpenRoadmInterface221(portMapping, openRoadmInterfaces, fixedFlex, flexGrid);
}
@Test
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.fixedflex.FlexGridImpl;
import org.opendaylight.transportpce.common.mapping.MappingUtils;
import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
import org.opendaylight.transportpce.common.mapping.PortMapping;
PortMapping portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22,
this.portMappingVersion121);
FixedFlexInterface fixedFlexInterface = new FixedFlexImpl();
+ FlexGridImpl flexGrid = new FlexGridImpl();
OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping,openRoadmInterfaces);
OpenRoadmInterface221 openRoadmInterface221 = new OpenRoadmInterface221(portMapping,openRoadmInterfaces,
- fixedFlexInterface);
+ fixedFlexInterface, flexGrid);
OpenRoadmOtnInterface221 openRoadmOTNInterface = new OpenRoadmOtnInterface221(portMapping, openRoadmInterfaces);
this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(this.mappingUtils,openRoadmInterface121,
openRoadmInterface221, openRoadmOTNInterface);
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.fixedflex.FlexGridImpl;
import org.opendaylight.transportpce.common.mapping.MappingUtils;
import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
import org.opendaylight.transportpce.common.mapping.PortMapping;
this.crossConnectImpl221);
this.crossConnect = Mockito.spy(crossConnect);
FixedFlexInterface fixedFlexInterface = new FixedFlexImpl();
+ FlexGridImpl flexGrid = new FlexGridImpl();
OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping,openRoadmInterfaces);
OpenRoadmInterface221 openRoadmInterface221 = new OpenRoadmInterface221(portMapping,openRoadmInterfaces,
- fixedFlexInterface);
+ fixedFlexInterface, flexGrid);
OpenRoadmOtnInterface221 openRoadmOTNInterface = new OpenRoadmOtnInterface221(portMapping, openRoadmInterfaces);
OpenRoadmInterfaceFactory openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(this.mappingUtils,
openRoadmInterface121, openRoadmInterface221, openRoadmOTNInterface);
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.fixedflex.FlexGridImpl;
import org.opendaylight.transportpce.common.mapping.MappingUtils;
import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
import org.opendaylight.transportpce.common.mapping.PortMapping;
this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22,
this.portMappingVersion121);
FixedFlexInterface fixedFlexInterface = new FixedFlexImpl();
+ FlexGridImpl flexGrid = new FlexGridImpl();
OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping,openRoadmInterfaces);
OpenRoadmInterface221 openRoadmInterface221 = new OpenRoadmInterface221(portMapping,openRoadmInterfaces,
- fixedFlexInterface);
+ fixedFlexInterface, flexGrid);
OpenRoadmOtnInterface221 openRoadmOTNInterface = new OpenRoadmOtnInterface221(portMapping, openRoadmInterfaces);
this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(this.mappingUtils,openRoadmInterface121,
openRoadmInterface221, openRoadmOTNInterface);