Fixup Augmentable and Identifiable methods changing
[netconf.git] / netconf / netconf-topology / src / main / java / org / opendaylight / netconf / topology / impl / NetconfConnectorFactoryImpl.java
index 7017d807bc2cc005158a7d8d1d230b1095f47d3a..f27f09eb7ec3391a3516a020b86a4805af3473c1 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.netconf.topology.impl;
 
-import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -15,7 +14,6 @@ import javax.annotation.Nullable;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.netconf.topology.api.NetconfConnectorFactory;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.HostBuilder;
@@ -77,15 +75,14 @@ public class NetconfConnectorFactoryImpl implements NetconfConnectorFactory {
                 .build();
         final Node node =  new NodeBuilder()
                 .setNodeId(nodeId)
-                .setKey(nodeKey)
+                .withKey(nodeKey)
                 .addAugmentation(NetconfNode.class, netconfNode)
                 .build();
 
         final InstanceIdentifier<Node> nodePath = TOPOLOGY_PATH.child(Node.class, nodeKey);
         final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
         transaction.put(LogicalDatastoreType.CONFIGURATION, nodePath, node);
-        final CheckedFuture<Void, TransactionCommitFailedException> submitFuture = transaction.submit();
-        Futures.addCallback(submitFuture, new FutureCallback<Void>() {
+        Futures.addCallback(transaction.submit(), new FutureCallback<Void>() {
             @Override
             public void onSuccess(@Nullable final Void result) {
                 LOG.debug("Node {} was successfully added to the topology", instanceName);