- private void insert(final KeyedInstanceIdentifier<Node, NodeKey> sourcePath, final Node node) {
- final NodeKey nodeKey = node.getKey();
+ private <T extends DataObject> void deleteData(final LogicalDatastoreType store,
+ final InstanceIdentifier<T> path) {
+ final WriteTransaction tx = getDataBroker().newWriteOnlyTransaction();
+ tx.delete(OPERATIONAL, path);
+ tx.commit().addCallback(new FutureCallback<CommitInfo>() {
+ @Override
+ public void onSuccess(final CommitInfo result) {
+ LOG.trace("Data has deleted from datastore {} {}", store, path);
+ }
+
+ @Override
+ public void onFailure(final Throwable ex) {
+ LOG.error("Can not delete data from datastore [store: {}] [path: {}]", store, path, ex);
+ }
+ }, MoreExecutors.directExecutor());
+ }
+
+ private void insert(final KeyedInstanceIdentifier<Node, NodeKey> sourcePath) {
+ final NodeKey nodeKey = sourcePath.getKey();