Schema determination is asynchronous 87/109987/12
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 25 Jan 2024 03:47:38 +0000 (04:47 +0100)
committerRobert Varga <nite@hq.sk>
Sun, 18 Feb 2024 14:53:06 +0000 (14:53 +0000)
commit2cec3131d7dbd89237677a3bb9d0cecbc9a5566b
treef3ff233e35f629dfc64835d870cab3eceb2a2ee2
parentebf61b3d4feb335d30ebe5a84b830e09861ff900
Schema determination is asynchronous

One of the reasons NetconfDevice needs an Executor is because it is
invoking Future.get() -- which must not happen on the invoking thread,
because then we would not get a response as we would block the Netty
thread.

Refactor schema acquisition to be asynchronous, which means it can be
executed immediately and we can then follow up with schema setup through
a callback.

The introduced asynchrony means we cannot really use things like
Verify.verify() and Preconditions.checkState(). We essentially write the
parsing code from scratch with proper defenses against the dark arts.

This removes artificial content stripping, as that is just not
appropriate -- leading to one test schema being ignored.

JIRA: NETCONF-1233
Change-Id: I527e2d8da6bdbd74baf5ffcd9eae256c2ade9e6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/DeviceSourcesResolver.java [deleted file]
plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/LibraryModulesSchemas.java
plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/NetconfDevice.java
plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/NetconfStateSchemas.java
plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/NetconfStateSchemasResolverImpl.java
plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/api/NetconfDeviceSchemasResolver.java
plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/impl/NetconfMessageTransformUtil.java
plugins/netconf-client-mdsal/src/test/java/org/opendaylight/netconf/client/mdsal/NetconfDeviceTest.java
plugins/netconf-client-mdsal/src/test/java/org/opendaylight/netconf/client/mdsal/NetconfStateSchemasTest.java