@Test public void test_NetworkElementWrite_NoEP_Overwrite() throws Exception { writeBaseNetworkElements(); NetworkElement ne = createNetworkElement(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IP_V4_NETWORK_ADDRESS_2); InstanceIdentifier<NetworkElement> iid = InstanceIdentifier.builder(NetworkElements.class) .child(NetworkElement.class, new NetworkElementKey(ne.getKey())) .build(); WriteTransaction wtx = dataBroker.newWriteOnlyTransaction(); wtx.put(LogicalDatastoreType.CONFIGURATION, iid, ne); wtx.submit().get(); NetworkElements nes = neProvider.getNetworkElements(); assertNotNull(nes.getNetworkElement()); assertEquals(1, nes.getNetworkElement().size()); assertEquals(ne, nes.getNetworkElement().get(0)); verifyEmptyLocations(); }
@VisibleForTesting synchronized NetworkElements getNetworkElements() { return networkElements; }
NeLocationProvider implements ClusteredDataTreeChangeListener<NetworkElements>, AutoCloseable { @VisibleForTesting synchronized NetworkElements getNetworkElements() { return networkElements; } }
NeLocationProvider implements ClusteredDataTreeChangeListener<NetworkElements>, AutoCloseable { @VisibleForTesting synchronized NetworkElements getNetworkElements() { return networkElements; } NeLocationProvider(DataBroker dataBroker); }
NeLocationProvider implements ClusteredDataTreeChangeListener<NetworkElements>, AutoCloseable { @VisibleForTesting synchronized NetworkElements getNetworkElements() { return networkElements; } NeLocationProvider(DataBroker dataBroker); @Override void close(); synchronized void onEndpointsChange(Collection<DataTreeModification<AddressEndpoint>> changes); @Override synchronized void onDataTreeChanged(Collection<DataTreeModification<NetworkElements>> changes); }
NeLocationProvider implements ClusteredDataTreeChangeListener<NetworkElements>, AutoCloseable { @VisibleForTesting synchronized NetworkElements getNetworkElements() { return networkElements; } NeLocationProvider(DataBroker dataBroker); @Override void close(); synchronized void onEndpointsChange(Collection<DataTreeModification<AddressEndpoint>> changes); @Override synchronized void onDataTreeChanged(Collection<DataTreeModification<NetworkElements>> changes); static final String NE_LOCATION_PROVIDER_NAME; }