- if (port1Object.isPresent() && port2Object.isPresent()) {
- Ports port1 = port1Object.get();
- Ports port2 = port2Object.get();
- if (port1.getPortQual() == null || port2.getPortQual() == null) {
- continue;
- } else if ((PortQual.RoadmExternal.getIntValue() == port1.getPortQual().getIntValue()
- && PortQual.RoadmExternal.getIntValue() == port2.getPortQual().getIntValue()
- && Direction.Rx.getIntValue() == port1.getPortDirection().getIntValue()
- && Direction.Tx.getIntValue() == port2.getPortDirection().getIntValue()
- && port1.getPartnerPort() != null && port2.getPartnerPort() != null
- && port1.getPartnerPort().getCircuitPackName().equals(cp2Name)
- && port1.getPartnerPort().getPortName().equals(port2.getPortName())
- && port2.getPartnerPort().getCircuitPackName().equals(cp1Name)
- && port2.getPartnerPort().getPortName().equals(port1.getPortName()))
- ||
- (PortQual.RoadmExternal.getIntValue() == port1.getPortQual().getIntValue()
- && PortQual.RoadmExternal.getIntValue() == port2.getPortQual().getIntValue()
- && Direction.Rx.getIntValue() == port2.getPortDirection().getIntValue()
- && Direction.Tx.getIntValue() == port1.getPortDirection().getIntValue()
- && port1.getPartnerPort() != null && port2.getPartnerPort() != null
- && port1.getPartnerPort().getCircuitPackName().equals(cp2Name)
- && port1.getPartnerPort().getPortName().equals(port2.getPortName())
- && port2.getPartnerPort().getCircuitPackName().equals(cp1Name)
- && port2.getPartnerPort().getPortName().equals(port1.getPortName()))) {
- String logicalConnectionPoint1 = new StringBuilder("DEG").append(cpMapEntry.getKey()).append("-TTP-")
- .append(port1.getPortDirection().getName().toUpperCase()).toString();
- LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId,
- connectionPortMap.get(cpMapEntry.getKey()).get(0).getCircuitPackName(), port1.getPortName(),
- logicalConnectionPoint1);
- portMapList.add(createMappingObject(nodeId, port1, connectionPortMap.get(cpMapEntry.getKey()).get(0)
- .getCircuitPackName(), logicalConnectionPoint1));
- String logicalConnectionPoint2 = new StringBuilder("DEG").append(cpMapEntry.getKey()).append("-TTP-")
- .append(port2.getPortDirection().getName().toUpperCase()).toString();
- LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId,
- connectionPortMap.get(cpMapEntry.getKey()).get(1).getCircuitPackName(), port2.getPortName(),
- logicalConnectionPoint2);
- portMapList.add(createMappingObject(nodeId, port2, connectionPortMap.get(cpMapEntry.getKey()).get(1)
- .getCircuitPackName(), logicalConnectionPoint2));
- } else {
- LOG.error(
- "impossible to create logical connection point for port {} or port {} on node {} - "
- + "Error in configuration with port-qual, port-direction or partner-port configuration",
- port1.getPortName(), port2.getPortName(), nodeId);
- }
- } else {