- public SchemaContext parseAndValidateModel(final File yangModelFile) {
- try {
- return YangUtils.parseYangModelFile(yangModelFile);
- } catch (final YangParserException e) {
- throw new CpsValidationException("Yang file validation failed", e.getMessage());
- } catch (final IOException e) {
- throw new CpsException(e);
- }
+ public void createSchemaSetFromModules(final String dataspaceName, final String schemaSetName,
+ final Map<String, String> newYangResourcesModuleNameToContentMap,
+ final List<ModuleReference> moduleReferences) {
+ cpsModulePersistenceService.storeSchemaSetFromModules(dataspaceName, schemaSetName,
+ newYangResourcesModuleNameToContentMap, moduleReferences);
+
+ }
+
+ @Override
+ public SchemaSet getSchemaSet(final String dataspaceName, final String schemaSetName) {
+ final var yangTextSchemaSourceSet = yangTextSchemaSourceSetCache
+ .get(dataspaceName, schemaSetName);
+ return SchemaSet.builder().name(schemaSetName).dataspaceName(dataspaceName)
+ .extendedModuleReferences(yangTextSchemaSourceSet.getModuleReferences()).build();