use of org.onap.aai.setup.ConfigTranslator in project aai-aai-common by onap.
the class NodeIngestor method translateAll.
private void translateAll(Translator translator) throws ExceptionInInitializerError {
if (translator instanceof ConfigTranslator) {
this.localSchema = "true";
}
Boolean retrieveLocalSchema = Boolean.parseBoolean(this.localSchema);
/*
* Set this to default schemaVersion
*/
this.schemaVersions = translator.getSchemaVersions();
List<SchemaVersion> schemaVersionList = translator.getSchemaVersions().getVersions();
try {
for (SchemaVersion version : schemaVersionList) {
LOGGER.debug("Version being processed" + version);
List<InputStream> inputStreams = retrieveOXM(version, translator);
LOGGER.debug("Retrieved OXMs from SchemaService");
/*
* IOUtils.copy and copy the inputstream
*/
if (inputStreams.isEmpty()) {
continue;
}
final DynamicJAXBContext ctx = ingest(inputStreams);
versionContextMap.put(version, ctx);
setAllTypesAndProperties(version, inputStreams);
schemaPerVersion.put(version, createCombinedSchema(inputStreams, version, retrieveLocalSchema));
}
} catch (JAXBException | ParserConfigurationException | SAXException | IOException e) {
throw new ExceptionInInitializerError(e);
}
}
Aggregations