Implement registerNotificationListeners() 02/109802/10
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 16 Jan 2024 13:51:32 +0000 (14:51 +0100)
committerRobert Varga <nite@hq.sk>
Wed, 17 Jan 2024 12:00:29 +0000 (12:00 +0000)
commite4e519e6c1c6db47d9c9cd96108f9206d1ca8062
treea953e17d5058cd0036cf9070be6ac363dfffe868
parent803bfe32f22bb50a256d0086fee1de252e48de2e
Implement registerNotificationListeners()

Bulk listener registration, as introduced a long time ago, should be
supported for all clients. Make sure we have an implementation.

While we are here, also fix thread safety hazards around
registration/unregistration -- with minimal critical sections.

Optimize retained memory by specializing empty/one/multiple registrations,
which in turn allows for some code reuse.

JIRA: NETCONF-1224
Change-Id: I8e40a6c149dbc8bea63d840cbd4cd0a807860175
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/spi/NetconfDeviceNotificationService.java
plugins/netconf-client-mdsal/src/test/java/org/opendaylight/netconf/client/mdsal/spi/NC1224Test.java [new file with mode: 0644]
plugins/netconf-client-mdsal/src/test/java/org/opendaylight/netconf/client/mdsal/spi/NetconfDeviceNotificationServiceTest.java