Merge "Bump transportpce-models upstream dependency"
[transportpce.git] / pce / src / main / java / org / opendaylight / transportpce / pce / networkanalyzer / PceOpticalNode.java
index 2c94225b9598d0f2ffa6da7984a8a877242999b7..611263d68a3f43e490abc0af1ab034a9146faa65 100644 (file)
@@ -17,22 +17,28 @@ import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.TreeMap;
+import org.opendaylight.transportpce.common.StringConstants;
 import org.opendaylight.transportpce.common.fixedflex.GridConstant;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.pce.SortPortsByName;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.Mapping;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.TerminationPoint1;
+import org.opendaylight.transportpce.pce.networkanalyzer.port.Preference;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205.path.computation.reroute.request.input.Endpoints;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.mapping.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.TerminationPoint1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev211210.Node1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.OpenroadmNodeType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.OpenroadmTpType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.available.freq.map.AvailFreqMapsKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.IfOCH;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.IfOCHOTU4ODU4;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.IfOtsiOtsigroup;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.SupportedIfCapability;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.Node1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.XpdrNetworkAttributes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.OpenroadmNodeType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.OpenroadmTpType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.available.freq.map.AvailFreqMapsKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCH;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCHOTU4ODU4;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOtsiOtsigroup;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.SupportedIfCapability;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev191129.ServiceFormat;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev230526.xpdr.mode.attributes.supported.operational.modes.OperationalMode;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev230526.xpdr.mode.attributes.supported.operational.modes.OperationalModeKey;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.Node;
 import org.opendaylight.yangtools.yang.common.Uint16;
@@ -63,10 +69,11 @@ public class PceOpticalNode implements PceNode {
     private String version;
     private BigDecimal slotWidthGranularity;
     private BigDecimal centralFreqGranularity;
+    private Endpoints endpoints;
 
     public PceOpticalNode(String deviceNodeId, String serviceType, PortMapping portMapping, Node node,
         OpenroadmNodeType nodeType, String version, BigDecimal slotWidthGranularity,
-        BigDecimal centralFreqGranularity) {
+                          BigDecimal centralFreqGranularity) {
 
         if (deviceNodeId != null
                 && serviceType != null
@@ -86,22 +93,23 @@ public class PceOpticalNode implements PceNode {
             this.slotWidthGranularity = slotWidthGranularity;
             this.centralFreqGranularity = centralFreqGranularity;
             this.adminStates = node.augmentation(org.opendaylight.yang.gen.v1.http
-                    .org.openroadm.common.network.rev211210.Node1.class).getAdministrativeState();
+                    .org.openroadm.common.network.rev230526.Node1.class).getAdministrativeState();
             this.state = node.augmentation(org.opendaylight.yang.gen.v1.http
-                .org.openroadm.common.network.rev211210.Node1.class).getOperationalState();
+                .org.openroadm.common.network.rev230526.Node1.class).getOperationalState();
         } else {
-            LOG.error("PceNode: one of parameters is not populated : nodeId, node type, slot width granularity");
+            LOG.error("PceNode {} : one of parameters is not populated : nodeId, node type, slot width granularity",
+                deviceNodeId);
             this.valid = false;
         }
     }
 
