diff options
author | Arul.Nambi <arul.nambi@amdocs.com> | 2018-12-13 15:34:17 -0500 |
---|---|---|
committer | Arul.Nambi <arul.nambi@amdocs.com> | 2018-12-14 10:30:26 -0500 |
commit | 885545697c79b299a372956b1b368e13bab3426c (patch) | |
tree | 9be5faaf897bbd03eb700760e9da5ba436e4c0c4 /sparkybe-onap-service/src | |
parent | 53d13ff36532723582f55febce79de2282e46cde (diff) |
Updating the new schema service ingest
Issue-ID: AAI-2006
Change-Id: I25360ea42d1e09ada6af00dbe99ceace978ee09a
Signed-off-by: Arul.Nambi <arul.nambi@amdocs.com>
Diffstat (limited to 'sparkybe-onap-service/src')
7 files changed, 22 insertions, 15 deletions
diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelLoader.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelLoader.java index 7ad01c7..a5c1525 100644 --- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelLoader.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelLoader.java @@ -29,7 +29,10 @@ import org.onap.aai.nodes.NodeIngestor; import org.onap.aai.setup.SchemaVersion; import org.onap.aai.setup.SchemaVersions; import org.onap.aai.sparky.logging.AaiUiMsgs; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +@Component("oxmModelLoader") public class OxmModelLoader { private static final Logger LOG = LoggerFactory.getInstance().getLogger(OxmModelLoader.class); @@ -48,16 +51,14 @@ public class OxmModelLoader { private NodeIngestor nodeIngestor; - public OxmModelLoader(String apiVersionOverride, Set<OxmModelProcessor> oxmModelProcessors, NodeIngestor nodeIngestor) { + public OxmModelLoader(String apiVersionOverride, Set<OxmModelProcessor> oxmModelProcessors) { this.oxmApiVersion = new SchemaVersion(apiVersionOverride); this.processors = oxmModelProcessors; - this.nodeIngestor = nodeIngestor; } - public OxmModelLoader(Set<OxmModelProcessor> oxmModelProcessors, NodeIngestor nodeIngestor, SchemaVersions schemaVersions) { + public OxmModelLoader(Set<OxmModelProcessor> oxmModelProcessors, SchemaVersions schemaVersions) { this.oxmApiVersion = schemaVersions.getDefaultVersion(); this.processors = oxmModelProcessors; - this.nodeIngestor = nodeIngestor; } public SchemaVersion getOxmApiVersion() { @@ -66,6 +67,15 @@ public class OxmModelLoader { + public NodeIngestor getNodeIngestor() { + return nodeIngestor; + } + + @Autowired + public void setNodeIngestor(NodeIngestor nodeIngestor) { + this.nodeIngestor = nodeIngestor; + } + /** * Load an oxm model. * diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizerTest.java index 8a83ca7..02d27f3 100644 --- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizerTest.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizerTest.java @@ -171,7 +171,8 @@ public class AutosuggestionSynchronizerTest { suggestionEntityLookup = new SuggestionEntityLookup(filtersConfig); processors.add(suggestionEntityLookup); - OxmModelLoader oxmModelLoader = new OxmModelLoader("v11", processors,nodeInjest); + OxmModelLoader oxmModelLoader = new OxmModelLoader("v11", processors); + oxmModelLoader.setNodeIngestor(nodeInjest); oxmModelLoader.loadModel(); diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/ActiveInventoryAdapterTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/ActiveInventoryAdapterTest.java index 6ec7513..d01c5bb 100644 --- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/ActiveInventoryAdapterTest.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/ActiveInventoryAdapterTest.java @@ -22,7 +22,7 @@ public class ActiveInventoryAdapterTest { @Before public void init() throws Exception { - oxmModelLoader = new OxmModelLoader("v11",null,null); + oxmModelLoader = new OxmModelLoader("v11",null); oxmEntityLookup = new OxmEntityLookup(); endpointConfig = new RestEndpointConfig(); queryParams = new ArrayList<String>(); diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/GizmoEntitySummarizer.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/GizmoEntitySummarizer.java index 435fbfb..b245943 100644 --- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/GizmoEntitySummarizer.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/GizmoEntitySummarizer.java @@ -71,7 +71,6 @@ public class GizmoEntitySummarizer { gizmoConfig.setValidateServerHostname(false); gizmoAdapter = new GizmoAdapter(oxmModelLoader, gizmoConfig); - gizmoAdapter.setInventoryBasePath("/services/inventory/v12/"); gizmoAdapter.setRelationshipsBasePath("/services/inventory/relationships/v12/"); diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/OxmModelAndProcessorHelper.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/OxmModelAndProcessorHelper.java index 0c72f33..fa05d71 100644 --- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/OxmModelAndProcessorHelper.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/OxmModelAndProcessorHelper.java @@ -56,7 +56,7 @@ public class OxmModelAndProcessorHelper { processors.add(searchableEntityLookup); processors.add(suggestionEntityLookup); processors.add(oxmEntityContainerLookup); - this.modelLoader = new OxmModelLoader(API_VERSION_OVERRIDE, processors, null); + this.modelLoader = new OxmModelLoader(API_VERSION_OVERRIDE, processors); } diff --git a/sparkybe-onap-service/src/test/resources/oxm-reader/oxm-reader-bean.xml b/sparkybe-onap-service/src/test/resources/oxm-reader/oxm-reader-bean.xml index 3722fdd..76e5f17 100644 --- a/sparkybe-onap-service/src/test/resources/oxm-reader/oxm-reader-bean.xml +++ b/sparkybe-onap-service/src/test/resources/oxm-reader/oxm-reader-bean.xml @@ -57,8 +57,7 @@ init-method="loadModel"> <!-- <constructor-arg name="apiVersionOverride" value="V11" /> --> <constructor-arg ref="oxmModelProcessorSet" /> - <constructor-arg ref="nodeIngestor" /> - <constructor-arg ref="schemaVersions" /> + <constructor-arg ref="schemaVersions" /> </bean> </beans>
\ No newline at end of file diff --git a/sparkybe-onap-service/src/test/resources/oxm-reader/sparky-core.xml b/sparkybe-onap-service/src/test/resources/oxm-reader/sparky-core.xml index 3a811ed..28ad9b4 100644 --- a/sparkybe-onap-service/src/test/resources/oxm-reader/sparky-core.xml +++ b/sparkybe-onap-service/src/test/resources/oxm-reader/sparky-core.xml @@ -59,12 +59,10 @@ <property name="nodeDirectory" value="bundleconfig-local/etc/oxm/" /> <property name="edgeDirectory" value="bundleconfig-local/etc/oxm/" /> </bean> - - <bean id="schemaVersions" class="org.onap.aai.setup.SchemaVersions"/> - + <bean id="oxmConfigTranslator" class="org.onap.aai.setup.AAIConfigTranslator"> - <constructor-arg ref="schemaLocationsBean" /> - <constructor-arg ref="schemaVersions" /> + <constructor-arg ref="schemaLocationsBean" /> + <constructor-arg ref="schemaVersions" /> </bean> <bean id="nodeIngestor" class="org.onap.aai.nodes.NodeIngestor"> |