Update sshd to 2.2.0 28/83528/4
authorAlexis de Talhouët <adetalhouet89@gmail.com>
Wed, 27 Mar 2019 21:20:06 +0000 (17:20 -0400)
committerAlexis de Talhouët <adetalhouet89@gmail.com>
Fri, 29 Mar 2019 13:05:05 +0000 (09:05 -0400)
Change-Id: I1bc052cfc7681d0f5d6793aa08e2083332ee88b3
Issue-ID: CCSDK-1137
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt
ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/mocks/NetconfDeviceSimulator.kt
ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/mocks/NetconfSubsystemFactory.kt
ms/blueprintsprocessor/parent/pom.xml

index d1ecb4f..de4cda9 100644 (file)
@@ -19,10 +19,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.core
 import com.google.common.collect.ImmutableList
 import com.google.common.collect.ImmutableSet
 import org.apache.sshd.client.SshClient
-import org.apache.sshd.client.channel.ChannelSubsystem
 import org.apache.sshd.client.channel.ClientChannel
 import org.apache.sshd.client.session.ClientSession
-import org.apache.sshd.client.session.ClientSessionImpl
 import org.apache.sshd.common.FactoryManager
 import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider
 import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.DeviceInfo
@@ -195,9 +193,9 @@ class NetconfSessionImpl(private val deviceInfo: DeviceInfo, private val rpcServ
 
     private fun startClient() {
         client = SshClient.setUpDefaultClient()
+
         client.properties.putIfAbsent(FactoryManager.IDLE_TIMEOUT, TimeUnit.SECONDS.toMillis(idleTimeout.toLong()))
         client.properties.putIfAbsent(FactoryManager.NIO2_READ_TIMEOUT, TimeUnit.SECONDS.toMillis(idleTimeout + 15L))
-        client.keyPairProvider = SimpleGeneratorHostKeyProvider()
         client.start()
 
         startSession()
index c6d6308..2b7aa76 100644 (file)
@@ -17,12 +17,11 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.mocks
 
 
 import org.apache.sshd.common.NamedFactory
-import org.apache.sshd.server.Command
+import org.apache.sshd.server.command.Command
 import org.apache.sshd.server.SshServer
 import org.apache.sshd.server.auth.UserAuth
 import org.apache.sshd.server.auth.UserAuthNoneFactory
 import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils.NetconfSubsystemFactory
 import java.util.*
 
 
index de0a5d0..f3e5d38 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils
+package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.mocks
 
 
 import java.io.IOException
 import java.io.InputStream
 import java.io.OutputStream
 import org.apache.sshd.common.NamedFactory;
-import org.apache.sshd.server.Command;
+import org.apache.sshd.server.command.Command;
 import org.apache.sshd.server.Environment;
 import org.apache.sshd.server.ExitCallback;
 
index 0b2ac70..d119d8f 100755 (executable)
@@ -37,8 +37,7 @@
         <kotlin.maven.version>1.3.21</kotlin.maven.version>
         <kotlin.couroutines.version>1.1.1</kotlin.couroutines.version>
         <grpc.version>1.18.0</grpc.version>
-        <!-- TODO("Migrate SSHD to 2.x version") -->
-        <sshd.version>1.7.0</sshd.version>
+        <sshd.version>2.2.0</sshd.version>
         <jsch.version>0.1.55</jsch.version>
         <protobuff.java.utils.version>3.6.1</protobuff.java.utils.version>
         <eelf.version>1.0.0</eelf.version>