import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack;
// FIXME: remove this class
// Hidden on purpose
}
- public static @NonNull Entry<InstanceIdentifierContext<OperationsContainerSchemaNode>, ContainerNode>
+ public static @NonNull Entry<InstanceIdentifierContext, ContainerNode>
contextForModelContext(final @NonNull SchemaContext context, final @Nullable DOMMountPoint mountPoint) {
// Determine which modules we need and construct leaf schemas to correspond to all RPC definitions
final Collection<Module> modules = new ArrayList<>();
final DataContainerNodeBuilder<NodeIdentifier, ContainerNode> operationsBuilder = Builders.containerBuilder()
.withNodeIdentifier(new NodeIdentifier(OperationsContainerSchemaNode.QNAME));
for (final OperationsLeafSchemaNode leaf : rpcLeafSchemas) {
- operationsBuilder.withChild(ImmutableNodes.leafNode(leaf.getQName(), Empty.getInstance()));
+ operationsBuilder.withChild(ImmutableNodes.leafNode(leaf.getQName(), Empty.value()));
}
- return Map.entry(new InstanceIdentifierContext<>(null, operatationsSchema, mountPoint,
- new OperationsEffectiveModuleContext(ImmutableSet.copyOf(modules))), operationsBuilder.build());
+ final var opContext = new OperationsEffectiveModuleContext(ImmutableSet.copyOf(modules));
+ final var stack = SchemaInferenceStack.of(opContext);
+ stack.enterSchemaTree(operatationsSchema.getQName());
+
+ return Map.entry(InstanceIdentifierContext.ofStack(stack, mountPoint), operationsBuilder.build());
}
}