Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1412

Add DataSchemaContextTree/SchemaInferenceStack integration


      The removal of SchemaNode.getPath() leaves a nasty gap in our integration with yang.data.api: there is no alternative to initialize a SchemaInferenceStack when have a YangInstanceIdentifier. DataSchemaContextTree can be used to locate the corresponding DataSchemaNode, but there is not sufficient information exposed to tie that lookup to a SchemaNodeIdentifier.Absolute path.

      There is a secondary issue, which directly impacts NETCONF-818, which is that there is no avenue to build up a YangInstanceIdentifier and also build up the corresponding SchemaInferenceStack state.

      Both of these facilities are available indirectly by means of DataSchemaContextNode.getDataSchemaNode().getPath() – an avenue not available since 8.0.0.

      Provide extend DataSchemaContextNode to provide

      DataSchemaContextNode<?> enterChild(SchemaInferenceStack stack, PathArgument child);
      DataSchemaContextNode<?> enterChild(SchemaInferenceStack stack, QName child);

      both of which work just as getChild(), except it also push the appropriate instruction into provided stack.

      Also provide a DataSchemaContextTree.enterPath(YangInstanceIdentifier), which will provide a both a context node and an initialized SchemaInferenceStack.

            rovarga Robert Varga
            rovarga Robert Varga
            0 Vote for this issue
            1 Start watching this issue