+ @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 "";
+ }
+ }