Update connection and interface name
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / openroadminterfaces / OpenRoadmInterfacesImpl221.java
index eb01a74c259e6142b5cf06ec1918228e916c704e..a0c0d56655f8f687f6ef6b7c5f048d041357628b 100755 (executable)
@@ -9,7 +9,6 @@
 package org.opendaylight.transportpce.common.openroadminterfaces;
 
 import com.google.common.util.concurrent.FluentFuture;
-
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
@@ -66,6 +65,7 @@ public class OpenRoadmInterfacesImpl221 {
             throw new OpenRoadmInterfaceException(String.format("Failed to obtain device transaction for node %s!",
                 nodeId), e);
         }
+
         InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
             Interface.class, new InterfaceKey(ifBuilder.getName()));
         LOG.info("POST INTERF for {} : InterfaceBuilder : name = {} \t type = {}", nodeId, ifBuilder.getName(),
@@ -113,7 +113,7 @@ public class OpenRoadmInterfacesImpl221 {
                     odu.setMaintTestsignal(maintSignalBuilder.build());
                 }
                 oduBuilder.setOdu(odu.build());
-                ifBuilder.addAugmentation(Interface1.class, oduBuilder.build());
+                ifBuilder.addAugmentation(oduBuilder.build());
             } else if (ifBuilder.getType() == OtnOtu.class) {
                 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev181019.Interface1Builder
                     otuBuilder =
@@ -128,9 +128,7 @@ public class OpenRoadmInterfacesImpl221 {
                     otu.setMaintLoopback(maintLoopBackBuilder.build());
                 }
                 otuBuilder.setOtu(otu.build());
-                ifBuilder.addAugmentation(
-                    org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev181019.Interface1.class,
-                    otuBuilder.build());
+                ifBuilder.addAugmentation(otuBuilder.build());
             }
             ifBuilder.setAdministrativeState(AdminStates.OutOfService);
             // post interface with updated admin state
@@ -199,12 +197,12 @@ public class OpenRoadmInterfacesImpl221 {
         boolean change = false;
         if (activate) {
             if (cpBldr.getEquipmentState() != null
-                    && !cpBldr.getEquipmentState().getName().equals(States.NotReservedInuse)) {
+                    && !States.NotReservedInuse.equals(cpBldr.getEquipmentState())) {
                 cpBldr.setEquipmentState(States.NotReservedInuse);
                 change = true;
             }
         } else if ((cpBldr.getEquipmentState() != null
-                && !cpBldr.getEquipmentState().getName().equals(States.NotReservedAvailable))) {
+                && !States.NotReservedAvailable.equals(cpBldr.getEquipmentState()))) {
             cpBldr.setEquipmentState(States.NotReservedAvailable);
             change = true;
         }