netconf-executor: NetconfSessionImp removed useless method 74/85074/1
authorOleg Mitsura <oleg.mitsura@amdocs.com>
Thu, 11 Apr 2019 14:40:55 +0000 (10:40 -0400)
committerOleg Mitsura <oleg.mitsura@amdocs.com>
Thu, 11 Apr 2019 15:15:23 +0000 (11:15 -0400)
Issue-ID: CCSDK-1126

Change-Id: I40fa7a5d83d14a33d8e06fe28394828f86f857fd
Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com>
ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt

index 13c1bfa..b1121b3 100644 (file)
@@ -257,19 +257,11 @@ class NetconfSessionImpl(private val deviceInfo: DeviceInfo, private val rpcServ
         }
 
         val capabilityMatcher = NetconfMessageUtils.CAPABILITY_REGEX_PATTERN.matcher(serverHelloResponse)
-        while (capabilityMatcher.find()) {
+        while (capabilityMatcher.find()) { //TODO: refactor to add unit test easily for device capability accumulation.
             deviceCapabilities.add(capabilityMatcher.group(1))
         }
     }
 
-    fun sessionstatus(state:String): Boolean{
-        return when (state){
-            "Close" -> channel.isClosed
-            "Open" -> channel.isOpen
-            else -> false
-        }
-    }
-
     internal fun setStreamHandler(streamHandler: NetconfDeviceCommunicator) {
         this.streamHandler = streamHandler
     }
@@ -279,7 +271,6 @@ class NetconfSessionImpl(private val deviceInfo: DeviceInfo, private val rpcServ
      * Used by {@link NetconfSessionListenerImpl}
      */
     internal fun addDeviceErrorReply(errReply: String) {
-        println("addDeviceErrorReply (errReply: $errReply") //TODO : get rid of this.
         errorReplies.add(errReply)
     }
 
@@ -288,7 +279,6 @@ class NetconfSessionImpl(private val deviceInfo: DeviceInfo, private val rpcServ
      * Used by {@link NetconfSessionListenerImpl}
      */
     internal fun addDeviceReply(messageId: String, replyMsg: String) {
-        println("addDeviceReply (messageId: $messageId replyMsg: $replyMsg") //TODO : get rid of this.
         replies[messageId]?.complete(replyMsg)
     }
 
@@ -312,7 +302,6 @@ class NetconfSessionImpl(private val deviceInfo: DeviceInfo, private val rpcServ
      * internal function for accessing errorReplies for testing.
      */
     internal fun getErrorReplies() = errorReplies
-
     internal fun clearErrorReplies() = errorReplies.clear()
     internal fun clearReplies() = replies.clear()
     internal fun setClient(client: SshClient) { this.client = client }