}
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
}
* Used by {@link NetconfSessionListenerImpl}
*/
internal fun addDeviceErrorReply(errReply: String) {
- println("addDeviceErrorReply (errReply: $errReply") //TODO : get rid of this.
errorReplies.add(errReply)
}
* 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)
}
* 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 }