-    public void initSrgTps() {
+    public void initSrgTps(Preference portPreference) {
         this.availableSrgPp.clear();
         this.availableSrgCp.clear();
         if (!isValid()) {
             return;
         }
-        LOG.info("initSrgTpList: getting SRG tps from ROADM node {}", this.nodeId);
+        LOG.debug("initSrgTpList: getting SRG tps from ROADM node {}", this.nodeId);
         org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1 nodeTp =
                 this.node.augmentation(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
                     .ietf.network.topology.rev180226.Node1.class);
@@ -115,30 +123,34 @@ public class PceOpticalNode implements PceNode {
         for (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network
             .node.TerminationPoint tp : allTps) {
             TerminationPoint1 cntp1 = tp.augmentation(TerminationPoint1.class);
-            org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev211210.TerminationPoint1 nttp1 = tp
-                .augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev211210
+            org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.TerminationPoint1 nttp1 = tp
+                .augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526
                         .TerminationPoint1.class);
             OpenroadmTpType type = cntp1.getTpType();
-            LOG.info("type = {} for tp {}", type.getName(), tp);
+            LOG.debug("type = {} for tp {}", type.getName(), tp);
 
             switch (type) {
                 case SRGTXRXCP:
                 case SRGRXCP:
                 case SRGTXCP:
                     if (State.InService.equals(cntp1.getOperationalState())) {
-                        LOG.info("initSrgTpList: adding SRG-CP tp = {} ", tp.getTpId().getValue());
+                        LOG.debug("initSrgTpList: adding SRG-CP tp = {} ", tp.getTpId().getValue());
                         this.availableSrgCp.put(tp.getTpId().getValue(), cntp1.getTpType());
                     }
                     break;
                 case SRGRXPP:
                 case SRGTXPP:
                 case SRGTXRXPP:
-                    LOG.info("initSrgTpList: SRG-PP tp = {} found", tp.getTpId().getValue());
+                    LOG.debug("initSrgTpList: SRG-PP tp = {} found", tp.getTpId().getValue());
+                    if (!portPreference.isPreferredPort(nodeId.getValue(), tp.getTpId().getValue())) {
+                        LOG.warn("initSrgTpList: SRG-PP tp = {} is rejected by the client", tp.getTpId().getValue());
+                        break;
+                    }
                     if (isTerminationPointAvailable(nttp1)) {
-                        LOG.info("initSrgTpList: adding SRG-PP tp '{}'", tp.getTpId().getValue());
+                        LOG.debug("initSrgTpList: adding SRG-PP tp '{}'", tp.getTpId().getValue());
                         this.availableSrgPp.put(tp.getTpId().getValue(), cntp1.getTpType());
                         if (State.InService.equals(cntp1.getOperationalState())) {
-                            LOG.info("initSrgTpList: adding SRG-PP tp '{}'", tp.getTpId().getValue());
+                            LOG.debug("initSrgTpList: adding SRG-PP tp '{}'", tp.getTpId().getValue());
                             this.availableSrgPp.put(tp.getTpId().getValue(), cntp1.getTpType());
                         }
                     } else {
@@ -154,12 +166,12 @@ public class PceOpticalNode implements PceNode {
             this.valid = false;
             return;
         }
-        LOG.info("initSrgTpList: availableSrgPp size = {} && availableSrgCp size = {} in {}",
+        LOG.debug("initSrgTpList: availableSrgPp size = {} && availableSrgCp size = {} in {}",
             this.availableSrgPp.size(), this.availableSrgCp.size(), this);
     }
 
     private boolean isTerminationPointAvailable(
-            org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev211210.TerminationPoint1 nttp1) {
+            org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.TerminationPoint1 nttp1) {
         byte[] availableByteArray = new byte[GridConstant.NB_OCTECTS];
         Arrays.fill(availableByteArray, (byte) GridConstant.AVAILABLE_SLOT_VALUE);
         return nttp1 == null || nttp1.getPpAttributes() == null
@@ -179,19 +191,15 @@ public class PceOpticalNode implements PceNode {
         }
         switch (this.serviceType) {
             case "400GE":
-                for (Class<? extends SupportedIfCapability> ifCap : mapping.getSupportedInterfaceCapability()) {
-                    if (ifCap.equals(IfOtsiOtsigroup.class)) {
+                for (SupportedIfCapability ifCap : mapping.getSupportedInterfaceCapability()) {
+                    if (ifCap.equals(IfOtsiOtsigroup.VALUE)) {
                         return true;
                     }
                 }
                 return false;
             case "100GE":
-                if (mapping.getSupportedInterfaceCapability().contains(IfOCH.class)
-                        || mapping.getSupportedInterfaceCapability().contains(IfOCHOTU4ODU4.class)) {
-                    return true;
-                } else {
-                    return false;
-                }
+                return mapping.getSupportedInterfaceCapability().contains(IfOCH.VALUE)
+                        || mapping.getSupportedInterfaceCapability().contains(IfOCHOTU4ODU4.VALUE);
             default:
                 return true;
         }
@@ -202,8 +210,8 @@ public class PceOpticalNode implements PceNode {
             return;
         }
         Node1 node1 = this.node.augmentation(Node1.class);
-        org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Node1 node11 =
-                this.node.augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Node1
+        org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Node1 node11 =
+                this.node.augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Node1
                         .class);
         switch (this.nodeType) {
             case SRG :
@@ -242,7 +250,6 @@ public class PceOpticalNode implements PceNode {
                 if (!State.InService.equals(node11.getOperationalState())) {
                     this.valid = false;
                     LOG.error("initWLlist: XPDR node {} is OOS/degraded", this);
-                    return;
                 }
                 break;
             default:
@@ -252,26 +259,29 @@ public class PceOpticalNode implements PceNode {
     }
 
     public void initXndrTps(ServiceFormat serviceFormat) {
-        LOG.info("PceNod: initXndrTps for node : {}", this.nodeId);
+        LOG.debug("PceNod: initXndrTps for node : {}", this.nodeId);
         if (!isValid()) {
             return;
         }
+        this.valid = false;
         org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1 nodeTp =
                 this.node.augmentation(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
                     .ietf.network.topology.rev180226.Node1.class);
         List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network
             .node.TerminationPoint> allTps = new ArrayList<>(nodeTp.nonnullTerminationPoint().values());
         if (allTps.isEmpty()) {
-            this.valid = false;
             LOG.error("initXndrTps: XPONDER TerminationPoint list is empty for node {}", this);
             return;
         }
-        this.valid = false;
         for (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network
-            .node.TerminationPoint tp : allTps) {
+                .node.TerminationPoint tp : allTps) {
             TerminationPoint1 cntp1 = tp.augmentation(TerminationPoint1.class);
+            if (cntp1 == null) {
+                LOG.error("initXndrTps: {} - {} has no tp type", this.nodeId, tp.getTpId().toString());
+                continue;
+            }
             if (cntp1.getTpType() != OpenroadmTpType.XPONDERNETWORK) {
-                LOG.warn("initXndrTps: {} is not an Xponder network port", cntp1.getTpType().getName());
+                LOG.debug("initXndrTps: {} is not an Xponder network port", cntp1.getTpType().getName());
                 continue;
             }
             if (!isTpWithGoodCapabilities(tp)) {
@@ -280,31 +290,31 @@ public class PceOpticalNode implements PceNode {
             }
             if (!State.InService.equals(cntp1.getOperationalState())) {
                 LOG.warn("initXndrTps: XPONDER tp = {} is OOS/degraded", tp.getTpId().getValue());
-                this.valid = false;
                 continue;
             }
-            org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev211210.TerminationPoint1 nttp1 = tp
-                .augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev211210
-                .TerminationPoint1.class);
-            if (nttp1 != null && nttp1.getXpdrNetworkAttributes().getWavelength() != null) {
-                this.usedXpndrNWTps.add(tp.getTpId().getValue());
-                LOG.info("initXndrTps: XPONDER tp = {} is used", tp.getTpId().getValue());
-            } else {
-                this.valid = true;
+            if (endpoints == null
+                    || (!endpoints.getAEndTp().equals(tp.getTpId().getValue())
+                        && !endpoints.getZEndTp().equals(tp.getTpId().getValue()))) {
+                org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.TerminationPoint1 nttp1 =
+                        tp.augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526
+                                .TerminationPoint1.class);
+                if (nttp1 != null && nttp1.getXpdrNetworkAttributes().getWavelength() != null) {
+                    this.usedXpndrNWTps.add(tp.getTpId().getValue());
+                    LOG.debug("initXndrTps: XPONDER tp = {} is used", tp.getTpId().getValue());
+                    continue;
+                }
             }
             // find Client of this network TP
-            String client;
-            org.opendaylight.yang.gen.v1.http.transportpce.topology.rev220123.TerminationPoint1 tpceTp1 =
-                    tp.augmentation(org.opendaylight.yang.gen.v1.http.transportpce.topology.rev220123
-                            .TerminationPoint1.class);
-            if (tpceTp1 != null) {
-                client = tpceTp1.getAssociatedConnectionMapPort();
+            if (cntp1.getAssociatedConnectionMapTp() != null) {
+                String client = cntp1.getAssociatedConnectionMapTp().iterator().next().getValue();
                 if (client != null) {
                     this.clientPerNwTp.put(tp.getTpId().getValue(), client);
                     this.valid = true;
                 } else {
                     LOG.error("Service Format {} not managed yet", serviceFormat.getName());
                 }
+            } else {
+                this.valid = true;
             }
         }
         if (!isValid()) {
@@ -314,7 +324,7 @@ public class PceOpticalNode implements PceNode {
 
     @Override
     public String getRdmSrgClient(String tp, String direction) {
-        LOG.info("getRdmSrgClient: Getting PP client for tp '{}' on node : {}", tp, this.nodeId);
+        LOG.debug("getRdmSrgClient: Getting PP client for tp '{}' on node : {}", tp, this.nodeId);
         OpenroadmTpType srgType = null;
         OpenroadmTpType cpType = this.availableSrgCp.get(tp);
         if (cpType == null) {
@@ -323,7 +333,7 @@ public class PceOpticalNode implements PceNode {
         }
         switch (cpType) {
             case SRGTXRXCP:
-                LOG.info("getRdmSrgClient: Getting BI Directional PP port ...");
+                LOG.debug("getRdmSrgClient: Getting BI Directional PP port ...");
                 // Take the first-element in the available PP key set
                 if (availableSrgPp.entrySet().iterator().next().getKey()
                         // and check if the port is bidirectional
@@ -336,43 +346,90 @@ public class PceOpticalNode implements PceNode {
                 }
                 break;
             case SRGTXCP:
-                LOG.info("getRdmSrgClient: Getting UNI Rx PP port ...");
+                LOG.debug("getRdmSrgClient: Getting UNI Rx PP port ...");
                 srgType = OpenroadmTpType.SRGRXPP;
                 break;
             case SRGRXCP:
-                LOG.info("getRdmSrgClient: Getting UNI Tx PP port ...");
+                LOG.debug("getRdmSrgClient: Getting UNI Tx PP port ...");
                 srgType = OpenroadmTpType.SRGTXPP;
                 break;
             default:
                 break;
         }
-        LOG.info("getRdmSrgClient:  Getting client PP for CP '{}'", tp);
-        if (!this.availableSrgPp.isEmpty()) {
-            Optional<String> client = null;
-            final OpenroadmTpType openType = srgType;
-            client = this.availableSrgPp.entrySet()
-                    .stream().filter(pp -> pp.getValue().getName().equals(openType.getName()))
-                    .map(Map.Entry::getKey)
-                    .sorted(new SortPortsByName())
-                    .findFirst();
-            if (!client.isPresent()) {
-                LOG.error("getRdmSrgClient: ROADM {} doesn't have PP Client for CP {}", this, tp);
-                return null;
-            }
-            LOG.info("getRdmSrgClient: client PP {} for CP {} found !", client, tp);
-            return client.get();
-        } else {
+        LOG.debug("getRdmSrgClient:  Getting client PP for CP '{}'", tp);
+        if (this.availableSrgPp.isEmpty()) {
             LOG.error("getRdmSrgClient: SRG TerminationPoint PP list is not available for node {}", this);
             return null;
         }
+        final OpenroadmTpType openType = srgType;
+        Optional<String> client = this.availableSrgPp.entrySet()
+                .stream().filter(pp -> pp.getValue().getName().equals(openType.getName()))
+                .map(Map.Entry::getKey).min(new SortPortsByName());
+        if (client.isEmpty()) {
+            LOG.error("getRdmSrgClient: ROADM {} doesn't have PP Client for CP {}", this, tp);
+            return null;
+        }
+        LOG.debug("getRdmSrgClient: client PP {} for CP {} found !", client, tp);
+        return client.orElseThrow();
+    }
+
+    @Override
+    public String getOperationalMode() {
+        Node1 node1 = this.node.augmentation(Node1.class);
+        if (node1 == null) {
+            LOG.warn("No openroadm node available for node {}", node);
+            return "";
+        }
+        switch (this.nodeType) {
+            case SRG :
+                if (node1.getSrgAttributes().getSupportedOperationalModes() == null
+                        || node1.getSrgAttributes().getSupportedOperationalModes().stream().findFirst().isEmpty()) {
+                    LOG.debug("getOperationalMode: SRG has no operational mode declared");
+                    return StringConstants.UNKNOWN_MODE;
+                } else {
+                    LOG.debug("getOperationalMode: SRG has operational mode declared {}",
+                        node1.getSrgAttributes().getSupportedOperationalModes().stream().findFirst().toString());
+                    return node1.getSrgAttributes().getSupportedOperationalModes().stream().findFirst().toString();
+                }
+            case DEGREE :
+                if (node1.getDegreeAttributes().getSupportedOperationalModes() == null
+                        || node1.getDegreeAttributes().getSupportedOperationalModes().stream().findFirst().isEmpty()) {
+                    LOG.debug("getOperationalMode: DEGREE has no operational mode declared");
+                    return StringConstants.UNKNOWN_MODE;
+                } else {
+                    LOG.debug("getOperationalMode: DEGREE has operational mode declared {}",
+                        node1.getDegreeAttributes().getSupportedOperationalModes().stream().findFirst().toString());
+                    return node1.getDegreeAttributes().getSupportedOperationalModes().stream().findFirst().toString();
+                }
+            default:
+                LOG.debug("getOperationalMode: Did not succeed retrieving Operational Mode for the node");
+                return "";
+        }
     }
 
+    @Override
+    public String getXponderOperationalMode(XpdrNetworkAttributes tp) {
+        if (tp.getSupportedOperationalModes() == null) {
+            LOG.warn("getOperationalMode: NetworkPort {} has no operational mode declared compatible with service type",
+                tp);
+            return StringConstants.UNKNOWN_MODE;
+        }
+        for (Map.Entry<OperationalModeKey, OperationalMode> mode : tp.getSupportedOperationalModes()
+                .getOperationalMode().entrySet()) {
+            if (mode.getKey().toString().contains(StringConstants.SERVICE_TYPE_RATE
+                    .get(this.serviceType).toCanonicalString())) {
+                LOG.info("getOperationalMode: NetworkPort {}  has {} operational mode declared", tp,
+                    mode.getKey().toString());
+                return mode.getKey().toString();
+            }
+        }
+        LOG.warn("getOperationalMode: NetworkPort {}  has no operational mode declared compatible with service type",
+            tp);
+        return StringConstants.UNKNOWN_MODE;
+    }
 
     public void validateAZxponder(String anodeId, String znodeId, ServiceFormat serviceFormat) {
-        if (!isValid()) {
-            return;
-        }
-        if (this.nodeType != OpenroadmNodeType.XPONDER) {
+        if (!isValid() || this.nodeType != OpenroadmNodeType.XPONDER) {
             return;
         }
         // Detect A and Z
@@ -381,7 +438,8 @@ public class PceOpticalNode implements PceNode {
             initXndrTps(serviceFormat);
             return;
         }
-        LOG.debug("validateAZxponder: XPONDER is ignored == {}", nodeId.getValue());
+        LOG.debug("validateAZxponder: XPONDER == {} is ignored, supported by {} for aNodeId {} ", nodeId.getValue(),
+            this.getSupNetworkNodeId(), anodeId);
         valid = false;
     }
 
@@ -392,9 +450,9 @@ public class PceOpticalNode implements PceNode {
 
     public boolean isValid() {
         if (node == null || nodeId == null || nodeType == null || this.getSupNetworkNodeId() == null
-            || this.getSupClliNodeId() == null || adminStates == null || state == null) {
-            LOG.error("PceNode: one of parameters is not populated : nodeId, node type, supporting nodeId, "
-                    + "admin state, operational state");
+                || this.getSupClliNodeId() == null || adminStates == null || state == null) {
+            LOG.error("PceNode {},   nodeId {}  NodeType {} : one of parameters is not populated : nodeId, node type,"
+                + " supporting nodeId, admin state, operational state", deviceNodeId, nodeId, nodeType);
             valid = false;
         }
         return valid;
@@ -455,6 +513,11 @@ public class PceOpticalNode implements PceNode {
         return null;
     }
 
+    @Override
+    public OpenroadmNodeType getORNodeType() {
+        return this.nodeType;
+    }
+
     @Override
     public Map<String, List<Uint16>> getAvailableTribSlots() {
         return null;
@@ -500,4 +563,8 @@ public class PceOpticalNode implements PceNode {
         return centralFreqGranularity;
     }
 
+    public void setEndpoints(Endpoints endpoints) {
+        this.endpoints = endpoints;
+    }
+
 }