[MDSAL-820] Update mdsal-binding-dom-{codec,adapter} to deal with AugmentationNode being removed Created: 29/Mar/23 Updated: 30/Aug/23 Resolved: 28/May/23 |
|
| Status: | Resolved |
| Project: | mdsal |
| Component/s: | Binding runtime |
| Affects Version/s: | None |
| Fix Version/s: | 12.0.0 |
| Type: | Task | Priority: | High |
| Reporter: | Robert Varga | Assignee: | Ruslan Kashapov |
| Resolution: | Done | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Epic Link: | Redesign NormalizedNode | ||||||||||||
| Description |
|
Update mdsal-binding-dom-codec to properly split an incoming NormalizedNode into its component augmentations (in the NormalizedNode->Binding direction) and assemble them back (in the Binding->NormalizedNode direction). This requires some thought around how AugmentationNodeContext really works: we certainly cannot provide DataContainerCodecPrototype.yangArg() as there is no AugmentationIdentifier anymore. Update mdsal-binding-dom-adapter's DataBroker adaptor to deal with read/merge/put operations involving InstanceIdentifiers ending with an augmentation class: these are not directly mappable to DOMDataBroker operations and need to be adapted. For example read() means read the parent and filter out only the children which are part of the requested augmentation. A put() means put()ing all present leaves and deleting all leaves that are part of the augmentation schema, but are missing in the provided augmentation data. |
| Comments |
| Comment by Robert Varga [ 20/Apr/23 ] |
|
So digging into the problems here, we need to start with mdsal-binding-dom-codec-api, specifically with BindingCodecTreeNode hierarchy. BindingCodecTreeNode is okay, as it only exposes underlying yang.model.api contract. BindingDataObjectCodecTreeNode is where the trouble starts. Aside from specilizing the corresponding class to a DataObject, it also implies there is a corresponding yang.data.api.schema contract, namely:
So that gives us three items to look into
The second order of business is BindingNormalizedNodeCodec itself. As such it assumes a 1:1 mapping for all BindingObjects, i.e. there is a NormalizedNode which holds the equivalent data. In and of itself this is okay, as that is true for most constructs, but here we are looking for something different:
The second point is important for mdsal-binding-dom-adaptor, as it needs to recognize this fact and deal with translating whatever mdsal-binding-api operation is being mirrored to mdsal-dom-api. We therefore have to have a type-safe way of discerning the two cases (which ties back to item 2. above). |