diff options
author | 2019-03-08 17:20:30 -0500 | |
---|---|---|
committer | 2019-03-20 18:40:23 +0000 | |
commit | ae19ea7f3aac00a151bd418d1ca948d83731f438 (patch) | |
tree | 7929f00cdea1f4283a2de948ee440a1588e90dec /ms/blueprintsprocessor/functions/netconf-executor/src/main | |
parent | b9859c7a69aece893b6cacce4dd0d4ce2d0badcb (diff) |
Netconf executor code coverage
Change-Id: Ia7b6ece822e4ad551f2b562d11842f3a8be03219
Issue-ID: CCSDK-1126
Signed-off-by: vinal patel <vinal.narendrabhai.patel@ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions/netconf-executor/src/main')
-rw-r--r-- | ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt index cf11cfdde..2dd73ef18 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt @@ -19,8 +19,10 @@ package org.onap.ccsdk.apps.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.apps.blueprintsprocessor.functions.netconf.executor.api.DeviceInfo @@ -40,6 +42,7 @@ import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ExecutionException import java.util.concurrent.TimeUnit import java.util.concurrent.TimeoutException +import java.util.concurrent.atomic.AtomicReference class NetconfSessionImpl(private val deviceInfo: DeviceInfo, private val rpcService: NetconfRpcService) : NetconfSession { @@ -273,4 +276,12 @@ class NetconfSessionImpl(private val deviceInfo: DeviceInfo, private val rpcServ } } } + + fun sessionstatus(state:String): Boolean{ + return when (state){ + "Close" -> channel.isClosed + "Open" -> channel.isOpen + else -> false + } + } }
\ No newline at end of file |