+ keystoreAdapter = new NetconfKeystoreAdapter(dataBroker);
+
+ // FIXME: this should be a put(), as we are initializing and will be re-populating the datastore with all the
+ // devices. Whatever has been there before should be nuked to properly re-align lifecycle.
+ final var wtx = dataBroker.newWriteOnlyTransaction();
+ wtx.merge(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(NetworkTopology.class)
+ .child(Topology.class, new TopologyKey(new TopologyId(topologyId)))
+ .build(), new TopologyBuilder().setTopologyId(new TopologyId(topologyId)).build());
+ final var future = wtx.commit();
+ try {
+ future.get();
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("Unable to initialize topology {}", topologyId, e);
+ throw new IllegalStateException(e);
+ }
+
+ LOG.debug("Topology {} initialized", topologyId);