Remove netconf-impl's getConfig_candidate.xml
[netconf.git] / netconf / netconf-ssh / src / main / java / org / opendaylight / netconf / ssh / RemoteNetconfCommand.java
index c016dc395949f3e172f9707f258107d6da101d89..36313786b16b82552822c193d5b3ed9a06609375 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.ssh;
 
 import com.google.common.base.Preconditions;
@@ -16,7 +15,6 @@ import io.netty.channel.ChannelInitializer;
 import io.netty.channel.EventLoopGroup;
 import io.netty.channel.local.LocalAddress;
 import io.netty.channel.local.LocalChannel;
-import io.netty.util.concurrent.GenericFutureListener;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.InetSocketAddress;
@@ -24,11 +22,11 @@ import java.net.SocketAddress;
 import org.apache.sshd.common.NamedFactory;
 import org.apache.sshd.common.io.IoInputStream;
 import org.apache.sshd.common.io.IoOutputStream;
-import org.apache.sshd.server.AsyncCommand;
-import org.apache.sshd.server.Command;
 import org.apache.sshd.server.Environment;
 import org.apache.sshd.server.ExitCallback;
 import org.apache.sshd.server.SessionAware;
+import org.apache.sshd.server.command.AsyncCommand;
+import org.apache.sshd.server.command.Command;
 import org.apache.sshd.server.session.ServerSession;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.slf4j.Logger;
@@ -118,19 +116,15 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware {
             }
         });
         clientChannelFuture = clientBootstrap.connect(localAddress);
-        clientChannelFuture.addListener(new GenericFutureListener<ChannelFuture>() {
-
-            @Override
-            public void operationComplete(final ChannelFuture future) {
-                if (future.isSuccess()) {
-                    clientChannel = clientChannelFuture.channel();
-                } else {
-                    LOG.warn("Unable to establish internal connection to netconf server for client: {}",
-                            getClientAddress());
-                    Preconditions.checkNotNull(callback, "Exit callback must be set");
-                    callback.onExit(1, "Unable to establish internal connection to netconf server for client: "
-                            + getClientAddress());
-                }
+        clientChannelFuture.addListener(future -> {
+            if (future.isSuccess()) {
+                clientChannel = clientChannelFuture.channel();
+            } else {
+                LOG.warn("Unable to establish internal connection to netconf server for client: {}",
+                        getClientAddress());
+                Preconditions.checkNotNull(callback, "Exit callback must be set");
+                callback.onExit(1, "Unable to establish internal connection to netconf server for client: "
+                        + getClientAddress());
             }
         });
     }
@@ -142,14 +136,10 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware {
 
         clientChannelFuture.cancel(true);
         if (clientChannel != null) {
-            clientChannel.close().addListener(new GenericFutureListener<ChannelFuture>() {
-
-                @Override
-                public void operationComplete(final ChannelFuture future) {
-                    if (!future.isSuccess()) {
-                        LOG.warn("Unable to release internal connection to netconf server on channel: {}",
-                                clientChannel);
-                    }
+            clientChannel.close().addListener(future -> {
+                if (!future.isSuccess()) {
+                    LOG.warn("Unable to release internal connection to netconf server on channel: {}",
+                            clientChannel);
                 }
             });
         }