Fix license header violations in sal-netconf-connector
[controller.git] / opendaylight / md-sal / sal-netconf-connector / src / main / java / org / opendaylight / controller / sal / connect / netconf / util / NetconfRpcFutureCallback.java
index 6e1e9d764fa20db25a9ff336157ee561694f616f..2c01766763cde6da7e873d8017d3e672fafd4560 100644 (file)
@@ -3,24 +3,22 @@
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
 package org.opendaylight.controller.sal.connect.netconf.util;
 
 import com.google.common.util.concurrent.FutureCallback;
-import org.opendaylight.controller.sal.connect.netconf.sal.tx.WriteRunningTx;
+import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
 import org.opendaylight.controller.sal.connect.util.RemoteDeviceId;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * Simple Netconf rpc logging callback
  */
-public class NetconfRpcFutureCallback implements FutureCallback<RpcResult<CompositeNode>> {
-    private static final Logger LOG  = LoggerFactory.getLogger(WriteRunningTx.class);
+public class NetconfRpcFutureCallback implements FutureCallback<DOMRpcResult> {
+    private static final Logger LOG  = LoggerFactory.getLogger(NetconfRpcFutureCallback.class);
 
     private final String type;
     private final RemoteDeviceId id;
@@ -31,15 +29,15 @@ public class NetconfRpcFutureCallback implements FutureCallback<RpcResult<Compos
     }
 
     @Override
-    public void onSuccess(final RpcResult<CompositeNode> result) {
-        if(result.isSuccessful()) {
+    public void onSuccess(final DOMRpcResult result) {
+        if(result.getErrors().isEmpty()) {
             LOG.trace("{}: " + type + " invoked successfully", id);
         } else {
             onUnsuccess(result);
         }
     }
 
-    protected void onUnsuccess(final RpcResult<CompositeNode> result) {
+    protected void onUnsuccess(final DOMRpcResult result) {
         LOG.warn("{}: " + type + " invoked unsuccessfully: {}", id, result.getErrors());
     }