private void addWaiters() { ovsdbWaiter = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, NotifyingDataChangeListener.BIT_CREATE, ovsdbIid, waitList); ovsdbWaiter.registerDataChangeListener(itUtils.dataBroker); bridgeWaiter = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, NotifyingDataChangeListener.BIT_CREATE, bridgeIid, waitList); bridgeWaiter.registerDataChangeListener(itUtils.dataBroker); }
/** * Check that the netvirt topology is in the operational mdsal. * @return true if the netvirt topology was successfully retrieved */ public Boolean getNetvirtTopology() { LOG.info("getNetvirtTopology: looking for {}...", ItConstants.NETVIRT_TOPOLOGY_ID); final TopologyId topologyId = new TopologyId(new Uri(ItConstants.NETVIRT_TOPOLOGY_ID)); InstanceIdentifier<Topology> path = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId)); NotifyingDataChangeListener waitForIt = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, path, null); waitForIt.registerDataChangeListener(dataBroker); try { waitForIt.waitForCreation(60 * 1000); } catch (InterruptedException e) { LOG.info("getNetvirtTopology: InterruptedException while wait(ing)ForCreation"); } boolean found = null != mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, path); LOG.info("getNetvirtTopology: found {} == {}", ItConstants.NETVIRT_TOPOLOGY_ID, found); return found; }
NotifyingDataChangeListener waitForIt = new NotifyingDataChangeListener(LogicalDatastoreType.CONFIGURATION, NotifyingDataChangeListener.BIT_CREATE, iid, null); waitForIt.registerDataChangeListener(dataBroker); waitForIt = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, NotifyingDataChangeListener.BIT_CREATE, iid, null); waitForIt.registerDataChangeListener(dataBroker);
NotifyingDataChangeListener waitForIt = new NotifyingDataChangeListener(LogicalDatastoreType.CONFIGURATION, NotifyingDataChangeListener.BIT_CREATE, iid, null); waitForIt.registerDataChangeListener(dataBroker);