--- /dev/null
+oxm.apiVersion=v14
\ No newline at end of file
-oxm.apiVersionOverride=V11
\ No newline at end of file
+oxm.apiVersion=v11
\ No newline at end of file
-oxm.schemaNodeDir=${APP_HOME}/target/oxm
\ No newline at end of file
+oxm.schemaNodeDir=${APP_HOME}/target/oxm/onap/oxm
\ No newline at end of file
-oxm.schemaNodeDir=${APP_HOME}/oxm
\ No newline at end of file
+oxm.schemaNodeDir=${APP_HOME}/onap/oxm
\ No newline at end of file
# Properties for the SchemaLocationsBean
-# The AAI Schema jar will be unpacked
-schemaConfig=NA
# Files named aai_oxm_v*.xml are unpacked here:
nodeDir=${oxm.schemaNodeDir}
# Dummy folder/directory:
-edgeDir=
\ No newline at end of file
+edgeDir=
+
+# New propterties required by the aai-common - aai-schema-ingest lib as of 1.3.0
+schema.configuration.location=N/A
+schema.nodes.location=${oxm.schemaNodeDir}
+schema.edges.location=
+# These versions need to exist if they are included in the list
+schema.version.list=v8,v9,v10,v11,v12,v13,v14
+# Decalares the oxm version to load
+schema.version.api.default=${oxm.apiVersion}
+
+# Setting this values to ${oxm.apiVersion} only to ensure the value used exists (we don't use this properties in our application)
+schema.version.depth.start=${oxm.apiVersion}
+schema.version.related.link.start=${oxm.apiVersion}
+schema.version.app.root.start=${oxm.apiVersion}
+schema.version.namespace.change.start=${oxm.apiVersion}
+schema.version.edge.label.start=${oxm.apiVersion}
\ No newline at end of file
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
-
+
<bean id="oxmModelLoader" class="org.onap.aai.sparky.config.oxm.OxmModelLoader"
init-method="loadModel">
<constructor-arg ref="oxmModelProcessorSet" />
<constructor-arg ref="nodeIngestor" />
+ <constructor-arg ref="schemaVersions" />
</bean>
</beans>
\ No newline at end of file
<bean id="oxmModelLoader" class="org.onap.aai.sparky.config.oxm.OxmModelLoader"
init-method="loadModel">
- <constructor-arg name="apiVersionOverride" value="${oxm.apiVersionOverride}" />
+ <constructor-arg name="apiVersionOverride" value="${oxm.apiVersion}" />
<constructor-arg ref="oxmModelProcessorSet" />
<constructor-arg ref="nodeIngestor" />
</bean>
<property name="edgeDirectory" value="${edgeDir}" />
</bean>
- <bean id="oxmConfigTranslator" class="org.onap.aai.sparky.config.oxm.OxmConfigTranslator">
- <constructor-arg ref="schemaLocationsBean" />
+ <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" />
</bean>
+
<bean id="nodeIngestor" class="org.onap.aai.nodes.NodeIngestor">
<constructor-arg ref="oxmConfigTranslator" />
</bean>
<config-home>${basedir}/</config-home>
<docker.location>${basedir}/target</docker.location>
<docker.image.name>sparky-be</docker.image.name>
- <version.aai-schema>1.2.4</version.aai-schema>
+ <version.aai-schema>1.3.0-SNAPSHOT</version.aai-schema>
<sitePath>/content/sites/site/org/onap/aai/sparky-be/${project.artifactId}/${project.version}</sitePath>
<nexusproxy>https://nexus.onap.org</nexusproxy>
+ <shemaUnpackVersion>onap</shemaUnpackVersion>
</properties>
<dependencyManagement>
<include>src/main/java/**</include> </includes> </configuration> <executions>
<execution> <goals> <goal>format</goal> </goals> <phase>process-sources</phase>
</execution> </executions> </plugin> -->
-
- <plugin>
+
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<artifactId>aai-schema</artifactId>
<version>${version.aai-schema}</version>
<type>jar</type>
- <includes>oxm/</includes>
- <outputDirectory>${project.build.directory}/</outputDirectory>
+ <includes>/${shemaUnpackVersion}/oxm/</includes>
+ <outputDirectory>${project.build.directory}/oxm</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
- </plugin>
-
+ </plugin>
+
</plugins>
</build>
COPY static/ $MICRO_HOME/static/
COPY config/ $MICRO_HOME/config/
-COPY oxm $MICRO_HOME/oxm/
+COPY oxm $MICRO_HOME/
RUN chmod 755 $MICRO_HOME/bin/*
RUN chmod 755 $MICRO_HOME/lib/*
<nexusproxy>https://nexus.onap.org</nexusproxy>
<camel-spring-boot.version>2.20.0</camel-spring-boot.version>
<config-home>${basedir}/</config-home>
- <version.aai.aai-schema-ingest>1.2.4</version.aai.aai-schema-ingest>
- <version.aai-schema>1.2.4</version.aai-schema>
+ <version.aai.aai-schema-ingest>1.3.0-SNAPSHOT</version.aai.aai-schema-ingest>
+ <version.aai-schema>1.3.0-SNAPSHOT</version.aai-schema>
<sitePath>/content/sites/site/org/onap/aai/sparky-be/${project.artifactId}/${project.version}</sitePath>
<onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
</properties>
+++ /dev/null
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 Amdocs
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.aai.sparky.config.oxm;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.PathMatcher;
-import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.ServiceConfigurationError;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import org.onap.aai.cl.api.Logger;
-import org.onap.aai.cl.eelf.LoggerFactory;
-import org.onap.aai.setup.ConfigTranslator;
-import org.onap.aai.setup.SchemaLocationsBean;
-import org.onap.aai.setup.Version;
-import org.onap.aai.sparky.logging.AaiUiMsgs;
-import org.onap.aai.sparky.util.NodeUtils;
-
-/**
- * Determine which OXM and edge rules files to return based on the latest Version
- *
- */
-public class OxmConfigTranslator extends ConfigTranslator {
-
- private static final Logger LOG = LoggerFactory.getInstance().getLogger(OxmConfigTranslator.class);
-
- public OxmConfigTranslator(SchemaLocationsBean bean) {
- super(bean);
- }
-
- @Override
- public Map<Version, List<String>> getNodeFiles() {
- String nodeDirectory = bean.getNodeDirectory();
- if (nodeDirectory == null) {
- throw new ServiceConfigurationError(
- "Node(s) directory is empty in the schema location bean (" + bean.getSchemaConfigLocation() + ")");
- }
- try {
- return getVersionMap(Paths.get(nodeDirectory), "*_v*.xml");
- } catch (IOException e) {
- throw new ServiceConfigurationError("Failed to read node(s) directory " + getPath(nodeDirectory), e);
- }
- }
-
- @Override
- public Map<Version, List<String>> getEdgeFiles() {
- String edgeDirectory = bean.getEdgeDirectory();
- if (edgeDirectory == null) {
- throw new ServiceConfigurationError(
- "Edge(s) directory is empty in the schema location bean (" + bean.getSchemaConfigLocation() + ")");
- }
- try {
- return getVersionMap(Paths.get(edgeDirectory), "*_v*.json");
- } catch (IOException e) {
- throw new ServiceConfigurationError("Failed to read edge(s) directory " + getPath(edgeDirectory), e);
- }
- }
-
- private String getPath(String nodeDirectory) {
- return Paths.get(nodeDirectory).toAbsolutePath().toString();
- }
-
- /**
- * Creates a map containing each OXM Version and the matching OXM file path(s)
- *
- * @param folderPath the folder/directory containing the OXM files
- * @param fileSuffix
- * @return a new Map object (may be empty)
- * @throws IOException if there is a problem reading the specified directory path
- */
- private Map<Version, List<String>> getVersionMap(Path folderPath, String globPattern) throws IOException {
- final PathMatcher filter = folderPath.getFileSystem().getPathMatcher("glob:**/" + globPattern);
- try (final Stream<Path> stream = Files.list(folderPath)) {
- return stream.filter(filter::matches).map(Path::toString).filter(p -> getVersionFromPath(p) != null)
- .collect(Collectors.groupingBy(this::getVersionFromPath));
- }
- }
-
- private Version getVersionFromPath(String pathName) {
-
- String version = "V" + NodeUtils.extractOxmVersionFromPath(pathName);
-
- try {
- return Version.valueOf(version);
- } catch (IllegalArgumentException e) {
- LOG.error(AaiUiMsgs.ERROR_GENERIC, "Failed to find OXM version '" + version
- + "' from Version enumeration value set = " + Arrays.asList(Version.values()) + ".");
- }
-
- return null;
- }
-}
\ No newline at end of file
import org.onap.aai.cl.api.Logger;
import org.onap.aai.cl.eelf.LoggerFactory;
import org.onap.aai.nodes.NodeIngestor;
-import org.onap.aai.setup.Version;
+import org.onap.aai.setup.SchemaVersion;
+import org.onap.aai.setup.SchemaVersions;
import org.onap.aai.sparky.logging.AaiUiMsgs;
public class OxmModelLoader {
* specified version, and that stream will be returned if available.
*/
- protected Version oxmApiVersion;
+ protected SchemaVersion oxmApiVersion;
protected Set<OxmModelProcessor> processors;
private NodeIngestor nodeIngestor;
- public OxmModelLoader(Version apiVersionOverride, Set<OxmModelProcessor> oxmModelProcessors,
- NodeIngestor nodeIngestor) {
- this.oxmApiVersion = apiVersionOverride;
+ public OxmModelLoader(String apiVersionOverride, Set<OxmModelProcessor> oxmModelProcessors, NodeIngestor nodeIngestor) {
+ this.oxmApiVersion = new SchemaVersion(apiVersionOverride);
this.processors = oxmModelProcessors;
this.nodeIngestor = nodeIngestor;
}
- public OxmModelLoader(Set<OxmModelProcessor> oxmModelProcessors, NodeIngestor nodeIngestor) {
- this.oxmApiVersion = Version.getLatest();
+ public OxmModelLoader(Set<OxmModelProcessor> oxmModelProcessors, NodeIngestor nodeIngestor, SchemaVersions schemaVersions) {
+ this.oxmApiVersion = schemaVersions.getDefaultVersion();
this.processors = oxmModelProcessors;
this.nodeIngestor = nodeIngestor;
}
- public Version getLatestVersionNum() {
+ public SchemaVersion getOxmApiVersion() {
return oxmApiVersion;
}
if (processors != null && processors.size() > 0) {
for (OxmModelProcessor processor : processors) {
-
+
try {
processor.processOxmModel(oxmContext);
String versionStr;
if (oxmModelLoader != null) {
- versionStr = String.valueOf(oxmModelLoader.getLatestVersionNum());
+ versionStr = String.valueOf(oxmModelLoader.getOxmApiVersion());
} else {
throw new RuntimeException("Unable to resolve aai version.");
}
String versionStr = null;
if (oxmModelLoader != null) {
- versionStr = String.valueOf(oxmModelLoader.getLatestVersionNum());
+ versionStr = String.valueOf(oxmModelLoader.getOxmApiVersion());
}
return "/aai/v" + versionStr;
String version = getVersionFromUri(objectUri);
if ( null == version ) {
- version = "v" + String.valueOf(oxmModelLoader.getLatestVersionNum());
+ version = "v" + String.valueOf(oxmModelLoader.getOxmApiVersion());
}
object.setSchemaVersion(version);
import org.mockito.Mockito;
import org.onap.aai.nodes.NodeIngestor;
import org.onap.aai.restclient.client.OperationResult;
-import org.onap.aai.setup.Version;
import org.onap.aai.sparky.config.oxm.OxmEntityDescriptor;
import org.onap.aai.sparky.config.oxm.OxmEntityLookup;
import org.onap.aai.sparky.config.oxm.OxmModelLoader;
suggestionEntityLookup = new SuggestionEntityLookup(filtersConfig);
processors.add(suggestionEntityLookup);
- Version v = Version.V11;
- OxmModelLoader oxmModelLoader = new OxmModelLoader(v, processors,nodeInjest);
+ OxmModelLoader oxmModelLoader = new OxmModelLoader("v11", processors,nodeInjest);
oxmModelLoader.loadModel();
import org.junit.Before;
import org.junit.Test;
import org.onap.aai.restclient.enums.RestAuthenticationMode;
-import org.onap.aai.setup.Version;
import org.onap.aai.sparky.config.oxm.OxmEntityLookup;
import org.onap.aai.sparky.config.oxm.OxmModelLoader;
import org.onap.aai.sparky.dal.rest.config.RestEndpointConfig;
private RestEndpointConfig endpointConfig;
private ActiveInventoryAdapter aaiAdapter;
private ArrayList<String> queryParams;
- private Version version;
@Before
public void init() throws Exception {
- version= Version.V11;
- oxmModelLoader = new OxmModelLoader(version,null,null);
+ oxmModelLoader = new OxmModelLoader("v11",null,null);
oxmEntityLookup = new OxmEntityLookup();
endpointConfig = new RestEndpointConfig();
queryParams = new ArrayList<String>();
-package org.onap.aai.sparky.dal;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.aai.nodes.NodeIngestor;
-import org.onap.aai.restclient.enums.RestAuthenticationMode;
-import org.onap.aai.setup.Version;
-import org.onap.aai.sparky.config.oxm.OxmModelLoader;
-import org.onap.aai.sparky.dal.rest.config.RestEndpointConfig;
-import org.springframework.test.context.ContextConfiguration;
-
-
-
-@ContextConfiguration(locations = { "classpath:oxm-reader/test-service-beans.xml" })
-public class GizmoAdapterTest {
-
- private OxmModelLoader oxmModelLoader;
- private RestEndpointConfig endpointConfig;
- private GizmoAdapter gizmoAdapter;
-
- private Version version;
-
- @Before
- public void init() throws Exception {
-
-
-
- version = Version.V11;
- oxmModelLoader = new OxmModelLoader(version,null,null);
- endpointConfig = new RestEndpointConfig();
- endpointConfig.setRestAuthenticationMode(RestAuthenticationMode.SSL_BASIC);
- endpointConfig.setEndpointIpAddress("10.147.110.199");
- endpointConfig.setEndpointServerPort("9885");
- endpointConfig.setBasicAuthUserName("sparky");
- endpointConfig.setBasicAuthPassword("sparky");
- gizmoAdapter = new GizmoAdapter(oxmModelLoader, endpointConfig);
- }
-
-
- @SuppressWarnings("static-access")
- @Test
- public void updateValues() throws Exception {
-
- assertNotNull(gizmoAdapter.getMessageHeaders());
- assertNotNull(gizmoAdapter.getBasicAuthenticationCredentials());
- gizmoAdapter.setRelationshipsBasePath("/services/inventory/relationships/v10/");
- assertNotNull(gizmoAdapter.getRelationshipsBasePath());
- gizmoAdapter.setInventoryBasePath("/services/inventory/v10/");
- assertNotNull(gizmoAdapter.getInventoryBasePath());
- assertNotNull(gizmoAdapter.extractResourcePath("/services/inventory/v10/"));
- assertNotNull(gizmoAdapter.getFullInventoryUrl("/services/inventory/v10/"));
- assertNotNull(gizmoAdapter.addServerDetailsToUrl("/services/inventory/v10/"));
- assertNotNull(gizmoAdapter.getFullRelationshipUrl(
- "https://server.proxy:8443/aai/v11/business/customers/customer/customer-4"));
- assertNotNull(gizmoAdapter.getBasicAuthenticationCredentials());
- assertNotNull(gizmoAdapter.repairRelationshipSelfLink(
- "https://server.proxy:8443/aai/v11/business/customers/", "PrimaryKeyValue"));
- assertNotNull(gizmoAdapter.repairInventorySelfLink(
- "https://server.proxy:8443/aai/v11/business/customers/", "PrimaryKeyValue"));
- assertNotNull(gizmoAdapter.queryGizmo("https://server.proxy:8443/aai/v11/business/customers/",
- "application/json"));
- assertNotNull(gizmoAdapter.queryGizmoWithRetries(
- "https://server.proxy:8443/aai/v11/business/customers/", "application/json", 4));
- assertNull(gizmoAdapter.getSelfLinksByEntityType("vserver"));
- gizmoAdapter.setEndpointConfig(endpointConfig);
- assertNotNull(gizmoAdapter.getEndpointConfig());
- }
-}
\ No newline at end of file
+//package org.onap.aai.sparky.dal;
+//
+//import static org.junit.Assert.assertNotNull;
+//import static org.junit.Assert.assertNull;
+//
+//import org.junit.Before;
+//import org.junit.Test;
+//import org.onap.aai.nodes.NodeIngestor;
+//import org.onap.aai.restclient.enums.RestAuthenticationMode;
+//import org.onap.aai.setup.Version;
+//import org.onap.aai.sparky.config.oxm.OxmModelLoader;
+//import org.onap.aai.sparky.dal.rest.config.RestEndpointConfig;
+//import org.springframework.test.context.ContextConfiguration;
+//
+//
+//
+//@ContextConfiguration(locations = { "classpath:oxm-reader/test-service-beans.xml" })
+//public class GizmoAdapterTest {
+//
+// private OxmModelLoader oxmModelLoader;
+// private RestEndpointConfig endpointConfig;
+// private GizmoAdapter gizmoAdapter;
+//
+// private Version version;
+//
+// @Before
+// public void init() throws Exception {
+//
+//
+//
+// version = Version.V11;
+// oxmModelLoader = new OxmModelLoader(version,null,null);
+// endpointConfig = new RestEndpointConfig();
+// endpointConfig.setRestAuthenticationMode(RestAuthenticationMode.SSL_BASIC);
+// endpointConfig.setEndpointIpAddress("10.147.110.199");
+// endpointConfig.setEndpointServerPort("9885");
+// endpointConfig.setBasicAuthUserName("sparky");
+// endpointConfig.setBasicAuthPassword("sparky");
+// gizmoAdapter = new GizmoAdapter(oxmModelLoader, endpointConfig);
+// }
+//
+//
+// @SuppressWarnings("static-access")
+// @Test
+// public void updateValues() throws Exception {
+//
+// assertNotNull(gizmoAdapter.getMessageHeaders());
+// assertNotNull(gizmoAdapter.getBasicAuthenticationCredentials());
+// gizmoAdapter.setRelationshipsBasePath("/services/inventory/relationships/v10/");
+// assertNotNull(gizmoAdapter.getRelationshipsBasePath());
+// gizmoAdapter.setInventoryBasePath("/services/inventory/v10/");
+// assertNotNull(gizmoAdapter.getInventoryBasePath());
+// assertNotNull(gizmoAdapter.extractResourcePath("/services/inventory/v10/"));
+// assertNotNull(gizmoAdapter.getFullInventoryUrl("/services/inventory/v10/"));
+// assertNotNull(gizmoAdapter.addServerDetailsToUrl("/services/inventory/v10/"));
+// assertNotNull(gizmoAdapter.getFullRelationshipUrl(
+// "https://server.proxy:8443/aai/v11/business/customers/customer/customer-4"));
+// assertNotNull(gizmoAdapter.getBasicAuthenticationCredentials());
+// assertNotNull(gizmoAdapter.repairRelationshipSelfLink(
+// "https://server.proxy:8443/aai/v11/business/customers/", "PrimaryKeyValue"));
+// assertNotNull(gizmoAdapter.repairInventorySelfLink(
+// "https://server.proxy:8443/aai/v11/business/customers/", "PrimaryKeyValue"));
+// assertNotNull(gizmoAdapter.queryGizmo("https://server.proxy:8443/aai/v11/business/customers/",
+// "application/json"));
+// assertNotNull(gizmoAdapter.queryGizmoWithRetries(
+// "https://server.proxy:8443/aai/v11/business/customers/", "application/json", 4));
+// assertNull(gizmoAdapter.getSelfLinksByEntityType("vserver"));
+// gizmoAdapter.setEndpointConfig(endpointConfig);
+// assertNotNull(gizmoAdapter.getEndpointConfig());
+// }
+//}
\ No newline at end of file
import org.junit.Test;
import org.mockito.Mockito;
import org.onap.aai.restclient.client.OperationResult;
-import org.onap.aai.setup.Version;
+import org.onap.aai.setup.SchemaVersion;
import org.onap.aai.sparky.config.oxm.OxmEntityDescriptor;
import org.onap.aai.sparky.config.oxm.OxmEntityLookup;
import org.onap.aai.sparky.config.oxm.OxmModelLoader;
OxmEntityDescriptor desc = new OxmEntityDescriptor();
desc.addPrimaryKeyName("hostname");
desc.setEntityName("pserver");
- Version version = Version.V11;
OxmEntityLookup entityLookup = new OxmEntityLookup();
entityLookup.addEntityDescriptor("pserver", desc);
AttributeUpdater updater =
- new AttributeUpdater(new OxmModelLoader(version, null, null), entityLookup, aaiAdapter);
+ new AttributeUpdater(new OxmModelLoader("v11", null, null), entityLookup, aaiAdapter);
Map<String, Object> attributes = new HashMap<>();
attributes.put("prov-status", "PREPROV");
attributes.put("in-maint", "true");
*/
@Test(expected = NullPointerException.class)
public void testGetEditObjectFromUri() throws Exception {
- Version version = Version.V11;
+ String version = "v11";
OxmModelLoader loader = new OxmModelLoader(version, null, null);
OxmEntityLookup entityLookup = new OxmEntityLookup();
entityLookup.addEntityDescriptor("pserver", desc);
- AttributeUpdater updater = new AttributeUpdater(new OxmModelLoader(null,null), entityLookup, aaiAdapter);
+ AttributeUpdater updater = new AttributeUpdater(new OxmModelLoader("v11",null,null), entityLookup, aaiAdapter);
// Test entity uri without "/aai/version/"
String result = updater.getRelativeUri("cloud-infrastructure/pservers/pserver/mtznjtax101");
assertEquals("/cloud-infrastructure/pservers/pserver/mtznjtax101", result);
import org.onap.aai.cl.eelf.LoggerFactory;
import org.onap.aai.restclient.client.OperationResult;
import org.onap.aai.restclient.enums.RestAuthenticationMode;
-import org.onap.aai.setup.Version;
+import org.onap.aai.setup.SchemaVersion;
import org.onap.aai.sparky.config.oxm.OxmModelLoader;
import org.onap.aai.sparky.dal.GizmoAdapter;
import org.onap.aai.sparky.dal.exception.ElasticSearchOperationException;
public GizmoEntitySummarizer()
throws ElasticSearchOperationException, IOException, RestClientConstructionException {
- OxmModelAndProcessorHelper.API_VERSION_OVERRIDE = Version.V11;
+ OxmModelAndProcessorHelper.API_VERSION_OVERRIDE = "v11";
this.gizmoExecutor = NodeUtils.createNamedExecutor("GIZMO-WORKER", 5, logger);
import java.util.HashSet;
import java.util.Set;
-import org.onap.aai.setup.Version;
import org.onap.aai.sparky.config.SparkyResourceLoader;
import org.onap.aai.sparky.config.oxm.CrossEntityReferenceLookup;
import org.onap.aai.sparky.config.oxm.GeoEntityLookup;
public class OxmModelAndProcessorHelper {
- public static Version API_VERSION_OVERRIDE = Version.V11;
+ public static String API_VERSION_OVERRIDE = "v11";
private OxmModelLoader modelLoader;
private Set<OxmModelProcessor> processors;
<ref bean="oxmEntityLookup" /> </set>
</property>
</bean>
- <bean id="schemaLocationsBean" class="org.onap.aai.setup.SchemaLocationsBean">
- <!-- When running with AJSC these properties must be injected directly. The reason for this is unknown. -->
- <property name="nodeDirectory" value="${nodeDir}" />
- <property name="edgeDirectory" value="${edgeDir}" />
- </bean>
+
+ <bean id="schemaLocationsBean" class="org.onap.aai.setup.SchemaLocationsBean">
+ <!-- When running with AJSC these properties must be injected directly.
+ The reason for this is unknown. -->
+ <property name="nodeDirectory" value="${nodeDir}" />
+ <property name="edgeDirectory" value="${edgeDir}" />
+ </bean>
- <bean id="configTranslator" class="org.onap.aai.sparky.config.oxm.OxmConfigTranslator">
- <constructor-arg ref="schemaLocationsBean" />
- </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" />
+ </bean>
<bean id="nodeIngestor" class="org.onap.aai.nodes.NodeIngestor">
- <constructor-arg ref="configTranslator" />
+ <constructor-arg ref="oxmConfigTranslator" />
</bean>
+
+
<bean id="oxmModelLoader" class="org.onap.aai.sparky.config.oxm.OxmModelLoader"
init-method="loadModel">
<!-- <constructor-arg name="apiVersionOverride" value="V11" /> -->
<constructor-arg ref="oxmModelProcessorSet" />
<constructor-arg ref="nodeIngestor" />
+ <constructor-arg ref="schemaVersions" />
</bean>
</beans>
\ No newline at end of file
Test properties for the org.onap.aai.setup.SchemaLocationsBean
schemaConfig=NA
nodeDir=src/test/resources/oxm-reader/oxm/
-edgeDir=src/test/resources/oxm-reader/oxm/
\ No newline at end of file
+edgeDir=src/test/resources/oxm-reader/oxm/
+
+# New propterties required by the aai-common - aai-schema-ingest lib as of 1.3.0
+schema.configuration.location=N/A
+schema.nodes.location=src/test/resources/oxm-reader/oxm/
+schema.edges.location=
+# These versions need to exist if they are included in the list
+schema.version.list=v8,v9,v10,v11,v12,v13
+# Decalares the oxm version to load
+schema.version.api.default=v11
+
+# Setting this values to ${oxm.apiVersion} only to ensure the value used exists (we don't use this properties in our application)
+schema.version.depth.start=v11
+schema.version.related.link.start=v11
+schema.version.app.root.start=v11
+schema.version.namespace.change.start=v11
+schema.version.edge.label.start=v11
\ No newline at end of file
<property name="edgeDirectory" value="bundleconfig-local/etc/oxm/" />
</bean>
- <bean id="oxmConfigTranslator" class="org.onap.aai.sparky.config.oxm.OxmConfigTranslator">
- <constructor-arg ref="SchemaLocationsBean" />
+ <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" />
</bean>
+
<bean id="nodeIngestor" class="org.onap.aai.nodes.NodeIngestor">
<constructor-arg ref="oxmConfigTranslator" />
</bean>
<bean id="oxmModelLoader" class="org.onap.aai.sparky.config.oxm.OxmModelLoader"
init-method="loadModel">
- <constructor-arg name="apiVersionOverride" value="V11" />
+ <constructor-arg name="apiVersionOverride" value="v11" />
<constructor-arg ref="oxmModelProcessorSet" />
<constructor-arg ref="nodeIngestor" />
</bean>