- static String convertCompositeNodeDataAndYangToJson(CompositeNode compositeNode, String yangPath, String outputPath) {
- return convertCompositeNodeDataAndYangToJson(compositeNode, yangPath, outputPath, null, null);
- }
-
- static String convertCompositeNodeDataAndYangToJson(CompositeNode compositeNode, String yangPath,
- String outputPath, String searchedModuleName, String searchedDataSchemaName) {
- Set<Module> modules = resolveModules(yangPath);
- Module module = resolveModule(searchedModuleName, modules);
- DataSchemaNode dataSchemaNode = resolveDataSchemaNode(module, searchedDataSchemaName);
-
- try {
- return writeCompNodeWithSchemaContextToJson(compositeNode, outputPath, modules, dataSchemaNode);
- } catch (WebApplicationException | IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
+ /**
+ *
+ * Fill missing data (namespaces) and build correct data type in
+ * {@code compositeNode} according to {@code dataSchemaNode}. The method
+ * {@link RestconfImpl#createConfigurationData createConfigurationData} is
+ * used because it contains calling of method {code normalizeNode}
+ */
+ public static void normalizeCompositeNode(CompositeNode compositeNode, Set<Module> modules, String schemaNodePath) {
+ RestconfImpl restconf = RestconfImpl.getInstance();
+ ControllerContext.getInstance().setSchemas(TestUtils.loadSchemaContext(modules));