[YANGTOOLS-430] Data Tree: provide a cursor/stream modification API Created: 20/Mar/15  Updated: 10/Apr/22  Due: 13/Aug/15  Resolved: 18/Aug/15

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement
Reporter: Robert Varga Assignee: Tony Tkacik
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
blocks MDSAL-94 Milestone: Introduce cursor-based mod... Resolved

 Description   

There are a few situations where we want to apply a tree-based operation into a data tree, for example if I want to replicate a DataTreeCandidate to another data tree.

Instead of performing global operations in the YangInstanceIdentifier+data sense, it would be nice if I could maintain a data-tree backed cursor, which I can navigate, such as this:

YangInstanceIdentifer id; // root of the incoming DataTreeCandidate
DataTree tree; // tree the operation needs to be applied to
DataTreeModification tx = tree.takeSnapshot().newModification();

DataTreeModificationCursor cursor = tx.cursor(id);
cursor.write(pathArgument1, data1);
cursor.enter(pathArgument2); // equivalent of 'cd'
cursor.enter(pathArgument3);
cursor.write(pathArgument4, data2);
cursor.exit();
cursor.exit();
cursor.close();



 Comments   
Comment by Robert Varga [ 19/Apr/15 ]

Preliminary API proposal, along with example of use: https://git.opendaylight.org/gerrit/18595

Comment by Robert Varga [ 17/Jun/15 ]

https://git.opendaylight.org/gerrit/22837

Generated at Wed Feb 07 20:53:13 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.