diff options
author | 2018-12-31 10:54:12 -0500 | |
---|---|---|
committer | 2018-12-31 12:06:15 -0500 | |
commit | cf65b483f546a9ed3e08f9417670d10122f46ab8 (patch) | |
tree | 02135da13646b7ab9b0fd4035be491fe1086923a /src/main/java/org/onap | |
parent | 5bbb6ae6045ca45b6bb40387276e94451db9ac9f (diff) |
Update router core new schema ingest lib
Issue-ID: AAI-2043
Change-Id: I609f548cf7fd6a28f041d39b1a68f7a2f01095fb
Signed-off-by: jjia <Jennie.Jia@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r-- | src/main/java/org/onap/aai/schema/OxmModelLoader.java | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/main/java/org/onap/aai/schema/OxmModelLoader.java b/src/main/java/org/onap/aai/schema/OxmModelLoader.java index bd64f3e..67e53bc 100644 --- a/src/main/java/org/onap/aai/schema/OxmModelLoader.java +++ b/src/main/java/org/onap/aai/schema/OxmModelLoader.java @@ -32,11 +32,10 @@ import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.aai.logging.RouterCoreMsgs; import org.onap.aai.util.ExternalOxmModelProcessor; import org.onap.aai.nodes.NodeIngestor; -import org.onap.aai.setup.ConfigTranslator; import org.onap.aai.setup.SchemaLocationsBean; import org.onap.aai.setup.SchemaVersion; import org.onap.aai.setup.SchemaVersions; -import org.onap.aai.setup.AAIConfigTranslator; + public class OxmModelLoader { @@ -46,19 +45,19 @@ public class OxmModelLoader { private static final org.onap.aai.cl.api.Logger logger = LoggerFactory.getInstance().getLogger(OxmModelLoader.class.getName()); - private OxmModelLoader() { - throw new IllegalStateException("Utility class"); + private static NodeIngestor nodeIngestor; + + private OxmModelLoader(NodeIngestor setNodeIngestor) { + nodeIngestor = setNodeIngestor; } public static synchronized void loadModels(SchemaVersions schemaVersions, SchemaLocationsBean schemaLocationsBean) { - ConfigTranslator configTranslator = new AAIConfigTranslator(schemaLocationsBean, schemaVersions); - NodeIngestor nodeIngestor = new NodeIngestor(configTranslator); for (SchemaVersion oxmVersion : schemaVersions.getVersions()) { - DynamicJAXBContext jaxbContext = nodeIngestor.getContextForVersion(oxmVersion); - if (jaxbContext != null) { - loadModel(oxmVersion.toString(), jaxbContext); - } + DynamicJAXBContext jaxbContext = nodeIngestor.getContextForVersion(oxmVersion); + if (jaxbContext != null) { + loadModel(oxmVersion.toString(), jaxbContext); + } } } @@ -86,6 +85,14 @@ public class OxmModelLoader { return versionContextMap; } + public static NodeIngestor getNodeIngestor() { + return nodeIngestor; + } + + public static void setNodeIngestor(NodeIngestor nodeIngestor) { + OxmModelLoader.nodeIngestor = nodeIngestor; + } + private static synchronized void loadModel(String oxmVersion, DynamicJAXBContext jaxbContext) { versionContextMap.put(oxmVersion, jaxbContext); if (oxmModelProcessorRegistry != null) { |