+ Set<Module> modules = null;
+ DOMMountPoint mountPoint = null;
+ final SchemaContextRef ref = new SchemaContextRef(this.schemaContextHandler.get());
+ if (identifier.contains(RestconfConstants.MOUNT)) {
+ final InstanceIdentifierContext<?> mountPointIdentifier = ParserIdentifier.toInstanceIdentifier(identifier,
+ ref.get());
+ mountPoint = mountPointIdentifier.getMountPoint();
+ modules = ref.getModules(mountPoint);
+
+ } else {
+ final String errMsg = "URI has bad format. If operations behind mount point should be showed, URI has to end with ";
+ LOG.debug(errMsg + ControllerContext.MOUNT + " for " + identifier);
+ throw new RestconfDocumentedException(errMsg + ControllerContext.MOUNT, ErrorType.PROTOCOL,
+ ErrorTag.INVALID_VALUE);
+ }
+
+ return getOperations(modules, mountPoint);
+ }
+
+ /**
+ * Special case only for GET restconf/operations use (since moment of old
+ * Yang parser and old Yang model API removal). The method is creating fake
+ * schema context with fake module and fake data by use own implementations
+ * of schema nodes and module.
+ *
+ * @param modules
+ * - set of modules for get RPCs from every module
+ * @param mountPoint
+ * - mount point, if in use otherwise null
+ * @return {@link NormalizedNodeContext}
+ */
+ private static NormalizedNodeContext getOperations(final Set<Module> modules, final DOMMountPoint mountPoint) {
+ final ContainerSchemaNodeImpl fakeCont = new ContainerSchemaNodeImpl();
+ final List<LeafNode<Object>> listRpcNodes = new ArrayList<>();
+ for (final Module m : modules) {
+ for (final RpcDefinition rpc : m.getRpcs()) {
+
+ final LeafSchemaNode fakeLeaf = new LeafSchemaNodeImpl(fakeCont.getPath(),
+ QName.create(ModuleImpl.moduleQName, m.getName() + ":" + rpc.getQName().getLocalName()));
+ fakeCont.addNodeChild(fakeLeaf);
+ listRpcNodes.add(Builders.leafBuilder(fakeLeaf).build());
+ }
+ }
+ final ContainerSchemaNode fakeContSchNode = fakeCont;
+ final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> containerBuilder = Builders
+ .containerBuilder(fakeContSchNode);
+
+ for (final LeafNode<Object> rpcNode : listRpcNodes) {
+ containerBuilder.withChild(rpcNode);
+ }
+
+ final Module fakeModule = new ModuleImpl(fakeContSchNode);
+
+ final Set<Module> fakeModules = new HashSet<>();
+ fakeModules.add(fakeModule);
+ final SchemaContext fakeSchemaCtx = EffectiveSchemaContext.resolveSchemaContext(fakeModules);
+ final InstanceIdentifierContext<ContainerSchemaNode> instanceIdentifierContext = new InstanceIdentifierContext<>(
+ null, fakeContSchNode, mountPoint, fakeSchemaCtx);
+ return new NormalizedNodeContext(instanceIdentifierContext, containerBuilder.build());