import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.slf4j.Logger;
@FunctionalInterface
public interface FallbackConfigProvider {
- NormalizedNode<?,?> get(SchemaContext schemaContext, DataSchemaNode dataSchema) throws IOException,
+ NormalizedNode<?,?> get(EffectiveModelContext schemaContext, DataSchemaNode dataSchema) throws IOException,
XMLStreamException, ParserConfigurationException, SAXException, URISyntaxException;
}
checkNotNull(schemaService, "%s: Could not obtain the SchemaService OSGi service", logName);
- SchemaContext schemaContext = schemaService.getGlobalContext();
+ EffectiveModelContext schemaContext = schemaService.getGlobalContext();
Module module = schemaContext.findModule(bindingContext.bindingQName.getModule()).orElse(null);
checkNotNull(module, "%s: Could not obtain the module schema for namespace %s, revision %s",
logName, bindingContext.bindingQName.getNamespace(), bindingContext.bindingQName.getRevision());
- DataSchemaNode dataSchema = module.getDataChildByName(bindingContext.bindingQName);
+ QName qname = bindingContext.bindingQName;
+ DataSchemaNode dataSchema = module.findDataChildByName(qname).orElseThrow(
+ () -> new ConfigXMLReaderException(logName + ": Could not obtain the schema for " + qname));
+
checkNotNull(dataSchema, "%s: Could not obtain the schema for %s", logName, bindingContext.bindingQName);
checkCondition(bindingContext.schemaType.isAssignableFrom(dataSchema.getClass()),
}
}
- private NormalizedNode<?, ?> parsePossibleDefaultAppConfigXMLFile(final SchemaContext schemaContext,
+ private NormalizedNode<?, ?> parsePossibleDefaultAppConfigXMLFile(final EffectiveModelContext schemaContext,
final DataSchemaNode dataSchema) throws ConfigXMLReaderException {
String appConfigFileName = defaultAppConfigFileName;