[MDSAL-45] InstanceIdentifier does not properly capture choice-case child relationship Created: 28/Aug/14 Updated: 22/Jun/18 Resolved: 22/Jun/18 |
|
| Status: | Resolved |
| Project: | mdsal |
| Component/s: | Binding API, Binding codegen |
| Affects Version/s: | None |
| Fix Version/s: | Fluorine |
| Type: | Improvement | ||
| Reporter: | Dana Kutenicsova | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
yang model: augment "<path>tables/routes" { Works fine with InstanceIdentifier constructed like this: iid = InstanceIdentifier.create(..).child(Tables.class, new TablesKey(..)) But when the container is moved to grouping: grouping linkstate-routes { } augment "<path>tables/routes" { The instance identifier gives following compilation error: Bound mismatch: The generic method child(Class<N>) of type InstanceIdentifier<T> is not applicable for the arguments (Class<LinkstateRoutes>). The inferred type LinkstateRoutes is not a valid substitute for the bounded parameter <N extends ChildOf<? super Tables>> |
| Comments |
| Comment by Robert Varga [ 23/May/18 ] |
|
I think the solution to this conundrum lies with
This is slightly confusing, though, as suddenly it looks like you should be able to read the case node directly from the data store... Which you probably don't want |
| Comment by Robert Varga [ 23/May/18 ] |
|
Thinking about it a bit more, we really need a new marker interfaces:
Then we need a new InstanceIdentifierBuilder method, which will have a prototype like: <C extends ChoiceIn<? super T>, N extends ChildOf<? super C> InstanceIdentifierBuilder<N> caseChild(Class<C> caze, Class<N> child); Hence access to a case's children (which is the problem here) is solved. This does not solve the problem addressing choices or their cases themselves. |
| Comment by Robert Varga [ 23/May/18 ] |
|
To fix that problem, one of the two needs to budge:
The first is not really an option, as DataObject guarantees implementation, whereas there can be no implementation for a choice. That leaves us with 2) as the only option. That should work, as DataContainers are not subject of ChildOf, hence if you jump to a choice in InstanceIdentifierBuilder, you are stuck and cannot move down. This is fine for read/write, as you can move towards a particular case instantiation (which is a dataobject) via checking 'instanceof'. The problem here, though, is DataTreeChangeListeners and |
| Comment by Robert Varga [ 23/May/18 ] |
|
Hence let's focus this issue on solving addressing case/grouping children. |