Fix periodic NETCONF Call Home connection dropping 28/101828/1
authorivan.martiniak <ivan.martiniak@pantheon.tech>
Tue, 28 Jun 2022 05:00:58 +0000 (07:00 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 25 Aug 2022 14:36:46 +0000 (14:36 +0000)
commit768f181e5b1411de38257ebf7e118c50ea6e39b5
tree7d2c8b9df2232c6899dc08fc0fa46f9785d86334
parentc46a0eb6cb97b936bbf2e0ddd01f29ef31b99c2f
Fix periodic NETCONF Call Home connection dropping

Callhome devices make reconnection every hour due to key re-exchange,
which is part of SSHD implementation.

When a specific session is authenticated and activated,
in case of key re-exchange, authentication (invoking of doAuth() method)
does not need to be made again.

While we are at it, also make sure CallHomeSessionContext's constructor
does not have side-effects -- while this cannot quite happen since we do
not reuse ClientSessions, it is a needless leak.

JIRA: NETCONF-681
Change-Id: I824c92d230c7570570d5eed21d489c435bdc8b22
Signed-off-by: Ivan Martiniak <ivan.martiniak@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 31560e352e65522fdbc64c2f863f90628d6ef772)
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/CallHomeSessionContext.java
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java
netconf/callhome-protocol/src/test/java/org/opendaylight/netconf/callhome/protocol/CallHomeSessionContextTest.java
netconf/callhome-protocol/src/test/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServerTest.java