[MDSAL-357] RFC7952 metadata should be transported over MD-SAL Created: 28/Jun/18  Updated: 09/Jan/24

Status: Confirmed
Project: mdsal
Component/s: Binding codegen, Binding runtime, DOM runtime
Affects Version/s: None
Fix Version/s: 14.0.0

Type: Epic Priority: Medium
Reporter: Robert Varga Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
is blocked by YANGTOOLS-961 Integrate NormalizedNodes with RFC795... Resolved
Epic Name: Add metadata awareness

 Description   

https://tools.ietf.org/html/rfc7952 defines a way to forward metadata attached to YANG-modeled data.

This has multiple uses, mostly revolving about cross-cutting concerns like AAA. Furthermore it allows us to enrich data with things like event time - which is useful for notifications.

Explore and implement a solution which allows such metadata to be tracked.



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

While we do have AnnotationAware interface, the solution is not complete, as we have leaf-equivalents which cannot have this interface attached:

  • unrestricted leaf types (which boil down to final java.lang objects)
  • restricted leaf types, i.e. TypeObjects (which boil down to java.lang.Enums) and which would need MDSAL-90/MDSAL-440 resolved to allow AnnotationAware subclassing
  • leaf-lists of the above

An obvious solution would be to generate metadataFoo() counterparts to getFoo() methods, but this feels like an overkill. It also does not quite align with leaf-lists, as we will end up disconnecting related data into two Lists – and we'd need empty metadata instances for leaf-list entries which do not have metadata (which is a minor annoyance).

The secondary problem is transporting metadata across builders and similar – if the metadata object is detached, copy builders break down. This is probably okay, as metadata is not data and hence it probably should not be automatically transportable.

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