[YANGTOOLS-711] XPath: provide an evaluator on top of DataTreeCandidate Created: 04/Nov/16  Updated: 18/Jan/24

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

Type: New Feature
Reporter: Robert Varga Assignee: Unassigned
Resolution: Unresolved 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 NETCONF-369 Incorrect handling of filter namespaces Confirmed
blocks YANGTOOLS-477 Milestone: Introduce support for XPat... Confirmed
blocks YANGTOOLS-689 DataTree: enforce 'must'-statement co... Confirmed
blocks YANGTOOLS-688 DataTree: enforce 'when'-statement c... Confirmed
is blocked by YANGTOOLS-966 Integrate YANG parser with XPath parser Resolved
is blocked by YANGTOOLS-878 Add yang-data-api model of an XPath e... Confirmed

 Description   

In order to efficiently propagate state to applications, we want to expose a utility method, which can evaluate a chain of incoming DataTreeCandidates and accurately translate them to a chain of changes to an expression's return values.

The way this should work is:

XPath xpath = ...;
XPathDelta delta = XPathDeltaFactory.initial(xpath);

Collection<DataTreeCandiates> candidates = ...;
for (DataTreeCandidate c : candidates) {
  final Optional<XPathResult> res = delta.apply(c);
  if (res.isPresent()) {
    // Should not result in duplicates printed
    LOG.debug("XPath {} changed result to {}", xpath, res.get());
  }
}
// If no state has been applied, this will return Optional.empty()
Optional<XPathResult> currentResult = delta.current();
LOG.debug("Current XPath {} result is {}", xpath, currentResult);

 


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