X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=common%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fcommon%2Fopenroadminterfaces%2FOpenRoadmInterfacesImpl121.java;h=b17f7cba68b6d7201cbee0935a5d49a7918607d8;hb=refs%2Fchanges%2F02%2F83902%2F1;hp=3eddbcb27403d74cf2b3253a4fce2ec46364bb10;hpb=dec29c25aaaa8fc10cc8cf979ecb6ce194de20f3;p=transportpce.git diff --git a/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl121.java b/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl121.java index 3eddbcb27..b17f7cba6 100755 --- a/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl121.java +++ b/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl121.java @@ -8,11 +8,13 @@ package org.opendaylight.transportpce.common.openroadminterfaces; -import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.FluentFuture; import java.util.Optional; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; +import org.opendaylight.mdsal.common.api.CommitInfo; import org.opendaylight.transportpce.common.StringConstants; import org.opendaylight.transportpce.common.Timeouts; import org.opendaylight.transportpce.common.device.DeviceTransaction; @@ -67,8 +69,8 @@ public class OpenRoadmInterfacesImpl121 { InstanceIdentifier interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child( Interface.class, new InterfaceKey(ifBuilder.getName())); deviceTx.put(LogicalDatastoreType.CONFIGURATION, interfacesIID, ifBuilder.build()); - ListenableFuture txSubmitFuture = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, - Timeouts.DEVICE_WRITE_TIMEOUT_UNIT); + FluentFuture txSubmitFuture = + deviceTx.commit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT); try { txSubmitFuture.get(); LOG.info("Successfully posted interface {} on node {}", ifBuilder.getName(), nodeId); @@ -155,11 +157,11 @@ public class OpenRoadmInterfacesImpl121 { } deviceTx.delete(LogicalDatastoreType.CONFIGURATION, interfacesIID); - ListenableFuture submit = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, - Timeouts.DEVICE_WRITE_TIMEOUT_UNIT); + FluentFuture commit = + deviceTx.commit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT); try { - submit.get(); + commit.get(); LOG.info("Successfully deleted {} on node {}", interfaceName, nodeId); } catch (InterruptedException | ExecutionException e) { throw new OpenRoadmInterfaceException(String.format("Failed to delete interface %s on " + "node %s", @@ -220,8 +222,8 @@ public class OpenRoadmInterfacesImpl121 { nodeId), e); } deviceTx.put(LogicalDatastoreType.CONFIGURATION, circuitPackIID, cpBldr.build()); - ListenableFuture txSubmitFuture = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, - Timeouts.DEVICE_WRITE_TIMEOUT_UNIT); + FluentFuture txSubmitFuture = + deviceTx.commit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT); try { txSubmitFuture.get(); LOG.info("Successfully posted equipment state change on node {}", nodeId);