Simplify NetconfDeviceTopologyAdapter datastore interactions 06/103606/16
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 5 Dec 2022 21:29:56 +0000 (22:29 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 8 Dec 2022 01:21:24 +0000 (02:21 +0100)
commit40d50663e9effe01a47ebf4d79d99183f0701d30
treed5c30f3d6e20a016887866ffd309261e5e714989
parentce7fc72dbbc5aff89ecb9f257517045d901a3281
Simplify NetconfDeviceTopologyAdapter datastore interactions

RemoteDeviceId holds a reference to device topology, which should be
managed by the user before an adapter is ever instantiated for that
device.

Reduce implicit coupling to default topology by requiring the source of
RemoteDeviceId to properly initialize the operational datastore, such
that it ensures the referenced topology actually exists.

This reduces the overhead for each adapter by two fields, as they are
absolutely superfluous when proper lifecycle is present.

To ensure this happens for AbstractTopology-derived topologies,
initialize the datastore during instantiation.

JIRA: NETCONF-918
Change-Id: Ib641cc65861bf25fe34ea2ef313ff2a1843e0f97
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
netconf/netconf-topology-impl/src/main/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImpl.java
netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/spi/AbstractNetconfTopology.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/util/RemoteDeviceId.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceSalProviderTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapterTest.java