summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--aai-annotations/pom.xml4
-rw-r--r--aai-auth/pom.xml4
-rw-r--r--aai-core/.classpath19
-rw-r--r--aai-core/pom.xml16
-rw-r--r--aai-core/pom.xml.versionsBackup1063
-rw-r--r--aai-core/src/main/java/org/onap/aai/config/IntrospectionConfig.java4
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/Introspector.java182
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java82
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/Loader.java25
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/MoxyLoader.java36
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java103
-rw-r--r--aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java299
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java3736
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngine.java51
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/engines/query/QueryEngine.java57
-rw-r--r--aai-core/src/test/java/org/onap/aai/HttpTestUtil.java52
-rw-r--r--aai-core/src/test/java/org/onap/aai/parsers/uri/URIToObjectTest.java51
-rw-r--r--aai-core/src/test/java/org/onap/aai/rest/EdgeNotValidAnymoreTest.java120
-rw-r--r--aai-core/src/test/java/org/onap/aai/rest/EntitlementTest.java96
-rw-r--r--aai-core/src/test/java/org/onap/aai/rest/ModelElementTest.java98
-rw-r--r--aai-core/src/test/java/org/onap/aai/rest/PserverDuplicateTest.java135
-rw-r--r--aai-core/src/test/java/org/onap/aai/rest/VipAddressListTest.java99
-rw-r--r--aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java17
-rw-r--r--aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java157
-rw-r--r--aai-core/src/test/resources/payloads/resource/cloud-region-with-vlan.json50
-rw-r--r--aai-core/src/test/resources/payloads/resource/cloud-region.json4
-rw-r--r--aai-core/src/test/resources/payloads/resource/entitlement.json4
-rw-r--r--aai-core/src/test/resources/payloads/resource/model-element.json230
-rw-r--r--aai-core/src/test/resources/payloads/resource/model.json975
-rw-r--r--aai-core/src/test/resources/payloads/resource/vip-ipv4-address-list.json6
-rw-r--r--aai-core/src/test/resources/payloads/resource/vnf.json4
-rw-r--r--aai-rest/LICENSE.TXT17
-rw-r--r--aai-rest/pom.xml129
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/JettyPasswordDecoder.java33
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/NoAuthRestClient.java53
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/OneWaySSLRestClient.java76
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/PasswordDecoder.java25
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/PropertyPasswordConfiguration.java78
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java99
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactory.java35
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java37
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/RestClientResponseErrorHandler.java59
-rw-r--r--aai-rest/src/main/java/org/onap/aai/restclient/TwoWaySSLRestClient.java91
-rw-r--r--aai-rest/src/test/java/org/onap/aai/restclient/RestClientTest.java24
-rw-r--r--aai-schema-ingest/pom.xml68
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/config/ConfigConfiguration.java46
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/config/EdgesConfiguration.java77
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/config/NodesConfiguration.java82
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/config/RestConfiguration.java82
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/config/SchemaServiceConfiguration.java54
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/config/TranslatorConfiguration.java36
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeIngestor.java1001
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRule.java26
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRuleQuery.java54
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/edges/JsonIngestor.java125
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/edges/SchemaFilter.java69
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/AmbiguousRuleChoiceException.java4
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/EdgeRuleNotFoundException.java4
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java428
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceNoAuthClient.java75
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceOneWayClient.java87
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceRestClient.java102
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/setup/AAIConfigTranslator.java9
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/setup/ConfigTranslator.java66
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaLocationsBean.java1
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaServiceTranslator.java105
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaServiceVersions.java48
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersion.java2
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersions.java120
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersionsBean.java83
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/setup/Translator.java67
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/validation/DefaultVersionValidationModule.java56
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/CousinDefaultingValidationModule.java9
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/DefaultEdgeFieldsValidationModule.java5
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/EdgeRuleValidator.java41
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/NodeTypesValidationModule.java7
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/SingleContainmentValidationModule.java9
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/UniqueLabelValidationModule.java9
-rw-r--r--aai-schema-ingest/src/main/java/org/onap/aai/validation/nodes/NodeValidator.java7
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorLocalTest.java369
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java197
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorWiringTest.java10
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeRuleQueryTest.java1
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java1
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/edges/TypeAlphabetizerTest.java1
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorLocalTest.java176
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java96
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorWiringTest.java10
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockProvider.java58
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockRestClient.java295
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/restclient/RestClientTest.java24
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/restclient/SchemaRestClientTest.java67
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/setup/ConfigTranslatorWiringTest.java13
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanDefaultInjectionTest.java5
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanEnvVarInjectionTest.java5
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterTest.java5
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java5
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaVersionsBeanTest.java87
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/testutils/BadEdgeConfigForValidationTest.java8
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/testutils/BadNodeConfigForValidationTest.java10
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/testutils/ConfigTranslatorForWiringTest.java11
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/testutils/GoodConfigForValidationTest.java7
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/testutils/SchemaIncompleteTranslator.java11
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslator.java16
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslatorforBusiness.java11
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/validation/VersionValidatorRainyDayTest.java9
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/validation/VersionValidatorSunnyDayTest.java12
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/DefaultEdgeFieldsValidationModuleTest.java2
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/EdgeRuleValidatorRainyDayTest.java16
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/EdgeRuleValidatorSunnyDayTest.java16
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/NodeTypesValidationModuleTest.java10
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorRainyDayTest.java14
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorSchemaIncompleteTest.java22
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorSunnyDayTest.java12
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/test_v10.json48
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/test_v11.json124
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/test_v12.json71
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/test_v13.json71
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/test_v14.json71
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/test_v15.json275
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/test_v8.json71
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/test_v9.json4
-rw-r--r--aai-schema-ingest/src/test/resources/edgerequests.json50
-rw-r--r--aai-schema-ingest/src/test/resources/forWiringTests/aai_oxm_v13.xml3
-rw-r--r--aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-ss-wiring-test.properties20
-rw-r--r--aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test-local-node.properties14
-rw-r--r--aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties15
-rw-r--r--aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test.properties16
-rw-r--r--aai-schema-ingest/src/test/resources/mockrequests.json52
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml6
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v10.xml83
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v11.xml101
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v12.xml101
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v13.xml101
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v14.xml101
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v15.xml101
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v8.xml101
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v9.xml101
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_combined_v13.xml4629
-rw-r--r--aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml6
-rw-r--r--aai-schema-ingest/src/test/resources/payload/versions.json18
-rw-r--r--aai-schema-ingest/src/test/resources/schemaservice-endpoints.json9
-rw-r--r--aai-schema/.classpath26
-rw-r--r--aai-schema/pom.xml4
-rw-r--r--aai-schema/src/main/resources/onap/aai_schema/aai_schema_v14.xsd2
-rw-r--r--aai-schema/src/main/resources/onap/aai_schema/aai_schema_v15.xsd4
-rw-r--r--aai-schema/src/main/resources/onap/dbedgerules/v14/DbEdgeRules_v14.json24
-rw-r--r--aai-schema/src/main/resources/onap/dbedgerules/v15/DbEdgeRules_v15.json24
-rw-r--r--aai-schema/src/main/resources/onap/oxm/v14/aai_oxm_v14.xml6
-rw-r--r--aai-schema/src/main/resources/onap/oxm/v15/aai_oxm_v15.xml10
-rw-r--r--aai-utils/pom.xml6
-rw-r--r--docs/AAI REST API Documentation/AAIRESTAPI_CASABLANCA.rst10
-rw-r--r--docs/AAI REST API Documentation/nodesQuery.rst94
-rw-r--r--docs/release-notes.rst68
-rw-r--r--pom.xml3
-rw-r--r--version.properties2
156 files changed, 16450 insertions, 3407 deletions
diff --git a/aai-annotations/pom.xml b/aai-annotations/pom.xml
index 4dab523e..f19bd28c 100644
--- a/aai-annotations/pom.xml
+++ b/aai-annotations/pom.xml
@@ -27,12 +27,12 @@
<parent>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-common</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>aai-annotations</artifactId>
<name>aai-annotations</name>
<packaging>jar</packaging>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<properties>
<onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
</properties>
diff --git a/aai-auth/pom.xml b/aai-auth/pom.xml
index ecae486c..4bc3f40c 100644
--- a/aai-auth/pom.xml
+++ b/aai-auth/pom.xml
@@ -26,11 +26,11 @@
<parent>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-common</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>aai-auth</artifactId>
<name>aai-auth</name>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<properties>
<onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
diff --git a/aai-core/.classpath b/aai-core/.classpath
deleted file mode 100644
index 78a65b57..00000000
--- a/aai-core/.classpath
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
- <attributes>
- <attribute name="owner.project.facets" value="java"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- <attribute name="org.eclipse.jst.component.nondependency" value=""/>
- </attributes>
- </classpathentry>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git a/aai-core/pom.xml b/aai-core/pom.xml
index a482b972..c3eb5f20 100644
--- a/aai-core/pom.xml
+++ b/aai-core/pom.xml
@@ -27,11 +27,11 @@
<parent>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-common</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>aai-core</artifactId>
<name>aai-core</name>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<sonar.language>java</sonar.language>
@@ -699,7 +699,7 @@
<dependency>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-schema-ingest</artifactId>
- <version>${project.version}</version>
+ <version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.onap.aai.aai-common</groupId>
@@ -801,12 +801,12 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
- <version>4.3.18.RELEASE</version>
+ <version>4.3.21.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
- <version>4.3.18.RELEASE</version>
+ <version>4.3.21.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
@@ -957,13 +957,13 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
- <version>4.3.18.RELEASE</version>
+ <version>4.3.21.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
- <version>1.5.1.RELEASE</version>
+ <version>1.5.18.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -997,7 +997,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
- <version>4.3.18.RELEASE</version>
+ <version>4.3.21.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
diff --git a/aai-core/pom.xml.versionsBackup b/aai-core/pom.xml.versionsBackup
new file mode 100644
index 00000000..55c5d712
--- /dev/null
+++ b/aai-core/pom.xml.versionsBackup
@@ -0,0 +1,1063 @@
+<?xml version="1.0"?>
+<!--
+
+ ============LICENSE_START=======================================================
+ org.onap.aai
+ ================================================================================
+ Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ 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=========================================================
+
+-->
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.aai.aai-common</groupId>
+ <artifactId>aai-common</artifactId>
+ <version>1.3.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>aai-core</artifactId>
+ <name>aai-core</name>
+ <version>1.3.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <properties>
+ <sonar.language>java</sonar.language>
+ <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+ <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
+ <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath>
+ <sonar.jacoco.reportMissing.force.zero>false</sonar.jacoco.reportMissing.force.zero>
+ <sonar.projectVersion>${project.version}</sonar.projectVersion>
+ <httpclient.version>4.5.5</httpclient.version>
+ <jackson.version>2.2.3</jackson.version>
+ <eelf.core.version>1.0.0</eelf.core.version>
+ <logback.version>1.2.3</logback.version>
+ <freemarker.version>2.3.21</freemarker.version>
+ <activemq.version>5.15.6</activemq.version>
+ <jacoco.line.coverage.limit>0.50</jacoco.line.coverage.limit>
+ <gremlin.version>3.2.2</gremlin.version>
+ <groovy.version>2.4.15</groovy.version>
+ <jetty.version>9.4.11.v20180605</jetty.version>
+
+ <!-- Start of Default ONAP Schema Properties -->
+ <aai.wiki.link>https://wiki.onap.org/</aai.wiki.link>
+ <gendoc.version>v14</gendoc.version>
+ <aai.release>onap</aai.release>
+ <schema.uri.base.path>/aai</schema.uri.base.path>
+ <schema.configuration.location>N/A</schema.configuration.location>
+ <schema.nodes.location>aai-schema/src/main/resources/${aai.release}/oxm</schema.nodes.location>
+ <schema.edges.location>aai-schema/src/main/resources/${aai.release}/dbedgerules</schema.edges.location>
+ <schema.version.depth.start>v9</schema.version.depth.start>
+ <schema.version.related.link.start>v10</schema.version.related.link.start>
+ <schema.version.app.root.start>v11</schema.version.app.root.start>
+ <schema.version.namespace.change.start>v12</schema.version.namespace.change.start>
+ <schema.version.edge.label.start>v12</schema.version.edge.label.start>
+ <schema.version.api.default>v14</schema.version.api.default>
+ <schema.version.list>v8,v9,v10,v11,v12,v13,v14</schema.version.list>
+ <!-- End of Default ONAP Schema Properties -->
+ </properties>
+ <profiles>
+ <!-- Start of ONAP profile -->
+ <profile>
+ <id>onap</id>
+ <properties>
+ <aai.release>onap</aai.release>
+ <schema.configuration.location>N/A</schema.configuration.location>
+ <schema.nodes.location>aai-schema/src/main/resources/${aai.release}/oxm</schema.nodes.location>
+ <schema.edges.location>aai-schema/src/main/resources/${aai.release}/dbedgerules</schema.edges.location>
+ <schema.version.depth.start>v9</schema.version.depth.start>
+ <schema.version.related.link.start>v10</schema.version.related.link.start>
+ <schema.version.app.root.start>v11</schema.version.app.root.start>
+ <schema.version.edge.label.start>v12</schema.version.edge.label.start>
+ <schema.version.namespace.change.start>v12</schema.version.namespace.change.start>
+ <schema.version.api.default>v14</schema.version.api.default>
+ <schema.version.list>v8,v9,v10,v11,v12,v13,v14</schema.version.list>
+ <gendoc.version>v14</gendoc.version>
+ </properties>
+ </profile>
+ <!-- End of ONAP profile -->
+ <profile>
+ <id>generateXsd</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>org.onap.aai.util.GenerateXsd</mainClass>
+ <systemProperties>
+ <systemProperty>
+ <key>gen_version</key>
+ <value>${gendoc.version}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>gen_type</key>
+ <value>XSD</value>
+ </systemProperty>
+ <systemProperty>
+ <key>yamlresponses_url</key>
+ <value></value>
+ </systemProperty>
+ <systemProperty>
+ <key>yamlresponses_label</key>
+ <value></value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.configuration.location</key>
+ <value>${schema.configuration.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.nodes.location</key>
+ <value>${schema.nodes.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.edges.location</key>
+ <value>${schema.edges.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.list</key>
+ <value>${schema.version.list}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.related.link.start</key>
+ <value>${schema.version.related.link.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.app.root.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.edge.label.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.namespace.change.start</key>
+ <value>${schema.version.namespace.change.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.api.default</key>
+ <value>${schema.version.api.default}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.uri.base.path</key>
+ <value>${schema.uri.base.path}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>aai.release</key>
+ <value>${aai.release}</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>generateYaml</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>org.onap.aai.util.GenerateXsd</mainClass>
+ <systemProperties>
+ <systemProperty>
+ <key>gen_version</key>
+ <value>${gendoc.version}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>gen_type</key>
+ <value>YAML</value>
+ </systemProperty>
+ <systemProperty>
+ <key>yamlresponses_url</key>
+ <value>https://wiki.web.att.com/pages/viewpage.action?pageId=607391054
+ </value>
+ </systemProperty>
+ <systemProperty>
+ <key>yamlresponses_label</key>
+ <value>Response codes found in [response codes]</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.configuration.location</key>
+ <value>${schema.configuration.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.nodes.location</key>
+ <value>${schema.nodes.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.edges.location</key>
+ <value>${schema.edges.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.list</key>
+ <value>${schema.version.list}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.related.link.start</key>
+ <value>${schema.version.related.link.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.app.root.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.edge.label.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.namespace.change.start</key>
+ <value>${schema.version.namespace.change.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.api.default</key>
+ <value>${schema.version.api.default}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.uri.base.path</key>
+ <value>${schema.uri.base.path}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>aai.release</key>
+ <value>${aai.release}</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>generateHtml</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>org.onap.aai.util.swagger.GenerateSwagger</mainClass>
+ <systemProperties>
+ <property>
+ <key>aai.generate.version</key>
+ <value>${gendoc.version}</value>
+ </property>
+ <property>
+ <key>aai.wiki.link</key>
+ <value>${aai.wiki.link}</value>
+ </property>
+ <systemProperty>
+ <key>schema.configuration.location</key>
+ <value>${schema.configuration.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.nodes.location</key>
+ <value>${schema.nodes.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.edges.location</key>
+ <value>${schema.edges.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.list</key>
+ <value>${schema.version.list}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.related.link.start</key>
+ <value>${schema.version.related.link.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.app.root.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.edge.label.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.namespace.change.start</key>
+ <value>${schema.version.namespace.change.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.api.default</key>
+ <value>${schema.version.api.default}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.uri.base.path</key>
+ <value>${schema.uri.base.path}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>aai.release</key>
+ <value>${aai.release}</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>autoGenerate</id>
+ <activation>
+ <property>
+ <name>aai.generate.schema</name>
+ <value>!false</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <id>autoGenerateXsd</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>org.onap.aai.util.GenerateXsd</mainClass>
+ <systemProperties>
+ <systemProperty>
+ <key>gen_version</key>
+ <value>ALL</value>
+ </systemProperty>
+ <systemProperty>
+ <key>gen_type</key>
+ <value>XSD</value>
+ </systemProperty>
+ <systemProperty>
+ <key>yamlresponses_url</key>
+ <value></value>
+ </systemProperty>
+ <systemProperty>
+ <key>yamlresponses_label</key>
+ <value></value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.configuration.location</key>
+ <value>${schema.configuration.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.nodes.location</key>
+ <value>${schema.nodes.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.edges.location</key>
+ <value>${schema.edges.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.list</key>
+ <value>${schema.version.list}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.related.link.start</key>
+ <value>${schema.version.related.link.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.app.root.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.edge.label.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.namespace.change.start</key>
+ <value>${schema.version.namespace.change.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.api.default</key>
+ <value>${schema.version.api.default}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.uri.base.path</key>
+ <value>${schema.uri.base.path}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>aai.release</key>
+ <value>${aai.release}</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>autoGenerateYaml</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>org.onap.aai.util.GenerateXsd</mainClass>
+ <systemProperties>
+ <systemProperty>
+ <key>gen_version</key>
+ <value>ALL</value>
+ </systemProperty>
+ <systemProperty>
+ <key>gen_type</key>
+ <value>YAML</value>
+ </systemProperty>
+ <systemProperty>
+ <key>yamlresponses_url</key>
+ <value>https://wiki.web.att.com/pages/viewpage.action?pageId=607391054
+ </value>
+ </systemProperty>
+ <systemProperty>
+ <key>yamlresponses_label</key>
+ <value>Response codes found in [response codes]</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.configuration.location</key>
+ <value>${schema.configuration.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.nodes.location</key>
+ <value>${schema.nodes.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.edges.location</key>
+ <value>${schema.edges.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.list</key>
+ <value>${schema.version.list}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.related.link.start</key>
+ <value>${schema.version.related.link.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.app.root.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.edge.label.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.namespace.change.start</key>
+ <value>${schema.version.namespace.change.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.api.default</key>
+ <value>${schema.version.api.default}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>aai.release</key>
+ <value>${aai.release}</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>autoGenerateHtml</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>org.onap.aai.util.AutoGenerateHtml</mainClass>
+ <systemProperties>
+ <property>
+ <key>aai.generate.version</key>
+ <value>${gendoc.version}</value>
+ </property>
+ <property>
+ <key>aai.wiki.link</key>
+ <value>${aai.wiki.link}</value>
+ </property>
+ <systemProperty>
+ <key>schema.configuration.location</key>
+ <value>${schema.configuration.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.nodes.location</key>
+ <value>${schema.nodes.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.edges.location</key>
+ <value>${schema.edges.location}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.list</key>
+ <value>${schema.version.list}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.depth.start</key>
+ <value>${schema.version.depth.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.related.link.start</key>
+ <value>${schema.version.related.link.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.app.root.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.edge.label.start</key>
+ <value>${schema.version.app.root.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.namespace.change.start</key>
+ <value>${schema.version.namespace.change.start}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>schema.version.api.default</key>
+ <value>${schema.version.api.default}</value>
+ </systemProperty>
+ <systemProperty>
+ <key>aai.release</key>
+ <value>${aai.release}</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.12.4</version>
+ <configuration>
+ <argLine>-noverify ${argLine}</argLine>
+ <systemPropertyVariables>
+ <AJSC_HOME>.</AJSC_HOME>
+ <BUNDLECONFIG_DIR>bundleconfig-local</BUNDLECONFIG_DIR>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sonar-maven-plugin</artifactId>
+ <version>3.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.7.7.201606060606</version>
+ <configuration>
+ <dumpOnExit>true</dumpOnExit>
+ </configuration>
+ <executions>
+ <execution>
+ <id>jacoco-initialize-unit-tests</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
+ <!-- <append>true</append> -->
+ </configuration>
+ </execution>
+ <execution>
+ <id>post-unit-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <configuration>
+ <!-- Sets the path to the file which contains the execution data. -->
+ <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
+ <!-- Sets the output directory for the code coverage report. -->
+ <outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>default-check</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
+ <rules>
+ <rule implementation="org.jacoco.maven.RuleConfiguration">
+ <element>BUNDLE</element>
+ <limits>
+ <limit implementation="org.jacoco.report.check.Limit">
+ <counter>LINE</counter>
+ <value>COVEREDRATIO</value>
+ <minimum>${jacoco.line.coverage.limit}</minimum>
+ </limit>
+ </limits>
+ </rule>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!-- explicitly define maven-deploy-plugin after other to force exec order -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.aai.aai-common</groupId>
+ <artifactId>aai-schema-ingest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.aai.aai-common</groupId>
+ <artifactId>aai-annotations</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-text</artifactId>
+ <version>1.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ <version>${eelf.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>1.9.13</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.9.13</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-junit</artifactId>
+ <version>2.0.0.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-core</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.10.19</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-junit4</artifactId>
+ <version>1.6.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ <version>1.6.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>19.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.janusgraph</groupId>
+ <artifactId>janusgraph-core</artifactId>
+ <version>0.2.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.json-simple</groupId>
+ <artifactId>json-simple</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>4.3.18.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>4.3.18.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2.11</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.persistence</groupId>
+ <artifactId>eclipselink</artifactId>
+ <version>2.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.7</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jayway.jsonpath</groupId>
+ <artifactId>json-path</artifactId>
+ <version>2.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.module</groupId>
+ <artifactId>jackson-module-jaxb-annotations</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-core</artifactId>
+ <version>1.18</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>1.18</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-json</artifactId>
+ <version>1.18</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>gremlin-core</artifactId>
+ <version>${gremlin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>tinkergraph-gremlin</artifactId>
+ <version>${gremlin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-yaml</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.0.b2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>com.beust</groupId>
+ <artifactId>jcommander</artifactId>
+ <version>1.48</version>
+ </dependency>
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <version>20160810</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.bazaarvoice.jolt</groupId>
+ <artifactId>jolt-complete</artifactId>
+ <version>0.0.24</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-access</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-broker</artifactId>
+ <version>${activemq.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.opencsv</groupId>
+ <artifactId>opencsv</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>${freemarker.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.github.fge</groupId>
+ <artifactId>json-patch</artifactId>
+ <version>1.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy</artifactId>
+ <version>${groovy.version}</version>
+ <classifier>indy</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>4.3.18.RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-test</artifactId>
+ <version>1.5.1.RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-javaagent</artifactId>
+ <version>1.6.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.skyscreamer</groupId>
+ <artifactId>jsonassert</artifactId>
+ <version>1.4.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>${httpclient.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>gremlin-groovy</artifactId>
+ <version>${gremlin.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ <version>4.3.18.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>2.8.11</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.8.11</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>2.8.11</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.17</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot</artifactId>
+ <version>1.5.15.RELEASE</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- Plugins and repositories -->
+ <pluginRepositories>
+ <pluginRepository>
+ <id>central</id>
+ <url>http://repo1.maven.org/maven2</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>EvoSuite</id>
+ <name>EvoSuite Repository</name>
+ <url>http://www.evosuite.org/m2</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.4</version>
+ <configuration>
+ <failOnError>false</failOnError>
+ <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
+ <docletArtifact>
+ <groupId>org.umlgraph</groupId>
+ <artifactId>umlgraph</artifactId>
+ <version>5.6</version>
+ </docletArtifact>
+ <additionalparam>-views</additionalparam>
+ <useStandardDocletOptions>true</useStandardDocletOptions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
diff --git a/aai-core/src/main/java/org/onap/aai/config/IntrospectionConfig.java b/aai-core/src/main/java/org/onap/aai/config/IntrospectionConfig.java
index aa4ec1a1..e737f08d 100644
--- a/aai-core/src/main/java/org/onap/aai/config/IntrospectionConfig.java
+++ b/aai-core/src/main/java/org/onap/aai/config/IntrospectionConfig.java
@@ -21,14 +21,16 @@
*/
package org.onap.aai.config;
+import org.onap.aai.schema.enums.ObjectMetadata;
import org.onap.aai.setup.SchemaVersion;
import org.onap.aai.setup.SchemaVersions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import java.util.Map;
+import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.stream.Collectors;
import org.onap.aai.introspection.LoaderFactory;
import org.onap.aai.introspection.MoxyLoader;
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java b/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java
index c7520dd4..269d6330 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java
@@ -36,6 +36,7 @@ import org.onap.aai.workarounds.NamingExceptions;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
+import java.util.stream.Collectors;
public abstract class Introspector implements Cloneable {
@@ -57,25 +58,25 @@ public abstract class Introspector implements Cloneable {
protected String convertPropertyName (String name) {
return CaseFormat.LOWER_HYPHEN.to(CaseFormat.LOWER_CAMEL, name);
}
-
+
protected abstract Object get(String name);
protected abstract void set(String name, Object value);
/**
- *
+ *
* @param name the property name you'd like to retrieve the value for
* @return the value of the property
*/
public <T> T getValue(String name) {
String convertedName = convertPropertyName(name);
Object result = null;
-
+
if (this.hasProperty(name)) {
result = this.get(convertedName);
} else {
/* property not found - slightly ambiguous */
return null;
}
-
+
Class<?> clazz = this.getClass(name);
if (this.isListType(name) && result == null) {
try {
@@ -88,18 +89,18 @@ public abstract class Introspector implements Cloneable {
return (T)result;
}
-
+
public Introspector getWrappedValue(String name) {
String convertedName = convertPropertyName(name);
Object value = null;
-
+
if (this.hasProperty(name)) {
value = this.get(convertedName);
} else {
/* property not found - slightly ambiguous */
return null;
}
-
+
Class<?> clazz = this.getClass(name);
if (this.isListType(name) && value == null) {
try {
@@ -115,9 +116,9 @@ public abstract class Introspector implements Cloneable {
//no value
return null;
}
-
+
}
-
+
public List<Introspector> getWrappedListValue(String name) {
String convertedName = convertPropertyName(name);
Object value = null;
@@ -141,17 +142,17 @@ public abstract class Introspector implements Cloneable {
LOGGER.warn(e.getMessage(),e);
}
}
-
+
List<Object> valueList = (List<Object>)value;
-
+
for (Object item : valueList) {
resultList.add(IntrospectorFactory.newInstance(this.getModelType(), item));
}
-
+
return resultList;
-
+
}
-
+
public Object castValueAccordingToSchema(String name, Object obj) {
Object result = obj;
Class<?> nameClass = this.getClass(name);
@@ -159,11 +160,11 @@ public abstract class Introspector implements Cloneable {
throw new IllegalArgumentException("property: " + name + " does not exist on " + this.getDbName());
}
if (obj != null) {
-
+
try {
if (!obj.getClass().getName().equals(nameClass.getName())) {
if (nameClass.isPrimitive()) {
- nameClass = ClassUtils.primitiveToWrapper(nameClass);
+ nameClass = ClassUtils.primitiveToWrapper(nameClass);
result = nameClass.getConstructor(String.class).newInstance(obj.toString());
}
if (obj instanceof String) {
@@ -180,35 +181,35 @@ public abstract class Introspector implements Cloneable {
}
return result;
}
-
+
public List<Object> castValueAccordingToSchema(String name, List<?> objs) {
List<Object> result = new ArrayList<>();
-
+
for (Object item : objs) {
result.add(this.castValueAccordingToSchema(name, item));
}
-
+
return result;
-
+
}
/**
- *
+ *
* @param name the property name you'd like to set the value of
* @param obj the value to be set
* @return
*/
public void setValue(String name, Object obj) throws IllegalArgumentException {
Object box = this.castValueAccordingToSchema(name, obj);
-
+
name = convertPropertyName(name);
this.set(name, box);
}
/**
- *
+ *
* @return a list of all the properties available on the object
*/
public abstract Set<String> getProperties();
-
+
public Set<String> getProperties(PropertyPredicate<Introspector, String> p) {
final Set<String> temp = new LinkedHashSet<>();
this.getProperties().stream().filter(item -> {
@@ -217,22 +218,30 @@ public abstract class Introspector implements Cloneable {
temp.add(item);
});
final Set<String> result = Collections.unmodifiableSet(temp);
-
+
return result;
-
+
}
+
+ public Set<String> getSimpleProperties(PropertyPredicate<Introspector, String> p){
+ return this.getProperties()
+ .stream()
+ .filter(item -> p.test(this, item))
+ .filter(this::isSimpleType)
+ .collect(Collectors.toSet());
+ }
/**
- *
+ *
* @return a list of the required properties on the object
*/
public abstract Set<String> getRequiredProperties();
/**
- *
+ *
* @return a list of the properties that can be used to query the object in the db
*/
public abstract Set<String> getKeys();
/**
- *
+ *
* @return a list of the all key properties for this object
*/
public Set<String> getAllKeys() {
@@ -274,7 +283,7 @@ public abstract class Introspector implements Cloneable {
result = this.indexedProperties;
return result;
}
-
+
public Set<String> getUniqueProperties() {
Set<String> result = null;
if (this.uniqueProperties == null) {
@@ -292,7 +301,7 @@ public abstract class Introspector implements Cloneable {
result = this.uniqueProperties;
return result;
}
-
+
public Set<String> getDependentOn() {
String dependentOn = this.getMetadata(ObjectMetadata.DEPENDENT_ON);
if (dependentOn == null) {
@@ -301,21 +310,21 @@ public abstract class Introspector implements Cloneable {
return new LinkedHashSet<>(Arrays.asList(dependentOn.split(",")));
}
/**
- *
+ *
* @param name
* @return the string name of the java class of the named property
*/
public String getType(String name) {
Class<?> resultClass = this.getClass(name);
String result = "";
-
+
if (resultClass != null) {
result = resultClass.getName();
if (result.equals("java.util.ArrayList")) {
result = "java.util.List";
}
}
-
+
return result;
}
/**
@@ -327,33 +336,33 @@ public abstract class Introspector implements Cloneable {
public String getGenericType(String name) {
Class<?> resultClass = this.getGenericTypeClass(name);
String result = "";
-
+
if (resultClass != null) {
result = resultClass.getName();
}
-
+
return result;
}
/**
- *
+ *
* @return the string name of the java class of the underlying object
*/
public abstract String getJavaClassName();
-
+
/**
- *
+ *
* @param name the property name
* @return the Class object
*/
public abstract Class<?> getClass(String name);
-
+
public abstract Class<?> getGenericTypeClass(String name);
/**
- *
+ *
* @param name the property name
* @return a new instance of the underlying type of this property
- * @throws AAIUnknownObjectException
+ * @throws AAIUnknownObjectException
*/
public Object newInstanceOfProperty(String name) throws AAIUnknownObjectException {
String type = this.getType(name);
@@ -364,22 +373,22 @@ public abstract class Introspector implements Cloneable {
String type = this.getGenericType(name);
return loader.objectFromName(type);
}
-
-
+
+
public Introspector newIntrospectorInstanceOfProperty(String name) throws AAIUnknownObjectException {
-
+
Introspector result = IntrospectorFactory.newInstance(this.getModelType(), this.newInstanceOfProperty(name));
-
+
return result;
-
+
}
-
+
public Introspector newIntrospectorInstanceOfNestedProperty(String name) throws AAIUnknownObjectException {
-
+
Introspector result = IntrospectorFactory.newInstance(this.getModelType(), this.newInstanceOfNestedProperty(name));
-
+
return result;
-
+
}
/**
* Is this type not a Java String or primitive
@@ -388,56 +397,56 @@ public abstract class Introspector implements Cloneable {
*/
public boolean isComplexType(String name) {
String result = this.getType(name);
-
+
if (result.contains("aai") || result.equals("java.lang.Object")) {
return true;
} else {
return false;
}
}
-
+
public boolean isComplexGenericType(String name) {
String result = this.getGenericType(name);
-
+
if (result.contains("aai")) {
return true;
} else {
return false;
}
}
-
+
public boolean isSimpleType(String name) {
return !(this.isComplexType(name) || this.isListType(name));
}
-
+
public boolean isSimpleGenericType(String name) {
return !this.isComplexGenericType(name);
}
public boolean isListType(String name) {
String result = this.getType(name);
-
+
if (result.contains("java.util.List")) {
return true;
} else {
return false;
}
}
-
+
public boolean isContainer() {
Set<String> props = this.getProperties();
boolean result = false;
if (props.size() == 1 && this.isListType(props.iterator().next())) {
result = true;
}
-
+
return result;
}
-
+
public abstract String getChildName();
public String getChildDBName() {
String result = this.getChildName();
-
+
result = namingException.getDBName(result);
return result;
}
@@ -447,10 +456,10 @@ public abstract class Introspector implements Cloneable {
String lowerHyphen = this.getName();
lowerHyphen = namingException.getDBName(lowerHyphen);
-
+
return lowerHyphen;
}
-
+
public abstract ModelType getModelType();
public boolean hasChild(Introspector child) {
@@ -474,7 +483,7 @@ public abstract class Introspector implements Cloneable {
}
return result;
}
-
+
public void setURIChain(String uri) {
this.uriChain = uri;
}
@@ -488,21 +497,21 @@ public abstract class Introspector implements Cloneable {
if (this.isContainer()) {
result += "/" + this.getName();
} else {
-
+
if (container != null) {
result += "/" + container;
}
result += "/" + this.getDbName() + "/" + this.findKey();
-
+
if (namespace != null && !namespace.equals("")) {
result = "/" + namespace + result;
}
}
-
+
return result;
}
-
+
public String getGenericURI() {
String result = "";
if (this.isContainer()) {
@@ -513,10 +522,10 @@ public abstract class Introspector implements Cloneable {
result += "/{" + this.getDbName() + "-" + key + "}";
}
}
-
+
return result;
}
-
+
public String getFullGenericURI() {
String result = "";
String namespace = this.getMetadata(ObjectMetadata.NAMESPACE);
@@ -537,33 +546,33 @@ public abstract class Introspector implements Cloneable {
if (namespace != null && !namespace.equals("")) {
result = "/" + namespace + result;
}
-
+
}
-
+
return result;
}
public abstract String preProcessKey(String key);
-
+
protected abstract String findKey() throws UnsupportedEncodingException;
-
+
public abstract String marshal(MarshallerProperties properties);
-
+
public abstract Object clone();
public abstract Object getUnderlyingObject();
-
+
public String marshal(boolean formatted) {
MarshallerProperties properties =
new MarshallerProperties.Builder(MediaType.APPLICATION_JSON_TYPE).formatted(formatted).build();
-
+
return marshal(properties);
}
public String makeSingular(String word) {
-
+
String result = word;
result = result.replaceAll("(?:([ho])es|s)$", "");
-
+
if (result.equals("ClassesOfService")) {
result = "ClassOfService";
} else if (result.equals("CvlanTag")) {
@@ -573,10 +582,10 @@ public abstract class Introspector implements Cloneable {
}
return result;
}
-
+
protected String makePlural(String word) {
String result = word;
-
+
if (result.equals("cvlan-tag-entry")) {
return "cvlan-tags";
} else if (result.equals("class-of-service")) {
@@ -590,7 +599,7 @@ public abstract class Introspector implements Cloneable {
if (result.equals("classes-of-services")) {
result = "classes-of-service";
}*/
-
+
return result;
}
@@ -599,21 +608,22 @@ public abstract class Introspector implements Cloneable {
public Optional<String> getPropertyMetadata(String propName, PropertyMetadata metadataName) {
final String resultValue = this.getPropertyMetadata(propName).getOrDefault(metadataName, "");
Optional<String> result = Optional.empty();
-
+
if (!resultValue.isEmpty()) {
result = Optional.of(resultValue);
}
return result;
-
+
}
public abstract SchemaVersion getVersion();
public Loader getLoader() {
return this.loader;
}
-
+
public boolean isTopLevel() {
-
+
return this.getMetadata(ObjectMetadata.NAMESPACE) != null;
}
+
}
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java b/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
index b1447d8f..d54a9833 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
@@ -46,47 +46,47 @@ public class JSONStrategy extends Introspector {
throw new IllegalArgumentException("This object has no named type.");
}
}
-
+
protected JSONStrategy(Object o, String namedType) {
super(o);
json = (JSONObject)o;
this.namedType = namedType;
-
+
}
-
+
@Override
public boolean hasProperty(String name) {
- //TODO
+ //TODO
return true;
}
@Override
public Object getValue(String name) {
Object result = "";
result = json.get(name);
-
+
return result;
}
@Override
public void setValue(String name, Object obj) {
json.put(name, obj);
-
+
}
@Override
public Object getUnderlyingObject() {
return this.json;
}
-
+
@Override
public Set<String> getProperties() {
Set<String> result = json.keySet();
return result;
}
-
+
@Override
public Set<String> getRequiredProperties() {
//unknowable
-
+
return this.getProperties();
}
@@ -109,11 +109,11 @@ public class JSONStrategy extends Introspector {
if (resultClass != null) {
result = resultClass.getName();
}
-
+
if (result.equals("org.json.simple.JSONArray")) {
result = "java.util.List";
}
-
+
return result;
}
@@ -136,7 +136,7 @@ public class JSONStrategy extends Introspector {
public Class<?> getClass(String name) {
Class<?> result = null;
result = json.get(name).getClass();
-
+
return result;
}
@@ -148,7 +148,7 @@ public class JSONStrategy extends Introspector {
if (resultObject.getClass().getName().equals("org.json.simple.JSONArray")) {
resultClass = ((List)resultObject).get(0).getClass();
}
-
+
return resultClass;
}
@@ -169,43 +169,43 @@ public class JSONStrategy extends Introspector {
return null;
}
}
-
+
@Override
public boolean isComplexType(String name) {
String result = this.getType(name);
-
+
if (result.contains("JSONObject")) {
return true;
} else {
return false;
}
-
+
}
-
+
@Override
public boolean isComplexGenericType(String name) {
String result = this.getGenericType(name);
-
+
if (result.contains("JSONObject")) {
return true;
} else {
return false;
}
-
+
}
-
+
@Override
public boolean isListType(String name) {
String result = this.getType(name);
-
+
if (result.contains("java.util.List")) {
return true;
} else {
return false;
}
-
+
}
-
+
@Override
public boolean isContainer() {
Set<String> props = this.getProperties();
@@ -213,66 +213,66 @@ public class JSONStrategy extends Introspector {
if (props.size() == 1 && this.isListType(props.iterator().next())) {
result = true;
}
-
+
return result;
}
@Override
protected String findKey() {
return "";
}
-
+
@Override
public String getName() {
return this.namedType;
}
-
+
@Override
public String getDbName() {
return this.getName();
}
-
+
@Override
public String getURI() {
-
- // use a UUID for now
+
+ // use a UUID for now
return UUID.randomUUID().toString();
}
-
+
@Override
public String getGenericURI() {
-
+
//there is none defined for this
return "";
}
-
+
@Override
public String preProcessKey (String key) {
-
+
// don't do anything with it
return key;
-
+
}
-
+
@Override
public String marshal(MarshallerProperties properties) {
//TODO
return null;
}
-
+
@Override
public Object clone() {
//TODO
return null;
}
-
+
/*@Override
public String findEdgeName(String parent, String child) {
-
+
// Always has for now
return "has";
-
+
}*/
-
+
@Override
public ModelType getModelType() {
return ModelType.JSON;
@@ -341,7 +341,7 @@ public class JSONStrategy extends Introspector {
@Override
protected void set(String name, Object value) {
// TODO Auto-generated method stub
-
+
}
@Override
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/Loader.java b/aai-core/src/main/java/org/onap/aai/introspection/Loader.java
index 3a69e56e..cae4cbb7 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/Loader.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/Loader.java
@@ -25,12 +25,13 @@ import org.onap.aai.restcore.MediaType;
import org.onap.aai.setup.SchemaVersion;
import java.util.Map;
+import java.util.Set;
public abstract class Loader {
private final SchemaVersion version;
private final ModelType modelType;
-
+
/**
* Instantiates a new loader.
*
@@ -41,32 +42,32 @@ public abstract class Loader {
this.version = version;
this.modelType = modelType;
}
-
+
/**
* Process.
*
* @param version the version
*/
protected abstract void process(SchemaVersion version);
-
+
/**
* Object from name.
*
* @param name the name
* @return the object
- * @throws AAIUnknownObjectException
+ * @throws AAIUnknownObjectException
*/
public abstract Object objectFromName(String name) throws AAIUnknownObjectException;
-
+
/**
* Introspector from name.
*
* @param name the name
* @return the introspector
- * @throws AAIUnknownObjectException
+ * @throws AAIUnknownObjectException
*/
public abstract Introspector introspectorFromName(String name) throws AAIUnknownObjectException;
-
+
/**
* Unmarshal.
*
@@ -76,7 +77,7 @@ public abstract class Loader {
* @return the introspector
*/
public abstract Introspector unmarshal(String type, String json, MediaType mediaType) throws AAIUnmarshallingException;
-
+
/**
* Unmarshal.
*
@@ -88,7 +89,7 @@ public abstract class Loader {
return unmarshal(type, json, MediaType.APPLICATION_JSON_TYPE);
}
-
+
/**
* Gets the model type.
*
@@ -97,7 +98,7 @@ public abstract class Loader {
public ModelType getModelType() {
return this.modelType;
}
-
+
/**
* Gets the version.
*
@@ -106,6 +107,8 @@ public abstract class Loader {
public SchemaVersion getVersion() {
return this.version;
}
-
+
public abstract Map<String, Introspector> getAllObjects();
+
+ public abstract Set<String> getNamedPropNodes();
}
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/MoxyLoader.java b/aai-core/src/main/java/org/onap/aai/introspection/MoxyLoader.java
index 82504550..fa52d62f 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/MoxyLoader.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/MoxyLoader.java
@@ -34,6 +34,7 @@ import org.onap.aai.logging.ErrorLogHelper;
import org.onap.aai.logging.LogFormatTools;
import org.onap.aai.nodes.NodeIngestor;
import org.onap.aai.restcore.MediaType;
+import org.onap.aai.schema.enums.ObjectMetadata;
import org.onap.aai.setup.SchemaVersion;
import org.onap.aai.workarounds.NamingExceptions;
import org.springframework.stereotype.Component;
@@ -44,6 +45,7 @@ import java.io.*;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.util.stream.Collectors;
public class MoxyLoader extends Loader {
@@ -52,9 +54,11 @@ public class MoxyLoader extends Loader {
private Map<String, Introspector> allObjs = null;
private Map<SchemaVersion, MoxyLoader> moxyLoaderFactory;
-
+
private NodeIngestor nodeIngestor;
+ private Set<String> namedProps;
+
public MoxyLoader(SchemaVersion version, NodeIngestor nodeIngestor) {
super(version, ModelType.MOXY);
this.nodeIngestor = nodeIngestor;
@@ -67,14 +71,14 @@ public class MoxyLoader extends Loader {
}
/**
* {@inheritDoc}
- * @throws AAIUnknownObjectException
+ * @throws AAIUnknownObjectException
*/
@Override
public Introspector introspectorFromName(String name) throws AAIUnknownObjectException {
return IntrospectorFactory.newInstance(ModelType.MOXY, objectFromName(name));
}
-
+
/**
* {@inheritDoc}
*/
@@ -93,7 +97,7 @@ public class MoxyLoader extends Loader {
} else {
upperCamel = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, sanitizedName);
}
-
+
try {
final DynamicEntity result = jaxbContext.newDynamicEntity(upperCamel);
@@ -115,14 +119,14 @@ public class MoxyLoader extends Loader {
* We need to have just same JaxbContext for each version
*/
jaxbContext = nodeIngestor.getContextForVersion(version);
-
+
}
/**
* {@inheritDoc}
*/
@Override
- public Introspector unmarshal(String type, String json, MediaType mediaType) throws AAIUnmarshallingException {
+ public Introspector unmarshal(String type, String json, MediaType mediaType) throws AAIUnmarshallingException {
try {
final Object clazz = objectFromName(type);
final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
@@ -143,7 +147,7 @@ public class MoxyLoader extends Loader {
throw new AAIUnmarshallingException("Could not unmarshall: " + e.getMessage(), e);
}
}
-
+
@Override
public Map<String, Introspector> getAllObjects() {
if (this.allObjs != null) {
@@ -163,7 +167,7 @@ public class MoxyLoader extends Loader {
return allObjs;
}
}
-
+
private Set<String> objectsInVersion() {
Set<String> result = new HashSet<>();
@@ -177,7 +181,21 @@ public class MoxyLoader extends Loader {
//result.remove("EdgePropNames");
return result;
}
-
+
+ @Override
+ public Set<String> getNamedPropNodes(){
+
+ if(namedProps == null){
+ namedProps = getAllObjects()
+ .entrySet()
+ .stream()
+ .filter(
+ (entry) -> entry.getValue().getMetadata(ObjectMetadata.NAME_PROPS) != null
+ ).map(entry -> entry.getKey()).collect(Collectors.toSet());
+ }
+
+ return namedProps;
+ }
public DynamicJAXBContext getJAXBContext() {
return this.jaxbContext;
}
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java b/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java
index ecf31253..f0d487e8 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java
@@ -51,9 +51,10 @@ import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.util.*;
import java.util.Map.Entry;
+import java.util.stream.Collectors;
public class MoxyStrategy extends Introspector {
-
+
private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(MoxyStrategy.class);
private DynamicEntity internalObject = null;
private DynamicType internalType = null;
@@ -67,9 +68,9 @@ public class MoxyStrategy extends Introspector {
private Set<String> requiredProperties = null;
private boolean isInitialized = false;
-
+
private NodeIngestor nodeIngestor;
-
+
protected MoxyStrategy(Object obj) {
super(obj);
/* must look up the correct jaxbcontext for this object */
@@ -81,19 +82,19 @@ public class MoxyStrategy extends Introspector {
jaxbContext = nodeIngestor.getContextForVersion(version);
String simpleName = internalObject.getClass().getName();
internalType = jaxbContext.getDynamicType(simpleName);
-
+
cd = internalType.getDescriptor();
try {
marshaller = jaxbContext.createMarshaller();
-
+
unmarshaller = jaxbContext.createUnmarshaller();
-
+
} catch (JAXBException e) {
}
}
-
+
private void init() {
isInitialized = true;
@@ -104,13 +105,13 @@ public class MoxyStrategy extends Introspector {
}
props = Collections.unmodifiableSet(props);
this.properties = props;
-
+
Set<String> requiredProps = new LinkedHashSet<>();
requiredProps = new LinkedHashSet<>();
for (DatabaseMapping dm : cd.getMappings()) {
- if (dm.getField() instanceof XMLField) {
+ if (dm.getField() instanceof XMLField) {
XMLField x = (XMLField)dm.getField();
- if (x != null) {
+ if (x != null) {
if (x.isRequired()) {
requiredProps.add(this.removeXPathDescriptor(x.getName()));
}
@@ -119,25 +120,25 @@ public class MoxyStrategy extends Introspector {
}
requiredProps = Collections.unmodifiableSet(requiredProps);
this.requiredProperties = requiredProps;
-
+
Set<String> keys = new LinkedHashSet<>();
-
+
for (String name : internalType.getDescriptor().getPrimaryKeyFieldNames()) {
keys.add(this.removeXPathDescriptor(name));
}
keys = Collections.unmodifiableSet(keys);
this.keys = keys;
-
-
+
+
}
-
+
@Override
public boolean hasProperty(String name) {
String convertedName = convertPropertyName(name);
- return internalType.containsProperty(convertedName);
+ return internalType.containsProperty(convertedName);
}
-
+
@Override
public Object get(String name) {
return internalObject.get(name);
@@ -145,7 +146,7 @@ public class MoxyStrategy extends Introspector {
@Override
public void set(String name, Object obj) throws IllegalArgumentException {
-
+
internalObject.set(name, obj);
}
@@ -157,7 +158,7 @@ public class MoxyStrategy extends Introspector {
}
return this.properties;
-
+
}
@Override
@@ -179,7 +180,7 @@ public class MoxyStrategy extends Introspector {
return this.keys;
}
-
+
@Override
public Map<PropertyMetadata, String> getPropertyMetadata(String prop) {
String propName = this.convertPropertyName(prop);
@@ -192,7 +193,7 @@ public class MoxyStrategy extends Introspector {
PropertyMetadata.valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, (String)entry.getKey())), (String)entry.getValue());
}
}
-
+
return result;
}
@@ -200,8 +201,8 @@ public class MoxyStrategy extends Introspector {
public String getJavaClassName() {
return internalObject.getClass().getName();
}
-
-
+
+
@Override
public Class<?> getClass(String name) {
@@ -211,7 +212,7 @@ public class MoxyStrategy extends Introspector {
if (internalType.getPropertyType(name) == null) {
if (cd.getMappingForAttributeName(name) instanceof XMLCompositeDirectCollectionMapping) {
resultClass = cd.getMappingForAttributeName(name).getContainerPolicy().getContainerClass();
-
+
} else if (cd.getMappingForAttributeName(name) instanceof XMLCompositeCollectionMapping) {
resultClass = cd.getMappingForAttributeName(name).getContainerPolicy().getContainerClass();
} else {
@@ -243,7 +244,7 @@ public class MoxyStrategy extends Introspector {
resultClass = cd.getMappingForAttributeName(name).getReferenceDescriptor().getJavaClass();
}
}
-
+
return resultClass;
}
@@ -251,20 +252,20 @@ public class MoxyStrategy extends Introspector {
public Object getUnderlyingObject() {
return this.internalObject;
}
-
+
@Override
public String getChildName() {
-
+
String className = internalObject.getClass().getSimpleName();
String lowerHyphen = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, className);
-
+
if (this.isContainer()) {
lowerHyphen = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN,this.getGenericTypeClass(this.getProperties().iterator().next()).getSimpleName());
}
-
+
return lowerHyphen;
}
-
+
@Override
public String getName() {
String className = internalObject.getClass().getSimpleName();
@@ -273,11 +274,11 @@ public class MoxyStrategy extends Introspector {
if (this.isContainer()) {
lowerHyphen = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN,this.getGenericTypeClass(this.getProperties().get(0)).getSimpleName());
}*/
-
+
return lowerHyphen;
}
-
+
@Override
public String getObjectId() throws UnsupportedEncodingException {
String result = "";
@@ -285,17 +286,17 @@ public class MoxyStrategy extends Introspector {
if (this.isContainer()) {
result += "/" + this.getName();
} else {
-
+
if (container != null) {
result += "/" + container;
}
result += "/" + this.getDbName() + "/" + this.findKey();
-
+
}
-
+
return result;
}
-
+
@Override
protected String findKey() throws UnsupportedEncodingException {
Set<String> keys = null;
@@ -305,10 +306,10 @@ public class MoxyStrategy extends Introspector {
String value = UriUtils.encode(this.getValue(key).toString(), "UTF-8");
results.add(value);
}
-
+
return Joiner.on("/").join(results);
}
-
+
@Override
public String preProcessKey (String key) {
String result = "";
@@ -316,19 +317,19 @@ public class MoxyStrategy extends Introspector {
String[] split = key.split("/");
int i = 0;
for (i = split.length-1; i >= 0; i--) {
-
+
if (jaxbContext.getDynamicType(split[i]) != null) {
break;
-
+
}
-
+
}
result = Joiner.on("/").join(Arrays.copyOfRange(split, 0, i));
-
+
return result;
-
+
}
-
+
@Override
public String marshal(MarshallerProperties properties) {
StringWriter result = new StringWriter();
@@ -339,7 +340,7 @@ public class MoxyStrategy extends Introspector {
marshaller.setProperty(org.eclipse.persistence.jaxb.MarshallerProperties.JSON_WRAPPER_AS_ARRAY_NAME, properties.getWrapperAsArrayName());
marshaller.setProperty(org.eclipse.persistence.jaxb.MarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS, false);
}
-
+
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, properties.getFormatted());
marshaller.marshal(this.internalObject, result);
} catch (JAXBException e) {
@@ -348,7 +349,7 @@ public class MoxyStrategy extends Introspector {
return result.toString();
}
-
+
@Override
public Object clone() {
Object result = null;
@@ -358,7 +359,7 @@ public class MoxyStrategy extends Introspector {
unmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE, "application/json");
unmarshaller.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT, false);
unmarshaller.setProperty(UnmarshallerProperties.JSON_WRAPPER_AS_ARRAY_NAME, true);
-
+
result = unmarshaller.unmarshal(new StreamSource(new StringReader(this.marshal(true))), this.internalObject.getClass()).getValue();
} catch (JAXBException e) {
// TODO Auto-generated catch block
@@ -371,21 +372,21 @@ public class MoxyStrategy extends Introspector {
public ModelType getModelType() {
return ModelType.MOXY;
}
-
+
private String removeXPathDescriptor(String name) {
-
+
return name.replaceAll("/text\\(\\)", "");
}
@Override
public String getMetadata(ObjectMetadata name) {
-
+
return (String)cd.getProperty(name.toString());
}
@Override
public SchemaVersion getVersion() {
-
+
return this.version;
}
}
diff --git a/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java b/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java
index dd5d42c6..bd7f1b91 100644
--- a/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java
+++ b/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java
@@ -8,7 +8,7 @@
* 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
+ * 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,
@@ -50,6 +50,7 @@ import com.github.fge.jsonpatch.mergepatch.JsonMergePatch;
import org.apache.commons.lang.StringUtils;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.janusgraph.core.JanusGraphException;
import org.javatuples.Pair;
import org.onap.aai.db.props.AAIProperties;
@@ -67,6 +68,7 @@ import org.onap.aai.nodes.NodeIngestor;
import org.onap.aai.parsers.query.QueryParser;
import org.onap.aai.parsers.uri.URIToExtensionInformation;
+import org.onap.aai.parsers.uri.URIToObject;
import org.onap.aai.rest.ueb.UEBNotification;
import org.onap.aai.restcore.HttpMethod;
import org.onap.aai.schema.enums.ObjectMetadata;
@@ -93,15 +95,15 @@ public class HttpEntry {
private static final String TARGET_ENTITY = "DB";
private ModelType introspectorFactoryType;
-
+
private QueryStyle queryStyle;
-
+
private SchemaVersion version;
-
+
private Loader loader;
-
+
private TransactionalGraphEngine dbEngine;
-
+
private boolean processSingle = true;
private int paginationBucket = -1;
@@ -148,7 +150,7 @@ public class HttpEntry {
}
- public HttpEntry setHttpEntryProperties(SchemaVersion version, DBConnectionType connectionType, UEBNotification notification){
+ public HttpEntry setHttpEntryProperties(SchemaVersion version, DBConnectionType connectionType, UEBNotification notification){
this.version = version;
this.loader = loaderFactory.createLoaderForVersion(introspectorFactoryType, version);
this.dbEngine = new JanusGraphDBEngine(
@@ -161,7 +163,7 @@ public class HttpEntry {
getDbEngine().startTransaction();
return this;
}
-
+
/**
* Gets the introspector factory type.
@@ -316,7 +318,7 @@ public class HttpEntry {
QueryEngine queryEngine = dbEngine.getQueryEngine();
int maxRetries = 10;
int retry = 0;
-
+
LoggingContext.save();
for (DBRequest request : requests) {
response = null;
@@ -358,7 +360,7 @@ public class HttpEntry {
if (requestContextList != null) {
requestContext = requestContextList.get(0);
}
-
+
if (cleanUp == null) {
cleanUp = "false";
}
@@ -426,7 +428,7 @@ public class HttpEntry {
result = formatter.output(vertices.stream().map(vertex -> (Object) vertex).collect(Collectors.toList())).toString();
status = Status.OK;
}
-
+
break;
case PUT:
response = this.invokeExtension(dbEngine, this.dbEngine.tx(), method, request, sourceOfTruth, version, loader, obj, uri, true);
@@ -441,9 +443,9 @@ public class HttpEntry {
}
obj = serializer.getLatestVersionView(v);
if (query.isDependent()) {
- relatedObjects = this.getRelatedObjects(serializer, queryEngine, v);
+ relatedObjects = this.getRelatedObjects(serializer, queryEngine, v, obj, this.loader);
}
- LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs() +
+ LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs() +
(long)queryEngine.getDBTimeMsecs(), TimeUnit.MILLISECONDS);
LOGGER.info ("Completed ");
LoggingContext.restoreIfPossible();
@@ -454,7 +456,7 @@ public class HttpEntry {
serializer.touchStandardVertexProperties(v, false);
this.invokeExtension(dbEngine, this.dbEngine.tx(), method, request, sourceOfTruth, version, loader, obj, uri, true);
serializer.createEdge(obj, v);
-
+
LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs(),TimeUnit.MILLISECONDS);
LOGGER.info ("Completed");
LoggingContext.restoreIfPossible();
@@ -466,7 +468,7 @@ public class HttpEntry {
existingObj = this.getObjectFromDb(vertices, serializer, query, existingObj, request.getUri(), 0, false, cleanUp);
String existingJson = existingObj.marshal(false);
String newJson;
-
+
if (request.getRawRequestContent().isPresent()) {
newJson = request.getRawRequestContent().get();
} else {
@@ -489,15 +491,15 @@ public class HttpEntry {
status = Status.OK;
patchedObj = serializer.getLatestVersionView(v);
if (query.isDependent()) {
- relatedObjects = this.getRelatedObjects(serializer, queryEngine, v);
+ relatedObjects = this.getRelatedObjects(serializer, queryEngine, v, patchedObj, this.loader);
}
- LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs() +
+ LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs() +
(long)queryEngine.getDBTimeMsecs(), TimeUnit.MILLISECONDS);
LOGGER.info ("Completed");
LoggingContext.restoreIfPossible();
notification.createNotificationEvent(transactionId, sourceOfTruth, status, uri, patchedObj, relatedObjects, basePath);
} catch (IOException | JsonPatchException e) {
-
+
LOGGER.info ("Caught exception: " + e.getMessage());
LoggingContext.restoreIfPossible();
throw new AAIException("AAI_3000", "could not perform patch operation");
@@ -507,18 +509,18 @@ public class HttpEntry {
String resourceVersion = params.getFirst("resource-version");
obj = serializer.getLatestVersionView(v);
if (query.isDependent()) {
- relatedObjects = this.getRelatedObjects(serializer, queryEngine, v);
+ relatedObjects = this.getRelatedObjects(serializer, queryEngine, v, obj, this.loader);
}
/*
* Find all Delete-other-vertex vertices and create structure for notify
- * findDeleatble also returns the startVertex v and we dont want to create
+ * findDeleatble also returns the startVertex v and we dont want to create
* duplicate notification events for the same
* So remove the startvertex first
*/
-
+
List<Vertex> deletableVertices = dbEngine.getQueryEngine().findDeletable(v);
Long vId = (Long) v.id();
-
+
/*
* I am assuming vertexId cant be null
*/
@@ -527,39 +529,39 @@ public class HttpEntry {
Map<Vertex, Introspector> deleteObjects = new HashMap<>();
Map<String, URI> uriMap = new HashMap<>();
Map<String, HashMap<String, Introspector>> deleteRelatedObjects = new HashMap<>();
-
+
if(isDelVerticesPresent){
deleteObjects = this.buildIntrospectorObjects(serializer, deletableVertices);
-
+
uriMap = this.buildURIMap(serializer, deleteObjects);
deleteRelatedObjects = this.buildRelatedObjects(serializer, queryEngine, deleteObjects);
}
-
+
this.invokeExtension(dbEngine, this.dbEngine.tx(), method, request, sourceOfTruth, version, loader, obj, uri, true);
serializer.delete(v, deletableVertices, resourceVersion, enableResourceVersion);
this.invokeExtension(dbEngine, this.dbEngine.tx(), method, request, sourceOfTruth, version, loader, obj, uri, false);
-
- LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs() +
+
+ LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs() +
(long)queryEngine.getDBTimeMsecs(), TimeUnit.MILLISECONDS);
LOGGER.info ("Completed");
LoggingContext.restoreIfPossible();
status = Status.NO_CONTENT;
notification.createNotificationEvent(transactionId, sourceOfTruth, status, uri, obj, relatedObjects, basePath);
-
+
/*
* Notify delete-other-v candidates
*/
-
+
if(isDelVerticesPresent){
this.buildNotificationEvent(sourceOfTruth, status, transactionId, notification, deleteObjects,
uriMap, deleteRelatedObjects, basePath);
}
-
+
break;
case DELETE_EDGE:
serializer.touchStandardVertexProperties(v, false);
serializer.deleteEdge(obj, v);
-
+
LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs(),TimeUnit.MILLISECONDS);
LOGGER.info ("Completed");
LoggingContext.restoreIfPossible();
@@ -569,8 +571,8 @@ public class HttpEntry {
default:
break;
}
-
-
+
+
/* temporarily adding vertex id to the headers
* to be able to use for testing the vertex id endpoint functionality
* since we presently have no other way of generating those id urls
@@ -606,7 +608,7 @@ public class HttpEntry {
break;
} catch (JanusGraphException e) {
this.dbEngine.rollback();
-
+
LOGGER.info ("Caught exception: " + e.getMessage());
LoggingContext.restoreIfPossible();
AAIException ex = new AAIException("AAI_6142", e);
@@ -655,7 +657,7 @@ public class HttpEntry {
return Pair.with(success, responses);
}
-
+
/**
* Gets the media type.
*
@@ -663,15 +665,15 @@ public class HttpEntry {
* @return the media type
*/
private String getMediaType(List <MediaType> mediaTypeList) {
- String mediaType = MediaType.APPLICATION_JSON; // json is the default
+ String mediaType = MediaType.APPLICATION_JSON; // json is the default
for (MediaType mt : mediaTypeList) {
if (MediaType.APPLICATION_XML_TYPE.isCompatible(mt)) {
mediaType = MediaType.APPLICATION_XML;
- }
+ }
}
return mediaType;
}
-
+
/**
* Gets the object from db.
*
@@ -691,19 +693,19 @@ public class HttpEntry {
* @throws NoSuchMethodException the no such method exception
* @throws UnsupportedEncodingException the unsupported encoding exception
* @throws MalformedURLException the malformed URL exception
- * @throws AAIUnknownObjectException
- * @throws URISyntaxException
+ * @throws AAIUnknownObjectException
+ * @throws URISyntaxException
*/
private Introspector getObjectFromDb(List<Vertex> results, DBSerializer serializer, QueryParser query, Introspector obj, URI uri, int depth, boolean nodeOnly, String cleanUp) throws AAIException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, UnsupportedEncodingException, AAIUnknownObjectException, URISyntaxException {
-
- //nothing found
- if (results.isEmpty()) {
- String msg = createNotFoundMessage(query.getResultType(), uri);
+
+ //nothing found
+ if (results.isEmpty()) {
+ String msg = createNotFoundMessage(query.getResultType(), uri);
throw new AAIException("AAI_6114", msg);
- }
+ }
+
+ return serializer.dbToObject(results, obj, depth, nodeOnly, cleanUp);
- return serializer.dbToObject(results, obj, depth, nodeOnly, cleanUp);
-
}
/**
@@ -800,7 +802,7 @@ public class HttpEntry {
return response;
}
-
+
/**
* Creates the not found message.
*
@@ -809,12 +811,12 @@ public class HttpEntry {
* @return the string
*/
private String createNotFoundMessage(String resultType, URI uri) {
-
- String msg = "No Node of type " + resultType + " found at: " + uri.getPath();
- return msg;
+ String msg = "No Node of type " + resultType + " found at: " + uri.getPath();
+
+ return msg;
}
-
+
/**
* Sets the depth.
*
@@ -831,11 +833,11 @@ public class HttpEntry {
return depth;
}
- if(depthParam == null){
+ if(depthParam == null){
if(this.version.compareTo(schemaVersions.getDepthVersion()) >= 0){
depth = 0;
} else {
- depth = AAIProperties.MAXIMUM_DEPTH;
+ depth = AAIProperties.MAXIMUM_DEPTH;
}
} else {
if (!depthParam.isEmpty() && !"all".equals(depthParam)){
@@ -847,16 +849,16 @@ public class HttpEntry {
}
}
- String maxDepth = obj.getMetadata(ObjectMetadata.MAXIMUM_DEPTH);
-
+ String maxDepth = obj.getMetadata(ObjectMetadata.MAXIMUM_DEPTH);
+
int maximumDepth = AAIProperties.MAXIMUM_DEPTH;
if(maxDepth != null){
- try {
- maximumDepth = Integer.parseInt(maxDepth);
- } catch(Exception ex){
- throw new AAIException("AAI_4018");
- }
+ try {
+ maximumDepth = Integer.parseInt(maxDepth);
+ } catch(Exception ex){
+ throw new AAIException("AAI_4018");
+ }
}
if(depth > maximumDepth){
@@ -865,7 +867,7 @@ public class HttpEntry {
return depth;
}
-
+
/**
* Checks if is modification method.
*
@@ -874,31 +876,155 @@ public class HttpEntry {
*/
private boolean isModificationMethod(HttpMethod method) {
boolean result = false;
-
+
if (method.equals(HttpMethod.PUT) || method.equals(HttpMethod.PUT_EDGE) || method.equals(HttpMethod.DELETE_EDGE) || method.equals(HttpMethod.MERGE_PATCH)) {
result = true;
}
-
+
return result;
-
+
}
-
- private HashMap<String, Introspector> getRelatedObjects(DBSerializer serializer, QueryEngine queryEngine, Vertex v) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, UnsupportedEncodingException, AAIException, URISyntaxException {
+
+ /**
+ * Given an uri, introspector object and loader object
+ * it will check if the obj is top level object if it is,
+ * it will return immediately returning the uri passed in
+ * If it isn't, it will go through, get the uriTemplate
+ * from the introspector object and get the count of "/"s
+ * and remove that part of the uri using substring
+ * and keep doing that until the current object is top level
+ * Also added the max depth just so worst case scenario
+ * Then keep adding aai-uri to the list include the aai-uri passed in
+ * Convert that list into an array and return it
+ * <p>
+ *
+ * Example:
+ *
+ * <blockquote>
+ * aai-uri -> /cloud-infrastructure/cloud-regions/cloud-region/cloud-owner/cloud-region-id/tenants/tenant/tenant1/vservers/vserver/v1
+ *
+ * Given the uriTemplate vserver -> /vservers/vserver/{vserver-id}
+ * it converts to /vservers/vserver
+ *
+ * lastIndexOf /vservers/vserver in /cloud-infrastructure/cloud-regions/cloud-region/cloud-owner/cloud-region-id/tenants/tenant/tenant1/vservers/vserver/v1
+ * ^
+ * |
+ * |
+ * lastIndexOf
+ * Use substring to get the string from 0 to that lastIndexOf
+ * aai-uri -> /cloud-infrastructure/cloud-regions/cloud-region/cloud-owner/cloud-region-id/tenants/tenant/tenant1
+ *
+ * From this new aai-uri, generate a introspector from the URITOObject class
+ * and keep doing this until you
+ *
+ * </blockquote>
+ *
+ * @param aaiUri - aai-uri of the vertex representating the unique id of a given vertex
+ * @param obj - introspector object of the given starting vertex
+ * @param loader - Type of loader which will always be MoxyLoader to support model driven
+ * @return an array of strings which can be used to get the vertexes of parent and grand parents from a given vertex
+ * @throws UnsupportedEncodingException
+ * @throws AAIException
+ */
+ String[] convertIntrospectorToUriList(String aaiUri, Introspector obj, Loader loader) throws UnsupportedEncodingException, AAIException {
+
+ List<String> uriList = new ArrayList<>();
+ String template = StringUtils.EMPTY;
+ String truncatedUri = aaiUri;
+ int depth = AAIProperties.MAXIMUM_DEPTH;
+ uriList.add(truncatedUri);
+
+ while (depth >= 0 && !obj.isTopLevel()) {
+ template = obj.getMetadata(ObjectMetadata.URI_TEMPLATE);
+
+ if(template == null){
+ LOGGER.warn("Unable to find the uriTemplate for the object {}", obj.getDbName());
+ return null;
+ }
+
+ int templateCount = StringUtils.countMatches(template, "/");
+ int truncatedUriCount = StringUtils.countMatches(truncatedUri, "/");
+
+ if(templateCount > truncatedUriCount){
+ LOGGER.warn("Template uri {} contains more slashes than truncatedUri {}", template, truncatedUri);
+ return null;
+ }
+
+ int cutIndex = StringUtils.ordinalIndexOf(truncatedUri, "/", truncatedUriCount-templateCount+1);
+ truncatedUri = StringUtils.substring(truncatedUri, 0, cutIndex);
+ uriList.add(truncatedUri);
+ obj = new URIToObject(loader, UriBuilder.fromPath(truncatedUri).build()).getEntity();
+ depth--;
+ }
+
+ return uriList.toArray(new String[uriList.size()]);
+ }
+
+ /**
+ *
+ * @param serializer
+ * @param queryEngine
+ * @param v
+ * @param obj
+ * @param loader
+ * @return
+ * @throws IllegalAccessException
+ * @throws IllegalArgumentException
+ * @throws InvocationTargetException
+ * @throws SecurityException
+ * @throws InstantiationException
+ * @throws NoSuchMethodException
+ * @throws UnsupportedEncodingException
+ * @throws AAIException
+ * @throws URISyntaxException
+ */
+ private HashMap<String, Introspector> getRelatedObjects(DBSerializer serializer, QueryEngine queryEngine, Vertex v, Introspector obj, Loader loader) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, UnsupportedEncodingException, AAIException, URISyntaxException {
+
HashMap<String, Introspector> relatedVertices = new HashMap<>();
- List<Vertex> vertexChain = queryEngine.findParents(v);
- for (Vertex vertex : vertexChain) {
+ VertexProperty aaiUriProperty = v.property(AAIProperties.AAI_URI);
+
+ if(!aaiUriProperty.isPresent()){
+ if(LOGGER.isDebugEnabled()){
+ LOGGER.debug("For the given vertex {}, it seems aai-uri is not present so not getting related objects", v.id().toString());
+ } else {
+ LOGGER.info("It seems aai-uri is not present in vertex, so not getting related objects, for more info enable debug log");
+ }
+ return relatedVertices;
+ }
+
+ String aaiUri = aaiUriProperty.value().toString();
+
+ if(!obj.isTopLevel()){
+ String[] uriList = convertIntrospectorToUriList(aaiUri, obj, loader);
+ List<Vertex> vertexChain = null;
+ // If the uriList is null then there is something wrong with converting the uri
+ // into a list of aai-uris so falling back to the old mechanism for finding parents
+ if(uriList == null){
+ LOGGER.info("Falling back to the old mechanism due to unable to convert aai-uri to list of uris but this is not optimal");
+ vertexChain = queryEngine.findParents(v);
+ } else {
+ vertexChain = queryEngine.findParents(uriList);
+ }
+ for(Vertex vertex : vertexChain){
+ try {
+ final Introspector vertexObj = serializer.getVertexProperties(vertex);
+ relatedVertices.put(vertexObj.getObjectId(), vertexObj);
+ } catch (AAIUnknownObjectException e) {
+ LOGGER.warn("Unable to get vertex properties, partial list of related vertices returned");
+ }
+ }
+ } else {
try {
- final Introspector vertexObj = serializer.getVertexProperties(vertex);
+ final Introspector vertexObj = serializer.getVertexProperties(v);
relatedVertices.put(vertexObj.getObjectId(), vertexObj);
} catch (AAIUnknownObjectException e) {
LOGGER.warn("Unable to get vertex properties, partial list of related vertices returned");
}
-
}
-
+
return relatedVertices;
}
-
+
private Map<Vertex, Introspector> buildIntrospectorObjects(DBSerializer serializer, Iterable<Vertex> vertices) {
Map<Vertex, Introspector> deleteObjectMap = new HashMap<>();
for (Vertex vertex : vertices) {
@@ -944,7 +1070,7 @@ public class HttpEntry {
for (Map.Entry<Vertex, Introspector> entry : introSpector.entrySet()) {
try {
HashMap<String, Introspector> relatedObjects = this.getRelatedObjects(serializer, queryEngine,
- entry.getKey());
+ entry.getKey(), entry.getValue(), this.loader);
if (null != entry.getValue())
relatedObjectsMap.put(entry.getValue().getObjectId(), relatedObjects);
} catch (IllegalAccessException | IllegalArgumentException
@@ -959,7 +1085,7 @@ public class HttpEntry {
return relatedObjectsMap;
}
-
+
private void buildNotificationEvent(String sourceOfTruth, Status status, String transactionId,
UEBNotification notification, Map<Vertex, Introspector> deleteObjects, Map<String, URI> uriMap,
Map<String, HashMap<String, Introspector>> deleteRelatedObjects, String basePath) {
@@ -980,4 +1106,27 @@ public class HttpEntry {
}
}
}
+
+ public void setPaginationParameters(String resultIndex, String resultSize) {
+ if (resultIndex != null && resultIndex != "-1" && resultSize != null && resultSize != "-1") {
+ this.setPaginationIndex(Integer.parseInt(resultIndex));
+ this.setPaginationBucket(Integer.parseInt(resultSize));
+ }
+ }
+
+ public List<Object> getPaginatedVertexList(List<Object> vertexList) throws AAIException{
+ List<Object> vertices;
+ if(this.isPaginated()) {
+ this.setTotalsForPaging(vertexList.size(), this.getPaginationBucket());
+ int startIndex = (this.getPaginationIndex() - 1) * this.getPaginationBucket();
+ int endIndex = Math.min((this.getPaginationBucket() * this.getPaginationIndex()), vertexList.size());
+ if(startIndex > endIndex){
+ throw new AAIException("AAI_6150"," ResultIndex is not appropriate for the result set, Needs to be <= "+ endIndex);
+ }
+ vertices = vertexList.subList(startIndex, endIndex);
+ }else{
+ vertices = vertexList;
+ }
+ return vertices;
+ }
}
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java b/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
index 7a2c447e..9d107b1f 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
@@ -23,18 +23,21 @@ package org.onap.aai.serialization.db;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.google.common.base.CaseFormat;
-import org.janusgraph.core.SchemaViolationException;
+import com.google.common.collect.Multimap;
import org.apache.commons.collections.IteratorUtils;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
import org.apache.tinkerpop.gremlin.structure.*;
-import org.javatuples.Pair;
+import org.janusgraph.core.SchemaViolationException;
import org.javatuples.Triplet;
+import org.onap.aai.concurrent.AaiCallable;
+import org.onap.aai.config.SpringContextAware;
import org.onap.aai.db.props.AAIProperties;
import org.onap.aai.edges.EdgeIngestor;
import org.onap.aai.edges.EdgeRule;
import org.onap.aai.edges.EdgeRuleQuery;
+import org.onap.aai.edges.TypeAlphabetizer;
import org.onap.aai.edges.enums.AAIDirection;
import org.onap.aai.edges.enums.EdgeField;
import org.onap.aai.edges.enums.EdgeProperty;
@@ -57,6 +60,7 @@ import org.onap.aai.schema.enums.PropertyMetadata;
import org.onap.aai.serialization.db.exceptions.MultipleEdgeRuleFoundException;
import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException;
import org.onap.aai.serialization.engines.TransactionalGraphEngine;
+import org.onap.aai.serialization.engines.query.QueryEngine;
import org.onap.aai.serialization.tinkerpop.TreeBackedVertex;
import org.onap.aai.setup.SchemaVersion;
import org.onap.aai.setup.SchemaVersions;
@@ -64,8 +68,6 @@ import org.onap.aai.util.AAIConfig;
import org.onap.aai.util.AAIConstants;
import org.onap.aai.workarounds.NamingExceptions;
import org.springframework.context.ApplicationContext;
-import org.onap.aai.concurrent.AaiCallable;
-import org.onap.aai.config.SpringContextAware;
import javax.ws.rs.core.UriBuilder;
import java.io.UnsupportedEncodingException;
@@ -78,1790 +80,1956 @@ import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
+import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.onap.aai.serialization.engines.query.QueryEngine;
+import java.util.stream.Collectors;
public class DBSerializer {
-
- private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(DBSerializer.class);
-
- private final TransactionalGraphEngine engine;
- private final String sourceOfTruth;
- private final ModelType introspectionType;
- private final SchemaVersion version;
- private final Loader latestLoader;
- private EdgeSerializer edgeSer;
- private EdgeIngestor edgeRules;
- private final Loader loader;
- private final String baseURL;
- private double dbTimeMsecs = 0;
- private long currentTimeMillis;
-
- private SchemaVersions schemaVersions;
- /**
- * Instantiates a new DB serializer.
- *
- * @param version the version
- * @param engine the engine
- * @param introspectionType the introspection type
- * @param sourceOfTruth the source of truth
- * @throws AAIException
- */
- public DBSerializer(SchemaVersion version, TransactionalGraphEngine engine, ModelType introspectionType, String sourceOfTruth) throws AAIException {
- this.engine = engine;
- this.sourceOfTruth = sourceOfTruth;
- this.introspectionType = introspectionType;
- this.schemaVersions = SpringContextAware.getBean(SchemaVersions.class);
- SchemaVersion LATEST = schemaVersions.getDefaultVersion();
- this.latestLoader = SpringContextAware.getBean(LoaderFactory.class).createLoaderForVersion(introspectionType, LATEST);
- this.version = version;
- this.loader = SpringContextAware.getBean(LoaderFactory.class).createLoaderForVersion(introspectionType, version);
- this.baseURL = AAIConfig.get(AAIConstants.AAI_SERVER_URL_BASE);
- this.currentTimeMillis = System.currentTimeMillis();
- initBeans();
- }
-
- private void initBeans() {
- //TODO proper spring wiring, but that requires a lot of refactoring so for now we have this
- ApplicationContext ctx = SpringContextAware.getApplicationContext();
- EdgeIngestor ei = ctx.getBean(EdgeIngestor.class);
- setEdgeIngestor(ei);
- EdgeSerializer es = ctx.getBean(EdgeSerializer.class);
- setEdgeSerializer(es);
- }
-
- private void backupESInit() {
- setEdgeSerializer(new EdgeSerializer(this.edgeRules));
- }
-
- public void setEdgeSerializer(EdgeSerializer edgeSer) {
- this.edgeSer = edgeSer;
- }
-
- public EdgeSerializer getEdgeSeriailizer() {
- return this.edgeSer;
- }
-
- public void setEdgeIngestor(EdgeIngestor ei) {
- this.edgeRules = ei;
- }
-
- public EdgeIngestor getEdgeIngestor(){
- return this.edgeRules;
- }
-
- /**
- * Touch standard vertex properties.
- *
- * @param v the v
- * @param isNewVertex the is new vertex
- */
- public void touchStandardVertexProperties(Vertex v, boolean isNewVertex) {
- String timeNowInSec = Long.toString(currentTimeMillis);
-
- if (isNewVertex) {
- v.property(AAIProperties.SOURCE_OF_TRUTH, this.sourceOfTruth);
- v.property(AAIProperties.CREATED_TS, timeNowInSec);
- v.property(AAIProperties.AAI_UUID, UUID.randomUUID().toString());
- }
- v.property(AAIProperties.RESOURCE_VERSION, timeNowInSec);
- v.property(AAIProperties.LAST_MOD_TS, timeNowInSec);
- v.property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, this.sourceOfTruth);
-
- }
-
- private void touchStandardVertexProperties(String nodeType, Vertex v, boolean isNewVertex) {
-
- v.property(AAIProperties.NODE_TYPE, nodeType);
- touchStandardVertexProperties(v, isNewVertex);
-
- }
-
-
-
- /**
- * Creates the new vertex.
- *
- * @param wrappedObject the wrapped object
- * @return the vertex
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIException the AAI exception
- */
- public Vertex createNewVertex(Introspector wrappedObject) {
- Vertex v;
- try {
- StopWatch.conditionalStart();
- v = this.engine.tx().addVertex();
- touchStandardVertexProperties(wrappedObject.getDbName(), v, true);
- }
- finally {
- dbTimeMsecs += StopWatch.stopIfStarted();
- }
- return v;
- }
-
- /**
- * Trim class name.
- *
- * @param className the class name
- * @return the string
- */
- /*
- * Removes the classpath from a class name
- */
- public String trimClassName (String className) {
- String returnValue = "";
-
- if (className.lastIndexOf('.') == -1) {
- return className;
- }
- returnValue = className.substring(className.lastIndexOf('.') + 1, className.length());
-
- return returnValue;
- }
-
- /**
- * Serialize to db.
- *
- * @param obj the obj
- * @param v the v
- * @param uriQuery the uri query
- * @param identifier the identifier
- * @throws SecurityException the security exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws InstantiationException the instantiation exception
- * @throws InterruptedException the interrupted exception
- * @throws NoSuchMethodException the no such method exception
- * @throws AAIException the AAI exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIUnknownObjectException
- */
- public void serializeToDb(Introspector obj, Vertex v, QueryParser uriQuery, String identifier, String requestContext) throws AAIException, UnsupportedEncodingException {
- StopWatch.conditionalStart();
- try {
- if (uriQuery.isDependent()) {
- //try to find the parent
- List<Vertex> vertices = uriQuery.getQueryBuilder().getParentQuery().toList();
- if (!vertices.isEmpty()) {
- Vertex parent = vertices.get(0);
- this.reflectDependentVertex(parent, v, obj, requestContext);
- } else {
- dbTimeMsecs += StopWatch.stopIfStarted();
- throw new AAIException("AAI_6114", "No parent Node of type " + uriQuery.getParentResultType() + " for " + identifier);
- }
- } else {
- serializeSingleVertex(v, obj, requestContext);
- }
-
- } catch (SchemaViolationException e) {
- dbTimeMsecs += StopWatch.stopIfStarted();
- throw new AAIException("AAI_6117", e);
- }
- dbTimeMsecs += StopWatch.stopIfStarted();
- }
-
- public void serializeSingleVertex(Vertex v, Introspector obj, String requestContext) throws UnsupportedEncodingException, AAIException {
- StopWatch.conditionalStart();
- try {
- boolean isTopLevel = obj.isTopLevel();
- if (isTopLevel) {
- addUriIfNeeded(v, obj.getURI());
- }
-
- processObject(obj, v, requestContext);
- if (!isTopLevel) {
- URI uri = this.getURIForVertex(v);
- URIParser parser = new URIParser(this.loader, uri);
- if (parser.validate()) {
- addUriIfNeeded(v, uri.toString());
- }
- }
- } catch (SchemaViolationException e) {
- throw new AAIException("AAI_6117", e);
- }
- finally {
- dbTimeMsecs += StopWatch.stopIfStarted();
- }
- }
-
- private void addUriIfNeeded(Vertex v, String uri) {
- VertexProperty<String> uriProp = v.property(AAIProperties.AAI_URI);
- if (!uriProp.isPresent() || (uriProp.isPresent() && !uriProp.value().equals(uri))) {
- v.property(AAIProperties.AAI_URI, uri);
- }
- }
-
- /**
- * Process object.
- *
- * @param <T> the generic type
- * @param obj the obj
- * @param v the v
- * @return the list
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws InstantiationException the instantiation exception
- * @throws NoSuchMethodException the no such method exception
- * @throws SecurityException the security exception
- * @throws AAIException the AAI exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIUnknownObjectException
- */
- /*
- * Helper method for reflectToDb
- * Handles all the property setting
- */
- private <T> List<Vertex> processObject (Introspector obj, Vertex v, String requestContext) throws UnsupportedEncodingException, AAIException {
- Set<String> properties = new LinkedHashSet<>(obj.getProperties());
- properties.remove(AAIProperties.RESOURCE_VERSION);
- List<Vertex> dependentVertexes = new ArrayList<>();
- List<Vertex> processedVertexes = new ArrayList<>();
- boolean isComplexType = false;
- boolean isListType = false;
- if (!obj.isContainer()) {
- this.touchStandardVertexProperties(obj.getDbName(), v, false);
- }
- this.executePreSideEffects(obj, v);
- for (String property : properties) {
- Object value = null;
- final String propertyType;
- propertyType = obj.getType(property);
- isComplexType = obj.isComplexType(property);
- isListType = obj.isListType(property);
- value = obj.getValue(property);
-
- if (!(isComplexType || isListType)) {
- boolean canModify = this.canModify(obj, property, requestContext);
-
- if (canModify) {
- final Map<PropertyMetadata, String> metadata = obj.getPropertyMetadata(property);
- String dbProperty = property;
- if (metadata.containsKey(PropertyMetadata.DB_ALIAS)) {
- dbProperty = metadata.get(PropertyMetadata.DB_ALIAS);
- }
- if (metadata.containsKey(PropertyMetadata.DATA_LINK)) {
- //data linked properties are ephemeral
- //they are populated dynamically on GETs
- continue;
- }
- if (value != null) {
- if (!value.equals(v.property(dbProperty).orElse(null))) {
- if (propertyType.toLowerCase().contains(".long")) {
- v.property(dbProperty, new Integer(((Long)value).toString()));
- } else {
- v.property(dbProperty, value);
- }
- }
- } else {
- v.property(dbProperty).remove();
- }
- }
- } else if (isListType) {
- List<Object> list = (List<Object>)value;
- if (obj.isComplexGenericType(property)) {
- if (list != null) {
- for (Object o : list) {
- Introspector child = IntrospectorFactory.newInstance(this.introspectionType, o);
- child.setURIChain(obj.getURI());
- processedVertexes.add(reflectDependentVertex(v, child, requestContext));
- }
- }
- } else {
- //simple list case
- engine.setListProperty(v, property, list);
- }
- } else {
- //method.getReturnType() is not 'simple' then create a vertex and edge recursively returning an edge back to this method
- if (value != null) { //effectively ignore complex properties not included in the object we're processing
- if (value.getClass().isArray()) {
-
- int length = Array.getLength(value);
- for (int i = 0; i < length; i ++) {
- Object arrayElement = Array.get(value, i);
- Introspector child = IntrospectorFactory.newInstance(this.introspectionType, arrayElement);
- child.setURIChain(obj.getURI());
- processedVertexes.add(reflectDependentVertex(v, child, requestContext));
-
- }
- } else if (!property.equals("relationship-list")) {
- // container case
- Introspector introspector = IntrospectorFactory.newInstance(this.introspectionType, value);
- if (introspector.isContainer()) {
- dependentVertexes.addAll(this.engine.getQueryEngine().findChildrenOfType(v, introspector.getChildDBName()));
- introspector.setURIChain(obj.getURI());
-
- processedVertexes.addAll(processObject(introspector, v, requestContext));
-
- } else {
- dependentVertexes.addAll(this.engine.getQueryEngine().findChildrenOfType(v, introspector.getDbName()));
- processedVertexes.add(reflectDependentVertex(v, introspector, requestContext));
-
- }
- } else if (property.equals("relationship-list")) {
- handleRelationships(obj, v);
- }
- }
- }
- }
- this.writeThroughDefaults(v, obj);
- /* handle those vertexes not touched */
- for (Vertex toBeRemoved : processedVertexes) {
- dependentVertexes.remove(toBeRemoved);
- }
- this.deleteItemsWithTraversal(dependentVertexes);
-
- this.executePostSideEffects(obj, v);
- return processedVertexes;
- }
-
- /**
- * Handle relationships.
- *
- * @param obj the obj
- * @param vertex the vertex
- * @throws SecurityException the security exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIException the AAI exception
- */
- /*
- * Handles the explicit relationships defined for an obj
- */
- private void handleRelationships(Introspector obj, Vertex vertex) throws UnsupportedEncodingException, AAIException {
-
-
-
- Introspector wrappedRl = obj.getWrappedValue("relationship-list");
- processRelationshipList(wrappedRl, vertex);
-
-
- }
-
-
- /**
- * Process relationship list.
- *
- * @param wrapped the wrapped
- * @param v the v
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIException the AAI exception
- */
- private void processRelationshipList(Introspector wrapped, Vertex v) throws UnsupportedEncodingException, AAIException {
-
- List<Object> relationships = (List<Object>)wrapped.getValue("relationship");
-
- List<Triplet<Vertex, Vertex, String>> addEdges = new ArrayList<>();
- List<Edge> existingEdges = this.engine.getQueryEngine().findEdgesForVersion(v, wrapped.getLoader());
-
- for (Object relationship : relationships) {
- Edge e = null;
- Vertex cousinVertex = null;
- String label = null;
- Introspector wrappedRel = IntrospectorFactory.newInstance(this.introspectionType, relationship);
- QueryParser parser = engine.getQueryBuilder().createQueryFromRelationship(wrappedRel);
-
- if (wrappedRel.hasProperty("relationship-label")) {
- label = wrappedRel.getValue("relationship-label");
- }
-
- List<Vertex> results = parser.getQueryBuilder().toList();
- if (results.isEmpty()) {
- final AAIException ex = new AAIException("AAI_6129", "Node of type " + parser.getResultType() + ". Could not find object at: " + parser.getUri());
- ex.getTemplateVars().add(parser.getResultType());
- ex.getTemplateVars().add(parser.getUri().toString());
- throw ex;
- } else {
- //still an issue if there's more than one
- cousinVertex = results.get(0);
- }
-
- if (cousinVertex != null) {
- String vType = (String)v.property(AAIProperties.NODE_TYPE).value();
- String cousinType = (String)cousinVertex.property(AAIProperties.NODE_TYPE).value();
- EdgeRuleQuery.Builder baseQ = new EdgeRuleQuery.Builder(vType, cousinType).label(label);
-
-
- if (!edgeRules.hasRule(baseQ.build())) {
- throw new AAIException("AAI_6120", "No EdgeRule found for passed nodeTypes: " + v.property(AAIProperties.NODE_TYPE).value().toString() + ", "
- + cousinVertex.property(AAIProperties.NODE_TYPE).value().toString() + (label != null ? (" with label " + label):"") +".");
- } else if (edgeRules.hasRule(baseQ.edgeType(EdgeType.TREE).build()) && !edgeRules.hasRule(baseQ.edgeType(EdgeType.COUSIN).build())) {
- throw new AAIException("AAI_6145");
- }
-
- e = this.getEdgeBetween(EdgeType.COUSIN, v, cousinVertex, label);
-
- if (e == null) {
- addEdges.add(new Triplet<>(v, cousinVertex, label));
- } else {
- existingEdges.remove(e);
- }
- }
- }
-
- for (Edge edge : existingEdges) {
- edge.remove();
- }
- for (Triplet<Vertex, Vertex, String> triplet : addEdges) {
- try {
- edgeSer.addEdge(this.engine.asAdmin().getTraversalSource(), triplet.getValue0(), triplet.getValue1(), triplet.getValue2());
- } catch (NoEdgeRuleFoundException e) {
- throw new AAIException("AAI_6129", e);
- }
- }
-
- }
-
- /**
- * Write through defaults.
- *
- * @param v the v
- * @param obj the obj
- * @throws AAIUnknownObjectException
- */
- private void writeThroughDefaults(Vertex v, Introspector obj) throws AAIUnknownObjectException {
- Introspector latest = this.latestLoader.introspectorFromName(obj.getName());
- if (latest != null) {
- Set<String> required = latest.getRequiredProperties();
-
- for (String field : required) {
- String defaultValue = null;
- Object vertexProp = null;
- defaultValue = latest.getPropertyMetadata(field).get(PropertyMetadata.DEFAULT_VALUE);
- if (defaultValue != null) {
- vertexProp = v.<Object>property(field).orElse(null);
- if (vertexProp == null) {
- v.property(field, defaultValue);
- }
- }
- }
- }
-
- }
-
-
- /**
- * Reflect dependent vertex.
- *
- * @param v the v
- * @param dependentObj the dependent obj
- * @return the vertex
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws InstantiationException the instantiation exception
- * @throws NoSuchMethodException the no such method exception
- * @throws SecurityException the security exception
- * @throws AAIException the AAI exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIUnknownObjectException
- */
- private Vertex reflectDependentVertex(Vertex v, Introspector dependentObj, String requestContext) throws AAIException, UnsupportedEncodingException {
-
- //QueryParser p = this.engine.getQueryBuilder().createQueryFromURI(obj.getURI());
- //List<Vertex> items = p.getQuery().toList();
- QueryBuilder<Vertex> query = this.engine.getQueryBuilder(v);
- query.createEdgeTraversal(EdgeType.TREE, v, dependentObj);
- query.createKeyQuery(dependentObj);
-
- List<Vertex> items = query.toList();
-
- Vertex dependentVertex = null;
- if (items.size() == 1) {
- dependentVertex = items.get(0);
- this.verifyResourceVersion("update", dependentObj.getDbName(), dependentVertex.<String>property(AAIProperties.RESOURCE_VERSION).orElse(null), (String)dependentObj.getValue(AAIProperties.RESOURCE_VERSION), (String)dependentObj.getURI());
- } else {
- this.verifyResourceVersion("create", dependentObj.getDbName(), "", (String)dependentObj.getValue(AAIProperties.RESOURCE_VERSION), (String)dependentObj.getURI());
- dependentVertex = createNewVertex(dependentObj);
- }
-
- return reflectDependentVertex(v, dependentVertex, dependentObj, requestContext);
-
- }
-
- /**
- * Reflect dependent vertex.
- *
- * @param parent the parent
- * @param child the child
- * @param obj the obj
- * @return the vertex
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws InstantiationException the instantiation exception
- * @throws NoSuchMethodException the no such method exception
- * @throws SecurityException the security exception
- * @throws AAIException the AAI exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIUnknownObjectException
- */
- private Vertex reflectDependentVertex(Vertex parent, Vertex child, Introspector obj, String requestContext) throws AAIException, UnsupportedEncodingException {
-
- String parentUri = parent.<String>property(AAIProperties.AAI_URI).orElse(null);
- if (parentUri != null) {
- String uri;
- uri = obj.getURI();
- addUriIfNeeded(child, parentUri + uri);
- }
- processObject(obj, child, requestContext);
-
- Edge e;
- e = this.getEdgeBetween(EdgeType.TREE, parent, child, null);
- if (e == null) {
- String canBeLinked = obj.getMetadata(ObjectMetadata.CAN_BE_LINKED);
- if (canBeLinked != null && canBeLinked.equals("true")) {
- Loader ldrForCntxt = SpringContextAware.getBean(LoaderFactory.class).createLoaderForVersion(introspectionType, getVerForContext(requestContext));
- boolean isFirst = !this.engine.getQueryBuilder(ldrForCntxt, parent).createEdgeTraversal(EdgeType.TREE, parent, obj).hasNext();
- if (isFirst) {
- child.property(AAIProperties.LINKED, true);
- }
- }
- edgeSer.addTreeEdge(this.engine.asAdmin().getTraversalSource(), parent, child);
- }
- return child;
-
- }
-
- private SchemaVersion getVerForContext(String requestContext) {
- Pattern pattern = Pattern.compile("v[0-9]+");
- Matcher m = pattern.matcher(requestContext);
- if (!m.find()) {
- return this.version;
- } else {
- return new SchemaVersion(requestContext);
- }
- }
-
- /**
- * Db to object.
- *
- * @param vertices the vertices
- * @param obj the obj
- * @param depth the depth
- * @param cleanUp the clean up
- * @return the introspector
- * @throws AAIException the AAI exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws SecurityException the security exception
- * @throws InstantiationException the instantiation exception
- * @throws NoSuchMethodException the no such method exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws MalformedURLException the malformed URL exception
- * @throws AAIUnknownObjectException
- * @throws URISyntaxException
- */
- public Introspector dbToObject(List<Vertex> vertices, final Introspector obj, int depth, boolean nodeOnly, String cleanUp) throws UnsupportedEncodingException, AAIException {
- final int internalDepth;
- if (depth == Integer.MAX_VALUE) {
- internalDepth = depth--;
- } else {
- internalDepth = depth;
- }
- StopWatch.conditionalStart();
- if (vertices.size() > 1 && !obj.isContainer()) {
- dbTimeMsecs += StopWatch.stopIfStarted();
- throw new AAIException("AAI_6136", "query object mismatch: this object cannot hold multiple items." + obj.getDbName());
- } else if (obj.isContainer()) {
- final List getList;
- String listProperty = null;
- for (String property : obj.getProperties()) {
- if (obj.isListType(property) && obj.isComplexGenericType(property)) {
- listProperty = property;
- break;
- }
- }
- final String propertyName = listProperty;
- getList = (List)obj.getValue(listProperty);
-
- /* This is an experimental multithreading experiment
- * on get alls.
- */
- ExecutorService pool = GetAllPool.getInstance().getPool();
-
- List<Future<Object>> futures = new ArrayList<>();
-
- QueryEngine tgEngine = this.engine.getQueryEngine();
- for (Vertex v : vertices) {
-
- AaiCallable<Object> task = new AaiCallable<Object>() {
- @Override
- public Object process() throws UnsupportedEncodingException, AAIException {
- Set<Vertex> seen = new HashSet<>();
- Introspector childObject;
- try {
- childObject = obj.newIntrospectorInstanceOfNestedProperty(propertyName);
- } catch (AAIUnknownObjectException e) {
- throw e;
- }
- Tree<Element> tree = tgEngine.findSubGraph(v, internalDepth, nodeOnly);
- TreeBackedVertex treeVertex = new TreeBackedVertex(v, tree);
- try {
- dbToObject(childObject, treeVertex, seen, internalDepth, nodeOnly, cleanUp);
- } catch (UnsupportedEncodingException e) {
- throw e;
- } catch (AAIException e) {
- throw e;
- }
- return childObject.getUnderlyingObject();
- //getList.add(childObject.getUnderlyingObject());
- }
- };
- futures.add(pool.submit(task));
- }
-
- for (Future<Object> future : futures) {
- try {
- getList.add(future.get());
- } catch (ExecutionException e) {
- dbTimeMsecs += StopWatch.stopIfStarted();
- throw new AAIException("AAI_4000", e);
- } catch (InterruptedException e) {
- dbTimeMsecs += StopWatch.stopIfStarted();
- throw new AAIException("AAI_4000", e);
- }
- }
- } else if (vertices.size() == 1) {
- Set<Vertex> seen = new HashSet<>();
- Tree<Element> tree = this.engine.getQueryEngine().findSubGraph(vertices.get(0), depth, nodeOnly);
- TreeBackedVertex treeVertex = new TreeBackedVertex(vertices.get(0), tree);
- dbToObject(obj, treeVertex, seen, depth, nodeOnly, cleanUp);
- } else {
- //obj = null;
- }
-
- dbTimeMsecs += StopWatch.stopIfStarted();
- return obj;
- }
-
- /**
- * Db to object.
- *
- * @param obj the obj
- * @param v the v
- * @param seen the seen
- * @param depth the depth
- * @param cleanUp the clean up
- * @return the introspector
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws SecurityException the security exception
- * @throws InstantiationException the instantiation exception
- * @throws NoSuchMethodException the no such method exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIException the AAI exception
- * @throws MalformedURLException the malformed URL exception
- * @throws AAIUnknownObjectException
- * @throws URISyntaxException
- */
- private Introspector dbToObject(Introspector obj, Vertex v, Set<Vertex> seen, int depth, boolean nodeOnly, String cleanUp) throws AAIException, UnsupportedEncodingException {
-
- if (depth < 0) {
- return null;
- }
- depth--;
- seen.add(v);
-
- boolean modified = false;
- for (String property : obj.getProperties(PropertyPredicates.isVisible())) {
- List<Object> getList = null;
- Vertex[] vertices = null;
-
- if (!(obj.isComplexType(property) || obj.isListType(property))) {
- this.copySimpleProperty(property, obj, v);
- modified = true;
- } else {
- if (obj.isComplexType(property)) {
- /* container case */
-
- if (!property.equals("relationship-list") && depth >= 0) {
- Introspector argumentObject = obj.newIntrospectorInstanceOfProperty(property);
- Object result = dbToObject(argumentObject, v, seen, depth+1, nodeOnly, cleanUp);
- if (result != null) {
- obj.setValue(property, argumentObject.getUnderlyingObject());
- modified = true;
- }
- } else if (property.equals("relationship-list") && !nodeOnly){
- /* relationships need to be handled correctly */
- Introspector relationshipList = obj.newIntrospectorInstanceOfProperty(property);
- relationshipList = createRelationshipList(v, relationshipList, cleanUp);
- if (relationshipList != null) {
- modified = true;
- obj.setValue(property, relationshipList.getUnderlyingObject());
- modified = true;
- }
-
- }
- } else if (obj.isListType(property)) {
-
- if (property.equals("any")) {
- continue;
- }
- String genericType = obj.getGenericTypeClass(property).getSimpleName();
- if (obj.isComplexGenericType(property) && depth >= 0) {
- final String childDbName = convertFromCamelCase(genericType);
- String vType = v.<String>property(AAIProperties.NODE_TYPE).orElse(null);
- EdgeRule rule;
-
- try {
- rule = edgeRules.getRule(new EdgeRuleQuery.Builder(vType, childDbName).edgeType(EdgeType.TREE).build());
- } catch (EdgeRuleNotFoundException e) {
- throw new NoEdgeRuleFoundException(e);
- } catch (AmbiguousRuleChoiceException e) {
- throw new MultipleEdgeRuleFoundException(e);
- }
- if (!rule.getContains().equals(AAIDirection.NONE.toString())) {
- //vertices = this.queryEngine.findRelatedVertices(v, Direction.OUT, rule.getLabel(), childDbName);
- Direction ruleDirection = rule.getDirection();
- Iterator<Vertex> itr = v.vertices(ruleDirection, rule.getLabel());
- List<Vertex> verticesList = (List<Vertex>)IteratorUtils.toList(itr);
- itr = verticesList.stream().filter(item -> {
- return item.property(AAIProperties.NODE_TYPE).orElse("").equals(childDbName);
- }).iterator();
- if (itr.hasNext()) {
- getList = (List<Object>)obj.getValue(property);
- }
- int processed = 0;
- int removed = 0;
- while (itr.hasNext()) {
- Vertex childVertex = itr.next();
- if (!seen.contains(childVertex)) {
- Introspector argumentObject = obj.newIntrospectorInstanceOfNestedProperty(property);
-
- Object result = dbToObject(argumentObject, childVertex, seen, depth, nodeOnly, cleanUp);
- if (result != null) {
- getList.add(argumentObject.getUnderlyingObject());
- }
-
- processed++;
- } else {
- removed++;
- LOGGER.warn("Cycle found while serializing vertex id={}", childVertex.id().toString());
- }
- }
- if (processed == 0) {
- //vertices were all seen, reset the list
- getList = null;
- }
- if (processed > 0) {
- modified = true;
- }
- }
- } else if (obj.isSimpleGenericType(property)) {
- List<Object> temp = this.engine.getListProperty(v, property);
- if (temp != null) {
- getList = (List<Object>)obj.getValue(property);
- getList.addAll(temp);
- modified = true;
- }
-
- }
-
- }
-
- }
- }
-
- //no changes were made to this obj, discard the instance
- if (!modified) {
- return null;
- }
- this.enrichData(obj, v);
- return obj;
-
- }
-
-
- public Introspector getVertexProperties(Vertex v) throws AAIException, UnsupportedEncodingException {
- String nodeType = v.<String>property(AAIProperties.NODE_TYPE).orElse(null);
- if (nodeType == null) {
- throw new AAIException("AAI_6143");
- }
-
- Introspector obj = this.latestLoader.introspectorFromName(nodeType);
- Set<Vertex> seen = new HashSet<>();
- int depth = 0;
- String cleanUp = "false";
- boolean nodeOnly = true;
- StopWatch.conditionalStart();
- this.dbToObject(obj, v, seen, depth, nodeOnly, cleanUp);
- dbTimeMsecs += StopWatch.stopIfStarted();
- return obj;
-
- }
- public Introspector getLatestVersionView(Vertex v) throws AAIException, UnsupportedEncodingException {
- String nodeType = v.<String>property(AAIProperties.NODE_TYPE).orElse(null);
- if (nodeType == null) {
- throw new AAIException("AAI_6143");
- }
- Introspector obj = this.latestLoader.introspectorFromName(nodeType);
- Set<Vertex> seen = new HashSet<>();
- int depth = AAIProperties.MAXIMUM_DEPTH;
- String cleanUp = "false";
- boolean nodeOnly = false;
- StopWatch.conditionalStart();
- Tree<Element> tree = this.engine.getQueryEngine().findSubGraph(v, depth, nodeOnly);
- TreeBackedVertex treeVertex = new TreeBackedVertex(v, tree);
- this.dbToObject(obj, treeVertex, seen, depth, nodeOnly, cleanUp);
- dbTimeMsecs += StopWatch.stopIfStarted();
- return obj;
- }
- /**
- * Copy simple property.
- *
- * @param property the property
- * @param obj the obj
- * @param v the v
- * @throws InstantiationException the instantiation exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws NoSuchMethodException the no such method exception
- * @throws SecurityException the security exception
- */
- private void copySimpleProperty(String property, Introspector obj, Vertex v) {
-
- final Map<PropertyMetadata, String> metadata = obj.getPropertyMetadata(property);
- String dbPropertyName = property;
-
- if (metadata.containsKey(PropertyMetadata.DB_ALIAS)) {
- dbPropertyName = metadata.get(PropertyMetadata.DB_ALIAS);
- }
-
-
-
- final Object temp = v.<Object>property(dbPropertyName).orElse(null);
- if (temp != null) {
- obj.setValue(property, temp);
- }
- }
-
- /**
- * Simple db to object.
- *
- * @param obj the obj
- * @param v the v
- * @throws InstantiationException the instantiation exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws NoSuchMethodException the no such method exception
- * @throws SecurityException the security exception
- */
- private void simpleDbToObject (Introspector obj, Vertex v) {
- for (String property : obj.getProperties()) {
-
-
- if (!(obj.isComplexType(property) || obj.isListType(property))) {
- this.copySimpleProperty(property, obj, v);
- }
- }
- }
-
- /**
- * Creates the relationship list.
- *
- * @param v the v
- * @param obj the obj
- * @param cleanUp the clean up
- * @return the object
- * @throws InstantiationException the instantiation exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws NoSuchMethodException the no such method exception
- * @throws SecurityException the security exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIException the AAI exception
- * @throws MalformedURLException the malformed URL exception
- * @throws URISyntaxException
- */
- private Introspector createRelationshipList(Vertex v, Introspector obj, String cleanUp) throws UnsupportedEncodingException, AAIException {
-
- List<Vertex> cousins = this.engine.getQueryEngine().findCousinVertices(v);
-
- List<Object> relationshipObjList = obj.getValue("relationship");
-
- for (Vertex cousin : cousins) {
- if (obj.getVersion().compareTo(schemaVersions.getEdgeLabelVersion()) >= 0) {
- List<Edge> edges = this.getEdgesBetween(EdgeType.COUSIN, v, cousin);
- for (Edge e : edges) {
- Introspector relationshipObj = obj.newIntrospectorInstanceOfNestedProperty("relationship");
- Object result = processEdgeRelationship(relationshipObj, cousin, cleanUp, e);
- if (result != null) {
- relationshipObjList.add(result);
- }
- }
- } else {
- Introspector relationshipObj = obj.newIntrospectorInstanceOfNestedProperty("relationship");
- Object result = processEdgeRelationship(relationshipObj, cousin, cleanUp, null);
- if (result != null) {
- relationshipObjList.add(result);
- }
- }
-
- }
-
- if (relationshipObjList.isEmpty()) {
- return null;
- } else {
- return obj;
- }
- }
-
- /**
- * Process edge relationship.
- *
- * @param relationshipObj the relationship obj
- * @param edge the edge
- * @param cleanUp the clean up
- * @return the object
- * @throws InstantiationException the instantiation exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws NoSuchMethodException the no such method exception
- * @throws SecurityException the security exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIException the AAI exception
- * @throws MalformedURLException the malformed URL exception
- * @throws AAIUnknownObjectException
- * @throws URISyntaxException
- */
- private Object processEdgeRelationship(Introspector relationshipObj, Vertex cousin, String cleanUp, Edge edge) throws UnsupportedEncodingException, AAIUnknownObjectException {
-
-
- //we must look up all parents in this case because we need to compute name-properties
- //we cannot used the cached aaiUri to perform this action currently
- Optional<Pair<Vertex, List<Introspector>>> tuple = this.getParents(relationshipObj.getLoader(), cousin, "true".equals(cleanUp));
- //damaged vertex found, ignore
- if (!tuple.isPresent()) {
- return null;
- }
- List<Introspector> list = tuple.get().getValue1();
- URI uri = this.getURIFromList(list);
-
- URIToRelationshipObject uriParser = null;
- Introspector result = null;
- try {
- uriParser = new URIToRelationshipObject(relationshipObj.getLoader(), uri, this.baseURL);
- result = uriParser.getResult();
- } catch (AAIException | URISyntaxException e) {
- LOGGER.error("Error while processing edge relationship in version " + relationshipObj.getVersion() + " (bad vertex ID=" + tuple.get().getValue0().id().toString() + ": "
- + e.getMessage() + " " + LogFormatTools.getStackTop(e));
- if ("true".equals(cleanUp)) {
- this.deleteWithTraversal(tuple.get().getValue0());
- }
- return null;
- }
- if (!list.isEmpty()) {
- this.addRelatedToProperty(result, list.get(0));
- }
-
- if (edge != null && result.hasProperty("relationship-label")) {
- result.setValue("relationship-label", edge.label());
- }
-
- return result.getUnderlyingObject();
- }
-
- /**
- * Gets the URI for vertex.
- *
- * @param v the v
- * @return the URI for vertex
- * @throws InstantiationException the instantiation exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws NoSuchMethodException the no such method exception
- * @throws SecurityException the security exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIUnknownObjectException
- */
- public URI getURIForVertex(Vertex v) throws UnsupportedEncodingException {
-
- return getURIForVertex(v, false);
- }
-
- public URI getURIForVertex(Vertex v, boolean overwrite) throws UnsupportedEncodingException {
- URI uri = UriBuilder.fromPath("/unknown-uri").build();
-
- String aaiUri = v.<String>property(AAIProperties.AAI_URI).orElse(null);
-
- if (aaiUri != null && !overwrite) {
- uri = UriBuilder.fromPath(aaiUri).build();
- } else {
- StopWatch.conditionalStart();
- Optional<Pair<Vertex, List<Introspector>>> tuple = this.getParents(this.loader, v, false);
- dbTimeMsecs += StopWatch.stopIfStarted();
- if (tuple.isPresent()) {
- List<Introspector> list = tuple.get().getValue1();
- uri = this.getURIFromList(list);
- }
-
-
- }
- return uri;
- }
- /**
- * Gets the URI from list.
- *
- * @param list the list
- * @return the URI from list
- * @throws UnsupportedEncodingException the unsupported encoding exception
- */
- private URI getURIFromList(List<Introspector> list) throws UnsupportedEncodingException {
- String uri = "";
- StringBuilder sb = new StringBuilder();
- for (Introspector i : list) {
- sb.insert(0, i.getURI());
- }
-
- uri = sb.toString();
- return UriBuilder.fromPath(uri).build();
- }
-
- /**
- * Gets the parents.
- *
- * @param start the start
- * @param removeDamaged the remove damaged
- * @return the parents
- * @throws InstantiationException the instantiation exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws NoSuchMethodException the no such method exception
- * @throws SecurityException the security exception
- * @throws AAIUnknownObjectException
- */
- private Optional<Pair<Vertex, List<Introspector>>> getParents(Loader loader, Vertex start, boolean removeDamaged) {
-
- List<Vertex> results = this.engine.getQueryEngine().findParents(start);
- List<Introspector> objs = new ArrayList<>();
- boolean shortCircuit = false;
- for (Vertex v : results) {
- String nodeType = v.<String>property(AAIProperties.NODE_TYPE).orElse(null);
- Introspector obj = null;
- //vertex on the other end of this edge is bad
- if (nodeType == null) {
- //log something here about what was found and that it was removed
- ErrorLogHelper.logError("AAI-6143", "Found a damaged parent vertex " + v.id().toString());
- if (removeDamaged) {
- this.deleteWithTraversal(v);
- }
- shortCircuit = true;
- } else {
- try {
- obj = loader.introspectorFromName(nodeType);
- } catch (AAIUnknownObjectException e) {
- LOGGER.info("attempted to create node type " + nodeType + " but we do not understand it for version: " + loader.getVersion());
- obj = null;
- }
- }
-
- if (obj == null) {
- //can't make a valid path because we don't understand this object
- // don't include it
- } else {
- this.simpleDbToObject(obj, v);
- objs.add(obj);
- }
- }
-
- //stop processing and don't return anything for this bad vertex
- if (shortCircuit) {
- return Optional.empty();
- }
-
- return Optional.of(new Pair<>(results.get(results.size()-1), objs));
- }
-
- /**
- * Adds the r
- * @throws AAIUnknownObjectException
- * @throws IllegalArgumentException elated to property.
- *
- * @param relationship the relationship
- * @param child the throws IllegalArgumentException, AAIUnknownObjectException child
- */
- public void addRelatedToProperty(Introspector relationship, Introspector child) throws AAIUnknownObjectException {
- String nameProps = child.getMetadata(ObjectMetadata.NAME_PROPS);
- List<Introspector> relatedToProperties = new ArrayList<>();
-
- if (nameProps != null) {
- String[] props = nameProps.split(",");
- for (String prop : props) {
- Introspector relatedTo = relationship.newIntrospectorInstanceOfNestedProperty("related-to-property");
- relatedTo.setValue("property-key", child.getDbName() + "." + prop);
- relatedTo.setValue("property-value", child.getValue(prop));
- relatedToProperties.add(relatedTo);
- }
- }
-
- if (!relatedToProperties.isEmpty()) {
- List relatedToList = (List)relationship.getValue("related-to-property");
- for (Introspector obj : relatedToProperties) {
- relatedToList.add(obj.getUnderlyingObject());
- }
- }
-
- }
-
- /**
- * Creates the edge.
- *
- * @param relationship the relationship
- * @param inputVertex the input vertex
- * @return true, if successful
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIException the AAI exception
- */
- public boolean createEdge(Introspector relationship, Vertex inputVertex) throws UnsupportedEncodingException, AAIException {
-
- Vertex relatedVertex = null;
- StopWatch.conditionalStart();
- QueryParser parser = engine.getQueryBuilder().createQueryFromRelationship(relationship);
-
- String label = null;
- if (relationship.hasProperty("relationship-label")) {
- label = relationship.getValue("relationship-label");
- }
-
- List<Vertex> results = parser.getQueryBuilder().toList();
- if (results.isEmpty()) {
- dbTimeMsecs += StopWatch.stopIfStarted();
- AAIException e = new AAIException("AAI_6129", "Node of type " + parser.getResultType() + ". Could not find object at: " + parser.getUri());
- e.getTemplateVars().add(parser.getResultType());
- e.getTemplateVars().add(parser.getUri().toString());
- throw e;
- } else {
- //still an issue if there's more than one
- relatedVertex = results.get(0);
- }
-
- if (relatedVertex != null) {
-
- Edge e;
- try {
- e = this.getEdgeBetween(EdgeType.COUSIN, inputVertex, relatedVertex, label);
- if (e == null) {
- edgeSer.addEdge(this.engine.asAdmin().getTraversalSource(), inputVertex, relatedVertex, label);
- } else {
- //attempted to link two vertexes already linked
- }
- } finally {
- dbTimeMsecs += StopWatch.stopIfStarted();
- }
- }
-
- dbTimeMsecs += StopWatch.stopIfStarted();
- return true;
- }
-
- /**
- * Gets all the edges between of the type.
- *
- * @param aVertex the out vertex
- * @param bVertex the in vertex
- * @return the edges between
- * @throws AAIException the AAI exception
- * @throws NoEdgeRuleFoundException
- */
- private List<Edge> getEdgesBetween(EdgeType type, Vertex aVertex, Vertex bVertex) {
-
- List<Edge> result = new ArrayList<>();
-
- if (bVertex != null) {
- GraphTraversal<Vertex, Edge> findEdgesBetween = null;
- findEdgesBetween = this.engine.asAdmin().getTraversalSource().V(aVertex).bothE();
- if (EdgeType.TREE.equals(type)) {
- findEdgesBetween = findEdgesBetween
- .not(
- __.or(
- __.has(EdgeProperty.CONTAINS.toString(), "NONE"),
- __.has(EdgeField.PRIVATE.toString(), true)
- )
- );
- } else {
- findEdgesBetween = findEdgesBetween
- .has(EdgeProperty.CONTAINS.toString(), "NONE")
- .not(
- __.has(EdgeField.PRIVATE.toString(), true)
- );
- }
- findEdgesBetween = findEdgesBetween.filter(__.otherV().hasId(bVertex.id()));
- result = findEdgesBetween.toList();
- }
-
- return result;
- }
- /**
- * Gets all the edges between the vertexes with the label and type.
- *
- * @param aVertex the out vertex
- * @param bVertex the in vertex
- * @param label
- * @return the edges between
- * @throws AAIException the AAI exception
- */
- private List<Edge> getEdgesBetween(EdgeType type, Vertex aVertex, Vertex bVertex, String label) throws AAIException {
-
- List<Edge> result = new ArrayList<>();
-
- if (bVertex != null) {
- String aType = aVertex.<String>property(AAIProperties.NODE_TYPE).value();
- String bType = bVertex.<String>property(AAIProperties.NODE_TYPE).value();
- EdgeRuleQuery q = new EdgeRuleQuery.Builder(aType, bType).edgeType(type).label(label).build();
- EdgeRule rule;
- try {
- rule = edgeRules.getRule(q);
- } catch (EdgeRuleNotFoundException e) {
- throw new NoEdgeRuleFoundException(e);
- } catch (AmbiguousRuleChoiceException e) {
- throw new MultipleEdgeRuleFoundException(e);
- }
- List<Edge> edges = this.getEdgesBetween(type, aVertex, bVertex);
- for (Edge edge : edges) {
- if (edge.label().equals(rule.getLabel())) {
- result.add(edge);
- }
- }
- }
-
- return result;
- }
-
- /**
- * Gets the edge between with the label and edge type.
- *
- * @param aVertex the out vertex
- * @param bVertex the in vertex
- * @param label
- * @return the edge between
- * @throws AAIException the AAI exception
- * @throws NoEdgeRuleFoundException
- */
- public Edge getEdgeBetween(EdgeType type, Vertex aVertex, Vertex bVertex, String label) throws AAIException {
-
- StopWatch.conditionalStart();
- if (bVertex != null) {
-
- List<Edge> edges = this.getEdgesBetween(type, aVertex, bVertex, label);
-
- if (!edges.isEmpty()) {
- dbTimeMsecs += StopWatch.stopIfStarted();
- return edges.get(0);
- }
-
- }
- dbTimeMsecs += StopWatch.stopIfStarted();
- return null;
- }
- public Edge getEdgeBetween(EdgeType type, Vertex aVertex, Vertex bVertex) throws AAIException {
- return this.getEdgeBetween(type, aVertex, bVertex, null);
- }
-
-
- /**
- * Delete edge.
- *
- * @param relationship the relationship
- * @param inputVertex the input vertex
- * @return true, if successful
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIException the AAI exception
- */
- public boolean deleteEdge(Introspector relationship, Vertex inputVertex) throws UnsupportedEncodingException, AAIException {
-
- Vertex relatedVertex = null;
- StopWatch.conditionalStart();
- QueryParser parser = engine.getQueryBuilder().createQueryFromRelationship(relationship);
-
- List<Vertex> results = parser.getQueryBuilder().toList();
-
- String label = null;
- if (relationship.hasProperty("relationship-label")) {
- label = relationship.getValue("relationship-label");
- }
-
- if (results.isEmpty()) {
- dbTimeMsecs += StopWatch.stopIfStarted();
- return false;
- }
-
- relatedVertex = results.get(0);
- Edge edge;
- try {
- edge = this.getEdgeBetween(EdgeType.COUSIN, inputVertex, relatedVertex, label);
- } catch (NoEdgeRuleFoundException e) {
- dbTimeMsecs += StopWatch.stopIfStarted();
- throw new AAIException("AAI_6129", e);
- }
- if (edge != null) {
- edge.remove();
- dbTimeMsecs += StopWatch.stopIfStarted();
- return true;
- } else {
- dbTimeMsecs += StopWatch.stopIfStarted();
- return false;
- }
-
- }
-
- /**
- * Delete items with traversal.
- *
- * @param vertexes the vertexes
- * @throws IllegalStateException the illegal state exception
- */
- public void deleteItemsWithTraversal(List<Vertex> vertexes) throws IllegalStateException {
-
- for (Vertex v : vertexes) {
+
+ private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(DBSerializer.class);
+
+ private final TransactionalGraphEngine engine;
+ private final String sourceOfTruth;
+ private final ModelType introspectionType;
+ private final SchemaVersion version;
+ private final Loader latestLoader;
+ private EdgeSerializer edgeSer;
+ private EdgeIngestor edgeRules;
+ private final Loader loader;
+ private final String baseURL;
+ private double dbTimeMsecs = 0;
+ private long currentTimeMillis;
+
+ private SchemaVersions schemaVersions;
+ private Set<String> namedPropNodes;
+ /**
+ * Instantiates a new DB serializer.
+ *
+ * @param version the version
+ * @param engine the engine
+ * @param introspectionType the introspection type
+ * @param sourceOfTruth the source of truth
+ * @throws AAIException
+ */
+ public DBSerializer(SchemaVersion version, TransactionalGraphEngine engine, ModelType introspectionType, String sourceOfTruth) throws AAIException {
+ this.engine = engine;
+ this.sourceOfTruth = sourceOfTruth;
+ this.introspectionType = introspectionType;
+ this.schemaVersions = SpringContextAware.getBean(SchemaVersions.class);
+ SchemaVersion LATEST = schemaVersions.getDefaultVersion();
+ this.latestLoader = SpringContextAware.getBean(LoaderFactory.class).createLoaderForVersion(introspectionType, LATEST);
+ this.version = version;
+ this.loader = SpringContextAware.getBean(LoaderFactory.class).createLoaderForVersion(introspectionType, version);
+ this.namedPropNodes = this.latestLoader.getNamedPropNodes();
+ this.baseURL = AAIConfig.get(AAIConstants.AAI_SERVER_URL_BASE);
+ this.currentTimeMillis = System.currentTimeMillis();
+ initBeans();
+ }
+
+ private void initBeans() {
+ //TODO proper spring wiring, but that requires a lot of refactoring so for now we have this
+ ApplicationContext ctx = SpringContextAware.getApplicationContext();
+ EdgeIngestor ei = ctx.getBean(EdgeIngestor.class);
+ setEdgeIngestor(ei);
+ EdgeSerializer es = ctx.getBean(EdgeSerializer.class);
+ setEdgeSerializer(es);
+ }
+
+ private void backupESInit() {
+ setEdgeSerializer(new EdgeSerializer(this.edgeRules));
+ }
+
+ public void setEdgeSerializer(EdgeSerializer edgeSer) {
+ this.edgeSer = edgeSer;
+ }
+
+ public EdgeSerializer getEdgeSeriailizer() {
+ return this.edgeSer;
+ }
+
+ public void setEdgeIngestor(EdgeIngestor ei) {
+ this.edgeRules = ei;
+ }
+
+ public EdgeIngestor getEdgeIngestor() {
+ return this.edgeRules;
+ }
+
+ /**
+ * Touch standard vertex properties.
+ *
+ * @param v the v
+ * @param isNewVertex the is new vertex
+ */
+ public void touchStandardVertexProperties(Vertex v, boolean isNewVertex) {
+ String timeNowInSec = Long.toString(currentTimeMillis);
+
+ if (isNewVertex) {
+ v.property(AAIProperties.SOURCE_OF_TRUTH, this.sourceOfTruth);
+ v.property(AAIProperties.CREATED_TS, timeNowInSec);
+ v.property(AAIProperties.AAI_UUID, UUID.randomUUID().toString());
+ }
+ v.property(AAIProperties.RESOURCE_VERSION, timeNowInSec);
+ v.property(AAIProperties.LAST_MOD_TS, timeNowInSec);
+ v.property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, this.sourceOfTruth);
+
+ }
+
+ private void touchStandardVertexProperties(String nodeType, Vertex v, boolean isNewVertex) {
+
+ v.property(AAIProperties.NODE_TYPE, nodeType);
+ touchStandardVertexProperties(v, isNewVertex);
+
+ }
+
+
+ /**
+ * Creates the new vertex.
+ *
+ * @param wrappedObject the wrapped object
+ * @return the vertex
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIException the AAI exception
+ */
+ public Vertex createNewVertex(Introspector wrappedObject) {
+ Vertex v;
+ try {
+ StopWatch.conditionalStart();
+ v = this.engine.tx().addVertex();
+ touchStandardVertexProperties(wrappedObject.getDbName(), v, true);
+ } finally {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ }
+ return v;
+ }
+
+ /**
+ * Trim class name.
+ *
+ * @param className the class name
+ * @return the string
+ */
+ /*
+ * Removes the classpath from a class name
+ */
+ public String trimClassName(String className) {
+ String returnValue = "";
+
+ if (className.lastIndexOf('.') == -1) {
+ return className;
+ }
+ returnValue = className.substring(className.lastIndexOf('.') + 1, className.length());
+
+ return returnValue;
+ }
+
+ /**
+ * Serialize to db.
+ *
+ * @param obj the obj
+ * @param v the v
+ * @param uriQuery the uri query
+ * @param identifier the identifier
+ * @throws SecurityException the security exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws InstantiationException the instantiation exception
+ * @throws InterruptedException the interrupted exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws AAIException the AAI exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIUnknownObjectException
+ */
+ public void serializeToDb(Introspector obj, Vertex v, QueryParser uriQuery, String identifier, String requestContext) throws AAIException, UnsupportedEncodingException {
+ StopWatch.conditionalStart();
+ try {
+ if (uriQuery.isDependent()) {
+ //try to find the parent
+ List<Vertex> vertices = uriQuery.getQueryBuilder().getParentQuery().toList();
+ if (!vertices.isEmpty()) {
+ Vertex parent = vertices.get(0);
+ this.reflectDependentVertex(parent, v, obj, requestContext);
+ } else {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ throw new AAIException("AAI_6114", "No parent Node of type " + uriQuery.getParentResultType() + " for " + identifier);
+ }
+ } else {
+ serializeSingleVertex(v, obj, requestContext);
+ }
+
+ } catch (SchemaViolationException e) {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ throw new AAIException("AAI_6117", e);
+ }
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ }
+
+ public void serializeSingleVertex(Vertex v, Introspector obj, String requestContext) throws UnsupportedEncodingException, AAIException {
+ StopWatch.conditionalStart();
+ try {
+ boolean isTopLevel = obj.isTopLevel();
+ if (isTopLevel) {
+ addUriIfNeeded(v, obj.getURI());
+ }
+
+ processObject(obj, v, requestContext);
+ if (!isTopLevel) {
+ URI uri = this.getURIForVertex(v);
+ URIParser parser = new URIParser(this.loader, uri);
+ if (parser.validate()) {
+ addUriIfNeeded(v, uri.toString());
+ }
+ }
+ } catch (SchemaViolationException e) {
+ throw new AAIException("AAI_6117", e);
+ } finally {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ }
+ }
+
+ private void addUriIfNeeded(Vertex v, String uri) {
+ VertexProperty<String> uriProp = v.property(AAIProperties.AAI_URI);
+ if (!uriProp.isPresent() || (uriProp.isPresent() && !uriProp.value().equals(uri))) {
+ v.property(AAIProperties.AAI_URI, uri);
+ }
+ }
+
+ /**
+ * Process object.
+ *
+ * @param <T> the generic type
+ * @param obj the obj
+ * @param v the v
+ * @return the list
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws InstantiationException the instantiation exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws SecurityException the security exception
+ * @throws AAIException the AAI exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIUnknownObjectException
+ */
+ /*
+ * Helper method for reflectToDb
+ * Handles all the property setting
+ */
+ private <T> List<Vertex> processObject(Introspector obj, Vertex v, String requestContext) throws UnsupportedEncodingException, AAIException {
+ Set<String> properties = new LinkedHashSet<>(obj.getProperties());
+ properties.remove(AAIProperties.RESOURCE_VERSION);
+ List<Vertex> dependentVertexes = new ArrayList<>();
+ List<Vertex> processedVertexes = new ArrayList<>();
+ boolean isComplexType = false;
+ boolean isListType = false;
+ if (!obj.isContainer()) {
+ this.touchStandardVertexProperties(obj.getDbName(), v, false);
+ }
+ this.executePreSideEffects(obj, v);
+ for (String property : properties) {
+ Object value = null;
+ final String propertyType;
+ propertyType = obj.getType(property);
+ isComplexType = obj.isComplexType(property);
+ isListType = obj.isListType(property);
+ value = obj.getValue(property);
+
+ if (!(isComplexType || isListType)) {
+ boolean canModify = this.canModify(obj, property, requestContext);
+
+ if (canModify) {
+ final Map<PropertyMetadata, String> metadata = obj.getPropertyMetadata(property);
+ String dbProperty = property;
+ if (metadata.containsKey(PropertyMetadata.DB_ALIAS)) {
+ dbProperty = metadata.get(PropertyMetadata.DB_ALIAS);
+ }
+ if (metadata.containsKey(PropertyMetadata.DATA_LINK)) {
+ //data linked properties are ephemeral
+ //they are populated dynamically on GETs
+ continue;
+ }
+ if (value != null) {
+ if (!value.equals(v.property(dbProperty).orElse(null))) {
+ if (propertyType.toLowerCase().contains(".long")) {
+ v.property(dbProperty, new Integer(((Long) value).toString()));
+ } else {
+ v.property(dbProperty, value);
+ }
+ }
+ } else {
+ v.property(dbProperty).remove();
+ }
+ }
+ } else if (isListType) {
+ List<Object> list = (List<Object>) value;
+ if (obj.isComplexGenericType(property)) {
+ if (list != null) {
+ for (Object o : list) {
+ Introspector child = IntrospectorFactory.newInstance(this.introspectionType, o);
+ child.setURIChain(obj.getURI());
+ processedVertexes.add(reflectDependentVertex(v, child, requestContext));
+ }
+ }
+ } else {
+ //simple list case
+ engine.setListProperty(v, property, list);
+ }
+ } else {
+ //method.getReturnType() is not 'simple' then create a vertex and edge recursively returning an edge back to this method
+ if (value != null) { //effectively ignore complex properties not included in the object we're processing
+ if (value.getClass().isArray()) {
+
+ int length = Array.getLength(value);
+ for (int i = 0; i < length; i++) {
+ Object arrayElement = Array.get(value, i);
+ Introspector child = IntrospectorFactory.newInstance(this.introspectionType, arrayElement);
+ child.setURIChain(obj.getURI());
+ processedVertexes.add(reflectDependentVertex(v, child, requestContext));
+
+ }
+ } else if (!property.equals("relationship-list")) {
+ // container case
+ Introspector introspector = IntrospectorFactory.newInstance(this.introspectionType, value);
+ if (introspector.isContainer()) {
+ dependentVertexes.addAll(this.engine.getQueryEngine().findChildrenOfType(v, introspector.getChildDBName()));
+ introspector.setURIChain(obj.getURI());
+
+ processedVertexes.addAll(processObject(introspector, v, requestContext));
+
+ } else {
+ dependentVertexes.addAll(this.engine.getQueryEngine().findChildrenOfType(v, introspector.getDbName()));
+ processedVertexes.add(reflectDependentVertex(v, introspector, requestContext));
+
+ }
+ } else if (property.equals("relationship-list")) {
+ handleRelationships(obj, v);
+ }
+ }
+ }
+ }
+ this.writeThroughDefaults(v, obj);
+ /* handle those vertexes not touched */
+ for (Vertex toBeRemoved : processedVertexes) {
+ dependentVertexes.remove(toBeRemoved);
+ }
+ this.deleteItemsWithTraversal(dependentVertexes);
+
+ this.executePostSideEffects(obj, v);
+ return processedVertexes;
+ }
+
+ /**
+ * Handle relationships.
+ *
+ * @param obj the obj
+ * @param vertex the vertex
+ * @throws SecurityException the security exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIException the AAI exception
+ */
+ /*
+ * Handles the explicit relationships defined for an obj
+ */
+ private void handleRelationships(Introspector obj, Vertex vertex) throws UnsupportedEncodingException, AAIException {
+
+
+ Introspector wrappedRl = obj.getWrappedValue("relationship-list");
+ processRelationshipList(wrappedRl, vertex);
+
+
+ }
+
+
+ /**
+ * Process relationship list.
+ *
+ * @param wrapped the wrapped
+ * @param v the v
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIException the AAI exception
+ */
+ private void processRelationshipList(Introspector wrapped, Vertex v) throws UnsupportedEncodingException, AAIException {
+
+ List<Object> relationships = (List<Object>) wrapped.getValue("relationship");
+
+ List<Triplet<Vertex, Vertex, String>> addEdges = new ArrayList<>();
+ List<Edge> existingEdges = this.engine.getQueryEngine().findEdgesForVersion(v, wrapped.getLoader());
+
+ for (Object relationship : relationships) {
+ Edge e = null;
+ Vertex cousinVertex = null;
+ String label = null;
+ Introspector wrappedRel = IntrospectorFactory.newInstance(this.introspectionType, relationship);
+ QueryParser parser = engine.getQueryBuilder().createQueryFromRelationship(wrappedRel);
+
+ if (wrappedRel.hasProperty("relationship-label")) {
+ label = wrappedRel.getValue("relationship-label");
+ }
+
+ List<Vertex> results = parser.getQueryBuilder().toList();
+ if (results.isEmpty()) {
+ final AAIException ex = new AAIException("AAI_6129", "Node of type " + parser.getResultType() + ". Could not find object at: " + parser.getUri());
+ ex.getTemplateVars().add(parser.getResultType());
+ ex.getTemplateVars().add(parser.getUri().toString());
+ throw ex;
+ } else {
+ //still an issue if there's more than one
+ cousinVertex = results.get(0);
+ }
+
+ if (cousinVertex != null) {
+ String vType = (String) v.property(AAIProperties.NODE_TYPE).value();
+ String cousinType = (String) cousinVertex.property(AAIProperties.NODE_TYPE).value();
+ EdgeRuleQuery.Builder baseQ = new EdgeRuleQuery.Builder(vType, cousinType).label(label);
+
+
+ if (!edgeRules.hasRule(baseQ.build())) {
+ throw new AAIException("AAI_6120", "No EdgeRule found for passed nodeTypes: " + v.property(AAIProperties.NODE_TYPE).value().toString() + ", "
+ + cousinVertex.property(AAIProperties.NODE_TYPE).value().toString() + (label != null ? (" with label " + label) : "") + ".");
+ } else if (edgeRules.hasRule(baseQ.edgeType(EdgeType.TREE).build()) && !edgeRules.hasRule(baseQ.edgeType(EdgeType.COUSIN).build())) {
+ throw new AAIException("AAI_6145");
+ }
+
+ e = this.getEdgeBetween(EdgeType.COUSIN, v, cousinVertex, label);
+
+ if (e == null) {
+ addEdges.add(new Triplet<>(v, cousinVertex, label));
+ } else {
+ existingEdges.remove(e);
+ }
+ }
+ }
+
+ for (Edge edge : existingEdges) {
+ edge.remove();
+ }
+ for (Triplet<Vertex, Vertex, String> triplet : addEdges) {
+ try {
+ edgeSer.addEdge(this.engine.asAdmin().getTraversalSource(), triplet.getValue0(), triplet.getValue1(), triplet.getValue2());
+ } catch (NoEdgeRuleFoundException e) {
+ throw new AAIException("AAI_6129", e);
+ }
+ }
+
+ }
+
+ /**
+ * Write through defaults.
+ *
+ * @param v the v
+ * @param obj the obj
+ * @throws AAIUnknownObjectException
+ */
+ private void writeThroughDefaults(Vertex v, Introspector obj) throws AAIUnknownObjectException {
+ Introspector latest = this.latestLoader.introspectorFromName(obj.getName());
+ if (latest != null) {
+ Set<String> required = latest.getRequiredProperties();
+
+ for (String field : required) {
+ String defaultValue = null;
+ Object vertexProp = null;
+ defaultValue = latest.getPropertyMetadata(field).get(PropertyMetadata.DEFAULT_VALUE);
+ if (defaultValue != null) {
+ vertexProp = v.<Object>property(field).orElse(null);
+ if (vertexProp == null) {
+ v.property(field, defaultValue);
+ }
+ }
+ }
+ }
+
+ }
+
+
+ /**
+ * Reflect dependent vertex.
+ *
+ * @param v the v
+ * @param dependentObj the dependent obj
+ * @return the vertex
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws InstantiationException the instantiation exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws SecurityException the security exception
+ * @throws AAIException the AAI exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIUnknownObjectException
+ */
+ private Vertex reflectDependentVertex(Vertex v, Introspector dependentObj, String requestContext) throws AAIException, UnsupportedEncodingException {
+
+ //QueryParser p = this.engine.getQueryBuilder().createQueryFromURI(obj.getURI());
+ //List<Vertex> items = p.getQuery().toList();
+ QueryBuilder<Vertex> query = this.engine.getQueryBuilder(v);
+ query.createEdgeTraversal(EdgeType.TREE, v, dependentObj);
+ query.createKeyQuery(dependentObj);
+
+ List<Vertex> items = query.toList();
+
+ Vertex dependentVertex = null;
+ if (items.size() == 1) {
+ dependentVertex = items.get(0);
+ this.verifyResourceVersion("update", dependentObj.getDbName(), dependentVertex.<String>property(AAIProperties.RESOURCE_VERSION).orElse(null), (String) dependentObj.getValue(AAIProperties.RESOURCE_VERSION), (String) dependentObj.getURI());
+ } else {
+ this.verifyResourceVersion("create", dependentObj.getDbName(), "", (String) dependentObj.getValue(AAIProperties.RESOURCE_VERSION), (String) dependentObj.getURI());
+ dependentVertex = createNewVertex(dependentObj);
+ }
+
+ return reflectDependentVertex(v, dependentVertex, dependentObj, requestContext);
+
+ }
+
+ /**
+ * Reflect dependent vertex.
+ *
+ * @param parent the parent
+ * @param child the child
+ * @param obj the obj
+ * @return the vertex
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws InstantiationException the instantiation exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws SecurityException the security exception
+ * @throws AAIException the AAI exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIUnknownObjectException
+ */
+ private Vertex reflectDependentVertex(Vertex parent, Vertex child, Introspector obj, String requestContext) throws AAIException, UnsupportedEncodingException {
+
+ String parentUri = parent.<String>property(AAIProperties.AAI_URI).orElse(null);
+ if (parentUri != null) {
+ String uri;
+ uri = obj.getURI();
+ addUriIfNeeded(child, parentUri + uri);
+ }
+ processObject(obj, child, requestContext);
+
+ Edge e;
+ e = this.getEdgeBetween(EdgeType.TREE, parent, child, null);
+
+ if (e == null) {
+ String canBeLinked = obj.getMetadata(ObjectMetadata.CAN_BE_LINKED);
+ if (canBeLinked != null && canBeLinked.equals("true")) {
+ Loader ldrForCntxt = SpringContextAware.getBean(LoaderFactory.class).createLoaderForVersion(introspectionType, getVerForContext(requestContext));
+ boolean isFirst = !this.engine.getQueryBuilder(ldrForCntxt, parent).createEdgeTraversal(EdgeType.TREE, parent, obj).hasNext();
+ if (isFirst) {
+ child.property(AAIProperties.LINKED, true);
+ }
+ }
+ edgeSer.addTreeEdge(this.engine.asAdmin().getTraversalSource(), parent, child);
+ }
+ return child;
+
+ }
+
+ private SchemaVersion getVerForContext(String requestContext) {
+ Pattern pattern = Pattern.compile("v[0-9]+");
+ Matcher m = pattern.matcher(requestContext);
+ if (!m.find()) {
+ return this.version;
+ } else {
+ return new SchemaVersion(requestContext);
+ }
+ }
+
+ /**
+ * Db to object.
+ *
+ * @param vertices the vertices
+ * @param obj the obj
+ * @param depth the depth
+ * @param cleanUp the clean up
+ * @return the introspector
+ * @throws AAIException the AAI exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws SecurityException the security exception
+ * @throws InstantiationException the instantiation exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws MalformedURLException the malformed URL exception
+ * @throws AAIUnknownObjectException
+ * @throws URISyntaxException
+ */
+ public Introspector dbToObject(List<Vertex> vertices, final Introspector obj, int depth, boolean nodeOnly, String cleanUp) throws UnsupportedEncodingException, AAIException {
+ final int internalDepth;
+ if (depth == Integer.MAX_VALUE) {
+ internalDepth = depth--;
+ } else {
+ internalDepth = depth;
+ }
+ StopWatch.conditionalStart();
+ if (vertices.size() > 1 && !obj.isContainer()) {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ throw new AAIException("AAI_6136", "query object mismatch: this object cannot hold multiple items." + obj.getDbName());
+ } else if (obj.isContainer()) {
+ final List getList;
+ String listProperty = null;
+ for (String property : obj.getProperties()) {
+ if (obj.isListType(property) && obj.isComplexGenericType(property)) {
+ listProperty = property;
+ break;
+ }
+ }
+ final String propertyName = listProperty;
+ getList = (List) obj.getValue(listProperty);
+
+ /* This is an experimental multithreading experiment
+ * on get alls.
+ */
+ ExecutorService pool = GetAllPool.getInstance().getPool();
+
+ List<Future<Object>> futures = new ArrayList<>();
+
+ QueryEngine tgEngine = this.engine.getQueryEngine();
+ for (Vertex v : vertices) {
+
+ AaiCallable<Object> task = new AaiCallable<Object>() {
+ @Override
+ public Object process() throws UnsupportedEncodingException, AAIException {
+ Set<Vertex> seen = new HashSet<>();
+ Introspector childObject;
+ try {
+ childObject = obj.newIntrospectorInstanceOfNestedProperty(propertyName);
+ } catch (AAIUnknownObjectException e) {
+ throw e;
+ }
+ try {
+ dbToObject(childObject, v, seen, internalDepth, nodeOnly, cleanUp);
+ } catch (UnsupportedEncodingException e) {
+ throw e;
+ } catch (AAIException e) {
+ throw e;
+ }
+ return childObject.getUnderlyingObject();
+ //getList.add(childObject.getUnderlyingObject());
+ }
+ };
+ futures.add(pool.submit(task));
+ }
+
+ for (Future<Object> future : futures) {
+ try {
+ getList.add(future.get());
+ } catch (ExecutionException e) {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ throw new AAIException("AAI_4000", e);
+ } catch (InterruptedException e) {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ throw new AAIException("AAI_4000", e);
+ }
+ }
+ } else if (vertices.size() == 1) {
+ Set<Vertex> seen = new HashSet<>();
+ dbToObject(obj, vertices.get(0), seen, depth, nodeOnly, cleanUp);
+ } else {
+ //obj = null;
+ }
+
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ return obj;
+ }
+
+ /**
+ * Db to object.
+ *
+ * @param obj the obj
+ * @param v the v
+ * @param seen the seen
+ * @param depth the depth
+ * @param cleanUp the clean up
+ * @return the introspector
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws SecurityException the security exception
+ * @throws InstantiationException the instantiation exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIException the AAI exception
+ * @throws MalformedURLException the malformed URL exception
+ * @throws AAIUnknownObjectException
+ * @throws URISyntaxException
+ */
+ private Introspector dbToObject(Introspector obj, Vertex v, Set<Vertex> seen, int depth, boolean nodeOnly, String cleanUp) throws AAIException, UnsupportedEncodingException {
+
+ if (depth < 0) {
+ return null;
+ }
+ depth--;
+ seen.add(v);
+
+ boolean modified = false;
+ for (String property : obj.getProperties(PropertyPredicates.isVisible())) {
+ List<Object> getList = null;
+ Vertex[] vertices = null;
+
+ if (!(obj.isComplexType(property) || obj.isListType(property))) {
+ this.copySimpleProperty(property, obj, v);
+ modified = true;
+ } else {
+ if (obj.isComplexType(property)) {
+ /* container case */
+
+ if (!property.equals("relationship-list") && depth >= 0) {
+ Introspector argumentObject = obj.newIntrospectorInstanceOfProperty(property);
+ Object result = dbToObject(argumentObject, v, seen, depth + 1, nodeOnly, cleanUp);
+ if (result != null) {
+ obj.setValue(property, argumentObject.getUnderlyingObject());
+ modified = true;
+ }
+ } else if (property.equals("relationship-list") && !nodeOnly) {
+ /* relationships need to be handled correctly */
+ Introspector relationshipList = obj.newIntrospectorInstanceOfProperty(property);
+ relationshipList = createRelationshipList(v, relationshipList, cleanUp);
+ if (relationshipList != null) {
+ modified = true;
+ obj.setValue(property, relationshipList.getUnderlyingObject());
+ modified = true;
+ }
+
+ }
+ } else if (obj.isListType(property)) {
+
+ if (property.equals("any")) {
+ continue;
+ }
+ String genericType = obj.getGenericTypeClass(property).getSimpleName();
+ if (obj.isComplexGenericType(property) && depth >= 0) {
+ final String childDbName = convertFromCamelCase(genericType);
+ String vType = v.<String>property(AAIProperties.NODE_TYPE).orElse(null);
+ EdgeRule rule;
+
+ try {
+ rule = edgeRules.getRule(new EdgeRuleQuery.Builder(vType, childDbName).edgeType(EdgeType.TREE).build());
+ } catch (EdgeRuleNotFoundException e) {
+ throw new NoEdgeRuleFoundException(e);
+ } catch (AmbiguousRuleChoiceException e) {
+ throw new MultipleEdgeRuleFoundException(e);
+ }
+ if (!rule.getContains().equals(AAIDirection.NONE.toString())) {
+ //vertices = this.queryEngine.findRelatedVertices(v, Direction.OUT, rule.getLabel(), childDbName);
+ Direction ruleDirection = rule.getDirection();
+ Iterator<Vertex> itr = v.vertices(ruleDirection, rule.getLabel());
+ List<Vertex> verticesList = (List<Vertex>) IteratorUtils.toList(itr);
+ itr = verticesList.stream().filter(item -> {
+ return item.property(AAIProperties.NODE_TYPE).orElse("").equals(childDbName);
+ }).iterator();
+ if (itr.hasNext()) {
+ getList = (List<Object>) obj.getValue(property);
+ }
+ int processed = 0;
+ int removed = 0;
+ while (itr.hasNext()) {
+ Vertex childVertex = itr.next();
+ if (!seen.contains(childVertex)) {
+ Introspector argumentObject = obj.newIntrospectorInstanceOfNestedProperty(property);
+
+ Object result = dbToObject(argumentObject, childVertex, seen, depth, nodeOnly, cleanUp);
+ if (result != null) {
+ getList.add(argumentObject.getUnderlyingObject());
+ }
+
+ processed++;
+ } else {
+ removed++;
+ LOGGER.warn("Cycle found while serializing vertex id={}", childVertex.id().toString());
+ }
+ }
+ if (processed == 0) {
+ //vertices were all seen, reset the list
+ getList = null;
+ }
+ if (processed > 0) {
+ modified = true;
+ }
+ }
+ } else if (obj.isSimpleGenericType(property)) {
+ List<Object> temp = this.engine.getListProperty(v, property);
+ if (temp != null) {
+ getList = (List<Object>) obj.getValue(property);
+ getList.addAll(temp);
+ modified = true;
+ }
+
+ }
+
+ }
+
+ }
+ }
+
+ //no changes were made to this obj, discard the instance
+ if (!modified) {
+ return null;
+ }
+ this.enrichData(obj, v);
+ return obj;
+
+ }
+
+
+ public Introspector getVertexProperties(Vertex v) throws AAIException, UnsupportedEncodingException {
+ String nodeType = v.<String>property(AAIProperties.NODE_TYPE).orElse(null);
+ if (nodeType == null) {
+ throw new AAIException("AAI_6143");
+ }
+
+ Introspector obj = this.latestLoader.introspectorFromName(nodeType);
+ Set<Vertex> seen = new HashSet<>();
+ int depth = 0;
+ String cleanUp = "false";
+ boolean nodeOnly = true;
+ StopWatch.conditionalStart();
+ this.dbToObject(obj, v, seen, depth, nodeOnly, cleanUp);
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ return obj;
+
+ }
+
+ public Introspector getLatestVersionView(Vertex v) throws AAIException, UnsupportedEncodingException {
+ String nodeType = v.<String>property(AAIProperties.NODE_TYPE).orElse(null);
+ if (nodeType == null) {
+ throw new AAIException("AAI_6143");
+ }
+ Introspector obj = this.latestLoader.introspectorFromName(nodeType);
+ Set<Vertex> seen = new HashSet<>();
+ int depth = AAIProperties.MAXIMUM_DEPTH;
+ String cleanUp = "false";
+ boolean nodeOnly = false;
+ StopWatch.conditionalStart();
+ Tree<Element> tree = this.engine.getQueryEngine().findSubGraph(v, depth, nodeOnly);
+ TreeBackedVertex treeVertex = new TreeBackedVertex(v, tree);
+ this.dbToObject(obj, treeVertex, seen, depth, nodeOnly, cleanUp);
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ return obj;
+ }
+
+ /**
+ * Copy simple property.
+ *
+ * @param property the property
+ * @param obj the obj
+ * @param v the v
+ * @throws InstantiationException the instantiation exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws SecurityException the security exception
+ */
+ private void copySimpleProperty(String property, Introspector obj, Vertex v) {
+
+ final Map<PropertyMetadata, String> metadata = obj.getPropertyMetadata(property);
+ String dbPropertyName = property;
+
+ if (metadata.containsKey(PropertyMetadata.DB_ALIAS)) {
+ dbPropertyName = metadata.get(PropertyMetadata.DB_ALIAS);
+ }
+
+
+ final Object temp = v.<Object>property(dbPropertyName).orElse(null);
+ if (temp != null) {
+ obj.setValue(property, temp);
+ }
+ }
+
+
+ /**
+ * Load the introspector from the hashmap for the given property key
+ *
+ * @param property - vertex property
+ * @param obj - introspector object representing the vertex
+ * @param hashMap - Containing a list of pre-fetched properties for a given vertex
+ */
+ private void copySimplePropertyFromHashMap(String property, Introspector obj, Map<String, Object> hashMap){
+
+ final Map<PropertyMetadata, String> metadata = obj.getPropertyMetadata(property);
+ String dbPropertyName = property;
+
+ if (metadata.containsKey(PropertyMetadata.DB_ALIAS)) {
+ dbPropertyName = metadata.get(PropertyMetadata.DB_ALIAS);
+ }
+
+ final Object temp = hashMap.getOrDefault(dbPropertyName, null);
+
+ if (temp != null) {
+ obj.setValue(property, temp);
+ }
+ }
+
+ /**
+ * Simple db to object.
+ *
+ * @param obj the obj
+ * @param v the v
+ * @throws InstantiationException the instantiation exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws SecurityException the security exception
+ */
+ private void simpleDbToObject(Introspector obj, Vertex v) {
+ for(String key : obj.getProperties()){
+ this.copySimpleProperty(key, obj, v);
+ }
+ }
+
+
+ public Map<String, Object> convertVertexToHashMap(Introspector obj, Vertex v){
+
+ long startTime = System.currentTimeMillis();
+
+ Set<String> simpleProperties = obj.getSimpleProperties(PropertyPredicates.isVisible());
+ String[] simplePropsArray = new String[simpleProperties.size()];
+ simplePropsArray = simpleProperties.toArray(simplePropsArray);
+
+ Map<String, Object> simplePropsHashMap = new HashMap<>(simplePropsArray.length * 2);
+
+ v.properties(simplePropsArray).forEachRemaining((vp) -> simplePropsHashMap.put(vp.key(), vp.value()));
+
+ return simplePropsHashMap;
+ }
+
+ /**
+ * Creates the relationship list.
+ *
+ * @param v the v
+ * @param obj the obj
+ * @param cleanUp the clean up
+ * @return the object
+ * @throws InstantiationException the instantiation exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws SecurityException the security exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIException the AAI exception
+ * @throws MalformedURLException the malformed URL exception
+ * @throws URISyntaxException
+ */
+ private Introspector createRelationshipList(Vertex v, Introspector obj, String cleanUp) throws UnsupportedEncodingException, AAIException {
+
+ String[] cousinRules = new String[0];
+
+ try {
+ cousinRules = edgeRules.retrieveCachedCousinLabels(obj.getDbName());
+ } catch (ExecutionException e) {
+ LOGGER.warn("Encountered an execution exception while retrieving labels for the node type {} using cached", obj.getDbName(), e);
+ }
+
+ List<Vertex> cousins = null;
+ if(cousinRules != null && cousinRules.length != 0){
+ cousins = this.engine.getQueryEngine().findCousinVertices(v, cousinRules);
+ } else {
+ cousins = this.engine.getQueryEngine().findCousinVertices(v);
+ }
+
+ List<Object> relationshipObjList = obj.getValue("relationship");
+ String aNodeType = v.property("aai-node-type").value().toString();
+
+ TypeAlphabetizer alphabetizer = new TypeAlphabetizer();
+
+ EdgeIngestor edgeIngestor = SpringContextAware.getBean(EdgeIngestor.class);
+ Set<String> keysWithMultipleLabels = edgeIngestor.getMultipleLabelKeys();
+
+ // For the given vertex, find all the cousins
+ // For each cousin retrieve the node type and then
+ // check if the version is greater than the edge label version
+ // meaning is the current version equal to greater than the version
+ // where we introduced the edge labels into the relationship payload
+ // If it is, then we check if the edge key there are multiple labels
+ // If there are multiple labels, then we need to go to the database
+ // to retrieve the labels between itself and cousin vertex
+ // If there is only single label between the edge a and b, then
+ // we can retrieve what that is without going to the database
+ // from using the edge rules json and get the edge rule out of it
+ EdgeRuleQuery.Builder queryBuilder = new EdgeRuleQuery.Builder(aNodeType);
+ for (Vertex cousin : cousins) {
+ VertexProperty vertexProperty = cousin.property("aai-node-type");
+ String bNodeType = null;
+ if(vertexProperty.isPresent()){
+ bNodeType = cousin.property("aai-node-type").value().toString();
+ } else {
+ // If the vertex is missing the aai-node-type
+ // Then its either a bad vertex or its in the process
+ // of getting deleted so we should ignore these vertexes
+ if(LOGGER.isDebugEnabled()){
+ LOGGER.debug("For the vertex {}, unable to retrieve the aai-node-type", v.id().toString());
+ } else {
+ LOGGER.info("Unable to retrieve the aai-node-type for vertex, for more info enable debug log");
+ }
+ continue;
+ }
+ if (obj.getVersion().compareTo(schemaVersions.getEdgeLabelVersion()) >= 0) {
+ String edgeKey = alphabetizer.buildAlphabetizedKey(aNodeType, bNodeType);
+ if(keysWithMultipleLabels.contains(edgeKey)){
+ List<String> edgeLabels = this.getEdgeLabelsBetween(EdgeType.COUSIN, v, cousin);
+ for(String edgeLabel: edgeLabels){
+ Introspector relationshipObj = obj.newIntrospectorInstanceOfNestedProperty("relationship");
+ Object result = processEdgeRelationship(relationshipObj, cousin, cleanUp, edgeLabel);
+ if (result != null) {
+ relationshipObjList.add(result);
+ }
+ }
+ } else {
+
+ EdgeRule edgeRule = null;
+
+ // Create a query based on the a nodetype and b nodetype
+ // which is also a cousin edge and ensure the version
+ // is used properly so for example in order to be backwards
+ // compatible if we had allowed a edge between a and b
+ // in a previous release and we decided to remove it from
+ // the edge rules in the future we can display the edge
+ // only for the older apis and the new apis if the edge rule
+ // is removed will not be seen in the newer version of the API
+
+ EdgeRuleQuery ruleQuery = queryBuilder
+ .to(bNodeType)
+ .edgeType(EdgeType.COUSIN)
+ .version(obj.getVersion())
+ .build();
+
+ try {
+ edgeRule = edgeIngestor.getRule(ruleQuery);
+ } catch (EdgeRuleNotFoundException e) {
+ LOGGER.warn("Caught an edge rule not found exception for query {}, {}," +
+ " it could be the edge rule is no longer valid for the existing edge in db",
+ ruleQuery, LogFormatTools.getStackTop(e));
+ continue;
+ } catch (AmbiguousRuleChoiceException e) {
+ LOGGER.error("Caught an ambiguous rule not found exception for query {}, {}",
+ ruleQuery, LogFormatTools.getStackTop(e));
+ continue;
+ }
+
+ Introspector relationshipObj = obj.newIntrospectorInstanceOfNestedProperty("relationship");
+ Object result = processEdgeRelationship(relationshipObj, cousin, cleanUp,edgeRule.getLabel());
+ if (result != null) {
+ relationshipObjList.add(result);
+ }
+ }
+ } else {
+ Introspector relationshipObj = obj.newIntrospectorInstanceOfNestedProperty("relationship");
+ Object result = processEdgeRelationship(relationshipObj, cousin, cleanUp, null);
+ if (result != null) {
+ relationshipObjList.add(result);
+ }
+ }
+
+ }
+
+ if (relationshipObjList.isEmpty()) {
+ return null;
+ } else {
+ return obj;
+ }
+ }
+
+ /**
+ * Process edge relationship.
+ *
+ * @param relationshipObj the relationship obj
+ * @param edge the edge
+ * @param cleanUp the clean up
+ * @return the object
+ * @throws InstantiationException the instantiation exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws SecurityException the security exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIException the AAI exception
+ * @throws MalformedURLException the malformed URL exception
+ * @throws AAIUnknownObjectException
+ * @throws URISyntaxException
+ */
+ private Object processEdgeRelationship(Introspector relationshipObj, Vertex cousin, String cleanUp, String edgeLabel) throws UnsupportedEncodingException, AAIUnknownObjectException {
+
+ VertexProperty aaiUriProperty = cousin.property("aai-uri");
+
+ if(!aaiUriProperty.isPresent()){
+ return null;
+ }
+
+ URI uri = UriBuilder.fromUri(aaiUriProperty.value().toString()).build();
+
+ URIToRelationshipObject uriParser = null;
+ Introspector result = null;
+ try {
+ uriParser = new URIToRelationshipObject(relationshipObj.getLoader(), uri, this.baseURL);
+ result = uriParser.getResult();
+ } catch (AAIException | URISyntaxException e) {
+ LOGGER.error("Error while processing edge relationship in version " + relationshipObj.getVersion() + " (bad vertex ID=" + ": "
+ + e.getMessage() + " " + LogFormatTools.getStackTop(e));
+ return null;
+ }
+
+ VertexProperty cousinVertexNodeType = cousin.property(AAIProperties.NODE_TYPE);
+
+ if(cousinVertexNodeType.isPresent()){
+ if(namedPropNodes.contains(cousinVertexNodeType.value().toString())){
+ Introspector cousinObj = loader.introspectorFromName(cousinVertexNodeType.value().toString());
+ this.simpleDbToObject(cousinObj, cousin);
+ this.addRelatedToProperty(result, cousinObj);
+ }
+ }
+
+ if (edgeLabel != null && result.hasProperty("relationship-label")) {
+ result.setValue("relationship-label", edgeLabel);
+ }
+
+ return result.getUnderlyingObject();
+ }
+
+ /**
+ * Gets the URI for vertex.
+ *
+ * @param v the v
+ * @return the URI for vertex
+ * @throws InstantiationException the instantiation exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws SecurityException the security exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIUnknownObjectException
+ */
+ public URI getURIForVertex(Vertex v) throws UnsupportedEncodingException {
+
+ return getURIForVertex(v, false);
+ }
+
+ public URI getURIForVertex(Vertex v, boolean overwrite) throws UnsupportedEncodingException {
+ URI uri = UriBuilder.fromPath("/unknown-uri").build();
+
+ String aaiUri = v.<String>property(AAIProperties.AAI_URI).orElse(null);
+
+ if (aaiUri != null && !overwrite) {
+ uri = UriBuilder.fromPath(aaiUri).build();
+ }
+
+ return uri;
+ }
+
+ /**
+ * Gets the URI from list.
+ *
+ * @param list the list
+ * @return the URI from list
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ */
+ private URI getURIFromList(List<Introspector> list) throws UnsupportedEncodingException {
+ String uri = "";
+ StringBuilder sb = new StringBuilder();
+ for (Introspector i : list) {
+ sb.insert(0, i.getURI());
+ }
+
+ uri = sb.toString();
+ return UriBuilder.fromPath(uri).build();
+ }
+
+ /**
+ * Adds the r
+ *
+ * @param relationship the relationship
+ * @param child the throws IllegalArgumentException, AAIUnknownObjectException child
+ * @throws AAIUnknownObjectException
+ * @throws IllegalArgumentException elated to property.
+ */
+ public void addRelatedToProperty(Introspector relationship, Introspector child) throws AAIUnknownObjectException {
+ String nameProps = child.getMetadata(ObjectMetadata.NAME_PROPS);
+ List<Introspector> relatedToProperties = new ArrayList<>();
+
+ if (nameProps != null) {
+ String[] props = nameProps.split(",");
+ for (String prop : props) {
+ Introspector relatedTo = relationship.newIntrospectorInstanceOfNestedProperty("related-to-property");
+ relatedTo.setValue("property-key", child.getDbName() + "." + prop);
+ relatedTo.setValue("property-value", child.getValue(prop));
+ relatedToProperties.add(relatedTo);
+ }
+ }
+
+ if (!relatedToProperties.isEmpty()) {
+ List relatedToList = (List) relationship.getValue("related-to-property");
+ for (Introspector obj : relatedToProperties) {
+ relatedToList.add(obj.getUnderlyingObject());
+ }
+ }
+
+ }
+
+ /**
+ * Creates the edge.
+ *
+ * @param relationship the relationship
+ * @param inputVertex the input vertex
+ * @return true, if successful
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIException the AAI exception
+ */
+ public boolean createEdge(Introspector relationship, Vertex inputVertex) throws UnsupportedEncodingException, AAIException {
+
+ Vertex relatedVertex = null;
+ StopWatch.conditionalStart();
+ QueryParser parser = engine.getQueryBuilder().createQueryFromRelationship(relationship);
+
+ String label = null;
+ if (relationship.hasProperty("relationship-label")) {
+ label = relationship.getValue("relationship-label");
+ }
+
+ List<Vertex> results = parser.getQueryBuilder().toList();
+ if (results.isEmpty()) {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ AAIException e = new AAIException("AAI_6129", "Node of type " + parser.getResultType() + ". Could not find object at: " + parser.getUri());
+ e.getTemplateVars().add(parser.getResultType());
+ e.getTemplateVars().add(parser.getUri().toString());
+ throw e;
+ } else {
+ //still an issue if there's more than one
+ relatedVertex = results.get(0);
+ }
+
+ if (relatedVertex != null) {
+
+ Edge e;
+ try {
+ e = this.getEdgeBetween(EdgeType.COUSIN, inputVertex, relatedVertex, label);
+ if (e == null) {
+ edgeSer.addEdge(this.engine.asAdmin().getTraversalSource(), inputVertex, relatedVertex, label);
+ } else {
+ //attempted to link two vertexes already linked
+ }
+ } finally {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ }
+ }
+
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ return true;
+ }
+
+ /**
+ * Gets all the edges between of the type with the specified label.
+ *
+ * @param aVertex the out vertex
+ * @param bVertex the in vertex
+ * @return the edges between
+ * @throws AAIException the AAI exception
+ * @throws NoEdgeRuleFoundException
+ */
+ private Edge getEdgeBetweenWithLabel(EdgeType type, Vertex aVertex, Vertex bVertex, EdgeRule edgeRule) {
+
+ Edge result = null;
+
+ if (bVertex != null) {
+ GraphTraversal<Vertex, Edge> findEdgesBetween = null;
+ if (EdgeType.TREE.equals(type)) {
+ GraphTraversal<Vertex,Vertex> findVertex = this.engine.asAdmin().getTraversalSource().V(bVertex);
+ if(edgeRule.getDirection().equals(Direction.IN)){
+ findEdgesBetween = findVertex.outE(edgeRule.getLabel())
+ .has(EdgeProperty.CONTAINS.toString(), edgeRule.getContains())
+ .not(
+ __.has(EdgeField.PRIVATE.toString(), true)
+ );
+ } else {
+ findEdgesBetween = findVertex.inE(edgeRule.getLabel())
+ .has(EdgeProperty.CONTAINS.toString(), edgeRule.getContains())
+ .not(
+ __.has(EdgeField.PRIVATE.toString(), true)
+ );
+ }
+ findEdgesBetween = findEdgesBetween.filter(__.otherV().hasId(aVertex.id())).limit(1);
+ } else {
+ findEdgesBetween = this.engine.asAdmin().getTraversalSource().V(aVertex).bothE(edgeRule.getLabel());
+ findEdgesBetween = findEdgesBetween
+ .has(EdgeProperty.CONTAINS.toString(), "NONE")
+ .not(
+ __.has(EdgeField.PRIVATE.toString(), true)
+ );
+ findEdgesBetween = findEdgesBetween.filter(__.otherV().hasId(bVertex.id())).limit(1);
+ }
+ List<Edge> list = findEdgesBetween.toList();
+ if(!list.isEmpty()){
+ result = list.get(0);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Gets all the edges between of the type.
+ *
+ * @param aVertex the out vertex
+ * @param bVertex the in vertex
+ * @return the edges between
+ * @throws AAIException the AAI exception
+ * @throws NoEdgeRuleFoundException
+ */
+ private List<Edge> getEdgesBetween(EdgeType type, Vertex aVertex, Vertex bVertex) {
+
+ List<Edge> result = new ArrayList<>();
+
+ if (bVertex != null) {
+ GraphTraversal<Vertex, Edge> findEdgesBetween = null;
+ findEdgesBetween = this.engine.asAdmin().getTraversalSource().V(aVertex).bothE();
+ if (EdgeType.TREE.equals(type)) {
+ findEdgesBetween = findEdgesBetween
+ .not(
+ __.or(
+ __.has(EdgeProperty.CONTAINS.toString(), "NONE"),
+ __.has(EdgeField.PRIVATE.toString(), true)
+ )
+ );
+ } else {
+ findEdgesBetween = findEdgesBetween
+ .has(EdgeProperty.CONTAINS.toString(), "NONE")
+ .not(
+ __.has(EdgeField.PRIVATE.toString(), true)
+ );
+ }
+ findEdgesBetween = findEdgesBetween.filter(__.otherV().hasId(bVertex.id()));
+ result = findEdgesBetween.toList();
+ }
+
+ return result;
+ }
+
+ /**
+ * Gets all the edges string between of the type.
+ *
+ * @param aVertex the out vertex
+ * @param bVertex the in vertex
+ * @return the edges between
+ * @throws AAIException the AAI exception
+ * @throws NoEdgeRuleFoundException
+ */
+ private List<String> getEdgeLabelsBetween(EdgeType type, Vertex aVertex, Vertex bVertex) {
+
+ List<String> result = new ArrayList<>();
+
+ if (bVertex != null) {
+ GraphTraversal<Vertex, Edge> findEdgesBetween = null;
+ findEdgesBetween = this.engine.asAdmin().getTraversalSource().V(aVertex).bothE();
+ if (EdgeType.TREE.equals(type)) {
+ findEdgesBetween = findEdgesBetween
+ .not(
+ __.or(
+ __.has(EdgeProperty.CONTAINS.toString(), "NONE"),
+ __.has(EdgeField.PRIVATE.toString(), true)
+ )
+ );
+ } else {
+ findEdgesBetween = findEdgesBetween
+ .has(EdgeProperty.CONTAINS.toString(), "NONE")
+ .not(
+ __.has(EdgeField.PRIVATE.toString(), true)
+ );
+ }
+ findEdgesBetween = findEdgesBetween.filter(__.otherV().hasId(bVertex.id()));
+ result = findEdgesBetween.label().toList();
+ }
+ return result;
+ }
+
+ /**
+ * Gets all the edges string between of the type.
+ *
+ * @param aVertex the out vertex
+ * @param bVertex the in vertex
+ * @return the edges between
+ * @throws AAIException the AAI exception
+ * @throws NoEdgeRuleFoundException
+ */
+ private Long getEdgeLabelsCount(Vertex aVertex, Vertex bVertex) {
+
+ Long result = null;
+
+ if (bVertex != null) {
+ GraphTraversal<Vertex, Edge> findEdgesBetween = null;
+ findEdgesBetween = this.engine.asAdmin().getTraversalSource().V(aVertex).bothE();
+ findEdgesBetween = findEdgesBetween
+ .has(EdgeProperty.CONTAINS.toString(), "NONE")
+ .not(
+ __.has(EdgeField.PRIVATE.toString(), true)
+ );
+ findEdgesBetween = findEdgesBetween.filter(__.otherV().hasId(bVertex.id()));
+ result = findEdgesBetween.count().next();
+ }
+ return result;
+ }
+ /**
+ * Gets all the edges between the vertexes with the label and type.
+ *
+ * @param aVertex the out vertex
+ * @param bVertex the in vertex
+ * @param label
+ * @return the edges between
+ * @throws AAIException the AAI exception
+ */
+ private Edge getEdgesBetween(EdgeType type, Vertex aVertex, Vertex bVertex, String label) throws AAIException {
+
+ Edge edge = null;
+
+ if (bVertex != null) {
+ String aType = aVertex.<String>property(AAIProperties.NODE_TYPE).value();
+ String bType = bVertex.<String>property(AAIProperties.NODE_TYPE).value();
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder(aType, bType).edgeType(type).label(label).build();
+ EdgeRule rule;
+ try {
+ rule = edgeRules.getRule(q);
+ } catch (EdgeRuleNotFoundException e) {
+ throw new NoEdgeRuleFoundException(e);
+ } catch (AmbiguousRuleChoiceException e) {
+ throw new MultipleEdgeRuleFoundException(e);
+ }
+ edge = this.getEdgeBetweenWithLabel(type, aVertex, bVertex, rule);
+ }
+
+ return edge;
+ }
+
+ /**
+ * Gets the edge between with the label and edge type.
+ *
+ * @param aVertex the out vertex
+ * @param bVertex the in vertex
+ * @param label
+ * @return the edge between
+ * @throws AAIException the AAI exception
+ * @throws NoEdgeRuleFoundException
+ */
+ public Edge getEdgeBetween(EdgeType type, Vertex aVertex, Vertex bVertex, String label) throws AAIException {
+
+ StopWatch.conditionalStart();
+ if (bVertex != null) {
+
+ Edge edge = this.getEdgesBetween(type, aVertex, bVertex, label);
+ if (edge != null) {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ return edge;
+ }
+
+ }
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ return null;
+ }
+
+ public Edge getEdgeBetween(EdgeType type, Vertex aVertex, Vertex bVertex) throws AAIException {
+ return this.getEdgeBetween(type, aVertex, bVertex, null);
+ }
+
+
+ /**
+ * Delete edge.
+ *
+ * @param relationship the relationship
+ * @param inputVertex the input vertex
+ * @return true, if successful
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIException the AAI exception
+ */
+ public boolean deleteEdge(Introspector relationship, Vertex inputVertex) throws UnsupportedEncodingException, AAIException {
+
+ Vertex relatedVertex = null;
+ StopWatch.conditionalStart();
+ QueryParser parser = engine.getQueryBuilder().createQueryFromRelationship(relationship);
+
+ List<Vertex> results = parser.getQueryBuilder().toList();
+
+ String label = null;
+ if (relationship.hasProperty("relationship-label")) {
+ label = relationship.getValue("relationship-label");
+ }
+
+ if (results.isEmpty()) {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ return false;
+ }
+
+ relatedVertex = results.get(0);
+ Edge edge;
+ try {
+ edge = this.getEdgeBetween(EdgeType.COUSIN, inputVertex, relatedVertex, label);
+ } catch (NoEdgeRuleFoundException e) {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ throw new AAIException("AAI_6129", e);
+ }
+ if (edge != null) {
+ edge.remove();
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ return true;
+ } else {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ return false;
+ }
+
+ }
+
+ /**
+ * Delete items with traversal.
+ *
+ * @param vertexes the vertexes
+ * @throws IllegalStateException the illegal state exception
+ */
+ public void deleteItemsWithTraversal(List<Vertex> vertexes) throws IllegalStateException {
+
+ for (Vertex v : vertexes) {
LOGGER.debug("About to delete the vertex with id: " + v.id());
- deleteWithTraversal(v);
- }
-
- }
-
- /**
- * Delete with traversal.
- *
- * @param startVertex the start vertex
- */
- public void deleteWithTraversal(Vertex startVertex) {
- StopWatch.conditionalStart();
- List<Vertex> results = this.engine.getQueryEngine().findDeletable(startVertex);
-
- for (Vertex v : results) {
- LOGGER.warn("Removing vertex " + v.id().toString());
-
- v.remove();
- }
- dbTimeMsecs += StopWatch.stopIfStarted();
- }
-
- /**
- * Delete.
- *
- * @param v the v
- * @param resourceVersion the resource version
- * @throws IllegalArgumentException the illegal argument exception
- * @throws AAIException the AAI exception
- * @throws InterruptedException the interrupted exception
- */
- public void delete(Vertex v, List<Vertex> deletableVertices, String resourceVersion, boolean enableResourceVersion) throws IllegalArgumentException, AAIException {
-
- boolean result = verifyDeleteSemantics(v, resourceVersion, enableResourceVersion);
- /*
- * The reason why I want to call PreventDeleteSemantics second time is to catch the prevent-deletes in a chain
- * These are far-fewer than seeing a prevnt-delete on the vertex to be deleted
- * So its better to make these in 2 steps
- */
- if(result && !deletableVertices.isEmpty()){
- result = verifyPreventDeleteSemantics(deletableVertices);
- }
- if (result) {
-
- try {
- deleteWithTraversal(v);
- } catch (IllegalStateException e) {
- throw new AAIException("AAI_6110", e);
- }
-
- }
-
- }
-
-
- /**
- * Delete.
- *
- * @param v the v
- * @param resourceVersion the resource version
- * @throws IllegalArgumentException the illegal argument exception
- * @throws AAIException the AAI exception
- * @throws InterruptedException the interrupted exception
- */
- public void delete(Vertex v, String resourceVersion, boolean enableResourceVersion) throws IllegalArgumentException, AAIException {
-
- boolean result = verifyDeleteSemantics(v, resourceVersion, enableResourceVersion);
-
- if (result) {
-
- try {
- deleteWithTraversal(v);
- } catch (IllegalStateException e) {
- throw new AAIException("AAI_6110", e);
- }
-
- }
-
- }
- /**
- * Verify delete semantics.
- *
- * @param vertex the vertex
- * @param resourceVersion the resource version
- * @return true, if successful
- * @throws AAIException the AAI exception
- */
- private boolean verifyDeleteSemantics(Vertex vertex, String resourceVersion, boolean enableResourceVersion) throws AAIException {
- boolean result = true;
- String nodeType = "";
- String errorDetail = " unknown delete semantic found";
- String aaiExceptionCode = "";
- nodeType = vertex.<String>property(AAIProperties.NODE_TYPE).orElse(null);
- if (enableResourceVersion && !this.verifyResourceVersion("delete", nodeType, vertex.<String>property(AAIProperties.RESOURCE_VERSION).orElse(null), resourceVersion, nodeType)) {
- }
- List<Vertex> vertices = new ArrayList<Vertex>();
- vertices.add(vertex);
- result = verifyPreventDeleteSemantics(vertices);
-
- return result;
- }
-
- /**
- * Verify Prevent delete semantics.
- * @param vertices the list of vertices
- * @return true, if successful
- * @throws AAIException the AAI exception
- */
- private boolean verifyPreventDeleteSemantics(List<Vertex> vertices) throws AAIException {
- boolean result = true;
- String nodeType = "";
- String errorDetail = " unknown delete semantic found";
- String aaiExceptionCode = "";
-
- StopWatch.conditionalStart();
- /*
- * This takes in all the vertices in a cascade-delete-chain and checks if there is any edge with a "prevent-delete" condition
- * If yes - that should prevent the deletion of the vertex
- * Dedup makes sure we dont capture the prevent-delete vertices twice
- * The prevent-delete vertices are stored so that the error message displays what prevents the delete
- */
-
- List<Object> preventDeleteVertices = this.engine.asAdmin().getReadOnlyTraversalSource().V(vertices).
- union(__.inE().has(EdgeProperty.PREVENT_DELETE.toString(), AAIDirection.IN.toString()).outV().values(AAIProperties.NODE_TYPE),
- __.outE().has(EdgeProperty.PREVENT_DELETE.toString(), AAIDirection.OUT.toString()).inV().values(AAIProperties.NODE_TYPE))
- .dedup().toList();
-
- dbTimeMsecs += StopWatch.stopIfStarted();
- if (!preventDeleteVertices.isEmpty()) {
- aaiExceptionCode = "AAI_6110";
- errorDetail = String.format("Object is being reference by additional objects preventing it from being deleted. Please clean up references from the following types %s", preventDeleteVertices);
- result = false;
- }
- if (!result) {
- throw new AAIException(aaiExceptionCode, errorDetail);
- }
- return result;
- }
-
- /**
- * Verify resource version.
- *
- * @param action the action
- * @param nodeType the node type
- * @param currentResourceVersion the current resource version
- * @param resourceVersion the resource version
- * @param uri the uri
- * @return true, if successful
- * @throws AAIException the AAI exception
- */
- public boolean verifyResourceVersion(String action, String nodeType, String currentResourceVersion, String resourceVersion, String uri) throws AAIException {
- String enabled = "";
- String errorDetail = "";
- String aaiExceptionCode = "";
- if (currentResourceVersion == null) {
- currentResourceVersion = "";
- }
-
- if (resourceVersion == null) {
- resourceVersion = "";
- }
- try {
- enabled = AAIConfig.get(AAIConstants.AAI_RESVERSION_ENABLEFLAG);
- } catch (AAIException e) {
- ErrorLogHelper.logException(e);
- }
- if (enabled.equals("true")) {
- if (!currentResourceVersion.equals(resourceVersion)) {
- if (action.equals("create") && !resourceVersion.equals("")) {
- errorDetail = "resource-version passed for " + action + " of " + uri;
- aaiExceptionCode = "AAI_6135";
- } else if (resourceVersion.equals("")) {
- errorDetail = "resource-version not passed for " + action + " of " + uri;
- aaiExceptionCode = "AAI_6130";
- } else {
- errorDetail = "resource-version MISMATCH for " + action + " of " + uri;
- aaiExceptionCode = "AAI_6131";
- }
-
- throw new AAIException(aaiExceptionCode, errorDetail);
-
- }
- }
- return true;
- }
-
- /**
- * Convert from camel case.
- *
- * @param name the name
- * @return the string
- */
- private String convertFromCamelCase (String name) {
- String result = "";
- result = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, name);
-
- NamingExceptions exceptions = NamingExceptions.getInstance();
- result = exceptions.getDBName(result);
-
- return result;
- }
-
- private boolean canModify(Introspector obj, String propName, String requestContext) {
- final String readOnly = obj.getPropertyMetadata(propName).get(PropertyMetadata.READ_ONLY);
- if (readOnly != null) {
- final String[] items = readOnly.split(",");
- for (String item : items) {
- if (requestContext.equals(item)) {
- return false;
- }
- }
- }
- return true;
- }
-
- private void executePreSideEffects(Introspector obj, Vertex self) throws AAIException {
-
- SideEffectRunner runner = new SideEffectRunner
- .Builder(this.engine, this).addSideEffect(DataCopy.class).addSideEffect(PrivateEdge.class).build();
-
- runner.execute(obj, self);
- }
-
- private void executePostSideEffects(Introspector obj, Vertex self) throws AAIException {
-
- SideEffectRunner runner = new SideEffectRunner
- .Builder(this.engine, this).addSideEffect(DataLinkWriter.class).build();
-
- runner.execute(obj, self);
- }
-
- private void enrichData(Introspector obj, Vertex self) throws AAIException {
-
- SideEffectRunner runner = new SideEffectRunner
- .Builder(this.engine, this).addSideEffect(DataLinkReader.class).build();
-
- runner.execute(obj, self);
- }
-
- public double getDBTimeMsecs() {
- return (dbTimeMsecs);
- }
-
- /**
- * Db to object With Filters
- * This is for a one-time run with Tenant Isloation to only filter relationships
- * TODO: Chnage the original dbToObject to take filter parent/cousins
- *
- * @param obj the obj
- * @param v the vertex from the graph
- * @param depth the depth
- * @param nodeOnly specify if to exclude relationships or not
- * @param filterCousinNodes
- * @return the introspector
- * @throws AAIException the AAI exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws SecurityException the security exception
- * @throws InstantiationException the instantiation exception
- * @throws NoSuchMethodException the no such method exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws MalformedURLException the malformed URL exception
- * @throws AAIUnknownObjectException
- * @throws URISyntaxException
- */
- //TODO - See if you can merge the 2 dbToObjectWithFilters
- public Introspector dbToObjectWithFilters(Introspector obj, Vertex v, Set<Vertex> seen, int depth, boolean nodeOnly, List<String> filterCousinNodes, List<String> filterParentNodes) throws AAIException, UnsupportedEncodingException {
- String cleanUp = "false";
- if (depth < 0) {
- return null;
- }
- depth--;
- seen.add(v);
- boolean modified = false;
- for (String property : obj.getProperties(PropertyPredicates.isVisible())) {
- List<Object> getList = null;
- Vertex[] vertices = null;
-
- if (!(obj.isComplexType(property) || obj.isListType(property))) {
- this.copySimpleProperty(property, obj, v);
- modified = true;
- } else {
- if (obj.isComplexType(property)) {
- /* container case */
-
- if (!property.equals("relationship-list") && depth >= 0) {
- Introspector argumentObject = obj.newIntrospectorInstanceOfProperty(property);
- Object result = dbToObjectWithFilters(argumentObject, v, seen, depth+1, nodeOnly, filterCousinNodes, filterParentNodes);
- if (result != null) {
- obj.setValue(property, argumentObject.getUnderlyingObject());
- modified = true;
- }
- } else if (property.equals("relationship-list") && !nodeOnly){
- /* relationships need to be handled correctly */
- Introspector relationshipList = obj.newIntrospectorInstanceOfProperty(property);
- relationshipList = createFilteredRelationshipList(v, relationshipList, cleanUp, filterCousinNodes);
- if (relationshipList != null) {
- modified = true;
- obj.setValue(property, relationshipList.getUnderlyingObject());
- modified = true;
- }
-
- }
- } else if (obj.isListType(property)) {
-
- if (property.equals("any")) {
- continue;
- }
- String genericType = obj.getGenericTypeClass(property).getSimpleName();
- if (obj.isComplexGenericType(property) && depth >= 0) {
- final String childDbName = convertFromCamelCase(genericType);
- String vType = v.<String>property(AAIProperties.NODE_TYPE).orElse(null);
- EdgeRule rule;
-
- boolean isthisParentRequired = filterParentNodes.parallelStream().anyMatch(childDbName::contains);
-
- EdgeRuleQuery q = new EdgeRuleQuery.Builder(vType, childDbName).edgeType(EdgeType.TREE).build();
-
- try {
- rule = edgeRules.getRule(q);
- } catch (EdgeRuleNotFoundException e) {
- throw new NoEdgeRuleFoundException(e);
- } catch (AmbiguousRuleChoiceException e) {
- throw new MultipleEdgeRuleFoundException(e);
- }
- if (!rule.getContains().equals(AAIDirection.NONE.toString()) && isthisParentRequired) {
- //vertices = this.queryEngine.findRelatedVertices(v, Direction.OUT, rule.getLabel(), childDbName);
- Direction ruleDirection = rule.getDirection();
- Iterator<Vertex> itr = v.vertices(ruleDirection, rule.getLabel());
- List<Vertex> verticesList = (List<Vertex>)IteratorUtils.toList(itr);
- itr = verticesList.stream().filter(item -> {
- return item.property(AAIProperties.NODE_TYPE).orElse("").equals(childDbName);
- }).iterator();
- if (itr.hasNext()) {
- getList = (List<Object>)obj.getValue(property);
- }
- int processed = 0;
- int removed = 0;
- while (itr.hasNext()) {
- Vertex childVertex = itr.next();
- if (!seen.contains(childVertex)) {
- Introspector argumentObject = obj.newIntrospectorInstanceOfNestedProperty(property);
-
- Object result = dbToObjectWithFilters(argumentObject, childVertex, seen, depth, nodeOnly, filterCousinNodes, filterParentNodes);
- if (result != null) {
- getList.add(argumentObject.getUnderlyingObject());
- }
-
- processed++;
- } else {
- removed++;
- LOGGER.warn("Cycle found while serializing vertex id={}", childVertex.id().toString());
- }
- }
- if (processed == 0) {
- //vertices were all seen, reset the list
- getList = null;
- }
- if (processed > 0) {
- modified = true;
- }
- }
- } else if (obj.isSimpleGenericType(property)) {
- List<Object> temp = this.engine.getListProperty(v, property);
- if (temp != null) {
- getList = (List<Object>)obj.getValue(property);
- getList.addAll(temp);
- modified = true;
- }
-
- }
-
- }
-
- }
- }
-
- //no changes were made to this obj, discard the instance
- if (!modified) {
- return null;
- }
- this.enrichData(obj, v);
- return obj;
-
- }
-
- /**
- * Creates the relationship list with the filtered node types.
- *
- * @param v the v
- * @param obj the obj
- * @param cleanUp the clean up
- * @return the object
- * @throws InstantiationException the instantiation exception
- * @throws IllegalAccessException the illegal access exception
- * @throws IllegalArgumentException the illegal argument exception
- * @throws InvocationTargetException the invocation target exception
- * @throws NoSuchMethodException the no such method exception
- * @throws SecurityException the security exception
- * @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIException the AAI exception
- * @throws MalformedURLException the malformed URL exception
- * @throws URISyntaxException
- */
- private Introspector createFilteredRelationshipList(Vertex v, Introspector obj, String cleanUp, List<String> filterNodes) throws UnsupportedEncodingException, AAIException {
- List<Vertex> allCousins = this.engine.getQueryEngine().findCousinVertices(v);
-
- Iterator<Vertex> cousinVertices = allCousins.stream().filter(item -> {
- String node = (String)item.property(AAIProperties.NODE_TYPE).orElse("");
- return filterNodes.parallelStream().anyMatch(node::contains);
- }).iterator();
-
-
- List<Vertex> cousins = (List<Vertex>)IteratorUtils.toList(cousinVertices);
-
- //items.parallelStream().anyMatch(inputStr::contains)
- List<Object> relationshipObjList = obj.getValue("relationship");
- for (Vertex cousin : cousins) {
-
- Introspector relationshipObj = obj.newIntrospectorInstanceOfNestedProperty("relationship");
- Object result = processEdgeRelationship(relationshipObj, cousin, cleanUp, null);
- if (result != null) {
- relationshipObjList.add(result);
- }
-
-
- }
-
- if (relationshipObjList.isEmpty()) {
- return null;
- } else {
- return obj;
- }
- }
+ deleteWithTraversal(v);
+ }
+
+ }
+
+ /**
+ * Delete with traversal.
+ *
+ * @param startVertex the start vertex
+ */
+ public void deleteWithTraversal(Vertex startVertex) {
+ StopWatch.conditionalStart();
+ List<Vertex> results = this.engine.getQueryEngine().findDeletable(startVertex);
+
+ for (Vertex v : results) {
+ LOGGER.warn("Removing vertex " + v.id().toString());
+
+ v.remove();
+ }
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ }
+
+ /**
+ * Delete.
+ *
+ * @param v the v
+ * @param resourceVersion the resource version
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws AAIException the AAI exception
+ * @throws InterruptedException the interrupted exception
+ */
+ public void delete(Vertex v, List<Vertex> deletableVertices, String resourceVersion, boolean enableResourceVersion) throws IllegalArgumentException, AAIException {
+
+ boolean result = verifyDeleteSemantics(v, resourceVersion, enableResourceVersion);
+ /*
+ * The reason why I want to call PreventDeleteSemantics second time is to catch the prevent-deletes in a chain
+ * These are far-fewer than seeing a prevnt-delete on the vertex to be deleted
+ * So its better to make these in 2 steps
+ */
+ if (result && !deletableVertices.isEmpty()) {
+ result = verifyPreventDeleteSemantics(deletableVertices);
+ }
+ if (result) {
+
+ try {
+ deleteWithTraversal(v);
+ } catch (IllegalStateException e) {
+ throw new AAIException("AAI_6110", e);
+ }
+
+ }
+
+ }
+
+
+ /**
+ * Delete.
+ *
+ * @param v the v
+ * @param resourceVersion the resource version
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws AAIException the AAI exception
+ * @throws InterruptedException the interrupted exception
+ */
+ public void delete(Vertex v, String resourceVersion, boolean enableResourceVersion) throws IllegalArgumentException, AAIException {
+
+ boolean result = verifyDeleteSemantics(v, resourceVersion, enableResourceVersion);
+
+ if (result) {
+
+ try {
+ deleteWithTraversal(v);
+ } catch (IllegalStateException e) {
+ throw new AAIException("AAI_6110", e);
+ }
+
+ }
+
+ }
+
+ /**
+ * Verify delete semantics.
+ *
+ * @param vertex the vertex
+ * @param resourceVersion the resource version
+ * @return true, if successful
+ * @throws AAIException the AAI exception
+ */
+ private boolean verifyDeleteSemantics(Vertex vertex, String resourceVersion, boolean enableResourceVersion) throws AAIException {
+ boolean result = true;
+ String nodeType = "";
+ String errorDetail = " unknown delete semantic found";
+ String aaiExceptionCode = "";
+ nodeType = vertex.<String>property(AAIProperties.NODE_TYPE).orElse(null);
+ if (enableResourceVersion && !this.verifyResourceVersion("delete", nodeType, vertex.<String>property(AAIProperties.RESOURCE_VERSION).orElse(null), resourceVersion, nodeType)) {
+ }
+ List<Vertex> vertices = new ArrayList<Vertex>();
+ vertices.add(vertex);
+ result = verifyPreventDeleteSemantics(vertices);
+
+ return result;
+ }
+
+ /**
+ * Verify Prevent delete semantics.
+ *
+ * @param vertices the list of vertices
+ * @return true, if successful
+ * @throws AAIException the AAI exception
+ */
+ private boolean verifyPreventDeleteSemantics(List<Vertex> vertices) throws AAIException {
+ boolean result = true;
+ String nodeType = "";
+ String errorDetail = " unknown delete semantic found";
+ String aaiExceptionCode = "";
+
+ StopWatch.conditionalStart();
+ /*
+ * This takes in all the vertices in a cascade-delete-chain and checks if there is any edge with a "prevent-delete" condition
+ * If yes - that should prevent the deletion of the vertex
+ * Dedup makes sure we dont capture the prevent-delete vertices twice
+ * The prevent-delete vertices are stored so that the error message displays what prevents the delete
+ */
+
+ List<Object> preventDeleteVertices = this.engine.asAdmin().getReadOnlyTraversalSource().V(vertices).
+ union(__.inE().has(EdgeProperty.PREVENT_DELETE.toString(), AAIDirection.IN.toString()).outV().values(AAIProperties.NODE_TYPE),
+ __.outE().has(EdgeProperty.PREVENT_DELETE.toString(), AAIDirection.OUT.toString()).inV().values(AAIProperties.NODE_TYPE))
+ .dedup().toList();
+
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ if (!preventDeleteVertices.isEmpty()) {
+ aaiExceptionCode = "AAI_6110";
+ errorDetail = String.format("Object is being reference by additional objects preventing it from being deleted. Please clean up references from the following types %s", preventDeleteVertices);
+ result = false;
+ }
+ if (!result) {
+ throw new AAIException(aaiExceptionCode, errorDetail);
+ }
+ return result;
+ }
+
+ /**
+ * Verify resource version.
+ *
+ * @param action the action
+ * @param nodeType the node type
+ * @param currentResourceVersion the current resource version
+ * @param resourceVersion the resource version
+ * @param uri the uri
+ * @return true, if successful
+ * @throws AAIException the AAI exception
+ */
+ public boolean verifyResourceVersion(String action, String nodeType, String currentResourceVersion, String resourceVersion, String uri) throws AAIException {
+ String enabled = "";
+ String errorDetail = "";
+ String aaiExceptionCode = "";
+ if (currentResourceVersion == null) {
+ currentResourceVersion = "";
+ }
+
+ if (resourceVersion == null) {
+ resourceVersion = "";
+ }
+ try {
+ enabled = AAIConfig.get(AAIConstants.AAI_RESVERSION_ENABLEFLAG);
+ } catch (AAIException e) {
+ ErrorLogHelper.logException(e);
+ }
+ if (enabled.equals("true")) {
+ if (!currentResourceVersion.equals(resourceVersion)) {
+ if (action.equals("create") && !resourceVersion.equals("")) {
+ errorDetail = "resource-version passed for " + action + " of " + uri;
+ aaiExceptionCode = "AAI_6135";
+ } else if (resourceVersion.equals("")) {
+ errorDetail = "resource-version not passed for " + action + " of " + uri;
+ aaiExceptionCode = "AAI_6130";
+ } else {
+ errorDetail = "resource-version MISMATCH for " + action + " of " + uri;
+ aaiExceptionCode = "AAI_6131";
+ }
+
+ throw new AAIException(aaiExceptionCode, errorDetail);
+
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Convert from camel case.
+ *
+ * @param name the name
+ * @return the string
+ */
+ private String convertFromCamelCase (String name) {
+ String result = "";
+ result = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, name);
+
+ NamingExceptions exceptions = NamingExceptions.getInstance();
+ result = exceptions.getDBName(result);
+
+ return result;
+ }
+
+ private boolean canModify(Introspector obj, String propName, String requestContext) {
+ final String readOnly = obj.getPropertyMetadata(propName).get(PropertyMetadata.READ_ONLY);
+ if (readOnly != null) {
+ final String[] items = readOnly.split(",");
+ for (String item : items) {
+ if (requestContext.equals(item)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private void executePreSideEffects(Introspector obj, Vertex self) throws AAIException {
+
+ SideEffectRunner runner = new SideEffectRunner
+ .Builder(this.engine, this).addSideEffect(DataCopy.class).addSideEffect(PrivateEdge.class).build();
+
+ runner.execute(obj, self);
+ }
+
+ private void executePostSideEffects(Introspector obj, Vertex self) throws AAIException {
+
+ SideEffectRunner runner = new SideEffectRunner
+ .Builder(this.engine, this).addSideEffect(DataLinkWriter.class).build();
+
+ runner.execute(obj, self);
+ }
+
+ private void enrichData(Introspector obj, Vertex self) throws AAIException {
+
+ SideEffectRunner runner = new SideEffectRunner
+ .Builder(this.engine, this).addSideEffect(DataLinkReader.class).build();
+
+ runner.execute(obj, self);
+ }
+
+ public double getDBTimeMsecs() {
+ return (dbTimeMsecs);
+ }
+
+ /**
+ * Db to object With Filters
+ * This is for a one-time run with Tenant Isloation to only filter relationships
+ * TODO: Chnage the original dbToObject to take filter parent/cousins
+ *
+ * @param obj the obj
+ * @param v the vertex from the graph
+ * @param depth the depth
+ * @param nodeOnly specify if to exclude relationships or not
+ * @param filterCousinNodes
+ * @return the introspector
+ * @throws AAIException the AAI exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws SecurityException the security exception
+ * @throws InstantiationException the instantiation exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws MalformedURLException the malformed URL exception
+ * @throws AAIUnknownObjectException
+ * @throws URISyntaxException
+ */
+ //TODO - See if you can merge the 2 dbToObjectWithFilters
+ public Introspector dbToObjectWithFilters(Introspector obj, Vertex v, Set<Vertex> seen, int depth, boolean nodeOnly, List<String> filterCousinNodes, List<String> filterParentNodes) throws AAIException, UnsupportedEncodingException {
+ String cleanUp = "false";
+ if (depth < 0) {
+ return null;
+ }
+ depth--;
+ seen.add(v);
+ boolean modified = false;
+ for (String property : obj.getProperties(PropertyPredicates.isVisible())) {
+ List<Object> getList = null;
+ Vertex[] vertices = null;
+
+ if (!(obj.isComplexType(property) || obj.isListType(property))) {
+ this.copySimpleProperty(property, obj, v);
+ modified = true;
+ } else {
+ if (obj.isComplexType(property)) {
+ /* container case */
+
+ if (!property.equals("relationship-list") && depth >= 0) {
+ Introspector argumentObject = obj.newIntrospectorInstanceOfProperty(property);
+ Object result = dbToObjectWithFilters(argumentObject, v, seen, depth + 1, nodeOnly, filterCousinNodes, filterParentNodes);
+ if (result != null) {
+ obj.setValue(property, argumentObject.getUnderlyingObject());
+ modified = true;
+ }
+ } else if (property.equals("relationship-list") && !nodeOnly) {
+ /* relationships need to be handled correctly */
+ Introspector relationshipList = obj.newIntrospectorInstanceOfProperty(property);
+ relationshipList = createFilteredRelationshipList(v, relationshipList, cleanUp, filterCousinNodes);
+ if (relationshipList != null) {
+ modified = true;
+ obj.setValue(property, relationshipList.getUnderlyingObject());
+ modified = true;
+ }
+
+ }
+ } else if (obj.isListType(property)) {
+
+ if (property.equals("any")) {
+ continue;
+ }
+ String genericType = obj.getGenericTypeClass(property).getSimpleName();
+ if (obj.isComplexGenericType(property) && depth >= 0) {
+ final String childDbName = convertFromCamelCase(genericType);
+ String vType = v.<String>property(AAIProperties.NODE_TYPE).orElse(null);
+ EdgeRule rule;
+
+ boolean isthisParentRequired = filterParentNodes.parallelStream().anyMatch(childDbName::contains);
+
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder(vType, childDbName).edgeType(EdgeType.TREE).build();
+
+ try {
+ rule = edgeRules.getRule(q);
+ } catch (EdgeRuleNotFoundException e) {
+ throw new NoEdgeRuleFoundException(e);
+ } catch (AmbiguousRuleChoiceException e) {
+ throw new MultipleEdgeRuleFoundException(e);
+ }
+ if (!rule.getContains().equals(AAIDirection.NONE.toString()) && isthisParentRequired) {
+ //vertices = this.queryEngine.findRelatedVertices(v, Direction.OUT, rule.getLabel(), childDbName);
+ Direction ruleDirection = rule.getDirection();
+ Iterator<Vertex> itr = v.vertices(ruleDirection, rule.getLabel());
+ List<Vertex> verticesList = (List<Vertex>) IteratorUtils.toList(itr);
+ itr = verticesList.stream().filter(item -> {
+ return item.property(AAIProperties.NODE_TYPE).orElse("").equals(childDbName);
+ }).iterator();
+ if (itr.hasNext()) {
+ getList = (List<Object>) obj.getValue(property);
+ }
+ int processed = 0;
+ int removed = 0;
+ while (itr.hasNext()) {
+ Vertex childVertex = itr.next();
+ if (!seen.contains(childVertex)) {
+ Introspector argumentObject = obj.newIntrospectorInstanceOfNestedProperty(property);
+
+ Object result = dbToObjectWithFilters(argumentObject, childVertex, seen, depth, nodeOnly, filterCousinNodes, filterParentNodes);
+ if (result != null) {
+ getList.add(argumentObject.getUnderlyingObject());
+ }
+
+ processed++;
+ } else {
+ removed++;
+ LOGGER.warn("Cycle found while serializing vertex id={}", childVertex.id().toString());
+ }
+ }
+ if (processed == 0) {
+ //vertices were all seen, reset the list
+ getList = null;
+ }
+ if (processed > 0) {
+ modified = true;
+ }
+ }
+ } else if (obj.isSimpleGenericType(property)) {
+ List<Object> temp = this.engine.getListProperty(v, property);
+ if (temp != null) {
+ getList = (List<Object>) obj.getValue(property);
+ getList.addAll(temp);
+ modified = true;
+ }
+
+ }
+
+ }
+
+ }
+ }
+
+ //no changes were made to this obj, discard the instance
+ if (!modified) {
+ return null;
+ }
+ this.enrichData(obj, v);
+ return obj;
+
+ }
+
+ /**
+ * Creates the relationship list with the filtered node types.
+ *
+ * @param v the v
+ * @param obj the obj
+ * @param cleanUp the clean up
+ * @return the object
+ * @throws InstantiationException the instantiation exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws InvocationTargetException the invocation target exception
+ * @throws NoSuchMethodException the no such method exception
+ * @throws SecurityException the security exception
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ * @throws AAIException the AAI exception
+ * @throws MalformedURLException the malformed URL exception
+ * @throws URISyntaxException
+ */
+ private Introspector createFilteredRelationshipList(Vertex v, Introspector obj, String cleanUp, List<String> filterNodes) throws UnsupportedEncodingException, AAIException {
+ List<Vertex> allCousins = this.engine.getQueryEngine().findCousinVertices(v);
+
+ Iterator<Vertex> cousinVertices = allCousins.stream().filter(item -> {
+ String node = (String) item.property(AAIProperties.NODE_TYPE).orElse("");
+ return filterNodes.parallelStream().anyMatch(node::contains);
+ }).iterator();
+
+
+ List<Vertex> cousins = (List<Vertex>) IteratorUtils.toList(cousinVertices);
+
+ //items.parallelStream().anyMatch(inputStr::contains)
+ List<Object> relationshipObjList = obj.getValue("relationship");
+ for (Vertex cousin : cousins) {
+
+ Introspector relationshipObj = obj.newIntrospectorInstanceOfNestedProperty("relationship");
+ Object result = processEdgeRelationship(relationshipObj, cousin, cleanUp, null);
+ if (result != null) {
+ relationshipObjList.add(result);
+ }
+
+
+ }
+
+ if (relationshipObjList.isEmpty()) {
+ return null;
+ } else {
+ return obj;
+ }
+ }
}
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngine.java b/aai-core/src/main/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngine.java
index 2158c894..d072db55 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngine.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngine.java
@@ -30,6 +30,7 @@ import static org.onap.aai.edges.enums.EdgeProperty.DELETE_OTHER_V;
import java.util.List;
import java.util.Set;
+import org.apache.tinkerpop.gremlin.process.traversal.Order;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
@@ -45,12 +46,12 @@ import org.onap.aai.logging.StopWatch;
/*
* This class needs some big explanation despite its compact size.
- * This controls all the queries performed by the CRUD API in A&AI.
+ * This controls all the queries performed by the CRUD API in A&AI.
* findParents, findChildren, and findDeletable require special attention
* These methods use 'repeat'. You cannot use 'emit' with repeat currently
* as it is extremely buggy as of tinkerpop-3.0.1-incubating. The way around
* it (for now) is to sideEffect all the vertices we traverse into an ArrayList.
- *
+ *
*/
public class GraphTraversalQueryEngine extends QueryEngine {
@@ -70,6 +71,7 @@ public class GraphTraversalQueryEngine extends QueryEngine {
public List<Vertex> findParents(Vertex start) {
try {
StopWatch.conditionalStart();
+
@SuppressWarnings("unchecked")
final GraphTraversal<Vertex, Vertex> pipe = this.g.V(start).emit(v -> true).repeat(__.union(__.inE().has(CONTAINS.toString(), OUT.toString()).outV(), __.outE().has(CONTAINS.toString(), IN.toString()).inV()));
return pipe.toList();
@@ -79,19 +81,36 @@ public class GraphTraversalQueryEngine extends QueryEngine {
}
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<Vertex> findParents(String[] uris) {
+ try {
+ StopWatch.conditionalStart();
+ final GraphTraversal<Vertex, Vertex> pipe = this.g.V()
+ .has(AAIProperties.AAI_URI, P.within(uris))
+ .order().by(AAIProperties.AAI_URI, Order.decr);
+ return pipe.toList();
+ }
+ finally {
+ dbTimeMsecs += StopWatch.stopIfStarted();
+ }
+ }
+
/**
* {@inheritDoc}
*/
@Override
public List<Vertex> findAllChildren(Vertex start) {
-
+
@SuppressWarnings("unchecked")
GraphTraversal<Vertex, Vertex> pipe = this.g
.V(start).emit(v -> true).repeat(__.union(__.outE().has(CONTAINS.toString(), OUT.toString()).inV(), __.inE().has(CONTAINS.toString(), IN.toString()).outV()));
-
+
return pipe.toList();
-
+
}
/**
@@ -104,10 +123,10 @@ public class GraphTraversalQueryEngine extends QueryEngine {
__.outE().has(CONTAINS.toString(), OUT.toString()).inV(),
__.inE().has(CONTAINS.toString(), IN.toString()).outV()
).has(AAIProperties.NODE_TYPE, type).dedup();
-
+
return pipe.toList();
}
-
+
/**
* {@inheritDoc}
*/
@@ -118,7 +137,7 @@ public class GraphTraversalQueryEngine extends QueryEngine {
__.outE().has(CONTAINS.toString(), OUT.toString()),
__.inE().has(CONTAINS.toString(), IN.toString())
).otherV().dedup();
-
+
return pipe.toList();
}
@@ -135,7 +154,7 @@ public class GraphTraversalQueryEngine extends QueryEngine {
__.inE().has(DELETE_OTHER_V.toString(), IN.toString()).outV()
)
).dedup();
-
+
return pipe.toList();
}
@@ -158,11 +177,11 @@ public class GraphTraversalQueryEngine extends QueryEngine {
default:
break;
}
-
+
pipe.has(AAIProperties.NODE_TYPE, nodeType).dedup();
return pipe.toList();
}
-
+
@Override
public Tree<Element> findSubGraph(Vertex start, int iterations, boolean nodeOnly) {
final GraphTraversal<Vertex, ?> t = this.g.V(start).emit(v -> true).times(iterations).repeat(
@@ -204,13 +223,13 @@ public class GraphTraversalQueryEngine extends QueryEngine {
__.has("private", true)
)
.dedup();
-
+
return pipeline.toList();
}
@Override
- public List<Vertex> findCousinVertices(Vertex start) {
+ public List<Vertex> findCousinVertices(Vertex start, String... labels) {
// Start at the given vertex
// Do a union to copy the start vertex to be run against all
// so for the start vertex it gets all of in edges that contains other v set to none
@@ -223,8 +242,8 @@ public class GraphTraversalQueryEngine extends QueryEngine {
GraphTraversal<Vertex, Vertex> pipeline = this.g
.V(start)
.union(
- __.inE().has(CONTAINS.toString(), NONE.toString()),
- __.outE().has(CONTAINS.toString(), NONE.toString())
+ __.inE(labels).has(CONTAINS.toString(), NONE.toString()),
+ __.outE(labels).has(CONTAINS.toString(), NONE.toString())
)
.not(
__.has(PRIVATE.toString(), true)
@@ -234,7 +253,7 @@ public class GraphTraversalQueryEngine extends QueryEngine {
return pipeline.toList();
}
-
+
public double getDBTimeMsecs() {
return (dbTimeMsecs);
}
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/engines/query/QueryEngine.java b/aai-core/src/main/java/org/onap/aai/serialization/engines/query/QueryEngine.java
index c2929468..110f8628 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/engines/query/QueryEngine.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/engines/query/QueryEngine.java
@@ -42,16 +42,33 @@ public abstract class QueryEngine {
public QueryEngine (GraphTraversalSource g) {
this.g = g;
}
-
+
/**
* Finds all the parents/grandparents/etc of the given start node.
*
* @param start - the start vertex whose parent chain you want
* @return the list of start and start's parent, grandparent, etc, in
- * order (ie {start, parent, grandparent, etc}
+ * order (ie {start, parent, grandparent, etc}
*/
public abstract List<Vertex> findParents(Vertex start);
-
+
+ /**
+ * Finds all the parents/grandparents/etc of the given start node.
+ *
+ * This method should be used in place of the #findParents(Vertex)
+ * as since the aai-uri is added the lookup for finding the parents
+ * using the given list of aai-uri will be much faster than using
+ * a traversal to follow a start vertex and keep repeating since
+ * as the number of different type of edges keeps growing that call
+ * will be more expensive than using the aai-uri's as they are fast lookup
+ *
+ * @param uris - list of the uris representing the aai-uris of
+ * parent, grandparent, etc
+ * @return the list of start and start's parent, grandparent, etc, in
+ * order (ie {start, parent, grandparent, etc}
+ */
+ public abstract List<Vertex> findParents(String [] uris);
+
/**
* Finds all children, grandchildren, etc of start
*
@@ -59,7 +76,7 @@ public abstract class QueryEngine {
* @return the list of child/grandchild/etc vertices
*/
public abstract List<Vertex> findAllChildren(Vertex start);
-
+
/**
* Finds all immediate children of start (no grandchildren or so forth) of the given type
* @param start - the start vertex
@@ -67,14 +84,14 @@ public abstract class QueryEngine {
* @return the list of immediate child vertices of given type
*/
public abstract List<Vertex> findChildrenOfType(Vertex start, String type);
-
+
/**
* Finds all immediate children of start (no grandchildren or so forth)
* @param start - the start vertex
* @return the list of immediate child vertices
*/
public abstract List<Vertex> findChildren(Vertex start);
-
+
/**
* Find all vertices that should be deleted in a cascade from a delete of start
*
@@ -82,34 +99,34 @@ public abstract class QueryEngine {
* @return the list of vertices to be deleted when start is deleted
*/
public abstract List<Vertex> findDeletable(Vertex start);
-
+
/**
* Finds the subgraph under start, including cousins as well as start's children/grandchildren/etc.
* More specifically, this includes start, all its descendants, start's cousins, and start's
* descendants' cousins (but not any of the cousins' cousins or descendants), and the edges
* connecting them.
- *
+ *
* @param start - the start vertex
- * @return - Tree containing nodes and edges of the subgraph
+ * @return - Tree containing nodes and edges of the subgraph
*/
public Tree<Element> findSubGraph(Vertex start) {
return findSubGraph(start, AAIProperties.MAXIMUM_DEPTH, false);
}
-
+
/**
* Finds the subgraph under start, including cousins as well as start's children/grandchildren/etc.
* More specifically, this includes start, all its descendants, start's cousins, and start's
* descendants' cousins (but not any of the cousins' cousins or descendants), and the edges
* connecting them.
- *
+ *
* @param start - the start vertex
- * @param iterations - depth of the subgraph, this limits how many generations of
+ * @param iterations - depth of the subgraph, this limits how many generations of
* descendants are included
* @param nodeOnly - if true the subgraph will NOT include the cousins
- * @return Tree containing nodes and edges of the subgraph
+ * @return Tree containing nodes and edges of the subgraph
*/
public abstract Tree<Element> findSubGraph(Vertex start, int iterations, boolean nodeOnly);
-
+
/**
* Find vertices of type nodeType related to start by edges of the given
* direction and label.
@@ -125,23 +142,23 @@ public abstract class QueryEngine {
/**
* Finds cousin edges connecting start to other vertices only of types defined in an old version.
* The idea is that if a user is using an old version, they won't understand any new node types in
- * subsequent versions. Thus, revealing edges to new types will cause problems. This methods
+ * subsequent versions. Thus, revealing edges to new types will cause problems. This methods
* filters any such edges out.
- *
+ *
* @param start - the start vertex
* @param loader - loader for retrieving the list of allowed node types for the desired version
* (version is set when the loader was instantiated)
* @return list of cousin edges between start and any node types understood by the version specified in loader
*/
public abstract List<Edge> findEdgesForVersion(Vertex start, Loader loader);
-
+
/**
- * Finds all cousins of start.
- *
+ * Finds all cousins of start.
+ *
* @param start - the start vertex
* @return list of start's cousin vertices
*/
- public abstract List<Vertex> findCousinVertices(Vertex start);
+ public abstract List<Vertex> findCousinVertices(Vertex start, String... labels);
public abstract double getDBTimeMsecs();
diff --git a/aai-core/src/test/java/org/onap/aai/HttpTestUtil.java b/aai-core/src/test/java/org/onap/aai/HttpTestUtil.java
index 82a3efdf..92cb59c5 100644
--- a/aai-core/src/test/java/org/onap/aai/HttpTestUtil.java
+++ b/aai-core/src/test/java/org/onap/aai/HttpTestUtil.java
@@ -52,11 +52,11 @@ import static org.mockito.Mockito.when;
public class HttpTestUtil extends RESTAPI {
-
- protected HttpEntry traversalHttpEntry;
-
- protected HttpEntry traversalUriHttpEntry;
-
+
+ protected HttpEntry traversalHttpEntry;
+
+ protected HttpEntry traversalUriHttpEntry;
+
private static final EELFLogger logger = EELFManager.getInstance().getLogger(HttpTestUtil.class);
protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json");
@@ -77,7 +77,7 @@ public class HttpTestUtil extends RESTAPI {
this.queryStyle = qs;
traversalHttpEntry = SpringContextAware.getBean("traversalUriHttpEntry", HttpEntry.class);
traversalUriHttpEntry = SpringContextAware.getBean("traversalUriHttpEntry", HttpEntry.class);
-
+
}
public void init(){
@@ -121,7 +121,10 @@ public class HttpTestUtil extends RESTAPI {
try {
- uri = uri.replaceAll("/aai/", "");
+ if(uri.startsWith("/aai/")){
+ uri = uri.substring(5);
+ }
+
logger.info("Starting the put request for the uri {} with payload {}", uri, payload);
String [] arr = uri.split("/");
@@ -142,7 +145,7 @@ public class HttpTestUtil extends RESTAPI {
Mockito.when(uriInfo.getPath()).thenReturn(uri);
DBConnectionType type = DBConnectionType.REALTIME;
-
+
traversalHttpEntry.setHttpEntryProperties(version, type);
Loader loader = traversalHttpEntry.getLoader();
dbEngine = traversalHttpEntry.getDbEngine();
@@ -206,7 +209,7 @@ public class HttpTestUtil extends RESTAPI {
return response;
}
- public Response doGet(String uri) throws UnsupportedEncodingException, AAIException {
+ public Response doGet(String uri, String depth){
this.init();
Response response = null;
@@ -215,8 +218,11 @@ public class HttpTestUtil extends RESTAPI {
try {
- uri = uri.replaceAll("/aai/", "");
- logger.info("Starting the GET request for the uri {} with depth {}", uri, "all");
+ if(uri.startsWith("/aai/")){
+ uri = uri.substring(5);
+ }
+
+ logger.info("Starting the GET request for the uri {} with depth {}", uri, depth);
String [] arr = uri.split("/");
@@ -240,21 +246,29 @@ public class HttpTestUtil extends RESTAPI {
dbEngine = traversalHttpEntry.getDbEngine();
URI uriObject = UriBuilder.fromPath(uri).build();
- URIToObject uriToObject = new URIToObject(loader, uriObject);
- String objType = uriToObject.getEntityName();
- queryParameters.add("depth", "all");
+ if(depth != null){
+ queryParameters.add("depth", depth);
+ }
+
QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject, queryParameters);
Mockito.when(uriInfo.getPath()).thenReturn(uri);
+ URIToObject uriToObject = new URIToObject(loader, uriObject);
+ String objType = "";
+ if (!uriQuery.getContainerType().equals("")) {
+ objType = uriQuery.getContainerType();
+ } else {
+ objType = uriQuery.getResultType();
+ }
logger.info("Unmarshalling the payload to this {}", objType);
Introspector obj = loader.introspectorFromName(objType);
DBRequest dbRequest =
- new DBRequest.Builder(HttpMethod.GET, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION")
- .build();
+ new DBRequest.Builder(HttpMethod.GET, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION")
+ .build();
List<DBRequest> dbRequestList = new ArrayList<>();
dbRequestList.add(dbRequest);
@@ -288,6 +302,10 @@ public class HttpTestUtil extends RESTAPI {
return response;
}
+ public Response doGet(String uri) throws UnsupportedEncodingException, AAIException {
+ return this.doGet(uri, "all");
+ }
+
public Response doDelete(String uri, String resourceVersion) throws UnsupportedEncodingException, AAIException {
this.init();
@@ -321,7 +339,7 @@ public class HttpTestUtil extends RESTAPI {
Mockito.when(uriInfo.getPath()).thenReturn(uri);
DBConnectionType type = DBConnectionType.REALTIME;
traversalHttpEntry.setHttpEntryProperties(version, type);
-
+
traversalHttpEntry.setHttpEntryProperties(version, type);
Loader loader = traversalHttpEntry.getLoader();
dbEngine = traversalHttpEntry.getDbEngine();
diff --git a/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToObjectTest.java b/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToObjectTest.java
index c7c1f4ca..fc2c64a1 100644
--- a/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToObjectTest.java
+++ b/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToObjectTest.java
@@ -19,6 +19,7 @@
*/
package org.onap.aai.parsers.uri;
+import org.onap.aai.schema.enums.ObjectMetadata;
import org.onap.aai.setup.SchemaVersion;
import org.junit.Ignore;
@@ -65,7 +66,7 @@ public class URIToObjectTest extends AAISetup {
currentVersion = schemaVersions.getDefaultVersion();
loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, schemaVersions.getRelatedLinkVersion());
}
-
+
@Test
public void uri() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException {
URI uri = UriBuilder.fromPath("/aai/" + loader.getVersion() + "/cloud-infrastructure/cloud-regions/cloud-region/mycloudowner/mycloudregionid/tenants/tenant/key1/vservers/vserver/key2/l-interfaces/l-interface/key3").build();
@@ -74,11 +75,11 @@ public class URIToObjectTest extends AAISetup {
String expected = "{\"cloud-owner\":\"mycloudowner\",\"cloud-region-id\":\"mycloudregionid\",\"tenants\":{\"tenant\":[{\"tenant-id\":\"key1\",\"vservers\":{\"vserver\":[{\"vserver-id\":\"key2\",\"l-interfaces\":{\"l-interface\":[{\"interface-name\":\"key3\"}]}}]}}]}}";
String topEntity = "cloud-region";
String entity = "l-interface";
-
+
testSet(result.marshal(false), parse, expected, topEntity, entity, version);
}
-
+
/**
* Uri no version.
*
@@ -86,7 +87,7 @@ public class URIToObjectTest extends AAISetup {
* @throws AAIException the AAI exception
* @throws IllegalArgumentException the illegal argument exception
* @throws UnsupportedEncodingException the unsupported encoding exception
- * @throws AAIUnknownObjectException
+ * @throws AAIUnknownObjectException
*/
@Test
public void uriNoVersion() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException, AAIUnknownObjectException {
@@ -106,12 +107,12 @@ public class URIToObjectTest extends AAISetup {
String expected = "{\"cloud-owner\":\"mycloudowner\",\"cloud-region-id\":\"mycloudregionid\",\"tenants\":{\"tenant\":[{\"tenant-id\":\"key1\",\"tenant-name\":\"name1\",\"vservers\":{\"vserver\":[{\"vserver-id\":\"key2\",\"vserver-name\":\"name2\",\"l-interfaces\":{\"l-interface\":[{\"interface-name\":\"key3\"}]}}]}}]}}";
String topEntity = "cloud-region";
String entity = "l-interface";
-
+
testSet(result.marshal(false), parse, expected, topEntity, entity, version);
-
+
}
-
+
/**
* Bad URI.
@@ -124,13 +125,13 @@ public class URIToObjectTest extends AAISetup {
@Test
public void badURI() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException {
URI uri = UriBuilder.fromPath("/aai/" + loader.getVersion() + "/cloud-infrastructure/cloud-regions/cloud-region/mycloudowner/mycloudregionid/tenants/tenant/key1/vservers/vserver/key2/l-interadsfaces/l-interface/key3").build();
-
+
thrown.expect(AAIException.class);
thrown.expect(hasProperty("code", is("AAI_3000")));
-
+
new URIToObject(loader, uri);
}
-
+
/**
* Starts with valid namespace.
*
@@ -147,10 +148,10 @@ public class URIToObjectTest extends AAISetup {
String expected = "{\"cloud-owner\":\"mycloudowner\",\"cloud-region-id\":\"mycloudregionid\",\"tenants\":{\"tenant\":[{\"tenant-id\":\"key1\",\"vservers\":{\"vserver\":[{\"vserver-id\":\"key2\",\"l-interfaces\":{\"l-interface\":[{\"interface-name\":\"key3\"}]}}]}}]}}";
String topEntity = "cloud-region";
String entity = "l-interface";
-
+
testSet(result.marshal(false), parse, expected, topEntity, entity, version);
}
-
+
/**
* Single top level.
*
@@ -165,14 +166,14 @@ public class URIToObjectTest extends AAISetup {
URIToObject parse = new URIToObject(loader, uri);
Introspector result = parse.getTopEntity();
String expected = "{\"vnf-id\":\"key1\"}";
-
+
String topEntity = "generic-vnf";
String entity = "generic-vnf";
-
+
testSet(result.marshal(false), parse, expected, topEntity, entity, version);
}
-
+
/**
* Naming exceptions.
*
@@ -190,11 +191,11 @@ public class URIToObjectTest extends AAISetup {
String expected = "{\"vnf-id\":\"key1\",\"port-groups\":{\"port-group\":[{\"interface-id\":\"key2\",\"cvlan-tags\":{\"cvlan-tag-entry\":[{\"cvlan-tag\":655}]}}]}}";
String topEntity = "vce";
String entity = "cvlan-tag";
-
+
testSet(result.marshal(false), parse, expected, topEntity, entity, version);
}
-
+
/**
* No list object.
*
@@ -212,23 +213,23 @@ public class URIToObjectTest extends AAISetup {
String entity = "l3-interface-ipv4-address-list";
String expected = "{\"equipment-name\":\"0e6189fd-9257-49b9-a3be-d7ba980ccfc9\",\"lag-interfaces\":{\"lag-interface\":[{\"interface-name\":\"8ae5aa76-d597-4382-b219-04f266fe5e37\",\"l-interfaces\":{\"l-interface\":[{\"interface-name\":\"9e141d03-467b-437f-b4eb-b3133ec1e205\",\"l3-interface-ipv4-address-list\":[{\"l3-interface-ipv4-address\":\"8f19f0ea-a81f-488e-8d5c-9b7b53696c11\"}]}]}}]}}";
testSet(result.marshal(false), parse, expected, topEntity, entity, version);
-
+
}
-
+
@Test
public void relativePath() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException {
URI uri = UriBuilder.fromPath("./l-interfaces/l-interface/key1").build();
URIToObject parse = new URIToObject(loader, uri);
Introspector result = parse.getEntity();
String expected = "{\"interface-name\":\"key1\"}";
-
+
String topEntity = "l-interface";
String entity = "l-interface";
-
+
testSet(result.marshal(false), parse, expected, topEntity, entity, version);
}
-
+
/**
* Test set.
*
@@ -241,15 +242,15 @@ public class URIToObjectTest extends AAISetup {
*/
public void testSet(String json, URIToObject parse, String expected, String topEntity, String entity, SchemaVersion version) {
assertEquals("blah", expected, json);
-
+
assertEquals("top entity", topEntity, parse.getTopEntityName());
assertEquals("entity", entity, parse.getEntityName());
assertEquals("entity object", entity, parse.getEntity().getDbName());
-
+
assertEquals("parent list object", 1, parse.getParentList().size());
-
+
assertEquals("object version", version, parse.getObjectVersion());
}
}
diff --git a/aai-core/src/test/java/org/onap/aai/rest/EdgeNotValidAnymoreTest.java b/aai-core/src/test/java/org/onap/aai/rest/EdgeNotValidAnymoreTest.java
new file mode 100644
index 00000000..1a69fc58
--- /dev/null
+++ b/aai-core/src/test/java/org/onap/aai/rest/EdgeNotValidAnymoreTest.java
@@ -0,0 +1,120 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.rest;
+
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.janusgraph.core.JanusGraph;
+import org.janusgraph.core.JanusGraphTransaction;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.aai.AAISetup;
+import org.onap.aai.HttpTestUtil;
+import org.onap.aai.PayloadUtil;
+import org.onap.aai.db.props.AAIProperties;
+import org.onap.aai.dbmap.AAIGraph;
+import org.onap.aai.edges.enums.EdgeField;
+import org.onap.aai.edges.enums.EdgeProperty;
+import org.onap.aai.exceptions.AAIException;
+import org.onap.aai.serialization.engines.QueryStyle;
+
+import javax.ws.rs.core.Response;
+import java.io.IOException;
+import java.util.UUID;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.junit.Assert.assertThat;
+
+public class EdgeNotValidAnymoreTest extends AAISetup {
+
+ private HttpTestUtil testUtil;
+
+ @Before
+ public void setupData() throws IOException, AAIException {
+
+ String cloudRegionEndpoint = "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/junit-cloud-owner-with-vlan/junit-cloud-region-with-vlan";
+
+ String cloudRegionBody = PayloadUtil.getResourcePayload("cloud-region-with-vlan.json");
+ testUtil = new HttpTestUtil(QueryStyle.TRAVERSAL_URI);
+ testUtil.doPut(cloudRegionEndpoint, cloudRegionBody);
+
+ JanusGraphTransaction transaction = AAIGraph.getInstance().getGraph().newTransaction();
+ GraphTraversalSource g = transaction.traversal();
+
+ Vertex configurationVertex = g.addV()
+ .property( AAIProperties.NODE_TYPE, "configuration")
+ .property( "configuration-id", "ci1")
+ .property( "configuration-type", "ci1")
+ .property( AAIProperties.AAI_URI, "/network/configurations/configuration/ci1")
+ .property(AAIProperties.SOURCE_OF_TRUTH, "JUNIT")
+ .next();
+
+ Vertex vlanVertex = g.V()
+ .has("vlan-interface", "test-vlan-interface-1")
+ .has(AAIProperties.NODE_TYPE, "vlan")
+ .next();
+
+ Edge edge = configurationVertex.addEdge("org.onap.relationships.inventory.PartOf", vlanVertex);
+ addEdge(edge);
+
+ transaction.commit();
+ }
+
+ public void addEdge(Edge edge) {
+ edge.property(EdgeProperty.CONTAINS.toString(), "NONE");
+ edge.property(EdgeProperty.DELETE_OTHER_V.toString(), "NONE");
+ edge.property(EdgeProperty.PREVENT_DELETE.toString(), "NONE");
+ edge.property(EdgeField.PRIVATE.toString(), false);
+ edge.property(AAIProperties.AAI_UUID, UUID.randomUUID().toString());
+ }
+
+ @Test
+ public void testWhenEdgeRuleIsNoLongerValidEnsureItRetrievesVertexesWithoutOldEdges() {
+
+ String endpoint = "/aai/v14/network/configurations";
+
+ Response response = testUtil.doGet(endpoint, null);
+ assertThat(response.getStatus(), is(200));
+
+ String body = response.getEntity().toString();
+
+ assertThat(body, containsString("configuration-id"));
+ assertThat(body, not(containsString("vlan")));
+ }
+
+ @After
+ public void teardown(){
+
+ JanusGraph janusGraph = AAIGraph.getInstance().getGraph();
+ JanusGraphTransaction transaction = janusGraph.newTransaction();
+ GraphTraversalSource g = transaction.traversal();
+
+ g.V()
+ .has(AAIProperties.SOURCE_OF_TRUTH, "JUNIT")
+ .toList()
+ .forEach((edge) -> edge.remove());
+
+ transaction.commit();
+ }
+}
diff --git a/aai-core/src/test/java/org/onap/aai/rest/EntitlementTest.java b/aai-core/src/test/java/org/onap/aai/rest/EntitlementTest.java
new file mode 100644
index 00000000..3559b9d6
--- /dev/null
+++ b/aai-core/src/test/java/org/onap/aai/rest/EntitlementTest.java
@@ -0,0 +1,96 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.rest;
+
+import com.jayway.jsonpath.JsonPath;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.onap.aai.AAISetup;
+import org.onap.aai.HttpTestUtil;
+import org.onap.aai.PayloadUtil;
+import org.onap.aai.exceptions.AAIException;
+import org.onap.aai.serialization.engines.QueryStyle;
+import org.skyscreamer.jsonassert.JSONAssert;
+import org.springframework.test.annotation.DirtiesContext;
+
+import javax.ws.rs.core.Response;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
+import java.util.Collection;
+
+import static org.junit.Assert.assertEquals;
+
+@RunWith(value = Parameterized.class)
+@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
+public class EntitlementTest extends AAISetup {
+
+ private HttpTestUtil httpTestUtil;
+
+ @Parameterized.Parameter(value = 0)
+ public QueryStyle queryStyle;
+
+ private String vnfPayload;
+
+ private String vnfUri;
+
+ @Parameterized.Parameters(name = "QueryStyle.{0}")
+ public static Collection<Object[]> data() {
+ return Arrays.asList(new Object[][]{
+ {QueryStyle.TRAVERSAL_URI}
+ });
+ }
+
+ @Before
+ public void setUp() throws IOException {
+ httpTestUtil = new HttpTestUtil(queryStyle);
+ vnfPayload = PayloadUtil.getResourcePayload("vnf.json");
+ vnfUri = "/aai/v14/network/generic-vnfs/generic-vnf/vnf1";
+ }
+
+ @Test
+ public void testPutGenericVnfAndThenInsertEntitlement() throws IOException, AAIException {
+ String entitlementPayload = PayloadUtil.getResourcePayload("entitlement.json");
+ String entitlementUri = "/aai/v14/network/generic-vnfs/generic-vnf/vnf1/entitlements/entitlement/g1/r1";
+ Response response = httpTestUtil.doPut(vnfUri, vnfPayload);
+ assertEquals("Expected the Generic Vnf to be created", 201, response.getStatus());
+
+ response = httpTestUtil.doGet(vnfUri);
+ assertEquals("Expected the Generic Vnf to be found", 200, response.getStatus());
+ String jsonResponse = response.getEntity().toString();
+ JSONAssert.assertEquals(vnfPayload, jsonResponse, false);
+
+ response = httpTestUtil.doPut(entitlementUri, entitlementPayload);
+ assertEquals("Expected the Entitlement to be created", 201, response.getStatus());
+ }
+
+ @After
+ public void tearDown() throws UnsupportedEncodingException, AAIException {
+ Response response = httpTestUtil.doGet(vnfUri);
+ assertEquals("Expected the Generic Vnf to be found", 200, response.getStatus());
+ String jsonResponse = response.getEntity().toString();
+ String resourceVersion = JsonPath.read(jsonResponse, "$.resource-version");
+ response = httpTestUtil.doDelete(vnfUri, resourceVersion);
+ assertEquals("Expected the cloud region to be deleted", 204, response.getStatus());
+ }
+}
diff --git a/aai-core/src/test/java/org/onap/aai/rest/ModelElementTest.java b/aai-core/src/test/java/org/onap/aai/rest/ModelElementTest.java
new file mode 100644
index 00000000..d808c993
--- /dev/null
+++ b/aai-core/src/test/java/org/onap/aai/rest/ModelElementTest.java
@@ -0,0 +1,98 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.rest;
+
+import com.jayway.jsonpath.JsonPath;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.onap.aai.AAISetup;
+import org.onap.aai.HttpTestUtil;
+import org.onap.aai.PayloadUtil;
+import org.onap.aai.exceptions.AAIException;
+import org.onap.aai.serialization.engines.QueryStyle;
+import org.skyscreamer.jsonassert.JSONAssert;
+import org.springframework.test.annotation.DirtiesContext;
+
+import javax.ws.rs.core.Response;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
+import java.util.Collection;
+
+import static org.junit.Assert.assertEquals;
+
+@RunWith(value = Parameterized.class)
+@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
+public class ModelElementTest extends AAISetup {
+
+ private HttpTestUtil httpTestUtil;
+
+ @Parameterized.Parameter(value = 0)
+ public QueryStyle queryStyle;
+
+ private String modelPayload;
+ private String modelElementPayload;
+
+ private String modelUri;
+ private String modelElementUri;
+
+ @Parameterized.Parameters(name = "QueryStyle.{0}")
+ public static Collection<Object[]> data() {
+ return Arrays.asList(new Object[][]{
+ {QueryStyle.TRAVERSAL_URI}
+ });
+ }
+
+ @Before
+ public void setUp() throws IOException {
+ httpTestUtil = new HttpTestUtil(queryStyle);
+ modelPayload = PayloadUtil.getResourcePayload("model.json");
+ modelElementPayload = PayloadUtil.getResourcePayload("model-element.json");
+ modelUri = "/aai/v14/service-design-and-creation/models/model/24c04fc5-f3f8-43ec-8792-c6f940638676-test1";
+ modelElementUri = "/aai/v14/service-design-and-creation/models/model/24c04fc5-f3f8-43ec-8792-c6f940638676-test1/model-vers/model-ver/0c4c59f0-9864-43ca-b0c2-ca38746b72a5-test1/model-elements/model-element/0dc2b8b6-af8d-4213-970b-7861a603fc86-test1/model-constraints/model-constraint/782ba24a-28ab-4fd0-8e69-da10cc5373f3-test1/constrained-element-sets/constrained-element-set/a33e65c3-1198-4d4c-9799-2b521e4c4212-test1/element-choice-sets/element-choice-set/7df27a94-06c8-46ef-9fc2-5900d8cffbb0-test1/model-elements/model-element/acf8b6cf-e051-4c1b-bcad-b24792f826cf-test1";
+ }
+
+ @Test
+ public void testPutModelAndThenModelElementAndItShouldSucceed() throws IOException, AAIException {
+ Response response = httpTestUtil.doPut(modelUri, modelPayload);
+ assertEquals("Expected the cloud region to be created", 201, response.getStatus());
+
+ response = httpTestUtil.doGet(modelUri);
+ assertEquals("Expected the cloud region to be found", 200, response.getStatus());
+ String jsonResponse = response.getEntity().toString();
+ JSONAssert.assertEquals(modelPayload, jsonResponse, false);
+
+ response = httpTestUtil.doPut(modelElementUri, modelElementPayload);
+ assertEquals("Expected the cloud region to be created", 201, response.getStatus());
+ }
+
+ @After
+ public void tearDown() throws UnsupportedEncodingException, AAIException {
+ Response response = httpTestUtil.doGet(modelUri);
+ assertEquals("Expected the cloud region to be found", 200, response.getStatus());
+ String jsonResponse = response.getEntity().toString();
+ String resourceVersion = JsonPath.read(jsonResponse, "$.resource-version");
+ response = httpTestUtil.doDelete(modelUri, resourceVersion);
+ assertEquals("Expected the cloud region to be deleted", 204, response.getStatus());
+ }
+}
diff --git a/aai-core/src/test/java/org/onap/aai/rest/PserverDuplicateTest.java b/aai-core/src/test/java/org/onap/aai/rest/PserverDuplicateTest.java
new file mode 100644
index 00000000..71e53be8
--- /dev/null
+++ b/aai-core/src/test/java/org/onap/aai/rest/PserverDuplicateTest.java
@@ -0,0 +1,135 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.rest;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.janusgraph.core.JanusGraph;
+import org.janusgraph.core.JanusGraphTransaction;
+import org.junit.Test;
+import org.onap.aai.AAISetup;
+import org.onap.aai.HttpTestUtil;
+import org.onap.aai.db.props.AAIProperties;
+import org.onap.aai.dbmap.AAIGraph;
+import org.onap.aai.serialization.engines.QueryStyle;
+
+import javax.ws.rs.core.Response;
+import java.util.List;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+public class PserverDuplicateTest extends AAISetup {
+
+ private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(PserverDuplicateTest.class);
+
+ private HttpTestUtil testUtil;
+
+ private String hostname;
+
+ public boolean createDuplicate() throws InterruptedException {
+
+ hostname = getHostname();
+ final String aaiUri = "/cloud-infrastructure/pservers/pserver/" + hostname;
+ final int threads = getNumberOfThreads();
+
+ ExecutorService service = Executors.newFixedThreadPool(threads);
+
+ JanusGraph janusGraph = AAIGraph.getInstance().getGraph();
+ // Due to the lazy instantiation of the graph, it needs to create a new transaction to create schema
+ janusGraph.newTransaction().rollback();
+
+ service.invokeAll(
+ IntStream.range(0, threads)
+ .mapToObj((i) -> (Callable<Void>) () -> {
+ JanusGraphTransaction transaction = janusGraph.newTransaction();
+ GraphTraversalSource g = transaction.traversal();
+ g.addV()
+ .property(AAIProperties.AAI_URI, aaiUri)
+ .property(AAIProperties.NODE_TYPE, "pserver")
+ .property("hostname", hostname)
+ .next();
+ transaction.commit();
+ return null;
+ }).collect(Collectors.toList())
+ , 7, TimeUnit.SECONDS
+ );
+
+ JanusGraphTransaction readOnlyTransaction = AAIGraph.getInstance().getGraph().buildTransaction().readOnly().start();
+ GraphTraversalSource g = readOnlyTransaction.traversal();
+
+ List<Vertex> pserverList = g.V().has(AAIProperties.AAI_URI, aaiUri).toList();
+ LOGGER.debug("Number of pservers with uri {} is {}", aaiUri, pserverList.size());
+
+ testUtil = new HttpTestUtil(QueryStyle.TRAVERSAL_URI);
+
+ if(pserverList.size() == 1){
+ return false;
+ }
+ return true;
+ }
+
+
+ @Test
+ public void testWhenDuplicatesExistInGraphThatGetAllSuceeds() throws InterruptedException {
+
+ int totalRetries = getNumOfRetries();
+ for(int retry = 0; retry < totalRetries; retry++){
+ if(!this.createDuplicate()){
+ if(retry == (totalRetries-1)){
+ fail("Unable to produce duplicates in the graph, " +
+ "please increase retry or ignore test if it becomes impossible to create duplicate this test");
+ }
+ } else {
+ // Successfully created a duplicate in the janus graph
+ break;
+ }
+ }
+
+ String endpoint = "/aai/v14/cloud-infrastructure/pservers";
+
+ Response response = testUtil.doGet(endpoint, null);
+ LOGGER.info("GET ALL Pservers with duplicates status code {} and body {}", response.getStatus(), response.getEntity());
+ assertThat(response.getStatus(), is(200));
+ }
+
+ public String getHostname(){
+ return UUID.randomUUID().toString();
+ }
+
+ public int getNumOfRetries(){
+ return 10;
+ }
+
+ public int getNumberOfThreads(){
+ return 10;
+ }
+}
+
diff --git a/aai-core/src/test/java/org/onap/aai/rest/VipAddressListTest.java b/aai-core/src/test/java/org/onap/aai/rest/VipAddressListTest.java
new file mode 100644
index 00000000..0351c2c3
--- /dev/null
+++ b/aai-core/src/test/java/org/onap/aai/rest/VipAddressListTest.java
@@ -0,0 +1,99 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.rest;
+
+import com.jayway.jsonpath.JsonPath;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.onap.aai.AAISetup;
+import org.onap.aai.HttpTestUtil;
+import org.onap.aai.PayloadUtil;
+import org.onap.aai.exceptions.AAIException;
+import org.onap.aai.serialization.engines.QueryStyle;
+import org.skyscreamer.jsonassert.JSONAssert;
+
+import javax.ws.rs.core.Response;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+
+import static org.junit.Assert.assertEquals;
+
+@RunWith(value = Parameterized.class)
+public class VipAddressListTest extends AAISetup {
+
+ private HttpTestUtil httpTestUtil;
+
+ @Parameterized.Parameter(value = 0)
+ public QueryStyle queryStyle;
+
+ @Parameterized.Parameters(name = "QueryStyle.{0}")
+ public static Collection<Object[]> data() {
+ return Arrays.asList(new Object[][]{
+ {QueryStyle.TRAVERSAL_URI}
+ });
+ }
+
+ @Before
+ public void setUp(){
+ httpTestUtil = new HttpTestUtil(queryStyle);
+ }
+
+ @Test
+ public void testPutWithAllCloudRegionChildrenNodesAndCheckIfDeleteIsSuccessful() throws IOException, AAIException {
+
+ String cloudRegionPayload = PayloadUtil.getResourcePayload("cloud-region.json");
+ String cloudRegionUri = "/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/cloud-region-owner-with-vip-ipv4/cloud-region-id-with-vip-ipv4";
+
+ Response response = httpTestUtil.doPut(cloudRegionUri, cloudRegionPayload);
+ assertEquals("Expected the cloud region to be created", 201, response.getStatus());
+
+ response = httpTestUtil.doGet(cloudRegionUri);
+ assertEquals("Expected the cloud region to be found", 200, response.getStatus());
+ String jsonResponse = response.getEntity().toString();
+
+ JSONAssert.assertEquals(cloudRegionPayload, jsonResponse, false);
+
+ String vipIpv4Uri = cloudRegionUri + "/vip-ipv4-address-list/vip-ipv4-address-list-1";
+ String vipIpv4Payload = PayloadUtil.getResourcePayload("vip-ipv4-address-list.json");
+
+ response = httpTestUtil.doPut(vipIpv4Uri, vipIpv4Payload);
+ assertEquals("Expected the ipv4 address list to be created", 201, response.getStatus());
+
+ response = httpTestUtil.doGet(vipIpv4Uri);
+ assertEquals("Expected the ipv4 address list to be found", 200, response.getStatus());
+
+ jsonResponse = response.getEntity().toString();
+ String resourceVersion = JsonPath.read(jsonResponse, "$.resource-version");
+
+ response = httpTestUtil.doDelete(vipIpv4Uri, resourceVersion);
+ assertEquals("Expected the ipv4 address list to be deleted", 204, response.getStatus());
+
+ response = httpTestUtil.doGet(cloudRegionUri);
+ jsonResponse = response.getEntity().toString();
+ resourceVersion = JsonPath.read(jsonResponse, "$.resource-version");
+
+ response = httpTestUtil.doDelete(cloudRegionUri, resourceVersion);
+ assertEquals("Expected the cloud region to be deleted", 204, response.getStatus());
+ }
+}
diff --git a/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java b/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java
index a5b968b3..5041c7d1 100644
--- a/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java
+++ b/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java
@@ -465,16 +465,18 @@ public class DbSerializerTest extends AAISetup {
public void getURIForVertexTest() throws AAIException, URISyntaxException, UnsupportedEncodingException {
engine.startTransaction();
- Vertex cr = engine.tx().addVertex("aai-node-type", "cloud-region", "cloud-owner", "me", "cloud-region-id", "123");
+ Vertex cr = engine.tx().addVertex("aai-node-type", "cloud-region", "cloud-owner", "me", "cloud-region-id", "123", "aai-uri", "/cloud-infrastructure/cloud-regions/cloud-region/me/123");
Vertex ten = engine.tx().addVertex("aai-node-type", "tenant", "tenant-id", "453");
edgeSer.addTreeEdge(engine.tx().traversal(), cr, ten);
+ ten.property("aai-uri", "/cloud-infrastructure/cloud-regions/cloud-region/me/123/tenants/tenant/453");
+
URI compare = new URI("/cloud-infrastructure/cloud-regions/cloud-region/me/123/tenants/tenant/453");
assertEquals(compare, dbser.getURIForVertex(ten));
- cr.property("aai-node-type").remove();
URI compareFailure = new URI("/unknown-uri");
+ ten.property("aai-uri").remove();
assertEquals(compareFailure, dbser.getURIForVertex(ten));
}
@@ -619,9 +621,10 @@ public class DbSerializerTest extends AAISetup {
public void serializeSingleVertexChildTest() throws AAIException, UnsupportedEncodingException {
engine.startTransaction();
- Vertex cr = engine.tx().addVertex("aai-node-type", "cloud-region", "cloud-owner", "me", "cloud-region-id", "123");
+ Vertex cr = engine.tx().addVertex("aai-node-type", "cloud-region", "cloud-owner", "me", "cloud-region-id", "123", "aai-uri", "/cloud-infrastructure/cloud-regions/cloud-region/me/123");
Introspector tenIn = loader.introspectorFromName("tenant");
Vertex ten = dbser.createNewVertex(tenIn);
+ ten.property("aai-uri", cr.property("aai-uri").value().toString() + "/tenants/tenant/453");
edgeSer.addTreeEdge(engine.tx().traversal(), cr, ten);
@@ -639,8 +642,8 @@ public class DbSerializerTest extends AAISetup {
public void getVertexPropertiesRelationshipHasLabelTest() throws AAIException, UnsupportedEncodingException {
engine.startTransaction();
- Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","vnf-123");
- Vertex vnfc = engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","vnfc-123");
+ Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","vnf-123","aai-uri", "/network/generic-vnfs/generic-vnf/vnf-123");
+ Vertex vnfc = engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","vnfc-123","aai-uri", "/network/vnfcs/vnfc/vnfc-123");
edgeSer.addEdge(engine.tx().traversal(), gvnf, vnfc);
@@ -672,8 +675,8 @@ public class DbSerializerTest extends AAISetup {
engine.startTransaction();
- Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","vnf-123");
- Vertex vnfc = engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","vnfc-123");
+ Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","vnf-123", "aai-uri", "/network/generic-vnfs/generic-vnf/vnf-123");
+ Vertex vnfc = engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","vnfc-123", "aai-uri", "/network/vnfcs/vnfc/vnfc-123");
edgeSer.addEdge(engine.tx().traversal(), gvnf, vnfc);
diff --git a/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java b/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java
index a24855b8..b9431217 100644
--- a/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java
+++ b/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java
@@ -38,6 +38,7 @@ import org.springframework.test.annotation.DirtiesContext;
import java.io.InputStream;
import java.util.*;
+import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
@@ -53,30 +54,30 @@ public class GraphTraversalQueryEngineTest extends AAISetup {
public void testFindParents() throws AAIException {
//setup
Graph graph = TinkerGraph.open();
-
+
Vertex cloudreg = graph.addVertex(T.id, "00", "aai-node-type", "cloud-region");
Vertex tenant = graph.addVertex(T.id, "10", "aai-node-type", "tenant");
Vertex vserver = graph.addVertex(T.id, "20", "aai-node-type", "vserver");
-
+
GraphTraversalSource g = graph.traversal();
-
+
edgeSer.addTreeEdge(g, cloudreg, tenant);
edgeSer.addTreeEdge(g, tenant, vserver);
-
+
//expect start vertex back plus any parents
List<Vertex> crExpected = new ArrayList<>(Arrays.asList(cloudreg)); //no parents
List<Vertex> tenExpected = new ArrayList<>(Arrays.asList(tenant, cloudreg)); //only has the immediate parent
List<Vertex> vsExpected = new ArrayList<>(Arrays.asList(vserver, tenant, cloudreg)); //parent & grandparent
-
+
GraphTraversalQueryEngine engine = new GraphTraversalQueryEngine(g);
-
+
//test
List<Vertex> crRes = engine.findParents(cloudreg);
assertTrue(crRes.containsAll(crExpected) && crExpected.containsAll(crRes));
-
+
List<Vertex> tenRes = engine.findParents(tenant);
assertTrue(tenRes.containsAll(tenExpected) && tenExpected.containsAll(tenRes));
-
+
List<Vertex> vsRes = engine.findParents(vserver);
assertTrue(vsRes.containsAll(vsExpected) && vsExpected.containsAll(vsRes));
//verify expected ordering - start, parent, grandparent
@@ -84,131 +85,157 @@ public class GraphTraversalQueryEngineTest extends AAISetup {
assertTrue(vsRes.get(1).equals(tenant));
assertTrue(vsRes.get(2).equals(cloudreg));
}
-
+
+ @Test
+ public void testFindAllParentsGivenAaiUris(){
+
+ //setup
+ Graph graph = TinkerGraph.open();
+
+ Vertex cloudreg = graph.addVertex(T.id, "00", "aai-node-type", "cloud-region", "aai-uri", "/cloud-infrastructure/cloud-regions/cloud-region/testowner/testid");
+ Vertex tenant = graph.addVertex(T.id, "10", "aai-node-type", "tenant", "aai-uri", "/cloud-infrastructure/cloud-regions/cloud-region/testowner/testid/tenants/tenant/testTenant1");
+ Vertex vserver = graph.addVertex(T.id, "20", "aai-node-type", "vserver", "aai-uri", "/cloud-infrastructure/cloud-regions/cloud-region/testowner/testid/tenants/tenant/testTenant1/vservers/vserver/testVserver1");
+
+ String [] uris = new String[]{
+ "/cloud-infrastructure/cloud-regions/cloud-region/testowner/testid/tenants/tenant/testTenant1",
+ "/cloud-infrastructure/cloud-regions/cloud-region/testowner/testid/tenants/tenant/testTenant1/vservers/vserver/testVserver1",
+ "/cloud-infrastructure/cloud-regions/cloud-region/testowner/testid"
+ };
+
+ GraphTraversalSource g = graph.traversal();
+ GraphTraversalQueryEngine queryEngine = new GraphTraversalQueryEngine(g);
+ List<Vertex> vertices = queryEngine.findParents(uris);
+
+ assertThat("Returned vertices should be 3 cloud region, tenant and vserver", vertices.size(), is(3));
+ assertThat("Expected the first element back to be vserver", vertices.get(0), is(vserver));
+ assertThat("Expected the second element back to be tenant", vertices.get(1), is(tenant));
+ assertThat("Expected the element back to be cloud region", vertices.get(2), is(cloudreg));
+ }
+
@Test
public void testFindAllChildren() throws AAIException {
//setup
Graph graph = TinkerGraph.open();
-
+
Vertex cloudreg = graph.addVertex(T.id, "00", "aai-node-type", "cloud-region");
Vertex tenant = graph.addVertex(T.id, "10", "aai-node-type", "tenant");
Vertex vserver = graph.addVertex(T.id, "20", "aai-node-type", "vserver");
Vertex vserver2 = graph.addVertex(T.id, "21", "aai-node-type", "vserver");
Vertex oam = graph.addVertex(T.id, "30", "aai-node-type", "oam-network");
-
+
GraphTraversalSource g = graph.traversal();
-
+
edgeSer.addTreeEdge(g, cloudreg, tenant);
edgeSer.addTreeEdge(g, tenant, vserver);
edgeSer.addTreeEdge(g, tenant, vserver2);
edgeSer.addTreeEdge(g, cloudreg, oam);
-
+
List<Vertex> crExpected = new ArrayList<>(Arrays.asList(cloudreg, tenant, vserver, vserver2, oam));
List<Vertex> vsExpected = new ArrayList<>(Arrays.asList(vserver));
-
+
GraphTraversalQueryEngine engine = new GraphTraversalQueryEngine(g);
-
+
//test
List<Vertex> crRes = engine.findAllChildren(cloudreg);
assertTrue(crRes.containsAll(crExpected) && crExpected.containsAll(crRes));
-
+
List<Vertex> vsRes = engine.findAllChildren(vserver);
assertTrue(vsRes.containsAll(vsExpected) && vsExpected.containsAll(vsRes));
}
-
+
@Test
public void testFindChildrenOfType() throws AAIException {
//setup
Graph graph = TinkerGraph.open();
-
+
Vertex gv = graph.addVertex(T.id, "00", "aai-node-type", "generic-vnf");
Vertex lint1 = graph.addVertex(T.id, "10", "aai-node-type", "l-interface");
Vertex lint2 = graph.addVertex(T.id, "11", "aai-node-type", "l-interface");
Vertex lag = graph.addVertex(T.id, "20", "aai-node-type", "lag-interface");
Vertex lint3 = graph.addVertex(T.id, "12", "aai-node-type", "l-interface");
-
+
GraphTraversalSource g = graph.traversal();
-
+
edgeSer.addTreeEdge(g, gv, lint1);
edgeSer.addTreeEdge(g, gv, lint2);
edgeSer.addTreeEdge(g, gv, lag);
edgeSer.addTreeEdge(g, lag, lint3);
-
+
List<Vertex> expected = new ArrayList<>(Arrays.asList(lint1, lint2));
-
+
GraphTraversalQueryEngine engine = new GraphTraversalQueryEngine(g);
-
+
//test
List<Vertex> results = engine.findChildrenOfType(gv, "l-interface");
assertTrue(results.containsAll(expected) && expected.containsAll(results));
}
-
+
@Test
public void testFindChildren() throws AAIException {
//setup
Graph graph = TinkerGraph.open();
-
+
Vertex gv = graph.addVertex(T.id, "00", "aai-node-type", "generic-vnf");
Vertex lint1 = graph.addVertex(T.id, "10", "aai-node-type", "l-interface");
Vertex lint2 = graph.addVertex(T.id, "11", "aai-node-type", "l-interface");
Vertex lag = graph.addVertex(T.id, "20", "aai-node-type", "lag-interface");
Vertex lint3 = graph.addVertex(T.id, "12", "aai-node-type", "l-interface");
-
+
GraphTraversalSource g = graph.traversal();
-
+
edgeSer.addTreeEdge(g, gv, lint1);
edgeSer.addTreeEdge(g, gv, lint2);
edgeSer.addTreeEdge(g, gv, lag);
edgeSer.addTreeEdge(g, lag, lint3);
-
+
List<Vertex> expected = new ArrayList<>(Arrays.asList(lint1, lint2, lag));
-
+
GraphTraversalQueryEngine engine = new GraphTraversalQueryEngine(g);
-
+
//test
List<Vertex> results = engine.findChildren(gv);
assertTrue(results.containsAll(expected) && expected.containsAll(results));
}
-
+
@Test
public void testFindRelatedVertices() throws AAIException {
//setup
-
+
Graph graph = TinkerGraph.open();
-
+
Vertex gv = graph.addVertex(T.id, "00", "aai-node-type", "generic-vnf");
Vertex lint = graph.addVertex(T.id, "10", "aai-node-type", "l-interface");
Vertex lint2 = graph.addVertex(T.id, "11", "aai-node-type", "l-interface");
Vertex log = graph.addVertex(T.id, "20", "aai-node-type", "logical-link");
-
+
GraphTraversalSource g = graph.traversal();
-
+
edgeSer.addTreeEdge(g, gv, lint);
edgeSer.addEdge(g, lint, log);
edgeSer.addEdge(g, log, lint2);
-
+
List<Vertex> outExpected = new ArrayList<>(Arrays.asList(lint));
List<Vertex> inExpected = new ArrayList<>(Arrays.asList(lint, lint2));
List<Vertex> bothExpected = new ArrayList<>(Arrays.asList(log));
-
+
GraphTraversalQueryEngine engine = new GraphTraversalQueryEngine(g);
-
+
//test
List<Vertex> outRes = engine.findRelatedVertices(gv, Direction.IN, "org.onap.relationships.inventory.BelongsTo", "l-interface");
assertTrue(outRes.containsAll(outExpected) && outExpected.containsAll(outRes));
List<Vertex> inRes = engine.findRelatedVertices(log, Direction.IN, "tosca.relationships.network.LinksTo", "l-interface");
assertTrue(inRes.containsAll(inExpected) && inExpected.containsAll(inRes));
-
+
List<Vertex> bothRes = engine.findRelatedVertices(lint, Direction.BOTH, "tosca.relationships.network.LinksTo", "logical-link");
assertTrue(bothRes.containsAll(bothExpected) && bothExpected.containsAll(bothRes));
}
-
+
@Test
public void testFindSubGraph() throws AAIException, EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
//setup
Graph graph = TinkerGraph.open();
-
+
Vertex cr = graph.addVertex(T.id, "00", "aai-node-type", "cloud-region");
Vertex ten = graph.addVertex(T.id, "10", "aai-node-type", "tenant");
Vertex ten2 = graph.addVertex(T.id, "11", "aai-node-type", "tenant");
@@ -225,7 +252,7 @@ public class GraphTraversalQueryEngineTest extends AAISetup {
Vertex modelVer = graph.addVertex(T.id, "100", "aai-node-type", "model-ver");
GraphTraversalSource g = graph.traversal();
-
+
Edge crTen = edgeSer.addTreeEdge(g, cr, ten);
Edge crTen2 = edgeSer.addTreeEdge(g, cr, ten2);
Edge tenVs = edgeSer.addTreeEdge(g, ten, vs);
@@ -234,14 +261,14 @@ public class GraphTraversalQueryEngineTest extends AAISetup {
Edge lintLog = edgeSer.addEdge(g, lint, log);
Edge vsGv = edgeSer.addEdge(g, vs, gv);
edgeSer.addEdge(g, gv, vnfc);
-
+
edgeSer.addTreeEdge(g, gv, lag);
edgeSer.addTreeEdge(g, lag, lint2);
Edge modelVerEdge = edgeSer.addPrivateEdge(g, gv, modelVer, null);
edgeSer.addTreeEdge(g, comp, ctag);
Edge crComp = edgeSer.addEdge(g, cr, comp);
-
+
//findSubGraph(cr, 0, true)
List<Element> expected1 = new ArrayList<>(Arrays.asList(cr));
//findSubGraph(cr, 2, true)
@@ -249,48 +276,48 @@ public class GraphTraversalQueryEngineTest extends AAISetup {
crTen, crTen2, tenVs, tenVs2));
//findSubGraph(cr)
List<Element> expected3 = new ArrayList<>(Arrays.asList(cr, ten, ten2, comp, vs, vs2, lint, gv, log,
- crTen, crTen2, crComp, tenVs, tenVs2, vsLInt,
+ crTen, crTen2, crComp, tenVs, tenVs2, vsLInt,
vsGv, lintLog));
-
+
GraphTraversalQueryEngine engine = new GraphTraversalQueryEngine(g);
-
+
//test
Tree<Element> res1 = engine.findSubGraph(cr, 0, true);
Set<Element> resList1 = treeToList(res1);
assertTrue(resList1.containsAll(expected1) && expected1.containsAll(resList1));
-
+
Tree<Element> res2 = engine.findSubGraph(cr, 2, true);
Set<Element> resList2 = treeToList(res2);
assertTrue(resList2.containsAll(expected2) && expected2.containsAll(resList2));
-
+
Tree<Element> res3 = engine.findSubGraph(cr);
Set<Element> resList3 = treeToList(res3);
assertThat(resList3, containsInAnyOrder(expected3.toArray()));
// assertTrue(resList3.containsAll(expected3) && expected3.containsAll(resList3));
}
-
+
/**
- * convenience helper method to make it easier to check the contents of the tree against
+ * convenience helper method to make it easier to check the contents of the tree against
* a list of expected results
* @param tree - the tree whose contents you want in collection form
* @return set of the contents of the tree
*/
private Set<Element> treeToList(Tree<Element> tree) {
Set<Element> ret = new HashSet<>();
-
+
for (Element key : tree.keySet()) {
ret.add(key);
ret.addAll(treeToList(tree.get(key)));
}
-
+
return ret;
}
-
+
@Test
public void testFindEdgesForVersion() throws AAIException, EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
//setup
Graph graph = TinkerGraph.open();
-
+
Vertex gv = graph.addVertex(T.id, "00", "aai-node-type", "generic-vnf");
Vertex vnfc = graph.addVertex(T.id, "10", "aai-node-type", "vnfc");
Vertex lob = graph.addVertex(T.id, "20", "aai-node-type", "line-of-business");
@@ -303,16 +330,16 @@ public class GraphTraversalQueryEngineTest extends AAISetup {
.addEdge("some-edge", cr, CONTAINS.toString(), "NONE");
GraphTraversalSource g = graph.traversal();
-
+
edgeSer.addTreeEdge(g, gv, lint); //tree edge so shouldn't appear in results
Edge gvVnfc = edgeSer.addEdge(g, gv, vnfc);
edgeSer.addEdge(g, gv, lob); //v11/12 not v10
Edge gvMvEdge = edgeSer.addPrivateEdge(g, gv, mv, null);
List<Edge> expected = new ArrayList<>(Arrays.asList(gvVnfc));
-
+
GraphTraversalQueryEngine engine = new GraphTraversalQueryEngine(g);
-
+
//test
Loader loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, schemaVersions.getRelatedLinkVersion());
List<Edge> results = engine.findEdgesForVersion(gv, loader);
@@ -322,27 +349,27 @@ public class GraphTraversalQueryEngineTest extends AAISetup {
results = engine.findEdgesForVersion(cr, loader);
assertThat(results, containsInAnyOrder(expected.toArray()));
}
-
+
@Test
public void testFindCousinVertices() throws AAIException {
//setup
Graph graph = TinkerGraph.open();
-
+
Vertex gv = graph.addVertex(T.id, "00", "aai-node-type", "generic-vnf");
Vertex vnfc = graph.addVertex(T.id, "10", "aai-node-type", "vnfc");
Vertex lob = graph.addVertex(T.id, "20", "aai-node-type", "line-of-business");
Vertex lint = graph.addVertex(T.id, "30", "aai-node-type", "l-interface");
-
+
GraphTraversalSource g = graph.traversal();
-
+
edgeSer.addTreeEdge(g, gv, lint); //tree edge so shouldn't appear in results
edgeSer.addEdge(g, gv, vnfc);
edgeSer.addEdge(g, gv, lob);
-
+
List<Vertex> expected = new ArrayList<>(Arrays.asList(vnfc, lob));
-
+
GraphTraversalQueryEngine engine = new GraphTraversalQueryEngine(g);
-
+
//test
List<Vertex> results = engine.findCousinVertices(gv);
assertTrue(results.containsAll(expected) && expected.containsAll(results));
diff --git a/aai-core/src/test/resources/payloads/resource/cloud-region-with-vlan.json b/aai-core/src/test/resources/payloads/resource/cloud-region-with-vlan.json
new file mode 100644
index 00000000..bad4fadf
--- /dev/null
+++ b/aai-core/src/test/resources/payloads/resource/cloud-region-with-vlan.json
@@ -0,0 +1,50 @@
+{
+ "cloud-owner" : "junit-cloud-owner-with-vlan",
+ "cloud-region-id" : "junit-cloud-region-with-vlan",
+ "cloud-type" : "P9P1X6U9eDXR",
+ "owner-defined-type" : "OUrR8kI6Br",
+ "tenants" : {
+ "tenant" : [ {
+ "tenant-id" : "tenant1-with-vlan",
+ "tenant-name" : "yhgVBcv3Pr",
+ "vservers" : {
+ "vserver" : [ {
+ "vserver-id" : "vserver1-with-vlan",
+ "vserver-name" : "P3SJ347Uyv",
+ "vserver-name2" : "1dHd",
+ "vserver-selflink" : "v7dU8H",
+ "in-maint" : false,
+ "is-closed-loop-disabled" : true,
+ "l-interfaces" : {
+ "l-interface" : [ {
+ "interface-name" : "top-linterface-with-vlan",
+ "interface-role" : "3W1FAJGSQ",
+ "v6-wan-link-ip" : "WugWw3N",
+ "selflink" : "Of4j0pU",
+ "interface-id" : "eoW",
+ "macaddr" : "XNbbIy33",
+ "network-name" : "ZETDv5sGhiS",
+ "management-option" : "qR3RyCxgEU",
+ "vlans" : {
+ "vlan" : [ {
+ "vlan-interface" : "test-vlan-interface-1",
+ "vlan-id-inner" : 884,
+ "vlan-id-outer" : 992,
+ "speed-value" : "RyFPm",
+ "speed-units" : "ZrckmLff7b",
+ "vlan-description" : "zjAeUFgeagpf",
+ "backdoor-connection" : "gANMvUquB",
+ "vpn-key" : "l0rV7bb2Sc",
+ "orchestration-status" : "WVnLpbzIx",
+ "in-maint" : false,
+ "prov-status" : "tYMRi6df",
+ "is-ip-unnumbered" : false
+ } ]
+ }
+ } ]
+ }
+ } ]
+ }
+ } ]
+ }
+}
diff --git a/aai-core/src/test/resources/payloads/resource/cloud-region.json b/aai-core/src/test/resources/payloads/resource/cloud-region.json
new file mode 100644
index 00000000..0bbf6398
--- /dev/null
+++ b/aai-core/src/test/resources/payloads/resource/cloud-region.json
@@ -0,0 +1,4 @@
+{
+ "cloud-owner": "cloud-region-owner-with-vip-ipv4",
+ "cloud-region-id": "cloud-region-id-with-vip-ipv4"
+}
diff --git a/aai-core/src/test/resources/payloads/resource/entitlement.json b/aai-core/src/test/resources/payloads/resource/entitlement.json
new file mode 100644
index 00000000..09afb617
--- /dev/null
+++ b/aai-core/src/test/resources/payloads/resource/entitlement.json
@@ -0,0 +1,4 @@
+{
+ "group-uuid":"g1",
+ "resource-uuid":"r1"
+}
diff --git a/aai-core/src/test/resources/payloads/resource/model-element.json b/aai-core/src/test/resources/payloads/resource/model-element.json
new file mode 100644
index 00000000..935f1b05
--- /dev/null
+++ b/aai-core/src/test/resources/payloads/resource/model-element.json
@@ -0,0 +1,230 @@
+{
+ "model-element-uuid": "acf8b6cf-e051-4c1b-bcad-b24792f826cf-test1",
+ "new-data-del-flag": "7hWigbwQCh",
+ "cardinality": "loWHX7E8X",
+ "linkage-points": [
+ "Ve4JU"
+ ],
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "01b757d5-6468-48d0-a1cd-2aa8310dadab-test1",
+ "new-data-del-flag": "IXoM0QnE0W",
+ "cardinality": "THLHKl"
+ },
+ {
+ "model-element-uuid": "2e5d5696-2221-4bcf-a493-e0ca92e323de-test1",
+ "new-data-del-flag": "icATJZ7Vbhz",
+ "cardinality": "tOIz"
+ }
+ ]
+ },
+ "model-constraints": {
+ "model-constraint": [
+ {
+ "model-constraint-uuid": "9f2e872b-000e-4bb9-9398-f308a997dd4f-test1",
+ "constrained-element-set-uuid-to-replace": "XfAVftTYu",
+ "constrained-element-sets": {
+ "constrained-element-set": [
+ {
+ "constrained-element-set-uuid": "103cc6f7-b648-4a3f-b5aa-0ffdac4d4bc5-test1",
+ "constraint-type": "FLKyNFdqbSSje",
+ "check-type": "IDLSYTM",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "5c063d38-d83e-4fe5-a721-86296fe39267-test1",
+ "element-choice-set-name": "EFc5b4k7LN8hF",
+ "cardinality": "xx8",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "0b7a5aa2-5061-4916-a2c6-5280e67e0a71-test1",
+ "new-data-del-flag": "x1Lo15W",
+ "cardinality": "COu"
+ },
+ {
+ "model-element-uuid": "f0af348b-1701-409f-bb11-e3acc77ad718-test1",
+ "new-data-del-flag": "eiWkNQEj",
+ "cardinality": "3aju5XtI"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "2c0888a6-fb6d-4a72-b0a1-3349c90d9e33-test1",
+ "element-choice-set-name": "Ko4",
+ "cardinality": "aXjnyYfCRFTDK",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "ea8853be-8473-4f80-8229-9041864e143e-test1",
+ "new-data-del-flag": "4tirsCs0fjDdS",
+ "cardinality": "v2hbEn8u"
+ },
+ {
+ "model-element-uuid": "f1267f37-5aa0-4f4a-ae66-3cf782ff4a9d-test1",
+ "new-data-del-flag": "mzuWZTlc9f",
+ "cardinality": "ysBXVL"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "constrained-element-set-uuid": "a82256df-5bc8-4433-851f-9b09f63432b4-test1",
+ "constraint-type": "qgnLpj",
+ "check-type": "zFug3wfyCe5cF",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "3ce79981-c0cc-4210-9dab-89b8866797be-test1",
+ "element-choice-set-name": "rZ2f7Es",
+ "cardinality": "H1b",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "52362a88-eb7a-4fe5-a6d5-1ca414cfed64-test1",
+ "new-data-del-flag": "8cQmvQgeKJz",
+ "cardinality": "6T7GiwYlJR5"
+ },
+ {
+ "model-element-uuid": "e9d00d89-a340-4ef1-ab19-63367a5e8642-test1",
+ "new-data-del-flag": "ec8DWfYeMJdr",
+ "cardinality": "Bumc8fT7"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "335bac38-9739-4ff7-8743-e186310d86a9-test1",
+ "element-choice-set-name": "K0MH",
+ "cardinality": "rL3fH1Oz",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "29244639-38ab-45b2-82b7-b91001ad56da-test1",
+ "new-data-del-flag": "YZGbB6",
+ "cardinality": "ushcYd"
+ },
+ {
+ "model-element-uuid": "e36d3159-bfa7-465a-849f-de9ca6d4f304-test1",
+ "new-data-del-flag": "ZtzRhZbxv2i",
+ "cardinality": "NE4m8n5hj"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "model-constraint-uuid": "9e74a97c-52a9-43b4-bb9d-144cb5a2216e-test1",
+ "constrained-element-set-uuid-to-replace": "bZqdarfk6",
+ "constrained-element-sets": {
+ "constrained-element-set": [
+ {
+ "constrained-element-set-uuid": "6c4db1da-8860-4445-a0ad-3ae00709e2bb-test1",
+ "constraint-type": "Xzat2eVcU36g",
+ "check-type": "3Y5Bi32VkRHFl",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "33dc52b0-3461-4ca6-a195-c3cacc2ab426-test1",
+ "element-choice-set-name": "2ziwMvQGmanJ",
+ "cardinality": "7XXcdT5sqsOf",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "c0fb7805-dfc4-4972-9a1c-d9409560f6e3-test1",
+ "new-data-del-flag": "262Lx",
+ "cardinality": "0ZaryC"
+ },
+ {
+ "model-element-uuid": "e868506d-ef7d-4843-9c1b-47712c7c1b77-test1",
+ "new-data-del-flag": "f7cKUCEbVuj6",
+ "cardinality": "6LlYciE99"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "aca6b107-ba99-4e10-aef5-ff35a5b25a60-test1",
+ "element-choice-set-name": "lqfZDs",
+ "cardinality": "9AwB7",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "527faaf0-f989-47a4-9ffd-4ea16d034be1-test1",
+ "new-data-del-flag": "mPra14ZfLilOw",
+ "cardinality": "y6mYr6"
+ },
+ {
+ "model-element-uuid": "dfd7c245-0a28-494d-b388-faf27481674c-test1",
+ "new-data-del-flag": "muGR",
+ "cardinality": "TUj4Z"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "constrained-element-set-uuid": "17999338-a062-4447-b8c3-b27228255ede-test1",
+ "constraint-type": "WhTbdWCLyA",
+ "check-type": "tN02MBeB",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "633c6757-2270-48fb-bff7-61145e6c943f-test1",
+ "element-choice-set-name": "Ith1PEe6",
+ "cardinality": "8sta",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "827c40a9-cabe-460a-b537-2f117ca62db5-test1",
+ "new-data-del-flag": "fS65rXWQY",
+ "cardinality": "Kq42Z8GzCh"
+ },
+ {
+ "model-element-uuid": "c107a4bd-59e4-4249-bbc3-a006645dcb01-test1",
+ "new-data-del-flag": "EtgTeJdo19",
+ "cardinality": "tvzpgg"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "930260d8-4cfd-4494-ba2c-d619c143a390-test1",
+ "element-choice-set-name": "ugDc0",
+ "cardinality": "K8MXjV",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "f17f9eea-d421-4e8a-8628-32a4b56507ef-test1",
+ "new-data-del-flag": "rjAbq7gyZWe",
+ "cardinality": "VbDCFB9"
+ },
+ {
+ "model-element-uuid": "ee1d800e-46c1-4bb0-8664-f257850ffff9-test1",
+ "new-data-del-flag": "YontPXK4sj4s",
+ "cardinality": "UQnNPld4sE"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
diff --git a/aai-core/src/test/resources/payloads/resource/model.json b/aai-core/src/test/resources/payloads/resource/model.json
new file mode 100644
index 00000000..a86a1de8
--- /dev/null
+++ b/aai-core/src/test/resources/payloads/resource/model.json
@@ -0,0 +1,975 @@
+{
+ "model-invariant-id": "24c04fc5-f3f8-43ec-8792-c6f940638676-test1",
+ "model-type": "woZ4dpF3TM",
+ "model-vers": {
+ "model-ver": [
+ {
+ "model-version-id": "0c4c59f0-9864-43ca-b0c2-ca38746b72a5-test1",
+ "model-name": "vzZn3Q3h",
+ "model-version": "RcN2FIwUF",
+ "distribution-status": "qcCHkye",
+ "model-description": "qcPB4hOig9",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "0dc2b8b6-af8d-4213-970b-7861a603fc86-test1",
+ "new-data-del-flag": "OzhypC",
+ "cardinality": "vNpFfHn",
+ "linkage-points": [
+ "BTDVw7pA"
+ ],
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "0ff7bfc5-e42b-474d-b728-cfdc08310971-test1",
+ "new-data-del-flag": "v54vhcTX",
+ "cardinality": "uHLsCw"
+ },
+ {
+ "model-element-uuid": "4fb1b036-9963-467e-93fe-c6e499859b2e-test1",
+ "new-data-del-flag": "UAJAjOCe9dIiW",
+ "cardinality": "8PhfKI"
+ }
+ ]
+ },
+ "model-constraints": {
+ "model-constraint": [
+ {
+ "model-constraint-uuid": "782ba24a-28ab-4fd0-8e69-da10cc5373f3-test1",
+ "constrained-element-set-uuid-to-replace": "8vcq",
+ "constrained-element-sets": {
+ "constrained-element-set": [
+ {
+ "constrained-element-set-uuid": "a33e65c3-1198-4d4c-9799-2b521e4c4212-test1",
+ "constraint-type": "4jqozTvJSD",
+ "check-type": "J9aM",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "7df27a94-06c8-46ef-9fc2-5900d8cffbb0-test1",
+ "element-choice-set-name": "wjNT",
+ "cardinality": "XSPmZH",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "fcf1450b-cf5c-414a-99c0-2bd7ca247997-test1",
+ "new-data-del-flag": "uhwWkaDw",
+ "cardinality": "jeBU9v"
+ },
+ {
+ "model-element-uuid": "85bfca5f-03ac-4653-a3b4-bdfad8dd1c13-test1",
+ "new-data-del-flag": "L2BQe2kyA",
+ "cardinality": "asciE2y7RWGVa"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "d20040e2-0417-4a2d-978e-e6c9f353a0c5-test1",
+ "element-choice-set-name": "x7vEDj5",
+ "cardinality": "A6f2Us",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "5cdcbb91-22eb-4c12-9a54-b8c3ff5aa591-test1",
+ "new-data-del-flag": "BCo",
+ "cardinality": "FejO1GRl"
+ },
+ {
+ "model-element-uuid": "7a401382-7d45-40f9-8fe7-236629273226-test1",
+ "new-data-del-flag": "zFj",
+ "cardinality": "9DzyB7u"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "constrained-element-set-uuid": "2f7a375a-135d-461b-b806-e7cd636506f4-test1",
+ "constraint-type": "Toy",
+ "check-type": "uYEWZon81Wa",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "8aab42ee-561f-4506-ab66-6432442193f8-test1",
+ "element-choice-set-name": "RpJJn1eRQL",
+ "cardinality": "q0XXZ52",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "2a35ad40-02ef-4947-b20c-94a90440ffc7-test1",
+ "new-data-del-flag": "gXHt5O5XyRKb",
+ "cardinality": "idg0cH"
+ },
+ {
+ "model-element-uuid": "7aae6c34-086e-477b-845a-01cedc2a4e25-test1",
+ "new-data-del-flag": "Zwj",
+ "cardinality": "3vkT"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "f42dcd25-aa82-401f-b987-5d0f46d6b5d6-test1",
+ "element-choice-set-name": "Cuon",
+ "cardinality": "cfxfo3MAF",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "2f9f4c5c-216c-45c0-913b-5513faa6f887-test1",
+ "new-data-del-flag": "2ZTs",
+ "cardinality": "zki"
+ },
+ {
+ "model-element-uuid": "6abd9eb0-59b2-45d1-bc31-51913bc9f54b-test1",
+ "new-data-del-flag": "9cQkkA",
+ "cardinality": "NGY7CgvUQDN"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "model-constraint-uuid": "8544de93-b647-4d79-aa55-a3ebe01664e7-test1",
+ "constrained-element-set-uuid-to-replace": "phbhKDPCcUjK",
+ "constrained-element-sets": {
+ "constrained-element-set": [
+ {
+ "constrained-element-set-uuid": "61624b66-e059-49c6-a97c-06ca4643e259-test1",
+ "constraint-type": "gp0nB63dH",
+ "check-type": "NFnVJKceCMc",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "f85f1ee8-d28f-4128-83d8-02c2e07f9e27-test1",
+ "element-choice-set-name": "8noi",
+ "cardinality": "mTFoGk",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "1e15718d-17e8-4a34-852e-2edede549b63-test1",
+ "new-data-del-flag": "f3p1f",
+ "cardinality": "c0Z6zG0iKX"
+ },
+ {
+ "model-element-uuid": "4ad51c91-1e90-4683-b9ea-017cf0bc528e-test1",
+ "new-data-del-flag": "05r47Aldegi",
+ "cardinality": "aoF"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "fb2c7824-fc87-4fe9-93c6-10586a59384e-test1",
+ "element-choice-set-name": "EIjKr0w3tJ",
+ "cardinality": "qlw6EFFF",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "2395bed7-399d-41cd-81af-e5002854bc69-test1",
+ "new-data-del-flag": "Uj2",
+ "cardinality": "eLHBGqv7wz5z"
+ },
+ {
+ "model-element-uuid": "77840aeb-0868-49c1-a97d-6ded16115174-test1",
+ "new-data-del-flag": "rOR",
+ "cardinality": "ddXm59kMQ01y"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "constrained-element-set-uuid": "4f1f30ee-5bd5-4f19-b11d-23ebf0fcd569-test1",
+ "constraint-type": "Ul7rn0Gyh",
+ "check-type": "5KpT6x",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "d2b9a3f5-29de-45ba-ad5a-184e0635607a-test1",
+ "element-choice-set-name": "OWFEeT",
+ "cardinality": "g2wvznpf",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "93d0b10b-529a-4ad4-88fa-afc7273ec538-test1",
+ "new-data-del-flag": "BHqDTu",
+ "cardinality": "bUZd3Zj4b"
+ },
+ {
+ "model-element-uuid": "fd6548f8-211a-4194-a78e-857efc443180-test1",
+ "new-data-del-flag": "ygDuebv",
+ "cardinality": "UZx1v0HH7I"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "f393b086-40b6-47d9-b28a-b830d5d7f896-test1",
+ "element-choice-set-name": "dxt8afBT",
+ "cardinality": "L3mtZIH342JVw",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "d802155e-8e16-4b9d-986a-d0f490d83e56-test1",
+ "new-data-del-flag": "cPapfw",
+ "cardinality": "4O3aiKf"
+ },
+ {
+ "model-element-uuid": "64cf1800-77b7-4c1d-80b2-38fc156769a6-test1",
+ "new-data-del-flag": "T2dc7t3",
+ "cardinality": "LTrGUfoB7imS"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "model-element-uuid": "1db3d04c-92c6-4100-b851-16a0a2318909-test1",
+ "new-data-del-flag": "9Gc",
+ "cardinality": "vtJk",
+ "linkage-points": [
+ "NKC5OiZl"
+ ],
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "16b90f9d-d2ed-46e8-8a0d-f2907ecf723d-test1",
+ "new-data-del-flag": "jcjL",
+ "cardinality": "qxX"
+ },
+ {
+ "model-element-uuid": "46afb085-7025-4a35-99e3-6170dc98b74b-test1",
+ "new-data-del-flag": "tXgrF6T4HrirE",
+ "cardinality": "55waV3oUI"
+ }
+ ]
+ },
+ "model-constraints": {
+ "model-constraint": [
+ {
+ "model-constraint-uuid": "6f6fbf96-c9a7-4393-9e81-284d194ba6a3-test1",
+ "constrained-element-set-uuid-to-replace": "HF81PuSuM",
+ "constrained-element-sets": {
+ "constrained-element-set": [
+ {
+ "constrained-element-set-uuid": "cf2d2ff1-1ffc-4ad6-b3ce-8729c3352637-test1",
+ "constraint-type": "XfD",
+ "check-type": "mVERn7luqFc",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "85fb8953-f86d-4d58-8ca2-3169cba074c6-test1",
+ "element-choice-set-name": "4s6Jf",
+ "cardinality": "KL8eVh9xZ",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "7b1fd5b5-b633-4ed6-a9e8-9c3430eaaae0-test1",
+ "new-data-del-flag": "uNbESfr",
+ "cardinality": "aEj2c5UXN2qW"
+ },
+ {
+ "model-element-uuid": "c67a3856-3812-4c16-abb3-484fe68ba65e-test1",
+ "new-data-del-flag": "cg1GbGyps",
+ "cardinality": "cCPBuauJ"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "4748a324-a8aa-420a-9f48-0fd0b7418a1a-test1",
+ "element-choice-set-name": "U3JuW0tx",
+ "cardinality": "4jpXRS43G",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "daad8caa-dbfc-487a-91d4-a93021a86e0c-test1",
+ "new-data-del-flag": "ZoRQyflmIqEaA",
+ "cardinality": "Mu7PzxNg8cta"
+ },
+ {
+ "model-element-uuid": "e5a640f1-1203-410c-8665-0ee325179368-test1",
+ "new-data-del-flag": "thsF0L",
+ "cardinality": "fViD"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "constrained-element-set-uuid": "5d1b2701-d719-4eb5-b5bc-355f99042648-test1",
+ "constraint-type": "4wPy2Xd",
+ "check-type": "sDuGfZji",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "d01f1c5b-5ba1-4c21-b80d-901867a1d810-test1",
+ "element-choice-set-name": "FdrVe6o",
+ "cardinality": "F1MXs1fET0jr3",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "6e059bfe-5386-4491-8e84-b1b6dd8b5333-test1",
+ "new-data-del-flag": "DfodMIT72h7",
+ "cardinality": "KvRbLIJFL"
+ },
+ {
+ "model-element-uuid": "ea73886a-ff64-4d3c-9b17-5ae5b2196dea-test1",
+ "new-data-del-flag": "n9PnoK5",
+ "cardinality": "0E3fM6"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "abb55d08-28b6-48d8-b19e-91b12c096649-test1",
+ "element-choice-set-name": "MRFYeF7",
+ "cardinality": "b64jIhgbYH7",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "c449a692-bd7d-4d86-b46e-1c417b17099f-test1",
+ "new-data-del-flag": "ApwuLwUkkw",
+ "cardinality": "m23c6lsF"
+ },
+ {
+ "model-element-uuid": "7cb770d9-55d8-45d2-8b9b-abdff7a2c88b-test1",
+ "new-data-del-flag": "MeSjvno",
+ "cardinality": "lGFfcOOl19"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "model-constraint-uuid": "ce9e9365-1fec-4c29-8201-c4417ee2ea1d-test1",
+ "constrained-element-set-uuid-to-replace": "Buq56Km4W9BD",
+ "constrained-element-sets": {
+ "constrained-element-set": [
+ {
+ "constrained-element-set-uuid": "3dcea521-a227-46f3-bd4f-ef1fcff0755e-test1",
+ "constraint-type": "WZr",
+ "check-type": "pxJXuyaXvsaQy",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "19dc8b4a-c58b-4ff8-b507-877c6521d91a-test1",
+ "element-choice-set-name": "af5CO7sD5TWwz",
+ "cardinality": "uGwotewgnmls",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "5d476750-ddc3-4822-b629-5fba93445ed9-test1",
+ "new-data-del-flag": "mMjS6OflV3c",
+ "cardinality": "Gidw5"
+ },
+ {
+ "model-element-uuid": "d4d4f1f6-ad60-4a94-b076-eb36db6fb362-test1",
+ "new-data-del-flag": "kWLrcR",
+ "cardinality": "AU6llmk"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "d6616e1a-3de5-4981-a216-805bdd97d65e-test1",
+ "element-choice-set-name": "9w67AaiJNt0",
+ "cardinality": "kKax01oqb",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "bb11c9c1-5013-4b51-9a06-9729addfd4af-test1",
+ "new-data-del-flag": "ANM8TN0a",
+ "cardinality": "UPtA8wc4m"
+ },
+ {
+ "model-element-uuid": "71b323c0-1829-414e-85f6-99f4b5835e44-test1",
+ "new-data-del-flag": "okC9",
+ "cardinality": "1KP3eU5j8"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "constrained-element-set-uuid": "77d1cc2d-6e94-4a4f-a7ec-f725605f18d3-test1",
+ "constraint-type": "inJa",
+ "check-type": "JkoIos3V",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "9893bb02-e422-4810-bccc-a594b0489ded-test1",
+ "element-choice-set-name": "ZIync",
+ "cardinality": "WZfSZe",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "b0aaa08d-a7fe-44ae-a6d8-d21645831a23-test1",
+ "new-data-del-flag": "RdwsDmBBz",
+ "cardinality": "Ry6V3zZtLOS"
+ },
+ {
+ "model-element-uuid": "a2670e8e-f57e-4c0e-9522-6d16b4e2cf18-test1",
+ "new-data-del-flag": "aCECwDjNyauTZ",
+ "cardinality": "a28MCzMm24JBI"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "321ccc75-61ae-4358-af89-53809a28f956-test1",
+ "element-choice-set-name": "HjNWjs",
+ "cardinality": "bxRIxMP",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "41965df8-b42d-47ba-8bf6-cade35804311-test1",
+ "new-data-del-flag": "CPLVd",
+ "cardinality": "4Ij4hep2"
+ },
+ {
+ "model-element-uuid": "db7ee384-420e-44fb-a1ca-809f94add6b8-test1",
+ "new-data-del-flag": "Cj5GVv",
+ "cardinality": "1LSdRvvzBBfa"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "metadata": {
+ "metadatum": [
+ {
+ "metaname": "8b3496f1-822e-4acf-b1fc-d07a494d3a86-test1",
+ "metaval": "gZwqNxIDsw"
+ },
+ {
+ "metaname": "d9a50737-f3df-4156-881d-e3875031b413-test1",
+ "metaval": "qMugMK"
+ }
+ ]
+ }
+ },
+ {
+ "model-version-id": "1e6ec4df-ad66-40bc-8f1d-ba40c835e77e-test1",
+ "model-name": "wStuf",
+ "model-version": "HAm",
+ "distribution-status": "zsKxpTc5YTW1",
+ "model-description": "zxHpALNUvX8V",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "b1ac6004-59bd-4372-ab16-f327d04d647e-test1",
+ "new-data-del-flag": "j58MXR",
+ "cardinality": "9Xr0gNa",
+ "linkage-points": [
+ "LmE7mpec2"
+ ],
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "38295729-dc3b-4b7b-87e3-446513a802df-test1",
+ "new-data-del-flag": "R5KeFH8",
+ "cardinality": "9wkk9Z"
+ },
+ {
+ "model-element-uuid": "b1ac08c3-3047-4637-8796-6b5e43bbad19-test1",
+ "new-data-del-flag": "KOS9kMuahku",
+ "cardinality": "F6A"
+ }
+ ]
+ },
+ "model-constraints": {
+ "model-constraint": [
+ {
+ "model-constraint-uuid": "0c7f45c8-2552-400a-b029-e20cddda592b-test1",
+ "constrained-element-set-uuid-to-replace": "105ZUJ",
+ "constrained-element-sets": {
+ "constrained-element-set": [
+ {
+ "constrained-element-set-uuid": "162ea223-ae49-4e6d-ba30-8215c433a7e2-test1",
+ "constraint-type": "GAq",
+ "check-type": "ippNik",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "5caa493c-e804-4c28-aad6-3389a1801e29-test1",
+ "element-choice-set-name": "oLPlXWcCL",
+ "cardinality": "ns6",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "ff8f0de4-220f-4f7f-8447-07c67ed8a109-test1",
+ "new-data-del-flag": "TlLVzdU5Mz",
+ "cardinality": "wQI"
+ },
+ {
+ "model-element-uuid": "fd6018bc-b3ce-4073-b494-848c06aaef83-test1",
+ "new-data-del-flag": "ZIkOtmdu8ij",
+ "cardinality": "XfOsai"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "45d079e2-94f8-4c75-9e58-fca00da8e032-test1",
+ "element-choice-set-name": "nfOh9SvgG",
+ "cardinality": "j5u1OHFt",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "3edbf250-7039-47cd-b31d-019e5639006b-test1",
+ "new-data-del-flag": "Qo5M8AB",
+ "cardinality": "crDs4E"
+ },
+ {
+ "model-element-uuid": "566c492a-4b8d-4393-9634-5deb36114390-test1",
+ "new-data-del-flag": "tSl",
+ "cardinality": "xZK7oAuI1"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "constrained-element-set-uuid": "6efd9e99-bca6-4f3b-a7dc-38ad373c38e9-test1",
+ "constraint-type": "v3RYRkCdTm",
+ "check-type": "adGnhMq6P4",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "09d59684-e8e5-4e08-93af-b2a65d0328e6-test1",
+ "element-choice-set-name": "Q1rPa",
+ "cardinality": "ENpTrUR",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "904654a2-4d7d-4d07-af26-ddb881dd05d7-test1",
+ "new-data-del-flag": "76D6azxVm1XR9",
+ "cardinality": "R0Zb34f"
+ },
+ {
+ "model-element-uuid": "898cfb56-6e36-4b03-8967-9384d06b3a3e-test1",
+ "new-data-del-flag": "SJtXdr4",
+ "cardinality": "vG4JrjQ8"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "9ac87d60-51c5-4dd6-bb1e-1b8dd234b5a9-test1",
+ "element-choice-set-name": "azv",
+ "cardinality": "oJfnKsDO5k",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "6ec8304f-8159-4344-b06d-faf1001fd275-test1",
+ "new-data-del-flag": "3s5zQjf8Vwl4",
+ "cardinality": "6SogRPhZX38Ol"
+ },
+ {
+ "model-element-uuid": "cfd9b055-3d8a-4429-9ea6-078a2270e469-test1",
+ "new-data-del-flag": "VaW81J59tqiY",
+ "cardinality": "t1mNuU7JnNc7L"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "model-constraint-uuid": "fe9d4b0d-dc65-4440-a10f-5237f135255c-test1",
+ "constrained-element-set-uuid-to-replace": "pWv26",
+ "constrained-element-sets": {
+ "constrained-element-set": [
+ {
+ "constrained-element-set-uuid": "ea1473a3-e72d-4838-b8d8-7c8e86e0b3c8-test1",
+ "constraint-type": "Mdbb0G5nLxcx3",
+ "check-type": "a8rlES",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "86726d80-74d6-4b7e-9532-65ebb76133ef-test1",
+ "element-choice-set-name": "fBm0",
+ "cardinality": "csPsKpgV",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "c0df13d1-a8be-4bc0-a572-44ca28d35d62-test1",
+ "new-data-del-flag": "k9x8eFMP",
+ "cardinality": "5xHWzWretpyAN"
+ },
+ {
+ "model-element-uuid": "ef4f9a86-a1b8-48ef-a7aa-ff56a1879ef7-test1",
+ "new-data-del-flag": "JdujO3QQr4",
+ "cardinality": "N6pvsIK"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "07f1ae12-8e40-4c42-bb8c-e5931f82be84-test1",
+ "element-choice-set-name": "by4K",
+ "cardinality": "HfJt7",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "aed78a3d-de9e-4825-88b3-8251a822e87c-test1",
+ "new-data-del-flag": "NbAWo0r1su",
+ "cardinality": "GIHSc"
+ },
+ {
+ "model-element-uuid": "451ef346-a43e-4d9c-ae94-4d14f12b7776-test1",
+ "new-data-del-flag": "o6GI",
+ "cardinality": "Hbbm3HRFeXw8U"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "constrained-element-set-uuid": "1b3d0f60-b438-4789-b711-5d48c211e9b3-test1",
+ "constraint-type": "G7HBqSqa8",
+ "check-type": "Rky",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "c47b3c18-912b-4781-82a9-961702e58712-test1",
+ "element-choice-set-name": "ntxJ1ETx96",
+ "cardinality": "6B1XDdERKUk0f",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "d451967f-5cb9-4aba-8595-938d44bed081-test1",
+ "new-data-del-flag": "pwHvYjtFEvmn",
+ "cardinality": "X6jiiniZ24e3"
+ },
+ {
+ "model-element-uuid": "0f6196d6-b3b7-451a-a3d8-2a0a9bf401b7-test1",
+ "new-data-del-flag": "YFY4Dmyr",
+ "cardinality": "CMF05rTle1"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "927a4c5d-c06f-474c-bc39-b1bf8edbd5a9-test1",
+ "element-choice-set-name": "C19",
+ "cardinality": "7xCo",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "b839b84d-4508-4aa6-8c32-0566a25d62d1-test1",
+ "new-data-del-flag": "QdvVPKk",
+ "cardinality": "QWO7FG"
+ },
+ {
+ "model-element-uuid": "20df13a4-aad9-46ed-8c40-d2c9ee25c0c0-test1",
+ "new-data-del-flag": "aFu39uCq",
+ "cardinality": "wFwAw3L3wT2x5"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "model-element-uuid": "c198c7e7-162f-4b36-ab18-1ea652940569-test1",
+ "new-data-del-flag": "c9VM1nU9",
+ "cardinality": "na6ev",
+ "linkage-points": [
+ "Qn71",
+ "VqVquEM"
+ ],
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "5a3d5001-ed82-4586-9f8e-f4754c5a7a18-test1",
+ "new-data-del-flag": "x5unCqf",
+ "cardinality": "SelKZSH"
+ },
+ {
+ "model-element-uuid": "b150a826-8d8e-4e76-8661-6cbc67fd0d9a-test1",
+ "new-data-del-flag": "9LfZWv",
+ "cardinality": "uMtY5vRkmCnw"
+ }
+ ]
+ },
+ "model-constraints": {
+ "model-constraint": [
+ {
+ "model-constraint-uuid": "43871728-3816-470f-9b36-4097731910a4-test1",
+ "constrained-element-set-uuid-to-replace": "R8Uhk",
+ "constrained-element-sets": {
+ "constrained-element-set": [
+ {
+ "constrained-element-set-uuid": "0fd99298-8079-4a3c-bbed-dce0ceadf790-test1",
+ "constraint-type": "JFVkmI9ilV",
+ "check-type": "9eqnm",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "22a978b9-4dcc-4c7d-b88a-6bdbab97dd7c-test1",
+ "element-choice-set-name": "4fHNNV",
+ "cardinality": "VBAiH",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "d9bef0c1-07c9-4251-b621-196be3b7870e-test1",
+ "new-data-del-flag": "FQen9U2BTGx",
+ "cardinality": "ohd"
+ },
+ {
+ "model-element-uuid": "60d8b814-8035-4010-8d46-9db2e5962f17-test1",
+ "new-data-del-flag": "2aJgwjV3UZv",
+ "cardinality": "WMb"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "a5b753eb-162e-4bea-8185-43b7e96c0770-test1",
+ "element-choice-set-name": "k9Ud",
+ "cardinality": "VAL51",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "1ecfe4f4-6696-4df4-8b93-b2b3fa39c377-test1",
+ "new-data-del-flag": "SRFYVMGe",
+ "cardinality": "muxuy0DZBBW"
+ },
+ {
+ "model-element-uuid": "96acb4b2-f178-4119-8c32-6c5901896417-test1",
+ "new-data-del-flag": "wbzd",
+ "cardinality": "M0Y7Meota"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "constrained-element-set-uuid": "b22dc84b-5568-4b7d-9b58-0bc90c969619-test1",
+ "constraint-type": "waPRf1NGHeFy",
+ "check-type": "YziABbwA4",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "fb4d5b28-2083-4bb6-a87d-e53eadd14d54-test1",
+ "element-choice-set-name": "VnX7QOx",
+ "cardinality": "qk4aMYBkw",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "1b5481f2-66c9-4cd4-89ee-492e333570fe-test1",
+ "new-data-del-flag": "ba6QIyym",
+ "cardinality": "zUJ9gpkRq"
+ },
+ {
+ "model-element-uuid": "c9918ba3-dcb3-46e8-870f-316251f459a3-test1",
+ "new-data-del-flag": "X2MIS2y",
+ "cardinality": "u3xIyaL"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "f5a14c3b-6536-4803-9660-4a2f2263dfdd-test1",
+ "element-choice-set-name": "KiVnNej1flt",
+ "cardinality": "AwImrctM5",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "e5e3b7db-7336-498b-8eca-f43f979dda68-test1",
+ "new-data-del-flag": "v3JnIH7JEK",
+ "cardinality": "pzypSipEOA"
+ },
+ {
+ "model-element-uuid": "24426103-516b-4634-83f6-0b02db4d10ed-test1",
+ "new-data-del-flag": "lNx",
+ "cardinality": "OFMiiE1w4K"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "model-constraint-uuid": "310f083b-2d76-4e2d-ab82-b4c6b2a49637-test1",
+ "constrained-element-set-uuid-to-replace": "70UQQ",
+ "constrained-element-sets": {
+ "constrained-element-set": [
+ {
+ "constrained-element-set-uuid": "f6b24791-facd-41d8-8b4e-b76d750ef3e8-test1",
+ "constraint-type": "eBTDI1Xx",
+ "check-type": "uyscxXaNEt",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "efc328ed-3302-4808-b25a-adbbe88af7d9-test1",
+ "element-choice-set-name": "HwpVVTGb6e",
+ "cardinality": "dZ78oR",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "1f20c582-952d-4489-a45b-b7b898062bc4-test1",
+ "new-data-del-flag": "Vq8f3STu8ez",
+ "cardinality": "5lN"
+ },
+ {
+ "model-element-uuid": "77f61b0a-ecf4-43ed-84b8-478372922557-test1",
+ "new-data-del-flag": "OrbNIIvUvTQ",
+ "cardinality": "CwT1hp9uUn"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "7561f91e-5d71-4871-b745-5974a29fa4f0-test1",
+ "element-choice-set-name": "JyMxtTdSzEYI",
+ "cardinality": "CU5",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "7857bb38-b373-4f32-bfed-fb698b38f288-test1",
+ "new-data-del-flag": "qGYsqE",
+ "cardinality": "m1wtW502"
+ },
+ {
+ "model-element-uuid": "27097500-1e6a-4692-bcfc-8c5751094416-test1",
+ "new-data-del-flag": "e3LD9ESy1h2we",
+ "cardinality": "a0jEiwQq"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "constrained-element-set-uuid": "a63f212b-0608-4676-a801-eae9704ca6f8-test1",
+ "constraint-type": "1s642QAY3emE",
+ "check-type": "3sR23Vt",
+ "element-choice-sets": {
+ "element-choice-set": [
+ {
+ "element-choice-set-uuid": "e6f1f3eb-61c5-4e00-877b-253d41dc8bc1-test1",
+ "element-choice-set-name": "EBhZUZSbs",
+ "cardinality": "1LrK8RM4o33LD",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "323c6b90-7aba-41ad-8313-5a4a2b2c56ae-test1",
+ "new-data-del-flag": "R3oKjC8hz87",
+ "cardinality": "LT8Phj"
+ },
+ {
+ "model-element-uuid": "6a4f5cbe-6251-402e-aa0c-d42284acf4f3-test1",
+ "new-data-del-flag": "XeIPIYLqyIL",
+ "cardinality": "pGK"
+ }
+ ]
+ }
+ },
+ {
+ "element-choice-set-uuid": "4937bd81-08f1-4cb7-b3bd-9c9db142a791-test1",
+ "element-choice-set-name": "VXcx",
+ "cardinality": "hIKH",
+ "model-elements": {
+ "model-element": [
+ {
+ "model-element-uuid": "db4ddcd0-6a57-47af-b72d-f10e806bd779-test1",
+ "new-data-del-flag": "2lsYwLYukGh43",
+ "cardinality": "zhcfiBQ"
+ },
+ {
+ "model-element-uuid": "7f0823ec-87f7-4f0a-b6ed-d19571917f3d-test1",
+ "new-data-del-flag": "8xUASuYyIym",
+ "cardinality": "ktmQThTtgu"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "metadata": {
+ "metadatum": [
+ {
+ "metaname": "a4f78e88-e09f-4ca1-b26a-093141044aea-test1",
+ "metaval": "kfsTQsxZk"
+ },
+ {
+ "metaname": "1d153c8b-ba38-4566-876b-53795a71b8f9-test1",
+ "metaval": "xr0Z"
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
diff --git a/aai-core/src/test/resources/payloads/resource/vip-ipv4-address-list.json b/aai-core/src/test/resources/payloads/resource/vip-ipv4-address-list.json
new file mode 100644
index 00000000..4978d2af
--- /dev/null
+++ b/aai-core/src/test/resources/payloads/resource/vip-ipv4-address-list.json
@@ -0,0 +1,6 @@
+{
+ "vip-ipv4-address": "vip-ipv4-address-list-1",
+ "vip-ipv4-prefix-length": 3333,
+ "vlan-id-inner": 3333,
+ "vlan-id-outer": 3333
+}
diff --git a/aai-core/src/test/resources/payloads/resource/vnf.json b/aai-core/src/test/resources/payloads/resource/vnf.json
new file mode 100644
index 00000000..e3e7a35f
--- /dev/null
+++ b/aai-core/src/test/resources/payloads/resource/vnf.json
@@ -0,0 +1,4 @@
+{
+ "vnf-id":"vnf1",
+ "vnf-type":"someval"
+}
diff --git a/aai-rest/LICENSE.TXT b/aai-rest/LICENSE.TXT
new file mode 100644
index 00000000..34558621
--- /dev/null
+++ b/aai-rest/LICENSE.TXT
@@ -0,0 +1,17 @@
+============LICENSE_START=======================================================
+org.onap.aai
+================================================================================
+Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+================================================================================
+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=========================================================
diff --git a/aai-rest/pom.xml b/aai-rest/pom.xml
new file mode 100644
index 00000000..7e6650ff
--- /dev/null
+++ b/aai-rest/pom.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ ============LICENSE_START=======================================================
+ org.onap.aai
+ ================================================================================
+ Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ Copyright © 2017 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=========================================================
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.aai.aai-common</groupId>
+ <artifactId>aai-common</artifactId>
+ <version>1.4.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>aai-rest</artifactId>
+ <name>aai-rest</name>
+ <version>1.4.1-SNAPSHOT</version>
+
+ <properties>
+ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
+ <eelf.core.version>1.0.0</eelf.core.version>
+ <spring.boot.starter.web.version>1.5.18.RELEASE</spring.boot.starter.web.version>
+ <spring.boot.starter.parent.version>1.5.18.RELEASE</spring.boot.starter.parent.version>
+ <spring.security.version>1.0.8.RELEASE</spring.security.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-parent</artifactId>
+ <version>${spring.boot.starter.parent.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ <version>${eelf.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <version>${spring.boot.starter.web.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-tomcat</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-jetty</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-jersey</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5.1</version>
+ </dependency>
+ <!--
+ Explicitly stating the security spring framework and
+ exclude the bouncy castle since that is somehow overwriting
+ our p12 file decryption that's built into java security
+ This will cause the password is incorrect
+ This needs to be added back if org.bouncy castle dependency
+ sneaks backs in and causing issues with the two way ssl
+ -->
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-rsa</artifactId>
+ <version>${spring.security.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpkix-jdk15on</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-test</artifactId>
+ <version>1.5.18.RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/JettyPasswordDecoder.java b/aai-rest/src/main/java/org/onap/aai/restclient/JettyPasswordDecoder.java
new file mode 100644
index 00000000..552aef96
--- /dev/null
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/JettyPasswordDecoder.java
@@ -0,0 +1,33 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import org.eclipse.jetty.util.security.Password;
+
+public class JettyPasswordDecoder implements PasswordDecoder {
+
+ @Override
+ public String decode(String input) {
+ if (input.startsWith("OBF:")) {
+ return Password.deobfuscate(input);
+ }
+ return Password.deobfuscate("OBF:" + input);
+ }
+}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/NoAuthRestClient.java b/aai-rest/src/main/java/org/onap/aai/restclient/NoAuthRestClient.java
new file mode 100644
index 00000000..7e3524d7
--- /dev/null
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/NoAuthRestClient.java
@@ -0,0 +1,53 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.springframework.boot.web.client.RestTemplateBuilder;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.web.client.RestTemplate;
+
+import javax.annotation.PostConstruct;
+
+public abstract class NoAuthRestClient extends RestClient{
+
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(NoAuthRestClient.class);
+
+ protected RestTemplate restTemplate;
+
+ @PostConstruct
+ public void init () throws Exception {
+ HttpClient client = HttpClients.createDefault();
+ restTemplate = new RestTemplateBuilder()
+ .requestFactory(new HttpComponentsClientHttpRequestFactory(client))
+ .build();
+
+ restTemplate.setErrorHandler(new RestClientResponseErrorHandler(getLogger()));
+ }
+
+ @Override
+ public RestTemplate getRestTemplate() {
+ return restTemplate;
+ }
+
+}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/OneWaySSLRestClient.java b/aai-rest/src/main/java/org/onap/aai/restclient/OneWaySSLRestClient.java
new file mode 100644
index 00000000..e502e5e5
--- /dev/null
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/OneWaySSLRestClient.java
@@ -0,0 +1,76 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.springframework.boot.web.client.RestTemplateBuilder;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.util.ResourceUtils;
+import org.springframework.web.client.RestTemplate;
+
+import javax.annotation.PostConstruct;
+import javax.net.ssl.SSLContext;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.security.KeyStore;
+
+public abstract class OneWaySSLRestClient extends RestClient {
+
+ private RestTemplate restTemplate;
+
+ @PostConstruct
+ public void init() throws Exception {
+
+ char[] trustStorePassword = getTruststorePassword();
+
+ String trustStore = getTruststorePath();
+
+ SSLContext sslContext = SSLContextBuilder
+ .create()
+ .loadTrustMaterial(ResourceUtils.getFile(trustStore), trustStorePassword)
+ .build();
+
+ HttpClient client = HttpClients.custom()
+ .setSSLContext(sslContext)
+ .setSSLHostnameVerifier((s, sslSession) -> true)
+ .build();
+
+ restTemplate = new RestTemplateBuilder()
+ .requestFactory(new HttpComponentsClientHttpRequestFactory(client))
+ .build();
+
+ restTemplate.setErrorHandler(new RestClientResponseErrorHandler(getLogger()));
+
+ }
+
+
+ protected abstract String getTruststorePath();
+
+ protected abstract char[] getTruststorePassword();
+
+ @Override
+ public RestTemplate getRestTemplate() {
+ return restTemplate;
+ }
+
+}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/PasswordDecoder.java b/aai-rest/src/main/java/org/onap/aai/restclient/PasswordDecoder.java
new file mode 100644
index 00000000..51c11181
--- /dev/null
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/PasswordDecoder.java
@@ -0,0 +1,25 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+public interface PasswordDecoder {
+
+ String decode(String input);
+}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/PropertyPasswordConfiguration.java b/aai-rest/src/main/java/org/onap/aai/restclient/PropertyPasswordConfiguration.java
new file mode 100644
index 00000000..97ae7bc6
--- /dev/null
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/PropertyPasswordConfiguration.java
@@ -0,0 +1,78 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import org.springframework.context.ApplicationContextInitializer;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.env.ConfigurableEnvironment;
+import org.springframework.core.env.EnumerablePropertySource;
+import org.springframework.core.env.MapPropertySource;
+import org.springframework.core.env.PropertySource;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class PropertyPasswordConfiguration implements ApplicationContextInitializer<ConfigurableApplicationContext> {
+
+ private static final Pattern decodePasswordPattern = Pattern.compile("password\\((.*?)\\)");
+
+ private PasswordDecoder passwordDecoder = new JettyPasswordDecoder();
+
+ @Override
+ public void initialize(ConfigurableApplicationContext applicationContext) {
+ ConfigurableEnvironment environment = applicationContext.getEnvironment();
+ for (PropertySource<?> propertySource : environment.getPropertySources()) {
+ Map<String, Object> propertyOverrides = new LinkedHashMap<>();
+ decodePasswords(propertySource, propertyOverrides);
+ if (!propertyOverrides.isEmpty()) {
+ PropertySource<?> decodedProperties = new MapPropertySource("decoded " + propertySource.getName(), propertyOverrides);
+ environment.getPropertySources().addBefore(propertySource.getName(), decodedProperties);
+ }
+ }
+ }
+
+ private void decodePasswords(PropertySource<?> source, Map<String, Object> propertyOverrides) {
+ if (source instanceof EnumerablePropertySource) {
+ EnumerablePropertySource<?> enumerablePropertySource = (EnumerablePropertySource<?>) source;
+ for (String key : enumerablePropertySource.getPropertyNames()) {
+ Object rawValue = source.getProperty(key);
+ if (rawValue instanceof String) {
+ String decodedValue = decodePasswordsInString((String) rawValue);
+ propertyOverrides.put(key, decodedValue);
+ }
+ }
+ }
+ }
+
+ private String decodePasswordsInString(String input) {
+ if (input == null) return null;
+ StringBuffer output = new StringBuffer();
+ Matcher matcher = decodePasswordPattern.matcher(input);
+ while (matcher.find()) {
+ String replacement = passwordDecoder.decode(matcher.group(1));
+ matcher.appendReplacement(output, replacement);
+ }
+ matcher.appendTail(output);
+ return output.toString();
+ }
+
+}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java b/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java
new file mode 100644
index 00000000..a17880f3
--- /dev/null
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java
@@ -0,0 +1,99 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * 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.restclient;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.io.Resource;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Map;
+
+public abstract class RestClient {
+
+ private static EELFLogger log = EELFManager.getInstance().getLogger(RestClient.class);
+ @Value("${spring.application.name}")
+ protected String appName;
+
+ public ResponseEntity execute(String uri, HttpMethod method, Map<String, String> headers, String body) throws RestClientException {
+
+ HttpEntity httpEntity;
+ log.debug("Headers: " + headers.toString());
+ if (body == null) {
+ httpEntity = new HttpEntity(getHeaders(headers));
+ } else {
+ httpEntity = new HttpEntity(body, getHeaders(headers));
+ }
+ String url = getBaseUrl() + uri;
+ return getRestTemplate().exchange(url, method, httpEntity, String.class);
+ }
+
+ public ResponseEntity executeResource(String uri, HttpMethod method, Map<String, String> headers, String body) throws RestClientException {
+
+ HttpEntity httpEntity;
+ log.debug("Headers: " + headers.toString());
+ if (body == null) {
+ httpEntity = new HttpEntity(getHeaders(headers));
+ } else {
+ httpEntity = new HttpEntity(body, getHeaders(headers));
+ }
+ String url = getBaseUrl() + uri;
+ return getRestTemplate().exchange(url, method, httpEntity, Resource.class);
+ }
+
+ public ResponseEntity execute(String uri, String method, Map<String, String> headers) throws RestClientException {
+ return execute(uri, HttpMethod.valueOf(method), headers, null);
+ }
+
+ public ResponseEntity getGetRequest(String content, String uri, Map<String, String> headersMap) {
+ return this.execute(
+ uri,
+ HttpMethod.GET,
+ headersMap,
+ content);
+
+ }
+
+ public ResponseEntity getGetResource(String content, String uri, Map<String, String> headersMap) {
+ return this.executeResource(
+ uri,
+ HttpMethod.GET,
+ headersMap,
+ content);
+
+ }
+
+ public abstract RestTemplate getRestTemplate();
+
+ public abstract String getBaseUrl();
+
+ protected abstract MultiValueMap<String, String> getHeaders(Map<String, String> headers);
+
+ protected abstract EELFLogger getLogger();
+
+}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactory.java b/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactory.java
new file mode 100644
index 00000000..3a19f2de
--- /dev/null
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactory.java
@@ -0,0 +1,35 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+/**
+ * Factory to get parser strategy based on rest client type.
+ */
+public interface RestClientFactory {
+
+ /**
+ *
+ * @param clientType
+ * type of client to return
+ * @return
+ */
+ RestClient getRestClient(String clientType);
+
+}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java b/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java
new file mode 100644
index 00000000..08060238
--- /dev/null
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java
@@ -0,0 +1,37 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import org.springframework.beans.factory.FactoryBean;
+import org.springframework.beans.factory.config.ServiceLocatorFactoryBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class RestClientFactoryConfiguration {
+
+ @Bean
+ public FactoryBean restClientFactoryBean() {
+ ServiceLocatorFactoryBean factoryBean = new ServiceLocatorFactoryBean();
+ factoryBean.setServiceLocatorInterface(RestClientFactory.class);
+ return factoryBean;
+ }
+}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/RestClientResponseErrorHandler.java b/aai-rest/src/main/java/org/onap/aai/restclient/RestClientResponseErrorHandler.java
new file mode 100644
index 00000000..1d6486b0
--- /dev/null
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/RestClientResponseErrorHandler.java
@@ -0,0 +1,59 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import com.att.eelf.configuration.EELFLogger;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.client.ClientHttpResponse;
+import org.springframework.web.client.ResponseErrorHandler;
+
+import java.io.IOException;
+
+public class RestClientResponseErrorHandler implements ResponseErrorHandler {
+
+ private EELFLogger logger;
+
+ public RestClientResponseErrorHandler(EELFLogger logger) {
+ this.logger = logger;
+ }
+
+ @Override
+ public boolean hasError(ClientHttpResponse clientHttpResponse) throws IOException {
+ if (!clientHttpResponse.getStatusCode().is2xxSuccessful()) {
+
+ logger.debug("Status code: " + clientHttpResponse.getStatusCode());
+
+ if (clientHttpResponse.getStatusCode() == HttpStatus.FORBIDDEN) {
+ logger.debug("Call returned a error 403 forbidden resposne ");
+ return true;
+ }
+
+ if (clientHttpResponse.getRawStatusCode() % 100 == 5) {
+ logger.debug("Call returned a error " + clientHttpResponse.getStatusText());
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void handleError(ClientHttpResponse clientHttpResponse) throws IOException {
+ }
+}
diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/TwoWaySSLRestClient.java b/aai-rest/src/main/java/org/onap/aai/restclient/TwoWaySSLRestClient.java
new file mode 100644
index 00000000..2fe9500f
--- /dev/null
+++ b/aai-rest/src/main/java/org/onap/aai/restclient/TwoWaySSLRestClient.java
@@ -0,0 +1,91 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.springframework.boot.web.client.RestTemplateBuilder;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.util.ResourceUtils;
+import org.springframework.web.client.RestTemplate;
+
+import javax.annotation.PostConstruct;
+import javax.net.ssl.SSLContext;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.security.KeyStore;
+
+public abstract class TwoWaySSLRestClient extends RestClient {
+
+ private RestTemplate restTemplate;
+
+ @PostConstruct
+ public void init() throws Exception {
+
+ char[] keyStorePassword = getKeystorePassword();
+ char[] trustStorePassword = getTruststorePassword();
+
+ String keyStore = getKeystorePath();
+ String trustStore = getTruststorePath();
+
+ SSLContext sslContext = SSLContextBuilder
+ .create()
+ .loadKeyMaterial(loadPfx(keyStore, keyStorePassword), keyStorePassword)
+ .loadTrustMaterial(ResourceUtils.getFile(trustStore), trustStorePassword)
+ .build();
+
+ HttpClient client = HttpClients.custom()
+ .setSSLContext(sslContext)
+ .setSSLHostnameVerifier((s, sslSession) -> true)
+ .build();
+
+ restTemplate = new RestTemplateBuilder()
+ .requestFactory(new HttpComponentsClientHttpRequestFactory(client))
+ .build();
+
+ restTemplate.setErrorHandler(new RestClientResponseErrorHandler(getLogger()));
+
+ }
+
+ private KeyStore loadPfx(String file, char[] password) throws Exception {
+ KeyStore keyStore = KeyStore.getInstance("PKCS12");
+ File key = ResourceUtils.getFile(file);
+ try (InputStream in = new FileInputStream(key)) {
+ keyStore.load(in, password);
+ }
+ return keyStore;
+ }
+
+ protected abstract String getKeystorePath();
+
+ protected abstract String getTruststorePath();
+
+ protected abstract char[] getTruststorePassword();
+
+ protected abstract char[] getKeystorePassword();
+
+ @Override
+ public RestTemplate getRestTemplate() {
+ return restTemplate;
+ }
+
+}
diff --git a/aai-rest/src/test/java/org/onap/aai/restclient/RestClientTest.java b/aai-rest/src/test/java/org/onap/aai/restclient/RestClientTest.java
new file mode 100644
index 00000000..4c3b0fcf
--- /dev/null
+++ b/aai-rest/src/test/java/org/onap/aai/restclient/RestClientTest.java
@@ -0,0 +1,24 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+public class RestClientTest {
+
+}
diff --git a/aai-schema-ingest/pom.xml b/aai-schema-ingest/pom.xml
index d2f93694..730a686a 100644
--- a/aai-schema-ingest/pom.xml
+++ b/aai-schema-ingest/pom.xml
@@ -25,13 +25,17 @@
<parent>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-common</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>aai-schema-ingest</artifactId>
<name>aai-schema-ingest</name>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<packaging>jar</packaging>
+ <properties>
+ <eelf.core.version>1.0.0</eelf.core.version>
+ <httpclient.version>4.5.5</httpclient.version>
+ </properties>
<build>
<plugins>
<plugin>
@@ -70,6 +74,17 @@
<version>2.4.15</version>
<classifier>indy</classifier>
</dependency>
+ <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.aai.aai-common</groupId>
+ <artifactId>aai-rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-core</artifactId>
@@ -81,19 +96,39 @@
<version>2.2.0</version>
</dependency>
<dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
- <version>4.3.18.RELEASE</version>
+ <version>4.3.21.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>4.3.21.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <version>1.5.18.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
- <version>4.3.18.RELEASE</version>
+ <version>4.3.21.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
- <version>1.5.1.RELEASE</version>
+ <version>1.5.18.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -108,6 +143,29 @@
<version>1.10.19</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ <version>${eelf.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.8.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.8.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.8.5</version>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
<!-- Plugins and repositories -->
<pluginRepositories>
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/config/ConfigConfiguration.java b/aai-schema-ingest/src/main/java/org/onap/aai/config/ConfigConfiguration.java
new file mode 100644
index 00000000..9f28cf8f
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/config/ConfigConfiguration.java
@@ -0,0 +1,46 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * 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.config;
+
+import org.onap.aai.setup.SchemaLocationsBean;
+import org.onap.aai.setup.SchemaVersions;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+
+@Configuration
+@ConditionalOnProperty(prefix = "schema.translator.list", value = "config", matchIfMissing = true)
+@PropertySource(value = "classpath:schema-ingest.properties", ignoreResourceNotFound = true)
+@PropertySource(value = "file:${schema.ingest.file}", ignoreResourceNotFound = true)
+public class ConfigConfiguration {
+
+ @Bean(name = "schemaVersions")
+ public SchemaVersions schemaVersions() {
+ return new SchemaVersions();
+ }
+
+ @Bean(name = "schemaLocationsBean")
+ public SchemaLocationsBean schemaLocationsBean() {
+ return new SchemaLocationsBean();
+ }
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/config/EdgesConfiguration.java b/aai-schema-ingest/src/main/java/org/onap/aai/config/EdgesConfiguration.java
new file mode 100644
index 00000000..e492d213
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/config/EdgesConfiguration.java
@@ -0,0 +1,77 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * 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.config;
+
+import org.onap.aai.edges.EdgeIngestor;
+import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.setup.Translator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.PropertySource;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+@Import({SchemaServiceConfiguration.class, ConfigConfiguration.class, TranslatorConfiguration.class})
+@PropertySource(value = "classpath:schema-ingest.properties", ignoreResourceNotFound = true)
+@PropertySource(value = "file:${schema.ingest.file}", ignoreResourceNotFound = true)
+@Configuration
+public class EdgesConfiguration {
+
+ private static final String CONFIG_TRANSLATOR = "config";
+ private static final String SCHEMA_SERVICE_TRANSLATOR = "schema-service";
+
+ @Autowired(required = false)
+ SchemaServiceConfiguration schemaConfiguration;
+
+ @Autowired(required = false)
+ ConfigConfiguration configConfiguration;
+
+ @Autowired(required = false)
+ TranslatorConfiguration translatorConfiguration;
+
+ @Value("${schema.translator.list}")
+ private String[] translatorArray;
+
+ public Set<Translator> translators() {
+ Set<Translator> translators = new HashSet<>();
+
+ List<String> translatorList = Arrays.asList(translatorArray);
+ if (translatorList.contains(SCHEMA_SERVICE_TRANSLATOR)) {
+ translators.add(schemaConfiguration.schemaServiceTranslator());
+ } else {
+ translators.add(translatorConfiguration.configTranslator);
+ }
+ return translators;
+ }
+
+ @Bean(name = "edgeIngestor")
+ public EdgeIngestor edgeIngestor() {
+ return new EdgeIngestor(translators());
+ }
+
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/config/NodesConfiguration.java b/aai-schema-ingest/src/main/java/org/onap/aai/config/NodesConfiguration.java
new file mode 100644
index 00000000..94bc6da5
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/config/NodesConfiguration.java
@@ -0,0 +1,82 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * 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.config;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.onap.aai.nodes.NodeIngestor;
+import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.setup.Translator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.PropertySource;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+@Import({SchemaServiceConfiguration.class, ConfigConfiguration.class, TranslatorConfiguration.class})
+@PropertySource(value = "classpath:schema-ingest.properties", ignoreResourceNotFound = true)
+@PropertySource(value = "file:${schema.ingest.file}", ignoreResourceNotFound = true)
+@Configuration
+public class NodesConfiguration {
+
+ private static final String CONFIG_TRANSLATOR = "config";
+ private static final String SCHEMA_SERVICE_TRANSLATOR = "schema-service";
+ private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(NodesConfiguration.class);
+
+ @Autowired(required = false)
+ SchemaServiceConfiguration schemaConfiguration;
+
+ @Autowired(required = false)
+ ConfigConfiguration configConfiguration;
+
+ @Autowired(required = false)
+ TranslatorConfiguration translatorConfiguration;
+
+ @Value("${schema.translator.list}")
+ private String[] translatorArray;
+
+ public Set<Translator> translators() {
+ Set<Translator> translators = new HashSet<>();
+
+ List<String> translatorList = Arrays.asList(translatorArray);
+ if (translatorList.contains(SCHEMA_SERVICE_TRANSLATOR)) {
+ LOGGER.info("Translator is SchemaServiceTranslator");
+ translators.add(schemaConfiguration.schemaServiceTranslator());
+ } else {
+ LOGGER.info("Translator is SchemaServiceTranslator");
+ translators.add(translatorConfiguration.configTranslator);
+ }
+ return translators;
+ }
+
+ @Bean(name = "nodeIngestor")
+ public NodeIngestor nodeIngestor() {
+ return new NodeIngestor(translators());
+ }
+
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/config/RestConfiguration.java b/aai-schema-ingest/src/main/java/org/onap/aai/config/RestConfiguration.java
new file mode 100644
index 00000000..0a3dbf5e
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/config/RestConfiguration.java
@@ -0,0 +1,82 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * 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.config;
+
+import org.onap.aai.restclient.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+
+@Configuration
+@ConditionalOnExpression("'${schema.translator.list}'.contains('schema-service')")
+@PropertySource(value = "classpath:schema-ingest.properties", ignoreResourceNotFound = true)
+@PropertySource(value = "file:${schema.ingest.file}", ignoreResourceNotFound = true)
+public class RestConfiguration {
+
+ private static final String TWO_WAY_SSL = "two-way-ssl";
+ private static final String ONE_WAY_SSL = "one-way-ssl";
+ private static final String NO_AUTH = "no-auth";
+
+ @Value("${schema.service.client:two-way-ssl}")
+ private String schemaServiceClient;
+
+ @Autowired
+ private RestClient restClient;
+
+ @Bean
+ public RestClientFactory restClientFactory() {
+
+ return new RestClientFactory() {
+ @Override
+ public RestClient getRestClient(String clientType) {
+ return restClient;
+
+ }
+ };
+ }
+
+ /*
+ In the below cases bean name and method names are different because all of them qualify as restClient
+ */
+ @Bean(name="restClient")
+ @ConditionalOnProperty(name = "schema.service.client", havingValue = "two-way-ssl", matchIfMissing = true)
+ public RestClient getSchemaServiceTwoWayClient() {
+ return new SchemaServiceRestClient();
+ }
+
+ @Bean(name="restClient")
+ @ConditionalOnProperty(name = "schema.service.client", havingValue = "no-auth")
+ public RestClient getSchemaServiceNoAuthClient() {
+ return new SchemaServiceNoAuthClient();
+ }
+
+ @Bean(name="restClient")
+ @ConditionalOnProperty(name = "schema.service.client", havingValue = "one-way-ssl")
+ public RestClient getSchemaServiceOneWayClient() {
+ return new SchemaServiceOneWayClient();
+ }
+
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/config/SchemaServiceConfiguration.java b/aai-schema-ingest/src/main/java/org/onap/aai/config/SchemaServiceConfiguration.java
new file mode 100644
index 00000000..81ef02a8
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/config/SchemaServiceConfiguration.java
@@ -0,0 +1,54 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * 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.config;
+
+import org.onap.aai.setup.SchemaServiceTranslator;
+import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.setup.SchemaVersionsBean;
+import org.onap.aai.setup.Translator;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+
+@Configuration
+@ConditionalOnExpression("'${schema.translator.list}'.contains('schema-service')")
+@PropertySource(value = "classpath:schema-ingest.properties", ignoreResourceNotFound = true)
+@PropertySource(value = "file:${schema.ingest.file}", ignoreResourceNotFound = true)
+public class SchemaServiceConfiguration {
+
+ @Bean(name = "schemaVersionsBean")
+ public SchemaVersionsBean schemaVersionsBean() {
+ return new SchemaVersionsBean();
+ }
+
+ @Bean(name = "schemaVersions")
+ public SchemaVersions schemaVersions() {
+ return schemaVersionsBean().getSchemaVersions();
+ }
+
+ @Bean(name = "schemaServiceTranslator")
+ public Translator schemaServiceTranslator() {
+ return new SchemaServiceTranslator(schemaVersions());
+ }
+
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/config/TranslatorConfiguration.java b/aai-schema-ingest/src/main/java/org/onap/aai/config/TranslatorConfiguration.java
new file mode 100644
index 00000000..941e03d9
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/config/TranslatorConfiguration.java
@@ -0,0 +1,36 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * 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.config;
+
+import org.onap.aai.setup.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@ConditionalOnProperty(prefix = "schema.translator.list", value = "config", matchIfMissing = true)
+public class TranslatorConfiguration {
+ //TODO check if you can put dependsOn to reduce number of config files
+ @Autowired(required = false)
+ ConfigTranslator configTranslator;
+
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeIngestor.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeIngestor.java
index dfcd0db3..71225340 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeIngestor.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeIngestor.java
@@ -1,4 +1,4 @@
-/**
+/**
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
@@ -20,30 +20,37 @@
package org.onap.aai.edges;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.Multimap;
+import com.jayway.jsonpath.Criteria;
+import com.jayway.jsonpath.DocumentContext;
+import com.jayway.jsonpath.Filter;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.onap.aai.edges.enums.DirectionNotation;
import org.onap.aai.edges.enums.EdgeField;
import org.onap.aai.edges.enums.EdgeType;
import org.onap.aai.edges.exceptions.AmbiguousRuleChoiceException;
import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException;
-import org.onap.aai.setup.ConfigTranslator;
import org.onap.aai.setup.SchemaVersion;
import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.setup.Translator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Multimap;
-import com.jayway.jsonpath.Criteria;
-import com.jayway.jsonpath.DocumentContext;
-import com.jayway.jsonpath.Filter;
-import static com.jayway.jsonpath.Filter.filter;
+import javax.annotation.PostConstruct;
+import java.io.IOException;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
+
import static com.jayway.jsonpath.Criteria.where;
+import static com.jayway.jsonpath.Filter.filter;
/**
* EdgeIngestor - ingests A&AI edge rule schema files per given config, serves that edge rule
@@ -51,413 +58,547 @@ import static com.jayway.jsonpath.Criteria.where;
*/
@Component
public class EdgeIngestor {
- private Map<SchemaVersion, List<DocumentContext>> versionJsonFilesMap;
- private static final String READ_START = "$.rules.[?]";
- private static final String READ_ALL_START = "$.rules.*";
+ private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(EdgeIngestor.class);
+ private Map<SchemaVersion, List<DocumentContext>> versionJsonFilesMap;
+ private static final String READ_START = "$.rules.[?]";
+ private static final String READ_ALL_START = "$.rules.*";
+ private SchemaVersions schemaVersions;
- private SchemaVersions schemaVersions;
- //-----ingest-----//
- /**
- * Instantiates the EdgeIngestor bean.
- *
- * @param translator - ConfigTranslator autowired in by Spring framework which
- * contains the configuration information needed to ingest the desired files.
- */
- @Autowired
- public EdgeIngestor(ConfigTranslator translator, SchemaVersions schemaVersions) {
- Map<SchemaVersion, List<String>> filesToIngest = translator.getEdgeFiles();
- JsonIngestor ji = new JsonIngestor();
- this.schemaVersions = schemaVersions;
- versionJsonFilesMap = ji.ingest(filesToIngest);
- }
-
- //-----methods for getting rule info-----//
-
- /**
- * Gets list of all edge rules defined in the latest version's schema
- *
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules associated with those types
- * where the key takes the form of
- * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
- * no rules are found.
- * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
- * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
- * This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
- * @throws EdgeRuleNotFoundException if none found
- */
- public Multimap<String, EdgeRule> getAllCurrentRules() throws EdgeRuleNotFoundException {
- return getAllRules(schemaVersions.getDefaultVersion());
- }
-
- /**
- * Gets list of all edge rules defined in the given version's schema
- *
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules associated with those types
- * where the key takes the form of
- * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
- * no rules are found.
- * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
- * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
- * This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
- * @throws EdgeRuleNotFoundException if none found
- */
- public Multimap<String, EdgeRule> getAllRules(SchemaVersion v) throws EdgeRuleNotFoundException {
- Multimap<String, EdgeRule> found = extractRules(null, v);
- if (found.isEmpty()) {
- throw new EdgeRuleNotFoundException("No rules found for version " + v.toString() + ".");
- } else {
- return found;
- }
- }
-
- /**
- * Finds the rules (if any) matching the given query criteria. If none, the returned Multimap
- * will be empty.
- *
- * @param q - EdgeRuleQuery with filter criteria set
- *
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
- * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
- * no rules are found.
- * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
- * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
- * This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
- * @throws EdgeRuleNotFoundException if none found
- */
- public Multimap<String, EdgeRule> getRules(EdgeRuleQuery q) throws EdgeRuleNotFoundException {
- Multimap<String, EdgeRule> found = null;
- if(q.getVersion().isPresent()){
- found = extractRules(q.getFilter(), q.getVersion().get());
- } else {
- found = extractRules(q.getFilter(), schemaVersions.getDefaultVersion());
- }
- if (found.isEmpty()) {
- throw new EdgeRuleNotFoundException("No rules found for " + q.toString());
- } else {
- for (EdgeRule rule : found.values()) {
- if (!q.getFromType().equals(rule.getFrom())) {
- /* To maintain backwards compatibility with old EdgeRules API,
- * where the direction of the returned EdgeRule would be
- * flipped (if necessary) to match the directionality of
- * the input params.
- * ie, If the rule is from=A,to=B,direction=OUT,
- * if the user asked (A,B) the direction would be OUT,
- * if they asked (B,A), it would be IN to match.
- */
- rule.flipDirection();
- }
- }
- return found;
- }
- }
-
- /**
- * Gets the rule satisfying the given filter criteria. If there are more than one
- * that match, return the default rule. If there is no clear default to return, or
- * no rules match at all, error.
- *
- * @param q - EdgeRuleQuery with filter criteria set
- * @return EdgeRule satisfying given criteria
- * @throws EdgeRuleNotFoundException if none found that match
- * @throws AmbiguousRuleChoiceException if multiple match but no way to choice one from them
- * Specifically, if multiple node type pairs come back (ie bar|foo and asdf|foo,
- * no way to know which is appropriate over the others),
- * or if there is a mix of Tree and Cousin edges because again there is no way to
- * know which is "defaulter" than the other.
- * The default property only clarifies among multiple cousin edges of the same node pair,
- * ex: which l-interface|logical-link rule to default to.
- */
- public EdgeRule getRule(EdgeRuleQuery q) throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
- Multimap<String, EdgeRule> found = null;
- if(q.getVersion().isPresent()){
- found = extractRules(q.getFilter(), q.getVersion().get());
- } else {
- found = extractRules(q.getFilter(), schemaVersions.getDefaultVersion());
- }
+ Map<SchemaVersion, List<String>> filesToIngest;
+
+ private Set<String> multipleLabelKeys;
+
+ private LoadingCache<SchemaFilter,Multimap<String,EdgeRule>> cacheFilterStore;
+
+ private LoadingCache<String, String[]> cousinLabelStore;
+
+ private Set<Translator> translators;
+
+ @Autowired
+ public EdgeIngestor(Set<Translator> translatorSet) {
+ LOGGER.debug("Local Schema files will be fetched");
+ this.translators = translatorSet;
+ }
+
+ @PostConstruct
+ public void initialize() {
+
+ for (Translator translator : translators) {
+ try {
+ LOGGER.debug("Processing the translator");
+ translateAll(translator);
+
+ } catch (Exception e) {
+ LOGGER.debug("Error while Processing the translator" + e.getMessage());
+ continue;
+ }
+ }
+ if (versionJsonFilesMap.isEmpty() || schemaVersions==null ) {
+ throw new ExceptionInInitializerError();
+ }
+ }
+
+ public void translateAll(Translator translator) {
+ /*
+ Use SchemaVersions from the Translator
+ */
+ this.schemaVersions = translator.getSchemaVersions();
+ List<SchemaVersion> schemaVersionList = this.schemaVersions.getVersions();
+ List<String> jsonPayloads = null;
+ JsonIngestor ji = new JsonIngestor();
+ Map<SchemaVersion, List<String>> edgeRulesToIngest = new HashMap<>(); // Obtain a map of schema versions to a list of strings. One List per key
+
+ // Add to the map the JSON file per version.
+ for (SchemaVersion version : schemaVersionList) {
+ LOGGER.debug("Version being processed" + version);
+ // If the flag is set to not use the local files, obtain the Json from the service.
+ try {
+ jsonPayloads = translator.getJsonPayload(version); // need to change this - need to receive the json files.
+ } catch (IOException e) {
+ LOGGER.info("Exception in retrieving the JSON Payload"+e.getMessage());
+ }
+ if (jsonPayloads == null || jsonPayloads.isEmpty()) {
+ continue;
+ }
+ LOGGER.debug("Retrieved json from SchemaService");
+ edgeRulesToIngest.put(version, jsonPayloads);
+ }
+ versionJsonFilesMap = ji.ingestContent(edgeRulesToIngest);
+
+ this.cacheFilterStore = CacheBuilder.newBuilder()
+ .maximumSize(2000)
+ .build(
+ new CacheLoader<SchemaFilter, Multimap<String, EdgeRule>>() {
+ @Override
+ public Multimap<String, EdgeRule> load(SchemaFilter key) {
+ return extractRules(key);
+ }
+ }
+ );
+
+ this.cousinLabelStore = CacheBuilder.newBuilder()
+ .maximumSize(50)
+ .build(
+ new CacheLoader<String, String[]>() {
+ @Override
+ public String[] load(String key) throws Exception {
+ return retrieveCousinLabels(key);
+ }
+ }
+ );
+ }
+
+// //-----methods for getting rule info-----//
+//
+ /**
+ * Gets list of all edge rules defined in the latest version's schema
+ *
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules associated with those types
+ * where the key takes the form of
+ * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
+ * no rules are found.
+ * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
+ * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
+ *
+ * This is alphabetical order to normalize the keys, as sometimes there will be multiple
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ * @throws EdgeRuleNotFoundException if none found
+ */
+ public Multimap<String, EdgeRule> getAllCurrentRules() throws EdgeRuleNotFoundException {
+ return getAllRules(schemaVersions.getDefaultVersion());
+ }
+
+ /**
+ * Retrieves all the nodes that contain multiple edge labels
+ *
+ * A lazy instantiation to retrieve all this info on first call
+ *
+ * @return a set containing a list of strings where each string is
+ * concatenated by a pipe (|) character such as aNodeType|bNodeType
+ */
+ public Set<String> getMultipleLabelKeys(){
+
+ if(multipleLabelKeys == null){
+ multipleLabelKeys = new HashSet<>();
+ try {
+ final Multimap<String, EdgeRule> edges = this.getAllCurrentRules();
+ if(edges == null || edges.isEmpty()){
+ LOGGER.warn("Unable to find any edge rules for the latest version");
+ return multipleLabelKeys;
+ }
+ edges.keySet().forEach(key -> {
+ Collection<EdgeRule> rules = edges.get(key);
+ if(rules.size() > 1){
+ multipleLabelKeys.add(key);
+ }
+ });
+ } catch (EdgeRuleNotFoundException e) {
+ LOGGER.info("For the latest schema version, unable to find any edges with multiple keys");
+ }
+ }
+
+ return multipleLabelKeys;
+ }
+ /**
+ * Gets list of all edge rules defined in the given version's schema
+ *
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules associated with those types
+ * where the key takes the form of
+ * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
+ * no rules are found.
+ * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
+ * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
+ *
+ * This is alphabetical order to normalize the keys, as sometimes there will be multiple
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ * @throws EdgeRuleNotFoundException if none found
+ */
+ public Multimap<String, EdgeRule> getAllRules(SchemaVersion v) throws EdgeRuleNotFoundException {
+ Multimap<String, EdgeRule> found = extractRules(null, v);
+ if (found.isEmpty()) {
+ throw new EdgeRuleNotFoundException("No rules found for version " + v.toString() + ".");
+ } else {
+ return found;
+ }
+ }
+
+ /**
+ * Finds the rules (if any) matching the given query criteria. If none, the returned Multimap
+ * will be empty.
+ *
+ * @param q - EdgeRuleQuery with filter criteria set
+ *
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
+ * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
+ * no rules are found.
+ * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
+ * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
+ *
+ * This is alphabetical order to normalize the keys, as sometimes there will be multiple
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ * @throws EdgeRuleNotFoundException if none found
+ */
+
+ public Multimap<String, EdgeRule> getRules(EdgeRuleQuery q) throws EdgeRuleNotFoundException {
+ Multimap<String, EdgeRule> found = null;
+ if(q.getVersion().isPresent()){
+ found = extractRules(q.getFilter(), q.getVersion().get());
+ } else {
+ found = extractRules(q.getFilter(), schemaVersions.getDefaultVersion());
+ }
+ if (found.isEmpty()) {
+ throw new EdgeRuleNotFoundException("No rules found for " + q.toString());
+ } else {
+ Multimap<String, EdgeRule> copy = ArrayListMultimap.create();
+ found.entries().stream().forEach((entry) -> {
+ EdgeRule rule = new EdgeRule(entry.getValue());
+ if (!q.getFromType().equals(rule.getFrom())) {
+ /* To maintain backwards compatibility with old EdgeRules API,
+ * where the direction of the returned EdgeRule would be
+ * flipped (if necessary) to match the directionality of
+ * the input params.
+ * ie, If the rule is from=A,to=B,direction=OUT,
+ * if the user asked (A,B) the direction would be OUT,
+ * if they asked (B,A), it would be IN to match.
+ */
+ rule.flipDirection();
+ }
+ copy.put(entry.getKey(), rule);
+ });
+
+ return copy;
+ }
+ }
+
+
+
+ /**
+ * Gets the rule satisfying the given filter criteria. If there are more than one
+ * that match, return the default rule. If there is no clear default to return, or
+ * no rules match at all, error.
+ *
+ * @param q - EdgeRuleQuery with filter criteria set
+ * @return EdgeRule satisfying given criteria
+ * @throws EdgeRuleNotFoundException if none found that match
+ * @throws AmbiguousRuleChoiceException if multiple match but no way to choice one from them
+ * Specifically, if multiple node type pairs come back (ie bar|foo and asdf|foo,
+ * no way to know which is appropriate over the others),
+ * or if there is a mix of Tree and Cousin edges because again there is no way to
+ * know which is "defaulter" than the other.
+ * The default property only clarifies among multiple cousin edges of the same node pair,
+ * ex: which l-interface|logical-link rule to default to.
+ */
+ public EdgeRule getRule(EdgeRuleQuery q) throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+ Multimap<String, EdgeRule> found = null;
+ if(q.getVersion().isPresent()){
+ found = extractRules(q.getFilter(), q.getVersion().get());
+ } else {
+ found = extractRules(q.getFilter(), schemaVersions.getDefaultVersion());
+ }
+
+ if (found.isEmpty()) {
+ throw new EdgeRuleNotFoundException("No rule found for " + q.toString() + ".");
+ }
+
+ EdgeRule rule = null;
+ if (found.keys().size() == 1) { //only one found, cool we're done
+ for (Entry<String, EdgeRule> e : found.entries()) {
+ rule = e.getValue();
+ }
+ } else {
+ rule = getDefaultRule(found);
+ }
+
+ if (rule == null) { //should never get here though
+ throw new EdgeRuleNotFoundException("No rule found for " + q.toString() + ".");
+ } else {
+ rule = new EdgeRule(rule);
+ if (!q.getFromType().equals(rule.getFrom())) {
+ /* To maintain backwards compatibility with old EdgeRules API,
+ * where the direction of the returned EdgeRule would be
+ * flipped (if necessary) to match the directionality of
+ * the input params.
+ * ie, If the rule is from=A,to=B,direction=OUT,
+ * if the user asked (A,B) the direction would be OUT,
+ * if they asked (B,A), it would be IN to match.
+ */
+ rule.flipDirection();
+ }
+ return rule;
+ }
+ }
+
+ private EdgeRule getDefaultRule(Multimap<String, EdgeRule> found) throws AmbiguousRuleChoiceException {
+ if (found.keySet().size() > 1) { //ie multiple node pairs (a|c and b|c not just all a|c) case
+ StringBuilder sb = new StringBuilder();
+ for (String k : found.keySet()) {
+ sb.append(k).append(" ");
+ }
+ throw new AmbiguousRuleChoiceException("No way to select single rule from these pairs: " + sb.toString() + ".");
+ }
+
+ int defaultCount = 0;
+ EdgeRule defRule = null;
+ for (Entry<String, EdgeRule> e : found.entries()) {
+ EdgeRule rule = e.getValue();
+ if (rule.isDefault()) {
+ defaultCount++;
+ defRule = rule;
+ }
+ }
+ if (defaultCount > 1) {
+ throw new AmbiguousRuleChoiceException("Multiple defaults found.");
+ } else if (defaultCount == 0) {
+ throw new AmbiguousRuleChoiceException("No default found.");
+ }
+
+ return defRule;
+ }
+ /**
+ * Checks if there exists any rule that satisfies the given filter criteria.
+ *
+ * @param q - EdgeRuleQuery with filter criteria set
+ * @return boolean
+ */
+ public boolean hasRule(EdgeRuleQuery q) {
+ if(q.getVersion().isPresent()){
+ return !extractRules(q.getFilter(), q.getVersion().get()).isEmpty();
+ } else {
+ return !extractRules(q.getFilter(), schemaVersions.getDefaultVersion()).isEmpty();
+ }
+ }
+
+ /**
+ * Gets all cousin rules for the given node type in the latest schema version.
+ *
+ * @param nodeType
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
+ * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
+ * no rules are found.
+ * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
+ * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
+ *
+ * This is alphabetical order to normalize the keys, as sometimes there will be multiple
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ */
+ public Multimap<String, EdgeRule> getCousinRules(String nodeType) {
+ return getCousinRules(nodeType, schemaVersions.getDefaultVersion()); //default to latest
+ }
+
+ public String[] retrieveCousinLabels(String nodeType){
+
+ Multimap<String, EdgeRule> cousinRules = getCousinRules(nodeType);
+ String[] cousinLabels = new String[cousinRules.size()];
+
+ return cousinRules.entries()
+ .stream()
+ .map(entry -> entry.getValue().getLabel())
+ .collect(Collectors.toList())
+ .toArray(cousinLabels);
+ }
+
+ public String[] retrieveCachedCousinLabels(String nodeType) throws ExecutionException {
+ return cousinLabelStore.get(nodeType);
+ }
+
+ /**
+ * Gets all cousin rules for the given node type in the given schema version.
+ *
+ * @param nodeType
+ * @param v - the version of the edge rules to query
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
+ * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
+ * no rules are found.
+ * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
+ * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
+ *
+ * This is alphabetical order to normalize the keys, as sometimes there will be multiple
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ */
+ public Multimap<String, EdgeRule> getCousinRules(String nodeType, SchemaVersion v) {
+ return extractRules(new EdgeRuleQuery.Builder(nodeType).edgeType(EdgeType.COUSIN).build().getFilter(), v);
+ }
+
+ /**
+ * Returns if the given node type has any cousin relationships in the current version.
+ * @param nodeType
+ * @return boolean
+ */
+ public boolean hasCousinRule(String nodeType) {
+ return hasCousinRule(nodeType, schemaVersions.getDefaultVersion());
+ }
+
+ /**
+ * Returns if the given node type has any cousin relationships in the given version.
+ * @param nodeType
+ * @return boolean
+ */
+ public boolean hasCousinRule(String nodeType, SchemaVersion v) {
+ return !getCousinRules(nodeType, v).isEmpty();
+ }
+
+ /**
+ * Gets all rules where "{given nodeType} contains {otherType}" in the latest schema version.
+ *
+ * @param nodeType - node type that is the container in the returned relationships
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
+ * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
+ * no rules are found.
+ * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
+ * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
+ *
+ * This is alphabetical order to normalize the keys, as sometimes there will be multiple
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ */
+ public Multimap<String, EdgeRule> getChildRules(String nodeType) {
+ return getChildRules(nodeType, schemaVersions.getDefaultVersion());
+ }
+
+ /**
+ * Gets all rules where "{given nodeType} contains {otherType}" in the given schema version.
+ *
+ * @param nodeType - node type that is the container in the returned relationships
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
+ * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
+ * no rules are found.
+ * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
+ * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
+ *
+ * This is alphabetical order to normalize the keys, as sometimes there will be multiple
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ */
+ public Multimap<String, EdgeRule> getChildRules(String nodeType, SchemaVersion v) {
+ Filter from = assembleFilterSegments(where(EdgeField.FROM.toString()).is(nodeType), getSameDirectionContainmentCriteria());
+ Filter to = assembleFilterSegments(where(EdgeField.TO.toString()).is(nodeType), getOppositeDirectionContainmentCriteria());
+ Filter total = from.or(to);
+
+ return extractRules(total, v);
+ }
+
+ /**
+ * Returns if the given node type has any child relationships (ie it contains another node type) in the current version.
+ * @param nodeType
+ * @return boolean
+ */
+ public boolean hasChildRule(String nodeType) {
+ return hasChildRule(nodeType, schemaVersions.getDefaultVersion());
+ }
+
+ /**
+ * Returns if the given node type has any child relationships (ie it contains another node type) in the given version.
+ * @param nodeType
+ * @return boolean
+ */
+ public boolean hasChildRule(String nodeType, SchemaVersion v) {
+ return !getChildRules(nodeType, v).isEmpty();
+ }
+
+ /**
+ * Gets all rules where "{given nodeType} is contained by {otherType}" in the latest schema version.
+ *
+ * @param nodeType - node type that is the containee in the returned relationships
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
+ * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
+ * no rules are found.
+ * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
+ * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
+ *
+ * This is alphabetical order to normalize the keys, as sometimes there will be multiple
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ */
+ public Multimap<String, EdgeRule> getParentRules(String nodeType) {
+ return getParentRules(nodeType, schemaVersions.getDefaultVersion());
+ }
+
+ /**
+ * Gets all rules where "{given nodeType} is contained by {otherType}" in the given schema version.
+ *
+ * @param nodeType - node type that is the containee in the returned relationships
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
+ * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
+ * no rules are found.
+ * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
+ * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
+ *
+ * This is alphabetical order to normalize the keys, as sometimes there will be multiple
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ */
+ public Multimap<String, EdgeRule> getParentRules(String nodeType, SchemaVersion v) {
+ Filter from = assembleFilterSegments(where(EdgeField.FROM.toString()).is(nodeType), getOppositeDirectionContainmentCriteria());
+ Filter to = assembleFilterSegments(where(EdgeField.TO.toString()).is(nodeType), getSameDirectionContainmentCriteria());
+ Filter total = from.or(to);
+
+ return extractRules(total, v);
+ }
+
+ /**
+ * Returns if the given node type has any parent relationships (ie it is contained by another node type) in the current version.
+ * @param nodeType
+ * @return boolean
+ */
+ public boolean hasParentRule(String nodeType) {
+ return hasParentRule(nodeType, schemaVersions.getDefaultVersion());
+ }
+
+ /**
+ * Returns if the given node type has any parent relationships (ie it is contained by another node type) in the given version.
+ * @param nodeType
+ * @return boolean
+ */
+ public boolean hasParentRule(String nodeType, SchemaVersion v) {
+ return !getParentRules(nodeType, v).isEmpty();
+ }
- if (found.isEmpty()) {
- throw new EdgeRuleNotFoundException("No rule found for " + q.toString() + ".");
- }
-
- EdgeRule rule = null;
- if (found.keys().size() == 1) { //only one found, cool we're done
- for (Entry<String, EdgeRule> e : found.entries()) {
- rule = e.getValue();
- }
- } else {
- rule = getDefaultRule(found);
- }
-
- if (rule == null) { //should never get here though
- throw new EdgeRuleNotFoundException("No rule found for " + q.toString() + ".");
- } else {
- if (!q.getFromType().equals(rule.getFrom())) {
- /* To maintain backwards compatibility with old EdgeRules API,
- * where the direction of the returned EdgeRule would be
- * flipped (if necessary) to match the directionality of
- * the input params.
- * ie, If the rule is from=A,to=B,direction=OUT,
- * if the user asked (A,B) the direction would be OUT,
- * if they asked (B,A), it would be IN to match.
- */
- rule.flipDirection();
- }
- return rule;
- }
- }
-
- private EdgeRule getDefaultRule(Multimap<String, EdgeRule> found) throws AmbiguousRuleChoiceException {
- if (found.keySet().size() > 1) { //ie multiple node pairs (a|c and b|c not just all a|c) case
- StringBuilder sb = new StringBuilder();
- for (String k : found.keySet()) {
- sb.append(k).append(" ");
- }
- throw new AmbiguousRuleChoiceException("No way to select single rule from these pairs: " + sb.toString() + ".");
- }
-
- int defaultCount = 0;
- EdgeRule defRule = null;
- for (Entry<String, EdgeRule> e : found.entries()) {
- EdgeRule rule = e.getValue();
- if (rule.isDefault()) {
- defaultCount++;
- defRule = rule;
- }
- }
- if (defaultCount > 1) {
- throw new AmbiguousRuleChoiceException("Multiple defaults found.");
- } else if (defaultCount == 0) {
- throw new AmbiguousRuleChoiceException("No default found.");
- }
-
- return defRule;
- }
-
- /**
- * Checks if there exists any rule that satisfies the given filter criteria.
- *
- * @param q - EdgeRuleQuery with filter criteria set
- * @return boolean
- */
- public boolean hasRule(EdgeRuleQuery q) {
- if(q.getVersion().isPresent()){
- return !extractRules(q.getFilter(), q.getVersion().get()).isEmpty();
- } else {
- return !extractRules(q.getFilter(), schemaVersions.getDefaultVersion()).isEmpty();
- }
- }
-
- /**
- * Gets all cousin rules for the given node type in the latest schema version.
- *
- * @param nodeType
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
- * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
- * no rules are found.
- * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
- * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
- * This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
- */
- public Multimap<String, EdgeRule> getCousinRules(String nodeType) {
- return getCousinRules(nodeType, schemaVersions.getDefaultVersion()); //default to latest
- }
-
- /**
- * Gets all cousin rules for the given node type in the given schema version.
- *
- * @param nodeType
- * @param v - the version of the edge rules to query
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
- * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
- * no rules are found.
- * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
- * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
- * This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
- */
- public Multimap<String, EdgeRule> getCousinRules(String nodeType, SchemaVersion v) {
- return extractRules(new EdgeRuleQuery.Builder(nodeType).edgeType(EdgeType.COUSIN).build().getFilter(), v);
- }
-
- /**
- * Returns if the given node type has any cousin relationships in the current version.
- * @param nodeType
- * @return boolean
- */
- public boolean hasCousinRule(String nodeType) {
- return hasCousinRule(nodeType, schemaVersions.getDefaultVersion());
- }
-
- /**
- * Returns if the given node type has any cousin relationships in the given version.
- * @param nodeType
- * @return boolean
- */
- public boolean hasCousinRule(String nodeType, SchemaVersion v) {
- return !getCousinRules(nodeType, v).isEmpty();
- }
-
- /**
- * Gets all rules where "{given nodeType} contains {otherType}" in the latest schema version.
- *
- * @param nodeType - node type that is the container in the returned relationships
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
- * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
- * no rules are found.
- * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
- * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
- * This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
- */
- public Multimap<String, EdgeRule> getChildRules(String nodeType) {
- return getChildRules(nodeType, schemaVersions.getDefaultVersion());
- }
-
- /**
- * Gets all rules where "{given nodeType} contains {otherType}" in the given schema version.
- *
- * @param nodeType - node type that is the container in the returned relationships
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
- * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
- * no rules are found.
- * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
- * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
- * This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
- */
- public Multimap<String, EdgeRule> getChildRules(String nodeType, SchemaVersion v) {
- Filter from = assembleFilterSegments(where(EdgeField.FROM.toString()).is(nodeType), getSameDirectionContainmentCriteria());
- Filter to = assembleFilterSegments(where(EdgeField.TO.toString()).is(nodeType), getOppositeDirectionContainmentCriteria());
- Filter total = from.or(to);
-
- return extractRules(total, v);
- }
-
- /**
- * Returns if the given node type has any child relationships (ie it contains another node type) in the current version.
- * @param nodeType
- * @return boolean
- */
- public boolean hasChildRule(String nodeType) {
- return hasChildRule(nodeType, schemaVersions.getDefaultVersion());
- }
-
- /**
- * Returns if the given node type has any child relationships (ie it contains another node type) in the given version.
- * @param nodeType
- * @return boolean
- */
- public boolean hasChildRule(String nodeType, SchemaVersion v) {
- return !getChildRules(nodeType, v).isEmpty();
- }
-
- /**
- * Gets all rules where "{given nodeType} is contained by {otherType}" in the latest schema version.
- *
- * @param nodeType - node type that is the containee in the returned relationships
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
- * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
- * no rules are found.
- * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
- * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
- * This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
- */
- public Multimap<String, EdgeRule> getParentRules(String nodeType) {
- return getParentRules(nodeType, schemaVersions.getDefaultVersion());
- }
-
- /**
- * Gets all rules where "{given nodeType} is contained by {otherType}" in the given schema version.
- *
- * @param nodeType - node type that is the containee in the returned relationships
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
- * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
- * no rules are found.
- * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
- * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
- * This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
- */
- public Multimap<String, EdgeRule> getParentRules(String nodeType, SchemaVersion v) {
- Filter from = assembleFilterSegments(where(EdgeField.FROM.toString()).is(nodeType), getOppositeDirectionContainmentCriteria());
- Filter to = assembleFilterSegments(where(EdgeField.TO.toString()).is(nodeType), getSameDirectionContainmentCriteria());
- Filter total = from.or(to);
-
- return extractRules(total, v);
- }
-
- /**
- * Returns if the given node type has any parent relationships (ie it is contained by another node type) in the current version.
- * @param nodeType
- * @return boolean
- */
- public boolean hasParentRule(String nodeType) {
- return hasParentRule(nodeType, schemaVersions.getDefaultVersion());
- }
-
- /**
- * Returns if the given node type has any parent relationships (ie it is contained by another node type) in the given version.
- * @param nodeType
- * @return boolean
- */
- public boolean hasParentRule(String nodeType, SchemaVersion v) {
- return !getParentRules(nodeType, v).isEmpty();
- }
-
/**
* Applies the given filter to the DocumentContext(s) for the given version to extract
* edge rules, and converts this extracted information into the Multimap form
- *
+ *
* @param filter - JsonPath filter to read the DocumentContexts with. May be null
* to denote no filter, ie get all.
* @param v - The schema version to extract from
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
* {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if
* no rules are found.
* ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
* buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
+ *
* This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
*/
- private Multimap<String, EdgeRule> extractRules(Filter filter, SchemaVersion v) {
- List<Map<String, String>> foundRules = new ArrayList<>();
- List<DocumentContext> docs = versionJsonFilesMap.get(v);
- if (docs != null) {
- for (DocumentContext doc : docs) {
- if (filter == null) {
- foundRules.addAll(doc.read(READ_ALL_START));
- } else {
- foundRules.addAll(doc.read(READ_START, filter));
- }
- }
- }
-
- return convertToEdgeRules(foundRules);
- }
-
+ private Multimap<String, EdgeRule> extractRules(Filter filter, SchemaVersion v) {
+ SchemaFilter schemaFilter = new SchemaFilter(filter, v);
+ try {
+ return cacheFilterStore.get(schemaFilter);
+ } catch (ExecutionException e) {
+ LOGGER.info("Encountered exception during the retrieval of the rules");
+ return ArrayListMultimap.create();
+ }
+ }
+
+ public Multimap<String, EdgeRule> extractRules(SchemaFilter schemaFilter){
+ List<Map<String, String>> foundRules = new ArrayList<>();
+ List<DocumentContext> docs = versionJsonFilesMap.get(schemaFilter.getSchemaVersion());
+ if (docs != null) {
+ for (DocumentContext doc : docs) {
+ if (schemaFilter.getFilter() == null) {
+ foundRules.addAll(doc.read(READ_ALL_START));
+ } else {
+ foundRules.addAll(doc.read(READ_START, Filter.parse(schemaFilter.getFilter())));
+ }
+ }
+ }
+
+ return convertToEdgeRules(foundRules);
+ }
+
//-----filter building helpers-----//
/**
* ANDs together the given start criteria with each criteria in the pieces list, and
* then ORs together these segments into one filter.
- *
+ *
* JsonPath doesn't have an OR method on Criteria, only on Filters, so assembling
* a complete filter requires this sort of roundabout construction.
- *
+ *
* @param start - Criteria of the form where(from/to).is(nodeType)
* (ie the start of any A&AI edge rule query)
* @param pieces - Other Criteria to be applied
@@ -474,91 +615,91 @@ public class EdgeIngestor {
}
return assembled;
}
-
+
/**
* Builds the sub-Criteria for a containment edge rule query where the direction
* and containment fields must match.
- *
+ *
* Used for getChildRules() where the container node type is in the "from" position and
* for getParentRules() where the containee type is in the "to" position.
- *
+ *
* @return List<Criteria> covering property permutations defined with either notation or explicit direction
*/
private List<Criteria> getSameDirectionContainmentCriteria() {
List<Criteria> crits = new ArrayList<>();
-
+
crits.add(where(EdgeField.CONTAINS.toString()).is(DirectionNotation.DIRECTION.toString()));
-
+
crits.add(where(EdgeField.DIRECTION.toString()).is(Direction.OUT.toString())
.and(EdgeField.CONTAINS.toString()).is(Direction.OUT.toString()));
-
+
crits.add(where(EdgeField.DIRECTION.toString()).is(Direction.IN.toString())
.and(EdgeField.CONTAINS.toString()).is(Direction.IN.toString()));
-
+
return crits;
}
-
+
/**
* Builds the sub-Criteria for a containment edge rule query where the direction
* and containment fields must not match.
- *
+ *
* Used for getChildRules() where the container node type is in the "to" position and
* for getParentRules() where the containee type is in the "from" position.
- *
+ *
* @return List<Criteria> covering property permutations defined with either notation or explicit direction
*/
private List<Criteria> getOppositeDirectionContainmentCriteria() {
List<Criteria> crits = new ArrayList<>();
-
+
crits.add(where(EdgeField.CONTAINS.toString()).is(DirectionNotation.OPPOSITE.toString()));
-
+
crits.add(where(EdgeField.DIRECTION.toString()).is(Direction.OUT.toString())
.and(EdgeField.CONTAINS.toString()).is(Direction.IN.toString()));
-
+
crits.add(where(EdgeField.DIRECTION.toString()).is(Direction.IN.toString())
.and(EdgeField.CONTAINS.toString()).is(Direction.OUT.toString()));
-
+
return crits;
}
-
+
//-----rule packaging helpers-----//
/**
* Converts the raw output from reading the json file to the Multimap<String key, EdgeRule> format
- *
+ *
* @param allFound - raw edge rule output read from json file(s)
* (could be empty if none found)
- * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
+ * @return Multimap<String, EdgeRule> of node names keys to the EdgeRules where the key takes the form of
* {alphabetically first nodetype}|{alphabetically second nodetype}. Will be empty if input
* was empty.
* ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link"
* buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link"
- *
+ *
* This is alphabetical order to normalize the keys, as sometimes there will be multiple
- * rules for a pair of node types but the from/to value in the json is flipped for some of them.
+ * rules for a pair of node types but the from/to value in the json is flipped for some of them.
*/
private Multimap<String, EdgeRule> convertToEdgeRules(List<Map<String, String>> allFound) {
Multimap<String, EdgeRule> rules = ArrayListMultimap.create();
-
+
TypeAlphabetizer alpher = new TypeAlphabetizer();
-
+
for (Map<String, String> raw : allFound) {
EdgeRule converted = new EdgeRule(raw);
if (converted.getFrom().equals(converted.getTo())) {
- /* the way the code worked in the past was with outs and
- * when we switched it to in the same-node-type to
- * same-node-type parent child edges were failing because all
- * of the calling code would pass the parent as the left argument,
- * so it was either in that method swap the parent/child,
- * flip the edge rule or make all callers swap. the last seemed
- * like a bad idea. and felt like the edge flip was the better
+ /* the way the code worked in the past was with outs and
+ * when we switched it to in the same-node-type to
+ * same-node-type parent child edges were failing because all
+ * of the calling code would pass the parent as the left argument,
+ * so it was either in that method swap the parent/child,
+ * flip the edge rule or make all callers swap. the last seemed
+ * like a bad idea. and felt like the edge flip was the better
* of the remaining 2 */
converted.flipDirection();
}
String alphabetizedKey = alpher.buildAlphabetizedKey(raw.get(EdgeField.FROM.toString()), raw.get(EdgeField.TO.toString()));
rules.put(alphabetizedKey, converted);
}
-
+
return rules;
}
-
+
}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRule.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRule.java
index e1cb240e..f8f8caca 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRule.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRule.java
@@ -20,13 +20,10 @@
package org.onap.aai.edges;
import org.apache.tinkerpop.gremlin.structure.Direction;
-import org.onap.aai.edges.enums.AAIDirection;
-import org.onap.aai.edges.enums.DirectionNotation;
-import org.onap.aai.edges.enums.EdgeField;
-import org.onap.aai.edges.enums.EdgeProperty;
-import org.onap.aai.edges.enums.MultiplicityRule;
+import org.onap.aai.edges.enums.*;
import java.util.EnumMap;
+import java.util.HashMap;
import java.util.Map;
/**
@@ -59,19 +56,32 @@ public class EdgeRule {
direction = Direction.valueOf(fieldVals.get(EdgeField.DIRECTION.toString()));
multiplicityRule = MultiplicityRule.getValue(fieldVals.get(EdgeField.MULTIPLICITY.toString()));
isPrivateEdge = Boolean.valueOf(fieldVals.getOrDefault(EdgeField.PRIVATE.toString(), "false"));
- for (EdgeProperty prop : EdgeProperty.values()) {
+
+ for (EdgeProperty prop : EdgeProperty.values()) {
String rawVal = fieldVals.get(prop.toString());
edgeFields.put(prop, convertNotation(direction, rawVal));
}
isDefaultEdge = Boolean.valueOf(fieldVals.get(EdgeField.DEFAULT.toString()));
-
- description = fieldVals.get(EdgeField.DESCRIPTION.toString());
+ description = fieldVals.get(EdgeField.DESCRIPTION.toString());
if (description == null) { //bc description is optional and not in v12 and earlier
description = "";
}
}
+ // Copy Constructor
+ public EdgeRule(EdgeRule edgeRule){
+ this.from = edgeRule.from;
+ this.to = edgeRule.to;
+ this.label = edgeRule.label;
+ this.direction = Direction.valueOf(edgeRule.direction.toString());
+ this.multiplicityRule = MultiplicityRule.valueOf(edgeRule.multiplicityRule.toString());
+ this.edgeFields = new HashMap<>(edgeRule.edgeFields);
+ this.isDefaultEdge = edgeRule.isDefaultEdge;
+ this.description = edgeRule.description;
+ this.isPrivateEdge = edgeRule.isPrivateEdge;
+ }
+
/**
* Converts whatever string was in the json for an edge property value into
* the appropriate AAIDirection
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRuleQuery.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRuleQuery.java
index 5801e816..d6fec83d 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRuleQuery.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRuleQuery.java
@@ -1,4 +1,4 @@
-/**
+/**
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
@@ -36,6 +36,7 @@ import static com.jayway.jsonpath.Filter.filter;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import java.util.Optional;
import static com.jayway.jsonpath.Criteria.where;
@@ -90,6 +91,12 @@ public class EdgeRuleQuery {
private String getSecondNodeType() {
return nodeB;
}
+
+ public Builder to(String nodeB){
+ this.nodeB = nodeB;
+ return this;
+ }
+
public Builder toOnly() {
//Allows this to be used with single parameter constructor Builder(String nodeA)
if(StringUtils.isEmpty(this.nodeB) && StringUtils.isNotEmpty(this.nodeA) ) {
@@ -163,7 +170,7 @@ public class EdgeRuleQuery {
List<Predicate> criteriaFromTo = new ArrayList<>();
//Special logic to allow for A to B case only
if(("FromOnly").equals(builder.getSecondNodeType())) {
- criteriaFromTo.add(buildToFromPart(builder.getFirstNodeType(), null));
+ criteriaFromTo.add(buildToFromPart(builder.getFirstNodeType(), null));
} else {
criteriaFromTo.add(buildToFromPart(builder.getFirstNodeType(), builder.getSecondNodeType()));
}
@@ -238,16 +245,16 @@ public class EdgeRuleQuery {
}
private Predicate addDirection(AAIDirection direction) {
- if (direction == AAIDirection.OUT) {
- return where(EdgeField.DIRECTION.toString()).in(AAIDirection.OUT.toString(), AAIDirection.BOTH.toString());
- } else if (direction == AAIDirection.IN) {
- return where(EdgeField.DIRECTION.toString()).in(AAIDirection.IN.toString(), AAIDirection.BOTH.toString());
- } else if (direction == AAIDirection.BOTH) {
- return where(EdgeField.DIRECTION.toString()).is(AAIDirection.BOTH.toString());
- } else if (direction == AAIDirection.NONE) {
- return where(EdgeField.DIRECTION.toString()).is(AAIDirection.NONE.toString());
- }
+ if (direction == AAIDirection.OUT) {
+ return where(EdgeField.DIRECTION.toString()).in(AAIDirection.OUT.toString(), AAIDirection.BOTH.toString());
+ } else if (direction == AAIDirection.IN) {
+ return where(EdgeField.DIRECTION.toString()).in(AAIDirection.IN.toString(), AAIDirection.BOTH.toString());
+ } else if (direction == AAIDirection.BOTH) {
+ return where(EdgeField.DIRECTION.toString()).is(AAIDirection.BOTH.toString());
+ } else if (direction == AAIDirection.NONE) {
return where(EdgeField.DIRECTION.toString()).is(AAIDirection.NONE.toString());
+ }
+ return where(EdgeField.DIRECTION.toString()).is(AAIDirection.NONE.toString());
}
/**
@@ -312,6 +319,29 @@ public class EdgeRuleQuery {
}
return sb.toString();
}
-}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ EdgeRuleQuery ruleQuery = (EdgeRuleQuery) o;
+ return isPrivate == ruleQuery.isPrivate &&
+ Objects.equals(v, ruleQuery.v) &&
+ Objects.equals(nodeA, ruleQuery.nodeA) &&
+ Objects.equals(nodeB, ruleQuery.nodeB) &&
+ Objects.equals(label, ruleQuery.label) &&
+ direction == ruleQuery.direction &&
+ type == ruleQuery.type;
+ }
+
+ @Override
+ public int hashCode() {
+ if(v.isPresent()){
+ return Objects.hash(v.get(), nodeA, nodeB, label, direction, type, isPrivate);
+ } else {
+ return Objects.hash(nodeA, nodeB, label, direction, type, isPrivate);
+ }
+ }
+
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/JsonIngestor.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/JsonIngestor.java
index 16562756..713103a0 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/edges/JsonIngestor.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/JsonIngestor.java
@@ -1,4 +1,4 @@
-/**
+/**
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
@@ -20,64 +20,85 @@
package org.onap.aai.edges;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.jayway.jsonpath.DocumentContext;
+import com.jayway.jsonpath.JsonPath;
+import org.onap.aai.setup.SchemaVersion;
+
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
-import org.onap.aai.setup.SchemaVersion;
-
-import com.jayway.jsonpath.DocumentContext;
-import com.jayway.jsonpath.JsonPath;
-
/**
* JsonIngestor produces DocumentContexts from json files
*/
public class JsonIngestor {
-
- /**
- * Reads in given json files to queryable DocumentContexts.
- *
- * @param filesToIngest - map of filenames to ingest
- * per Version
- * @return Map<SchemaVersion, List<DocumentContext>> - map of DocumentContexts per Version
- */
- public Map<SchemaVersion, List<DocumentContext>> ingest(Map<SchemaVersion, List<String>> filesToIngest) {
- Map<SchemaVersion, List<DocumentContext>> result = new HashMap<>();
-
- for (Entry<SchemaVersion, List<String>> verFiles : filesToIngest.entrySet()) {
- SchemaVersion v = verFiles.getKey();
- List<String> files = verFiles.getValue();
-
- List<DocumentContext> docs = new ArrayList<>();
-
- for (String rulesFilename : files) {
- String fileContents = readInJsonFile(rulesFilename);
- docs.add(JsonPath.parse(fileContents));
- }
- result.put(v, docs);
- }
-
- return result;
- }
-
- /**
- * Reads the json file at the given filename into an in-memory String.
- *
- * @param rulesFilename - json file to be read (must include path to the file)
- * @return String json contents of the given file
- */
- private String readInJsonFile(String rulesFilename) {
- StringBuilder sb = new StringBuilder();
- try(BufferedReader br = new BufferedReader(new FileReader(rulesFilename))) {
- String line;
- while ((line = br.readLine()) != null) {
- sb.append(line);
- }
- } catch (IOException e) {
- throw new ExceptionInInitializerError(e);
- }
- return sb.toString();
- }
+ private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(JsonIngestor.class);
+
+ /**
+ * Reads in given json files to queryable DocumentContexts.
+ *
+ * @param filesToIngest - map of filenames to ingest
+ * per Version
+ * @return Map<SchemaVersion, List<DocumentContext>> - map of DocumentContexts per Version
+ */
+ public Map<SchemaVersion, List<DocumentContext>> ingest(Map<SchemaVersion, List<String>> filesToIngest) {
+ Map<SchemaVersion, List<DocumentContext>> result = new HashMap<>();
+
+ for (Entry<SchemaVersion, List<String>> verFiles : filesToIngest.entrySet()) {
+ SchemaVersion v = verFiles.getKey();
+ List<String> files = verFiles.getValue();
+
+ List<DocumentContext> docs = new ArrayList<>();
+ for (String rulesFilename : files) {
+ String fileContents = readInJsonFile(rulesFilename);
+ docs.add(JsonPath.parse(fileContents));
+ }
+ result.put(v, docs);
+ }
+
+ return result;
+ }
+
+ public Map<SchemaVersion, List<DocumentContext>> ingestContent(Map<SchemaVersion, List<String>> filesToIngest) {
+ Map<SchemaVersion, List<DocumentContext>> result = new HashMap<>();
+
+ for (Entry<SchemaVersion, List<String>> verFiles : filesToIngest.entrySet()) {
+ SchemaVersion v = verFiles.getKey();
+ List<String> files = verFiles.getValue();
+
+ List<DocumentContext> docs = new ArrayList<>();
+ for (String jsonPayload : files) {
+ docs.add(JsonPath.parse(jsonPayload));
+ }
+ result.put(v, docs);
+ }
+ return result;
+ }
+
+ /**
+ * Reads the json file at the given filename into an in-memory String.
+ *
+ * @param rulesFilename - json file to be read (must include path to the file)
+ * @return String json contents of the given file
+ */
+ public String readInJsonFile(String rulesFilename) {
+ StringBuilder sb = new StringBuilder();
+ try(BufferedReader br = new BufferedReader(new FileReader(rulesFilename))) {
+ String line;
+ while ((line = br.readLine()) != null) {
+ sb.append(line);
+ }
+ } catch (IOException e) {
+ LOGGER.warn("Exception in file"+e.getMessage());
+ throw new ExceptionInInitializerError(e);
+ }
+ return sb.toString();
+ }
}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/SchemaFilter.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/SchemaFilter.java
new file mode 100644
index 00000000..792e3c51
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/SchemaFilter.java
@@ -0,0 +1,69 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-18 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.edges;
+
+import com.jayway.jsonpath.Filter;
+import org.onap.aai.setup.SchemaVersion;
+
+import java.util.Objects;
+
+public class SchemaFilter {
+
+ private String filter;
+
+ private SchemaVersion schemaVersion;
+
+ public SchemaFilter(Filter filter, SchemaVersion schemaVersion){
+ if(filter != null){
+ this.filter = filter.toString();
+ }
+ this.schemaVersion = schemaVersion;
+ }
+
+ public SchemaVersion getSchemaVersion() {
+ return schemaVersion;
+ }
+
+ public String getFilter() {
+ return filter;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ SchemaFilter that = (SchemaFilter) o;
+ return Objects.equals(filter, that.filter) &&
+ Objects.equals(schemaVersion, that.schemaVersion);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(filter, schemaVersion);
+ }
+
+ @Override
+ public String toString() {
+ return "SchemaFilter{" +
+ "filter='" + filter + '\'' +
+ ", schemaVersion=" + schemaVersion +
+ '}';
+ }
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/AmbiguousRuleChoiceException.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/AmbiguousRuleChoiceException.java
index b218cecd..da79d9c7 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/AmbiguousRuleChoiceException.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/AmbiguousRuleChoiceException.java
@@ -24,4 +24,8 @@ public class AmbiguousRuleChoiceException extends Exception {
public AmbiguousRuleChoiceException(String msg) {
super(msg);
}
+
+ public AmbiguousRuleChoiceException(Throwable throwable){
+ super(throwable);
+ }
}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/EdgeRuleNotFoundException.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/EdgeRuleNotFoundException.java
index 4d339de2..f9b9b643 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/EdgeRuleNotFoundException.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/EdgeRuleNotFoundException.java
@@ -24,4 +24,8 @@ public class EdgeRuleNotFoundException extends Exception {
public EdgeRuleNotFoundException(String msg) {
super(msg);
}
+
+ public EdgeRuleNotFoundException(Throwable throwable){
+ super(throwable);
+ }
}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java b/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java
index 95232386..1945a1ef 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java
@@ -2,13 +2,15 @@
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-18 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
* ================================================================================
* 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
+ * 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,
@@ -20,210 +22,256 @@
package org.onap.aai.nodes;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.*;
-import java.io.ByteArrayInputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.xml.XMLConstants;
-import javax.xml.bind.JAXBException;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.google.common.base.CaseFormat;
import org.eclipse.persistence.jaxb.JAXBContextProperties;
import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext;
import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory;
-
import org.onap.aai.setup.ConfigTranslator;
import org.onap.aai.setup.SchemaVersion;
+import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.setup.Translator;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
-import com.google.common.base.CaseFormat;
+import javax.annotation.PostConstruct;
+import javax.xml.XMLConstants;
+import javax.xml.bind.JAXBException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.*;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
@Component
-/**
- * NodeIngestor - ingests A&AI OXM files per given config, serves DynamicJAXBContext per version
+/*
+ NodeIngestor - ingests A&AI OXM files per given config, serves DynamicJAXBContext per version
*/
+@PropertySource(value = "classpath:schema-ingest.properties", ignoreResourceNotFound=true)
+@PropertySource(value = "file:${schema.ingest.file}", ignoreResourceNotFound=true)
public class NodeIngestor {
+ private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(NodeIngestor.class);
+ private static final Pattern classNamePattern = Pattern.compile("\\.(v\\d+)\\.");
+ Map<SchemaVersion, List<String>> filesToIngest;
+ private Map<SchemaVersion, DynamicJAXBContext> versionContextMap = new TreeMap<>();
+ private Map<SchemaVersion, Set<String>> typesPerVersion = new TreeMap<>();
+ private Map<SchemaVersion, Document> schemaPerVersion = new TreeMap<>();
+ private String localSchema;
+ private SchemaVersions schemaVersions;
+ private Set<Translator> translators;
+
+ //TODO : See if you can get rid of InputStream resets
+ /**
+ * Instantiates the NodeIngestor bean.
+ *
+ * @param - ConfigTranslator autowired in by Spring framework which
+ * contains the configuration information needed to ingest the desired files.
+ */
- private Map<SchemaVersion, DynamicJAXBContext> versionContextMap = new TreeMap<>();
- private Map<SchemaVersion, Set<String>> typesPerVersion = new TreeMap<>();
- private Map<SchemaVersion, Document> schemaPerVersion = new TreeMap<>();
- private static final Pattern classNamePattern = Pattern.compile("\\.(v\\d+)\\.");
-
- private ConfigTranslator translator;
-
-
- @Autowired
- /**
- * Instantiates the NodeIngestor bean.
- *
- * @param translator - ConfigTranslator autowired in by Spring framework which
- * contains the configuration information needed to ingest the desired files.
- */
- public NodeIngestor(ConfigTranslator translator) {
- this.translator = translator;
- Map<SchemaVersion, List<String>> filesToIngest = translator.getNodeFiles();
-
- try {
- for (Entry<SchemaVersion, List<String>> verFiles : filesToIngest.entrySet()) {
- SchemaVersion v = verFiles.getKey();
- List<String> files = verFiles.getValue();
- final DynamicJAXBContext ctx = ingest(files);
- versionContextMap.put(v, ctx);
- typesPerVersion.put(v, getAllNodeTypes(files));
- schemaPerVersion.put(v, createCombinedSchema(files, v));
- }
- } catch (JAXBException | ParserConfigurationException | SAXException | IOException e) {
- throw new ExceptionInInitializerError(e);
- }
- }
-
- /**
- * Ingests the given OXM files into DynamicJAXBContext
- *
- * @param files - List<String> of full filenames (ie including the path) to be ingested
- *
- * @return DynamicJAXBContext including schema information from all given files
- *
- * @throws FileNotFoundException if an OXM file can't be found
- * @throws JAXBException if there's an error creating the DynamicJAXBContext
- */
- private DynamicJAXBContext ingest(List<String> files) throws FileNotFoundException, JAXBException {
- List<InputStream> streams = new ArrayList<>();
-
- for (String name : files) {
- streams.add(new FileInputStream(new File(name)));
- }
-
- Map<String, Object> properties = new HashMap<>();
- properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, streams);
- return DynamicJAXBContextFactory.createContextFromOXM(this.getClass().getClassLoader(), properties);
- }
-
-
-
- private Set<String> getAllNodeTypes(List<String> files) throws ParserConfigurationException, SAXException, IOException {
- Set<String> types = new HashSet<>();
- final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
- docFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- final DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
-
- ArrayList<Node> javaTypes = new ArrayList<Node>();
- for (String file : files) {
- InputStream inputStream = new FileInputStream(file);
-
- final Document doc = docBuilder.parse(inputStream);
- final NodeList list = doc.getElementsByTagName("java-type");
-
- for (int i = 0; i < list.getLength(); i++) {
- String type = list.item(i).getAttributes().getNamedItem("name").getNodeValue();
- javaTypes.add(list.item(i));
- types.add(CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, type));
- }
- }
-
- return types;
- }
-
- private Document createCombinedSchema(List<String> files,SchemaVersion v) throws ParserConfigurationException, SAXException, IOException {
- final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
- docFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- final DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
- DocumentBuilder masterDocBuilder = docFactory.newDocumentBuilder();
- Document combinedDoc = masterDocBuilder.parse(getShell(v));
- NodeList masterList = combinedDoc.getElementsByTagName("java-types");
- Node javaTypesContainer = masterList.getLength() == 0 ? combinedDoc.getDocumentElement() : masterList.item(0);
- for (String file : files) {
- InputStream inputStream = new FileInputStream(file);
-
- final Document doc = docBuilder.parse(inputStream);
- final NodeList list = doc.getElementsByTagName("java-type");
- for (int i = 0; i < list.getLength(); i++) {
- Node copy = combinedDoc.importNode(list.item(i),true);
- javaTypesContainer.appendChild(copy);
- }
- }
- return combinedDoc;
- }
-
- /**
- * Gets the DynamicJAXBContext for the given version
- *
- * @param v
- * @return DynamicJAXBContext
- */
- public DynamicJAXBContext getContextForVersion(SchemaVersion v) {
- return versionContextMap.get(v);
- }
-
- /**
- * Determines if the given version contains the given node type
- *
- * @param nodeType - node type to check, must be in lower hyphen form (ie "type-name")
- * @param v - schema version to check against
- * @return
- */
- public boolean hasNodeType(String nodeType, SchemaVersion v) {
- return typesPerVersion.get(v).contains(nodeType);
- }
-
- public Set<String> getObjectsInVersion(SchemaVersion v){
- return typesPerVersion.get(v);
- }
- /**
- * Determines if the given version contains the given node type
- *
- * @param String nodeType - node type to check, must be in lower hyphen form (ie "type-name")
- * @param v
- * @return
- */
- public Document getSchema(SchemaVersion v) {
- return schemaPerVersion.get(v);
- }
-
- private InputStream getShell(SchemaVersion v) {
- String source = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<xml-bindings xmlns=\"http://www.eclipse.org/eclipselink/xsds/persistence/oxm\" package-name=\"inventory.aai.onap.org."+v.toString().toLowerCase()+"\" xml-mapping-metadata-complete=\"true\">\n" +
- " <xml-schema element-form-default=\"QUALIFIED\">\n" +
- " <xml-ns namespace-uri=\"http://org.onap.aai.inventory/"+v.toString().toLowerCase()+"\" />\n" +
- " </xml-schema>\n" +
- " <java-types>\n" +
- " </java-types>\\n" +
- "</xml-bindings>";
-// source.rep.replace("v11", v.toString());
- return new ByteArrayInputStream(source.getBytes(StandardCharsets.UTF_8));
- }
-
-
- public SchemaVersion getVersionFromClassName (String classname) {
- Matcher m = classNamePattern.matcher(classname);
- String version = null;
- if (m.find()) {
- version = m.group(1);
- return new SchemaVersion(version);
- } else {
- return translator.getSchemaVersions().getDefaultVersion();
- }
- }
-}
+ @Autowired
+ public NodeIngestor(Set<Translator> translatorSet) {
+ LOGGER.debug("Local Schema files will be fetched");
+ this.translators = translatorSet;
+ }
+ @PostConstruct
+ public void initialize() {
+
+ for (Translator translator : translators) {
+ try {
+ LOGGER.debug("Processing the translator");
+ translateAll(translator);
+
+ } catch (Exception e) {
+ LOGGER.info("Error while Processing the translator" + e.getMessage());
+ continue;
+ }
+ }
+ if (versionContextMap.isEmpty() || schemaPerVersion.isEmpty() || typesPerVersion.isEmpty()) {
+ throw new ExceptionInInitializerError();
+ }
+ }
+
+ 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);
+ typesPerVersion.put(version, getAllNodeTypes(inputStreams));
+ schemaPerVersion.put(version, createCombinedSchema(inputStreams, version, retrieveLocalSchema));
+ }
+ } catch (JAXBException | ParserConfigurationException | SAXException | IOException e) {
+ throw new ExceptionInInitializerError(e);
+ }
+ }
+
+ /**
+ * Ingests the given OXM files into DynamicJAXBContext
+ *
+ * @param inputStreams - inputStrean of oxms from SchemaService to be ingested
+ *
+ * @return DynamicJAXBContext including schema information from all given files
+ *
+ * @throws JAXBException if there's an error creating the DynamicJAXBContext
+ */
+ private DynamicJAXBContext ingest(List<InputStream> inputStreams) throws JAXBException {
+ Map<String, Object> properties = new HashMap<>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, inputStreams);
+ LOGGER.debug("Ingested the InputStream");
+ return DynamicJAXBContextFactory.createContextFromOXM(this.getClass().getClassLoader(), properties);
+ }
+
+ private Set<String> getAllNodeTypes(List<InputStream> inputStreams) throws ParserConfigurationException, SAXException, IOException {
+ //Reset the InputStream to reset the offset to inital position
+ Set<String> types = new HashSet<>();
+ final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ docFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ final DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+
+ for (InputStream inputStream : inputStreams) {
+ //TODO Change this
+ inputStream.reset();
+ final Document doc = docBuilder.parse(inputStream);
+ final NodeList list = doc.getElementsByTagName("java-type");
+
+ for (int i = 0; i < list.getLength(); i++) {
+ String type = list.item(i).getAttributes().getNamedItem("name").getNodeValue();
+ types.add(CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, type));
+ }
+ }
+
+ LOGGER.debug("Types size" + types.size());
+ return types;
+ }
+
+ private Document createCombinedSchema(List<InputStream> inputStreams, SchemaVersion version, boolean localSchema) throws ParserConfigurationException, SAXException, IOException {
+ if (localSchema) {
+ return createCombinedSchema(inputStreams, version);
+ }
+
+ InputStream inputStream = inputStreams.get(0);
+ inputStream.reset();
+ final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ docFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ DocumentBuilder masterDocBuilder = docFactory.newDocumentBuilder();
+ return masterDocBuilder.parse(inputStream);
+ }
+
+ private Document createCombinedSchema(List<InputStream> inputStreams, SchemaVersion version) throws ParserConfigurationException, SAXException, IOException {
+ final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ docFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ final DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ DocumentBuilder masterDocBuilder = docFactory.newDocumentBuilder();
+ Document combinedDoc = masterDocBuilder.parse(getShell(version));
+ NodeList masterList = combinedDoc.getElementsByTagName("java-types");
+ Node javaTypesContainer = masterList.getLength() == 0 ? combinedDoc.getDocumentElement() : masterList.item(0);
+
+ for (InputStream inputStream : inputStreams) {
+ inputStream.reset();
+ final Document doc = docBuilder.parse(inputStream);
+ final NodeList list = doc.getElementsByTagName("java-type");
+ for (int i = 0; i < list.getLength(); i++) {
+ Node copy = combinedDoc.importNode(list.item(i), true);
+ javaTypesContainer.appendChild(copy);
+ }
+ }
+ return combinedDoc;
+ }
+
+ /**
+ * Gets the DynamicJAXBContext for the given version
+ *
+ * @param v - schema version to retrieve the context
+ * @return DynamicJAXBContext
+ */
+ public DynamicJAXBContext getContextForVersion(SchemaVersion v) {
+ return versionContextMap.get(v);
+ }
+
+ /**
+ * Determines if the given version contains the given node type
+ *
+ * @param nodeType - node type to check, must be in lower hyphen form (ie "type-name")
+ * @param v - schema version to check against
+ * @return boolean
+ */
+ public boolean hasNodeType(String nodeType, SchemaVersion v) {
+ return typesPerVersion.get(v).contains(nodeType);
+ }
+
+ public Set<String> getObjectsInVersion(SchemaVersion v) {
+ return typesPerVersion.get(v);
+ }
+
+ /**
+ * Determines if the given version contains the given node type
+ *
+ * @param v - Schemaversion to retrieve the schema
+ * @return Document
+ */
+ public Document getSchema(SchemaVersion v) {
+ return schemaPerVersion.get(v);
+ }
+
+
+ public SchemaVersion getVersionFromClassName(String classname) {
+ Matcher m = classNamePattern.matcher(classname);
+ if (m.find()) {
+ String version = m.group(1);
+ return new SchemaVersion(version);
+ } else {
+ return this.schemaVersions.getDefaultVersion();
+ }
+ }
+
+ private List<InputStream> retrieveOXM(SchemaVersion version, Translator translator) throws IOException {
+ /*
+ Call Schema MS to get versions using RestTemplate or Local
+ */
+ return translator.getVersionNodeStream(version);
+
+ }
+
+ private InputStream getShell(SchemaVersion v) {
+ String source = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+ "<xml-bindings xmlns=\"http://www.eclipse.org/eclipselink/xsds/persistence/oxm\" package-name=\"inventory.aai.onap.org." + v.toString().toLowerCase() + "\" xml-mapping-metadata-complete=\"true\">\n" +
+ " <xml-schema element-form-default=\"QUALIFIED\">\n" +
+ " <xml-ns namespace-uri=\"http://org.onap.aai.inventory/" + v.toString().toLowerCase() + "\" />\n" +
+ " </xml-schema>\n" +
+ " <java-types>\n" +
+ " </java-types>\n" +
+ "</xml-bindings>";
+ return new ByteArrayInputStream(source.getBytes(StandardCharsets.UTF_8));
+ }
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceNoAuthClient.java b/aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceNoAuthClient.java
new file mode 100644
index 00000000..07f522b4
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceNoAuthClient.java
@@ -0,0 +1,75 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2018-19 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import org.springframework.util.MultiValueMap;
+
+import javax.annotation.PostConstruct;
+import java.util.Collections;
+import java.util.Map;
+import java.util.UUID;
+
+@Component(value="no-auth-service-rest-client")
+public class SchemaServiceNoAuthClient extends NoAuthRestClient{
+
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(SchemaServiceNoAuthClient.class);
+
+ @Value("${schema.service.base.url}")
+ private String baseUrl;
+
+ @PostConstruct
+ public void init () throws Exception {
+ super.init();
+ }
+
+ @Override
+ public String getBaseUrl() {
+ return baseUrl;
+ }
+
+ @Override
+ public MultiValueMap<String, String> getHeaders(Map<String, String> headers) {
+ HttpHeaders httpHeaders = new HttpHeaders();
+
+ String defaultAccept = headers.getOrDefault(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON.toString());
+ String defaultContentType = headers.getOrDefault(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON.toString());
+
+ if(headers.isEmpty()){
+ httpHeaders.setAccept(Collections.singletonList(MediaType.parseMediaType(defaultAccept)));
+ httpHeaders.setContentType(MediaType.parseMediaType(defaultContentType));
+ }
+
+ httpHeaders.add("X-FromAppId", appName);
+ httpHeaders.add("X-TransactionId", UUID.randomUUID().toString());
+ headers.forEach(httpHeaders::add);
+ return httpHeaders;
+ }
+
+ @Override
+ public EELFLogger getLogger() {
+ return logger;
+ }
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceOneWayClient.java b/aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceOneWayClient.java
new file mode 100644
index 00000000..3aa3b1da
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceOneWayClient.java
@@ -0,0 +1,87 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2018-19 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import org.springframework.util.MultiValueMap;
+
+import javax.annotation.PostConstruct;
+import java.util.Collections;
+import java.util.Map;
+import java.util.UUID;
+
+@Component(value="schema-service-one-way-rest-client")
+public class SchemaServiceOneWayClient extends OneWaySSLRestClient{
+
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(SchemaServiceOneWayClient.class);
+
+ @Value("${schema.service.base.url}")
+ private String baseUrl;
+
+ @Value("${schema.service.ssl.trust-store}")
+ private String truststorePath;
+
+ @Value("${schema.service.ssl.trust-store-password}")
+ private String truststorePassword;
+
+ @Override
+ public String getBaseUrl() {
+ return baseUrl;
+ }
+
+ @Override
+ protected String getTruststorePath() {
+ return truststorePath;
+ }
+
+ @Override
+ protected char[] getTruststorePassword() {
+ return truststorePassword.toCharArray();
+ }
+
+ @Override
+ public MultiValueMap<String, String> getHeaders(Map<String, String> headers) {
+ HttpHeaders httpHeaders = new HttpHeaders();
+
+ String defaultAccept = headers.getOrDefault(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON.toString());
+ String defaultContentType = headers.getOrDefault(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON.toString());
+
+ if(headers.isEmpty()){
+ httpHeaders.setAccept(Collections.singletonList(MediaType.parseMediaType(defaultAccept)));
+ httpHeaders.setContentType(MediaType.parseMediaType(defaultContentType));
+ }
+
+ httpHeaders.add("X-FromAppId", appName);
+ httpHeaders.add("X-TransactionId", UUID.randomUUID().toString());
+ httpHeaders.add("X-TransactionId", appName);
+ headers.forEach(httpHeaders::add);
+ return httpHeaders;
+ }
+
+ @Override
+ public EELFLogger getLogger() {
+ return logger;
+ }
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceRestClient.java b/aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceRestClient.java
new file mode 100644
index 00000000..db1a50b5
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/restclient/SchemaServiceRestClient.java
@@ -0,0 +1,102 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
+ * 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.restclient;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import org.springframework.util.MultiValueMap;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.UUID;
+
+@Component(value = "schema-service-rest-client")
+public class SchemaServiceRestClient extends TwoWaySSLRestClient {
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(SchemaServiceRestClient.class);
+
+ @Value("${schema.service.base.url}")
+ private String baseUrl;
+
+ @Value("${schema.service.ssl.key-store}")
+ private String keystorePath;
+
+ @Value("${schema.service.ssl.trust-store}")
+ private String truststorePath;
+
+ @Value("${schema.service.ssl.key-store-password}")
+ private String keystorePassword;
+
+ @Value("${schema.service.ssl.trust-store-password}")
+ private String truststorePassword;
+
+ @Override
+ public String getBaseUrl() {
+ return baseUrl;
+ }
+
+ @Override
+ protected String getKeystorePath() {
+ return keystorePath;
+ }
+
+ @Override
+ protected String getTruststorePath() {
+ return truststorePath;
+ }
+
+ @Override
+ protected char[] getKeystorePassword() {
+ return keystorePassword.toCharArray();
+ }
+
+ @Override
+ protected char[] getTruststorePassword() {
+ return truststorePassword.toCharArray();
+ }
+
+ @Override
+ public MultiValueMap<String, String> getHeaders(Map<String, String> headers) {
+ HttpHeaders httpHeaders = new HttpHeaders();
+
+ String defaultAccept = headers.getOrDefault(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON.toString());
+ String defaultContentType = headers.getOrDefault(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON.toString());
+
+ if (headers.isEmpty()) {
+ httpHeaders.setAccept(Collections.singletonList(MediaType.parseMediaType(defaultAccept)));
+ httpHeaders.setContentType(MediaType.parseMediaType(defaultContentType));
+ }
+
+ httpHeaders.add("X-FromAppId", appName);
+ httpHeaders.add("X-TransactionId", UUID.randomUUID().toString());
+ headers.forEach(httpHeaders::add);
+ return httpHeaders;
+ }
+
+ @Override
+ public EELFLogger getLogger() {
+ return logger;
+ }
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/AAIConfigTranslator.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/AAIConfigTranslator.java
index 2cb0c99b..899a520d 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/setup/AAIConfigTranslator.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/AAIConfigTranslator.java
@@ -20,7 +20,10 @@
package org.onap.aai.setup;
import java.io.File;
-import java.util.*;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -43,7 +46,7 @@ public class AAIConfigTranslator extends ConfigTranslator {
*/
@Override
public Map<SchemaVersion, List<String>> getNodeFiles() {
-
+
Map<SchemaVersion, List<String>> files = new TreeMap<>();
for (SchemaVersion v : schemaVersions.getVersions()) {
List<String> container = getVersionNodeFiles(v);
@@ -55,7 +58,6 @@ public class AAIConfigTranslator extends ConfigTranslator {
private List<String> getVersionNodeFiles(SchemaVersion v) {
-
return getVersionFiles(
bean.getNodeDirectory(),
v,
@@ -99,7 +101,6 @@ public class AAIConfigTranslator extends ConfigTranslator {
List<String> container;
final String directoryName = startDirectory + FILESEP + schemaVersion.toString() + FILESEP;
-
container = Arrays.stream(new File(directoryName).listFiles())
.map(File::getName)
.filter(name -> inclusionPattern.get().anyMatch(name::matches))
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/ConfigTranslator.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/ConfigTranslator.java
index ccbe7065..4e6a6bdf 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/setup/ConfigTranslator.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/ConfigTranslator.java
@@ -20,25 +20,35 @@
package org.onap.aai.setup;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.apache.commons.io.IOUtils;
+import org.onap.aai.edges.JsonIngestor;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.io.*;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import org.springframework.beans.factory.annotation.Autowired;
-
/**
* Converts the contents of the schema config file
* (which lists which schema files to be loaded) to
* the format the Ingestors can work with.
*
*/
-public abstract class ConfigTranslator {
+public abstract class ConfigTranslator extends Translator{
+ private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(ConfigTranslator.class);
+
protected SchemaLocationsBean bean;
- protected SchemaVersions schemaVersions;
+
@Autowired
public ConfigTranslator(SchemaLocationsBean schemaLocationbean, SchemaVersions schemaVersions) {
+ super(schemaVersions);
this.bean = schemaLocationbean;
- this.schemaVersions = schemaVersions;
+
}
/**
@@ -49,6 +59,49 @@ public abstract class ConfigTranslator {
* ingested for that version
*/
public abstract Map<SchemaVersion, List<String>> getNodeFiles();
+
+ public List<InputStream> getVersionNodeStream(SchemaVersion version) {
+
+ Map<SchemaVersion, List<String>> filesToIngest = getNodeFiles();
+ List<InputStream> streams = new ArrayList<>();
+
+ if(!filesToIngest.containsKey(version)) {
+ return streams;
+ }
+ List<String> versionFiles = filesToIngest.get(version);
+
+ for (String name : versionFiles) {
+ try {
+ InputStream stream = new FileInputStream(new File(name));
+ String value = IOUtils.toString(stream, Charset.defaultCharset());
+ InputStream bis =(IOUtils.toInputStream(value, Charset.defaultCharset()));
+ streams.add(bis);
+ } catch (FileNotFoundException e) {
+ //TODO This may have to be cascaded
+ LOGGER.warn("File Not Found"+e.getMessage());
+ } catch (IOException e) {
+ LOGGER.warn("IOException while reading files"+e.getMessage());
+ }
+ }
+ return streams;
+ }
+
+ @Override
+ public List<String> getJsonPayload(SchemaVersion version) {
+ Map<SchemaVersion, List<String>> filesToIngest = getEdgeFiles();
+ List<String> jsonPayloads = new ArrayList<>();
+ if(!filesToIngest.containsKey(version)) {
+ return jsonPayloads;
+ }
+ List<String> versionFiles = filesToIngest.get(version);
+ JsonIngestor ji = new JsonIngestor();
+ for (String rulesFilename : versionFiles) {
+ jsonPayloads.add(ji.readInJsonFile(rulesFilename));
+
+ }
+
+ return jsonPayloads;
+ }
/**
* Translates the contents of the schema config file
@@ -59,7 +112,4 @@ public abstract class ConfigTranslator {
*/
public abstract Map<SchemaVersion, List<String>> getEdgeFiles();
- public SchemaVersions getSchemaVersions(){
- return schemaVersions;
- }
}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaLocationsBean.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaLocationsBean.java
index e3cd7236..9e740a8c 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaLocationsBean.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaLocationsBean.java
@@ -26,7 +26,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
-import java.util.Collections;
import java.util.List;
@Configuration
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaServiceTranslator.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaServiceTranslator.java
new file mode 100644
index 00000000..21082fa1
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaServiceTranslator.java
@@ -0,0 +1,105 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.setup;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.onap.aai.restclient.RestClient;
+import org.onap.aai.restclient.RestClientFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.io.Resource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+
+import javax.ws.rs.HttpMethod;
+import java.io.*;
+import java.util.*;
+
+/**
+ * <b>AAIConfigTranslator</b> is responsible for looking at the schema files and
+ * edge files based on the available versions Also has the ability to exclude
+ * them based on the node.exclusion.pattern
+ */
+public class SchemaServiceTranslator extends Translator {
+
+ private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(SchemaServiceTranslator.class);
+
+ private static final String SchemaServiceClientType = "schema.service";
+
+ @Value("${schema.service.nodes.endpoint}")
+ private String nodeSchemaUri;
+
+ @Value("${schema.service.edges.endpoint}")
+ private String edgeSchemaUri;
+
+ @Autowired
+ private RestClientFactory restClientFactory;
+
+ public SchemaServiceTranslator(SchemaVersions schemaVersions) {
+ super(schemaVersions);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.onap.aai.setup.ConfigTranslator#getNodeFiles()
+ */
+
+ @Override
+ public List<InputStream> getVersionNodeStream(SchemaVersion version) throws IOException {
+
+ List<InputStream> inputStreams = new ArrayList<>();
+ String content = "";
+ String uri = nodeSchemaUri + version.toString();
+ Map<String, String> headersMap = new HashMap<>();
+
+ headersMap.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML.toString());
+ headersMap.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML.toString());
+ RestClient restClient = restClientFactory.getRestClient(SchemaServiceClientType);
+ ResponseEntity<Resource> schemaResponse = restClient.getGetResource(content, uri,
+ headersMap);
+ LOGGER.debug("SchemaResponse Status code" + schemaResponse.getStatusCode());
+ inputStreams.add(schemaResponse.getBody().getInputStream());
+ return inputStreams;
+ }
+
+ @Override
+ public List<String> getJsonPayload(SchemaVersion version) throws IOException {
+ /*
+ * Call Schema MS to get versions using RestTemplate
+ */
+ List<String> inputStreams = new ArrayList<>();
+ String content = "";
+ String uri = edgeSchemaUri + version.toString();
+ Map<String, String> headersMap = new HashMap<>();
+
+ RestClient restClient = restClientFactory.getRestClient(SchemaServiceClientType);
+
+ ResponseEntity<String> schemaResponse = restClient.getGetRequest(content, uri,
+ headersMap);
+ LOGGER.debug("SchemaResponse Status code" + schemaResponse.getStatusCode());
+ inputStreams.add(schemaResponse.getBody());
+ return inputStreams;
+
+ }
+
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaServiceVersions.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaServiceVersions.java
new file mode 100644
index 00000000..6594f232
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaServiceVersions.java
@@ -0,0 +1,48 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-18 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.setup;
+
+import javax.annotation.PostConstruct;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class SchemaServiceVersions extends SchemaVersions {
+ private List<String> versions;
+ private String edgeVersion;
+ private String defaultVersion;
+ private String depthVersion;
+ private String appRootVersion;
+ private String relatedLinkVersion;
+ private String namespaceChangeVersion;
+
+
+ @PostConstruct
+ public void initializeFromSchemaService() {
+ versionsValue = versions.stream().map(SchemaVersion::new).collect(Collectors.toList());
+ edgeLabelVersionValue = new SchemaVersion(edgeVersion);
+ defaultVersionValue = new SchemaVersion(defaultVersion);
+ depthVersionValue = new SchemaVersion(depthVersion);
+ appRootVersionValue = new SchemaVersion(appRootVersion);
+ relatedLinkVersionValue = new SchemaVersion(relatedLinkVersion);
+ namespaceChangeVersionValue = new SchemaVersion(namespaceChangeVersion);
+ this.validate();
+ }
+
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersion.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersion.java
index c744c5a3..a1a40e69 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersion.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersion.java
@@ -21,7 +21,6 @@ package org.onap.aai.setup;
import org.onap.aai.validation.AAISchemaValidationException;
-import java.util.Comparator;
import java.util.regex.Pattern;
public class SchemaVersion implements Comparable<SchemaVersion> {
@@ -31,7 +30,6 @@ public class SchemaVersion implements Comparable<SchemaVersion> {
private final String value;
public SchemaVersion(String value){
-
if(!VERSION_PATTERN.matcher(value).matches()){
throw new AAISchemaValidationException("Invalid Schema Version " + value + ", value doesn't match the expected regex: " + VERSION_PATTERN);
}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersions.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersions.java
index 2205b14b..028ebdeb 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersions.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersions.java
@@ -2,13 +2,13 @@
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-18 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* 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
+ * 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,
@@ -25,7 +25,6 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
-import javax.xml.validation.Schema;
import java.util.List;
import java.util.stream.Collectors;
@@ -36,124 +35,99 @@ public class SchemaVersions {
@Value("#{'${schema.version.list}'.split(',')}")
private List<String> apiVersions;
-
@Value("${schema.version.api.default}")
private String defaultApiVersion;
-
@Value("${schema.version.edge.label.start}")
private String edgeLabelStartVersion;
-
@Value("${schema.version.depth.start}")
private String depthStartVersion;
-
@Value("${schema.version.app.root.start}")
private String appRootStartVersion;
-
@Value("${schema.version.related.link.start}")
private String relatedLinkStartVersion;
-
@Value("${schema.version.namespace.change.start}")
- private String namespaceChangeStartVersion;
- private List<SchemaVersion> versions;
-
- private SchemaVersion edgeLabelVersion;
- private SchemaVersion defaultVersion;
- private SchemaVersion depthVersion;
- private SchemaVersion appRootVersion;
- private SchemaVersion relatedLinkVersion;
- private SchemaVersion namespaceChangeVersion;
+ protected String namespaceChangeStartVersion;
+ protected List<SchemaVersion> versionsValue;
+ protected SchemaVersion edgeLabelVersionValue;
+ protected SchemaVersion defaultVersionValue;
+ protected SchemaVersion depthVersionValue;
+ protected SchemaVersion appRootVersionValue;
+ protected SchemaVersion relatedLinkVersionValue;
+ protected SchemaVersion namespaceChangeVersionValue;
@PostConstruct
public void initialize() {
- versions = apiVersions.stream().map(SchemaVersion::new).collect(Collectors.toList());
-
- edgeLabelVersion = new SchemaVersion(edgeLabelStartVersion);
- defaultVersion = new SchemaVersion(defaultApiVersion);
- depthVersion = new SchemaVersion(depthStartVersion);
- appRootVersion = new SchemaVersion(appRootStartVersion);
- relatedLinkVersion = new SchemaVersion(relatedLinkStartVersion);
- namespaceChangeVersion = new SchemaVersion(namespaceChangeStartVersion);
-
- if (!versions.contains(edgeLabelVersion)) {
- throw new AAISchemaValidationException(
- "Invalid, edge label version is not in the api versions list"
+ versionsValue = apiVersions.stream().map(SchemaVersion::new).collect(Collectors.toList());
+ edgeLabelVersionValue = new SchemaVersion(edgeLabelStartVersion);
+ defaultVersionValue = new SchemaVersion(defaultApiVersion);
+ depthVersionValue = new SchemaVersion(depthStartVersion);
+ appRootVersionValue = new SchemaVersion(appRootStartVersion);
+ relatedLinkVersionValue = new SchemaVersion(relatedLinkStartVersion);
+ namespaceChangeVersionValue = new SchemaVersion(namespaceChangeStartVersion);
+ this.validate();
+ }
+
+
+ protected void validate() {
+ String errorMessage = "Invalid, edge label version is not in the api versions list"
+ ", please check schema.version.list and ensure that the"
- + " schema.version.edge.label.start is in that list"
- );
+ + " schema.version.edge.label.start is in that list";
+ if (!versionsValue.contains(edgeLabelVersionValue)) {
+ throw new AAISchemaValidationException(errorMessage);
}
- if (!versions.contains(defaultVersion)) {
- throw new AAISchemaValidationException(
- "Invalid, default version is not in the api versions list"
- + ", please check schema.version.list and ensure that the"
- + " schema.version.api.default is in that list"
- );
+ if (!versionsValue.contains(defaultVersionValue)) {
+ throw new AAISchemaValidationException(errorMessage);
}
- if (!versions.contains(depthVersion)) {
- throw new AAISchemaValidationException(
- "Invalid, depth version is not in the api versions list"
- + ", please check schema.version.list and ensure that the"
- + " schema.version.depth.start is in that list"
- );
+ if (!versionsValue.contains(depthVersionValue)) {
+ throw new AAISchemaValidationException(errorMessage);
}
- if(!versions.contains(appRootVersion)){
- throw new AAISchemaValidationException(
- "Invalid, app root version is not in the api versions list"
- + ", please check schema.version.list and ensure that the"
- + " schema.version.app.root.start is in that list"
- );
+ if (!versionsValue.contains(appRootVersionValue)) {
+ throw new AAISchemaValidationException(errorMessage);
}
- if(!versions.contains(relatedLinkVersion)){
- throw new AAISchemaValidationException(
- "Invalid, related link version is not in the api versions list"
- + ", please check schema.version.list and ensure that the"
- + " schema.version.related.link.start is in that list"
- );
+ if (!versionsValue.contains(relatedLinkVersionValue)) {
+ throw new AAISchemaValidationException(errorMessage);
}
- if(!versions.contains(namespaceChangeVersion)){
- throw new AAISchemaValidationException(
- "Invalid, namespace change start version is not in the api versions list"
- + ", please check schema.version.list and ensure that the"
- + " schema.version.related.link.start is in that list"
- );
+ if (!versionsValue.contains(namespaceChangeVersionValue)) {
+ throw new AAISchemaValidationException(errorMessage);
}
}
-
+
public List<SchemaVersion> getVersions() {
- return versions;
+ return versionsValue;
}
public SchemaVersion getEdgeLabelVersion() {
- return edgeLabelVersion;
+ return edgeLabelVersionValue;
}
public SchemaVersion getDefaultVersion() {
- return defaultVersion;
+ return defaultVersionValue;
}
public SchemaVersion getDepthVersion() {
- return depthVersion;
+ return depthVersionValue;
}
- public SchemaVersion getAppRootVersion(){
- return appRootVersion;
+ public SchemaVersion getAppRootVersion() {
+ return appRootVersionValue;
}
- public SchemaVersion getRelatedLinkVersion(){
- return relatedLinkVersion;
+ public SchemaVersion getRelatedLinkVersion() {
+ return relatedLinkVersionValue;
}
public SchemaVersion getNamespaceChangeVersion() {
- return namespaceChangeVersion;
+ return namespaceChangeVersionValue;
}
public void setNamespaceChangeVersion(SchemaVersion namespaceChangeVersion) {
- this.namespaceChangeVersion = namespaceChangeVersion;
+ this.namespaceChangeVersionValue = namespaceChangeVersion;
}
}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersionsBean.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersionsBean.java
new file mode 100644
index 00000000..119669d3
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaVersionsBean.java
@@ -0,0 +1,83 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-18 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.setup;
+
+import com.google.gson.FieldNamingPolicy;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import org.onap.aai.restclient.RestClient;
+import org.onap.aai.restclient.RestClientFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
+
+import javax.annotation.PostConstruct;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SchemaVersionsBean {
+
+ private String SCHEMA_SERVICE = "schema-service";
+ private SchemaServiceVersions schemaVersions;
+
+ @Value("${schema.service.versions.endpoint}")
+ private String versionsUri;
+
+ @Autowired
+ private RestClientFactory restClientFactory;
+
+ @PostConstruct
+ public void initialize() {
+ //Call SchemaService to get versions
+ retrieveAllSchemaVersions();
+ }
+
+ public void retrieveAllSchemaVersions() {
+ /*
+ Call Schema MS to get versions using RestTemplate
+ */
+ String content = "";
+ Map<String, String> headersMap = new HashMap<>();
+ RestClient restClient = restClientFactory
+ .getRestClient(SCHEMA_SERVICE);
+
+ ResponseEntity<String> schemaResponse = restClient.getGetRequest( content, versionsUri, headersMap);
+ Gson gson = new GsonBuilder()
+ .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_DASHES)
+ .create();
+ schemaVersions = gson.fromJson(schemaResponse.getBody(), SchemaServiceVersions.class);
+ schemaVersions.initializeFromSchemaService();
+
+ }
+
+ public SchemaServiceVersions getSchemaVersions() {
+ return schemaVersions;
+ }
+
+ public void setSchemaVersions(SchemaServiceVersions schemaVersions) {
+ this.schemaVersions = schemaVersions;
+ }
+
+ public List<SchemaVersion> getVersions() {
+ return getSchemaVersions().getVersions();
+ }
+
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/Translator.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/Translator.java
new file mode 100644
index 00000000..09062e1c
--- /dev/null
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/Translator.java
@@ -0,0 +1,67 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-18 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.setup;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.io.*;
+import java.util.List;
+/**
+ * Converts the contents of the schema config file
+ * (which lists which schema files to be loaded) to
+ * the format the Ingestors can work with.
+ *
+ */
+public abstract class Translator {
+
+ protected SchemaVersions schemaVersions;
+
+ public Translator(SchemaVersions schemaVersions) {
+ this.schemaVersions = schemaVersions;
+ }
+
+ /**
+ * Translates the contents of the schema config file
+ * into the input for the NodeIngestor
+ *
+ * @return Map of Version to the list of (string) filenames to be
+ * ingested for that version
+ */
+
+
+ public abstract List<InputStream> getVersionNodeStream(SchemaVersion version) throws IOException;
+
+ public abstract List<String>
+ getJsonPayload(SchemaVersion version) throws IOException;
+
+ /**
+ * Translates the contents of the schema config file
+ * into the input for the EdgeIngestor
+ *
+ * @return Map of Version to the List of (String) filenames to be
+ * ingested for that version
+ */
+
+
+ public SchemaVersions getSchemaVersions(){
+ return this.schemaVersions;
+ }
+}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/DefaultVersionValidationModule.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/DefaultVersionValidationModule.java
index 7eae7508..36176587 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/DefaultVersionValidationModule.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/DefaultVersionValidationModule.java
@@ -38,39 +38,41 @@ import org.springframework.stereotype.Component;
*/
@Component
public class DefaultVersionValidationModule implements VersionValidationModule {
- private ConfigTranslator config;
-
+
+ private ConfigTranslator config;
+
@Autowired
public DefaultVersionValidationModule(ConfigTranslator config) {
- this.config = config;
+
+ this.config = config;
}
/* (non-Javadoc)
* @see org.onap.aai.validation.VersionValidationModule#validate(org.onap.aai.setup.ConfigTranslator)
*/
- @Override
- public String validate() {
- Map<SchemaVersion, List<String>> nodeConfig = config.getNodeFiles();
- Map<SchemaVersion, List<String>> edgeConfig = config.getEdgeFiles();
-
- StringBuilder missingVers = new StringBuilder().append("Missing schema for the following versions: ");
- boolean isMissing = false;
- for (SchemaVersion v : config.getSchemaVersions().getVersions()) {
- if (nodeConfig.get(v) == null) {
- isMissing = true;
- missingVers.append(v.toString()).append(" has no OXM configured. ");
- }
- if (edgeConfig.get(v) == null) {
- isMissing = true;
- missingVers.append(v.toString()).append(" has no edge rules configured. ");
- }
- }
-
- if (isMissing) {
- return missingVers.toString();
- } else {
- return "";
- }
- }
+ @Override
+ public String validate() {
+ Map<SchemaVersion, List<String>> nodeConfig = config.getNodeFiles();
+ Map<SchemaVersion, List<String>> edgeConfig = config.getEdgeFiles();
+
+ StringBuilder missingVers = new StringBuilder().append("Missing schema for the following versions: ");
+ boolean isMissing = false;
+ for (SchemaVersion v : config.getSchemaVersions().getVersions()) {
+ if (nodeConfig.get(v) == null) {
+ isMissing = true;
+ missingVers.append(v.toString()).append(" has no OXM configured. ");
+ }
+ if (edgeConfig.get(v) == null) {
+ isMissing = true;
+ missingVers.append(v.toString()).append(" has no edge rules configured. ");
+ }
+ }
+
+ if (isMissing) {
+ return missingVers.toString();
+ } else {
+ return "";
+ }
+ }
}
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/CousinDefaultingValidationModule.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/CousinDefaultingValidationModule.java
index 05b79753..d4ab7aeb 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/CousinDefaultingValidationModule.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/CousinDefaultingValidationModule.java
@@ -20,18 +20,13 @@
package org.onap.aai.validation.edges;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
+import com.jayway.jsonpath.DocumentContext;
import org.onap.aai.edges.EdgeRuleQuery;
import org.onap.aai.edges.EdgeRuleQuery.Builder;
import org.onap.aai.edges.enums.EdgeField;
import org.onap.aai.edges.enums.EdgeType;
-import com.jayway.jsonpath.DocumentContext;
+import java.util.*;
/**
* Validates that in the collection of cousin rules between a given node type pair,
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/DefaultEdgeFieldsValidationModule.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/DefaultEdgeFieldsValidationModule.java
index 01e9e296..9a7288b0 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/DefaultEdgeFieldsValidationModule.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/DefaultEdgeFieldsValidationModule.java
@@ -23,12 +23,11 @@
*/
package org.onap.aai.validation.edges;
+import org.onap.aai.edges.enums.EdgeField;
+
import java.util.EnumSet;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Set;
-
-import org.onap.aai.edges.enums.EdgeField;
/**
* Default core A&AI edge field validation
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/EdgeRuleValidator.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/EdgeRuleValidator.java
index 309d8945..38dcbb7e 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/EdgeRuleValidator.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/EdgeRuleValidator.java
@@ -20,22 +20,18 @@
package org.onap.aai.validation.edges;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
+import com.jayway.jsonpath.DocumentContext;
import org.onap.aai.edges.JsonIngestor;
import org.onap.aai.edges.TypeAlphabetizer;
import org.onap.aai.edges.enums.EdgeField;
+
import org.onap.aai.setup.ConfigTranslator;
import org.onap.aai.setup.SchemaVersion;
import org.onap.aai.validation.SchemaErrorStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import com.jayway.jsonpath.DocumentContext;
+import java.util.*;
/**
* Runs all validations against the ingested schema
@@ -49,21 +45,22 @@ public class EdgeRuleValidator {
protected final SingleContainmentValidationModule containsValidator;
protected final CousinDefaultingValidationModule defaultsValidator;
protected final NodeTypesValidationModule typeValidator;
-
- @Autowired
- public EdgeRuleValidator(ConfigTranslator config, SchemaErrorStrategy strat,
- EdgeFieldsValidationModule fieldValidator, UniqueLabelValidationModule labelValidator,
- SingleContainmentValidationModule containsValidator, CousinDefaultingValidationModule defaultsValidator,
- NodeTypesValidationModule typeValidator) {
- this.versionJsonFilesMap = new JsonIngestor().ingest(config.getEdgeFiles());
- this.strat = strat;
- this.fieldValidator = fieldValidator;
- this.labelValidator = labelValidator;
- this.containsValidator = containsValidator;
- this.defaultsValidator = defaultsValidator;
- this.typeValidator = typeValidator;
- }
-
+
+ @Autowired
+ public EdgeRuleValidator(ConfigTranslator config, SchemaErrorStrategy strat,
+ EdgeFieldsValidationModule fieldValidator, UniqueLabelValidationModule labelValidator,
+ SingleContainmentValidationModule containsValidator, CousinDefaultingValidationModule defaultsValidator,
+ NodeTypesValidationModule typeValidator) {
+ //TODO - Need to change this to use files/schemaservice
+ this.versionJsonFilesMap = new JsonIngestor().ingest(config.getEdgeFiles());
+ this.strat = strat;
+ this.fieldValidator = fieldValidator;
+ this.labelValidator = labelValidator;
+ this.containsValidator = containsValidator;
+ this.defaultsValidator = defaultsValidator;
+ this.typeValidator = typeValidator;
+ }
+
public boolean validate() {
for (Map.Entry<SchemaVersion, List<DocumentContext>> verEntry : versionJsonFilesMap.entrySet()) {
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/NodeTypesValidationModule.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/NodeTypesValidationModule.java
index b4ed3782..e8c45063 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/NodeTypesValidationModule.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/NodeTypesValidationModule.java
@@ -20,15 +20,16 @@
package org.onap.aai.validation.edges;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
import org.onap.aai.nodes.NodeIngestor;
import org.onap.aai.setup.SchemaVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
/**
* Validates that the node types appearing in the edge rules are valid
* against the ingested OXM.
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/SingleContainmentValidationModule.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/SingleContainmentValidationModule.java
index 4586ccce..ad2cffeb 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/SingleContainmentValidationModule.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/SingleContainmentValidationModule.java
@@ -20,14 +20,13 @@
package org.onap.aai.validation.edges;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
+import com.jayway.jsonpath.DocumentContext;
import org.onap.aai.edges.EdgeRuleQuery;
import org.onap.aai.edges.enums.EdgeType;
-import com.jayway.jsonpath.DocumentContext;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
/**
* Validates that the given node type pair has at most one containment relationship
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/UniqueLabelValidationModule.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/UniqueLabelValidationModule.java
index 103baaba..35d74667 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/UniqueLabelValidationModule.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/edges/UniqueLabelValidationModule.java
@@ -20,17 +20,12 @@
package org.onap.aai.validation.edges;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
+import com.jayway.jsonpath.DocumentContext;
import org.onap.aai.edges.EdgeRuleQuery;
import org.onap.aai.edges.EdgeRuleQuery.Builder;
import org.onap.aai.edges.enums.EdgeField;
-import com.jayway.jsonpath.DocumentContext;
+import java.util.*;
/**
* Applies label validation rules
diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/validation/nodes/NodeValidator.java b/aai-schema-ingest/src/main/java/org/onap/aai/validation/nodes/NodeValidator.java
index 27a69f9b..38b3a70c 100644
--- a/aai-schema-ingest/src/main/java/org/onap/aai/validation/nodes/NodeValidator.java
+++ b/aai-schema-ingest/src/main/java/org/onap/aai/validation/nodes/NodeValidator.java
@@ -31,13 +31,14 @@ import org.springframework.stereotype.Component;
@Component
public class NodeValidator {
- private ConfigTranslator translator;
+
+ private ConfigTranslator translator;
private SchemaErrorStrategy strat;
private DuplicateNodeDefinitionValidationModule dupChecker;
@Autowired
- public NodeValidator(ConfigTranslator translator, SchemaErrorStrategy strategy, DuplicateNodeDefinitionValidationModule dupChecker) {
- this.translator = translator;
+ public NodeValidator( ConfigTranslator translator, SchemaErrorStrategy strategy, DuplicateNodeDefinitionValidationModule dupChecker) {
+ this.translator = translator;
this.strat = strategy;
this.dupChecker = dupChecker;
}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorLocalTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorLocalTest.java
new file mode 100644
index 00000000..3ed7bb79
--- /dev/null
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorLocalTest.java
@@ -0,0 +1,369 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-18 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.edges;
+
+import com.google.common.collect.Multimap;
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.onap.aai.restclient.MockProvider;
+import org.onap.aai.config.EdgesConfiguration;
+import org.onap.aai.edges.enums.AAIDirection;
+import org.onap.aai.edges.enums.MultiplicityRule;
+import org.onap.aai.edges.exceptions.AmbiguousRuleChoiceException;
+import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException;
+import org.onap.aai.setup.SchemaLocationsBean;
+import org.onap.aai.setup.SchemaVersion;
+import org.onap.aai.testutils.TestUtilConfigTranslator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import java.util.Collection;
+
+import static org.junit.Assert.*;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = { EdgesConfiguration.class, TestUtilConfigTranslator.class})
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties" })
+
+@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
+//@TestPropertySource(locations = "/schema-service-rest.properties" )
+@SpringBootTest
+public class EdgeIngestorLocalTest {
+ @Autowired
+ EdgeIngestor edgeIngestor;
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ @Test
+ public void getRulesTest1() throws EdgeRuleNotFoundException {
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo").build();
+ Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
+ assertTrue(results.size() == 5);
+ assertTrue(results.containsKey("bar|foo"));
+
+ assertTrue(2 == results.get("bar|foo").size());
+ boolean seenLabel1 = false;
+ boolean seenLabel2 = false;
+ for(EdgeRule r : results.get("bar|foo")) {
+ if ("eats".equals(r.getLabel())) {
+ seenLabel1 = true;
+ }
+ if ("eatz".equals(r.getLabel())) {
+ seenLabel2 = true;
+ }
+ }
+ assertTrue(seenLabel1 && seenLabel2);
+
+ assertTrue(results.containsKey("baz|foo"));
+ assertTrue(results.containsKey("foo|quux"));
+ assertTrue(results.containsKey("dog|foo"));
+ }
+
+ @Test
+ public void getRulesTest2() throws EdgeRuleNotFoundException {
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("dog", "puppy").build();
+ Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
+ assertTrue(results.size() == 1);
+ assertTrue(results.containsKey("dog|puppy"));
+ Collection<EdgeRule> cr = results.get("dog|puppy");
+ for (EdgeRule r : cr) {
+ assertTrue("dog".equals(r.getFrom()));
+ assertTrue("puppy".equals(r.getTo()));
+ assertTrue("caresFor".equals(r.getLabel()));
+ assertTrue(Direction.OUT.equals(r.getDirection()));
+ assertTrue("One2Many".equalsIgnoreCase(r.getMultiplicityRule().toString()));
+ assertTrue("NONE".equals(r.getContains()));
+ assertTrue("OUT".equals(r.getDeleteOtherV()));
+ assertTrue("NONE".equals(r.getPreventDelete()));
+ assertTrue(r.isDefault());
+ }
+ }
+
+ @Test
+ public void getRulesFlippedTypesTest() throws EdgeRuleNotFoundException {
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface", "logical-link").version(new SchemaVersion("v11")).build();
+ Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
+ assertTrue(results.size() == 3);
+ for (EdgeRule r : results.get("l-interface|logical-link")) {
+ if ("org.onap.relationships.inventory.Source".equals(r.getLabel()) ||
+ "org.onap.relationships.inventory.Destination".equals(r.getLabel())) {
+ //these are defined with from=logical-link, to=l-interface, so they must be flipped
+ assertTrue(Direction.IN.equals(r.getDirection()));
+ } else if ("tosca.relationships.network.LinksTo".equals(r.getLabel())) {
+ //this is defined with from=l-interface, to=logical-link, so it shouldn't be flipped
+ assertTrue(Direction.OUT.equals(r.getDirection()));
+ } else {
+ fail("how did you get here");
+ }
+ }
+ }
+
+ @Test
+ public void fromToSameFlipTests() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+ //getRules, setting from and to
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("bloop","bloop").version(new SchemaVersion("v11")).build();
+ Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
+ assertTrue(results.size() == 1);
+ for (EdgeRule r : results.get("bloop|bloop")) {
+ assertTrue(Direction.IN.equals(r.getDirection()));
+ }
+
+ //getRule, setting just from
+ EdgeRuleQuery q2 = new EdgeRuleQuery.Builder("bloop").version(new SchemaVersion("v11")).build();
+ assertTrue(Direction.IN.equals(edgeIngestor.getRule(q2).getDirection()));
+
+ //getChildRules
+ Multimap<String, EdgeRule> child = edgeIngestor.getChildRules("bloop", new SchemaVersion("v11"));
+ assertTrue(child.size() == 1);
+ for (EdgeRule r : child.get("bloop|bloop")) {
+ assertTrue(Direction.IN.equals(r.getDirection()));
+ }
+ }
+
+ @Test
+ public void getRulesTest3() throws EdgeRuleNotFoundException {
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface").version(new SchemaVersion("v11")).build();
+ Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
+ assertTrue(results.size() == 4);
+ assertTrue(results.containsKey("lag-interface|l-interface"));
+ assertTrue(results.containsKey("l-interface|logical-link"));
+ assertTrue(results.get("l-interface|logical-link").size() == 3);
+ }
+
+ @Test
+ public void getRulesNoneFound() throws EdgeRuleNotFoundException {
+ thrown.expect(EdgeRuleNotFoundException.class);
+ thrown.expectMessage("No rules found for");
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface").build();
+ edgeIngestor.getRules(q);
+ }
+
+ @Test
+ public void getRuleSimpleTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("parent", "notation").build();
+ EdgeRule result = edgeIngestor.getRule(q);
+ assertTrue("parent".equals(result.getFrom()));
+ assertTrue("notation".equals(result.getTo()));
+ assertTrue("has".equals(result.getLabel()));
+ assertTrue(Direction.OUT.equals(result.getDirection()));
+ assertTrue(MultiplicityRule.MANY2MANY.equals(result.getMultiplicityRule()));
+ assertTrue(AAIDirection.OUT.toString().equals(result.getContains()));
+ assertTrue(AAIDirection.NONE.toString().equals(result.getDeleteOtherV()));
+ assertTrue(AAIDirection.NONE.toString().equals(result.getPreventDelete()));
+ assertTrue("parent contains notation".equals(result.getDescription()));
+ }
+
+ @Test
+ public void getRuleFlippedTypesTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("notation", "parent").build();
+ EdgeRule result = edgeIngestor.getRule(q);
+ assertTrue("parent".equals(result.getFrom()));
+ assertTrue("notation".equals(result.getTo()));
+ assertTrue("has".equals(result.getLabel()));
+ //direction flipped to match input order per old EdgeRules.java API
+ assertTrue(Direction.IN.equals(result.getDirection()));
+ assertTrue(MultiplicityRule.MANY2MANY.equals(result.getMultiplicityRule()));
+ assertTrue(AAIDirection.OUT.toString().equals(result.getContains()));
+ assertTrue(AAIDirection.NONE.toString().equals(result.getDeleteOtherV()));
+ assertTrue(AAIDirection.NONE.toString().equals(result.getPreventDelete()));
+ assertTrue("parent contains notation".equals(result.getDescription()));
+ }
+
+// @Test
+// public void getRuleWithDefaultTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+//
+// EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface","logical-link").version(new SchemaVersion("v11")).build();
+// EdgeRule res = edgeIngestor.getRule(q);
+// assertTrue(res.isDefault());
+// assertTrue("tosca.relationships.network.LinksTo".equals(res.getLabel()));
+// }
+//
+// @Test
+// public void getRuleWithNonDefault() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+// EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface","logical-link").label("org.onap.relationships.inventory.Source").version(new SchemaVersion("v11")).build();
+// EdgeRule res = edgeIngestor.getRule(q);
+// assertFalse(res.isDefault());
+// assertTrue("org.onap.relationships.inventory.Source".equals(res.getLabel()));
+// }
+
+ @Test
+ public void getRuleNoneFoundTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+ thrown.expect(EdgeRuleNotFoundException.class);
+ thrown.expectMessage("No rule found for");
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface","nonexistent").build();
+ edgeIngestor.getRule(q);
+ }
+
+// @Test
+// public void getRuleTooManyPairsTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+// thrown.expect(AmbiguousRuleChoiceException.class);
+// thrown.expectMessage("No way to select single rule from these pairs:");
+// EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo").build();
+// edgeIngestor.getRule(q);
+// }
+
+ @Test
+ public void getRuleAmbiguousDefaultTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+ thrown.expect(AmbiguousRuleChoiceException.class);
+ thrown.expectMessage("Multiple defaults found.");
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("seed","plant").version(new SchemaVersion("v11")).build();
+ edgeIngestor.getRule(q);
+ }
+
+ @Test
+ public void getRuleNoDefaultTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+ thrown.expect(AmbiguousRuleChoiceException.class);
+ thrown.expectMessage("No default found.");
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("apple", "orange").version(new SchemaVersion("v11")).build();
+ edgeIngestor.getRule(q);
+ }
+
+// @Test
+// public void hasRuleTest() {
+// assertTrue(edgeIngestor.hasRule(new EdgeRuleQuery.Builder("l-interface").version(new SchemaVersion("v11")).build()));
+// assertFalse(edgeIngestor.hasRule(new EdgeRuleQuery.Builder("l-interface").build()));
+// }
+//
+// @Test
+// public void getCousinRulesTest() {
+// Multimap<String, EdgeRule> results = edgeIngestor.getCousinRules("dog");
+// assertTrue(results.size() == 2);
+// assertTrue(results.containsKey("dog|puppy"));
+// assertTrue(results.containsKey("dog|foo"));
+// }
+
+ @Test
+ public void getCousinRulesWithVersionTest() {
+ Multimap<String, EdgeRule> results = edgeIngestor.getCousinRules("foo", new SchemaVersion("v10"));
+ assertTrue(results.size() == 2);
+ assertTrue(results.containsKey("bar|foo"));
+ assertTrue(results.get("bar|foo").size() == 2);
+ }
+
+ @Test
+ public void getCousinsNoneInVersionTest() {
+ Multimap<String, EdgeRule> results = edgeIngestor.getCousinRules("foo", new SchemaVersion("v11"));
+ assertTrue(results.isEmpty());
+ }
+
+// @Test
+// public void hasCousinTest() {
+// assertTrue(edgeIngestor.hasCousinRule("foo"));
+// assertTrue(edgeIngestor.hasCousinRule("foo", new SchemaVersion("v10")));
+// assertFalse(edgeIngestor.hasCousinRule("parent"));
+// assertFalse(edgeIngestor.hasCousinRule("foo", new SchemaVersion("v11")));
+// }
+
+ @Test
+ public void getChildRulesTest() {
+ Multimap<String, EdgeRule> results = edgeIngestor.getChildRules("parent");
+ assertTrue(results.size() == 6);
+ assertTrue(results.containsKey("notation|parent"));
+ assertTrue(results.containsKey("not-notation|parent"));
+ assertTrue(results.containsKey("out-out|parent"));
+ assertTrue(results.containsKey("in-in|parent"));
+ assertTrue(results.containsKey("in-out|parent"));
+ assertTrue(results.containsKey("out-in|parent"));
+ }
+
+ @Test
+ public void getChildRulesWithVersionTest() {
+ Multimap<String, EdgeRule> results = edgeIngestor.getChildRules("foo", new SchemaVersion("v10"));
+ assertTrue(results.size() == 2);
+ assertTrue(results.containsKey("baz|foo"));
+ assertTrue(results.containsKey("foo|quux"));
+ }
+
+ @Test
+ public void getChildRulesNoneInVersionTest() {
+ Multimap<String, EdgeRule> results = edgeIngestor.getChildRules("foo", new SchemaVersion("v11"));
+ assertTrue(results.isEmpty());
+ }
+
+// @Test
+// public void hasChildTest() {
+// assertTrue(edgeIngestor.hasChildRule("foo"));
+// assertTrue(edgeIngestor.hasChildRule("foo", new SchemaVersion("v10")));
+// assertFalse(edgeIngestor.hasChildRule("puppy"));
+// assertFalse(edgeIngestor.hasChildRule("foo", new SchemaVersion("v11")));
+// }
+
+ @Test
+ public void getParentRulesTest() {
+ Multimap<String, EdgeRule> results = edgeIngestor.getParentRules("parent");
+ assertTrue(results.size() == 6);
+ assertTrue(results.containsKey("grandparent1|parent"));
+ assertTrue(results.containsKey("grandparent2|parent"));
+ assertTrue(results.containsKey("grandparent3|parent"));
+ assertTrue(results.containsKey("grandparent4|parent"));
+ assertTrue(results.containsKey("grandparent5|parent"));
+ assertTrue(results.containsKey("grandparent6|parent"));
+ }
+
+ @Test
+ public void getParentRulesWithVersionTest() {
+ Multimap<String, EdgeRule> results = edgeIngestor.getParentRules("baz", new SchemaVersion("v10"));
+ assertTrue(results.size() == 1);
+ assertTrue(results.containsKey("baz|foo"));
+ }
+
+ @Test
+ public void getParentRulesNoneInVersionTest() {
+ Multimap<String, EdgeRule> results = edgeIngestor.getParentRules("baz", new SchemaVersion("v11"));
+ assertTrue(results.isEmpty());
+ }
+
+ @Test
+ public void hasParentTest() {
+ assertTrue(edgeIngestor.hasParentRule("parent"));
+ assertTrue(edgeIngestor.hasParentRule("quux", new SchemaVersion("v10")));
+ assertFalse(edgeIngestor.hasParentRule("puppy"));
+ assertFalse(edgeIngestor.hasParentRule("foo", new SchemaVersion("v11")));
+ }
+
+// @Test
+// public void getAllCurrentRulesTest() throws EdgeRuleNotFoundException {
+// Multimap<String, EdgeRule> res = edgeIngestor.getAllCurrentRules();
+// assertTrue(res.size() == 18);
+// }
+
+ @Test
+ public void getAllRulesTest() throws EdgeRuleNotFoundException {
+ Multimap<String, EdgeRule> res = edgeIngestor.getAllRules(new SchemaVersion("v10"));
+ assertTrue(res.size() == 4);
+ assertTrue(res.containsKey("bar|foo"));
+ assertTrue(res.get("bar|foo").size() == 2);
+ assertTrue(res.containsKey("baz|foo"));
+ assertTrue(res.containsKey("foo|quux"));
+
+ thrown.expect(EdgeRuleNotFoundException.class);
+ thrown.expectMessage("No rules found for version v9.");
+ edgeIngestor.getAllRules(new SchemaVersion("v9"));
+ }
+}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java
index 6292da71..ab83e196 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java
@@ -1,4 +1,4 @@
-/**
+/**
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
@@ -25,20 +25,22 @@ import static org.junit.Assert.*;
import java.util.Collection;
import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
+import org.onap.aai.restclient.MockProvider;
+import org.onap.aai.restclient.MockRestClient;
+import org.onap.aai.config.EdgesConfiguration;
import org.onap.aai.edges.enums.AAIDirection;
import org.onap.aai.edges.enums.MultiplicityRule;
import org.onap.aai.edges.exceptions.AmbiguousRuleChoiceException;
import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException;
-import org.onap.aai.setup.SchemaLocationsBean;
import org.onap.aai.setup.SchemaVersion;
-import org.onap.aai.setup.SchemaVersions;
-import org.onap.aai.testutils.TestUtilConfigTranslator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -46,23 +48,29 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.google.common.collect.Multimap;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, TestUtilConfigTranslator.class, EdgeIngestor.class})
+@ContextConfiguration(classes = {MockProvider.class, EdgesConfiguration.class})
@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties" })
+
+@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
@SpringBootTest
public class EdgeIngestorTest {
@Autowired
- EdgeIngestor ei;
-
+ EdgeIngestor edgeIngestor;
+
@Rule
public ExpectedException thrown = ExpectedException.none();
-
+
@Test
public void getRulesTest1() throws EdgeRuleNotFoundException {
EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo").build();
- Multimap<String, EdgeRule> results = ei.getRules(q);
+ Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
+ System.out.println(results.size());
+ for (String key : results.keySet()) {
+ System.out.println(key);
+ }
assertTrue(results.size() == 5);
assertTrue(results.containsKey("bar|foo"));
-
+
assertTrue(2 == results.get("bar|foo").size());
boolean seenLabel1 = false;
boolean seenLabel2 = false;
@@ -75,16 +83,16 @@ public class EdgeIngestorTest {
}
}
assertTrue(seenLabel1 && seenLabel2);
-
+
assertTrue(results.containsKey("baz|foo"));
assertTrue(results.containsKey("foo|quux"));
assertTrue(results.containsKey("dog|foo"));
}
-
+
@Test
public void getRulesTest2() throws EdgeRuleNotFoundException {
EdgeRuleQuery q = new EdgeRuleQuery.Builder("dog", "puppy").build();
- Multimap<String, EdgeRule> results = ei.getRules(q);
+ Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
assertTrue(results.size() == 1);
assertTrue(results.containsKey("dog|puppy"));
Collection<EdgeRule> cr = results.get("dog|puppy");
@@ -100,11 +108,11 @@ public class EdgeIngestorTest {
assertTrue(r.isDefault());
}
}
-
+
@Test
public void getRulesFlippedTypesTest() throws EdgeRuleNotFoundException {
EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface", "logical-link").version(new SchemaVersion("v11")).build();
- Multimap<String, EdgeRule> results = ei.getRules(q);
+ Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
assertTrue(results.size() == 3);
for (EdgeRule r : results.get("l-interface|logical-link")) {
if ("org.onap.relationships.inventory.Source".equals(r.getLabel()) ||
@@ -119,51 +127,51 @@ public class EdgeIngestorTest {
}
}
}
-
+
@Test
public void fromToSameFlipTests() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
//getRules, setting from and to
EdgeRuleQuery q = new EdgeRuleQuery.Builder("bloop","bloop").version(new SchemaVersion("v11")).build();
- Multimap<String, EdgeRule> results = ei.getRules(q);
+ Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
assertTrue(results.size() == 1);
for (EdgeRule r : results.get("bloop|bloop")) {
assertTrue(Direction.IN.equals(r.getDirection()));
}
-
+
//getRule, setting just from
EdgeRuleQuery q2 = new EdgeRuleQuery.Builder("bloop").version(new SchemaVersion("v11")).build();
- assertTrue(Direction.IN.equals(ei.getRule(q2).getDirection()));
-
+ assertTrue(Direction.IN.equals(edgeIngestor.getRule(q2).getDirection()));
+
//getChildRules
- Multimap<String, EdgeRule> child = ei.getChildRules("bloop", new SchemaVersion("v11"));
+ Multimap<String, EdgeRule> child = edgeIngestor.getChildRules("bloop", new SchemaVersion("v11"));
assertTrue(child.size() == 1);
for (EdgeRule r : child.get("bloop|bloop")) {
assertTrue(Direction.IN.equals(r.getDirection()));
}
}
-
+
@Test
public void getRulesTest3() throws EdgeRuleNotFoundException {
EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface").version(new SchemaVersion("v11")).build();
- Multimap<String, EdgeRule> results = ei.getRules(q);
+ Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
assertTrue(results.size() == 4);
assertTrue(results.containsKey("lag-interface|l-interface"));
assertTrue(results.containsKey("l-interface|logical-link"));
assertTrue(results.get("l-interface|logical-link").size() == 3);
}
-
+
@Test
public void getRulesNoneFound() throws EdgeRuleNotFoundException {
thrown.expect(EdgeRuleNotFoundException.class);
thrown.expectMessage("No rules found for");
- EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface").build();
- ei.getRules(q);
+ EdgeRuleQuery q = new EdgeRuleQuery.Builder("bogus-value").build();
+ edgeIngestor.getRules(q);
}
-
+
@Test
public void getRuleSimpleTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
EdgeRuleQuery q = new EdgeRuleQuery.Builder("parent", "notation").build();
- EdgeRule result = ei.getRule(q);
+ EdgeRule result = edgeIngestor.getRule(q);
assertTrue("parent".equals(result.getFrom()));
assertTrue("notation".equals(result.getTo()));
assertTrue("has".equals(result.getLabel()));
@@ -174,11 +182,30 @@ public class EdgeIngestorTest {
assertTrue(AAIDirection.NONE.toString().equals(result.getPreventDelete()));
assertTrue("parent contains notation".equals(result.getDescription()));
}
-
+// @Test
+// public void getRuleSimpleTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
+// EdgeRuleQuery q = new EdgeRuleQuery.Builder("parent", "notation").build();
+// Multimap<String, EdgeRule> results = edgeIngestor.getRules(q);
+// assertTrue(results.size() == 1);
+// // EdgeRule result = edgeIngestor.getRule(q);
+// for (EdgeRule result : results.get("parent|notation")) {
+// assertTrue("parent".equals(result.getFrom()));
+// assertTrue("notation".equals(result.getTo()));
+// assertTrue("has".equals(result.getLabel()));
+// assertTrue(Direction.OUT.equals(result.getDirection()));
+// assertTrue(MultiplicityRule.MANY2MANY.equals(result.getMultiplicityRule()));
+// assertTrue(AAIDirection.OUT.toString().equals(result.getContains()));
+// assertTrue(AAIDirection.NONE.toString().equals(result.getDeleteOtherV()));
+// assertTrue(AAIDirection.NONE.toString().equals(result.getPreventDelete()));
+// assertTrue("parent contains notation".equals(result.getDescription()));
+// }
+// }
+
+
@Test
public void getRuleFlippedTypesTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
EdgeRuleQuery q = new EdgeRuleQuery.Builder("notation", "parent").build();
- EdgeRule result = ei.getRule(q);
+ EdgeRule result = edgeIngestor.getRule(q);
assertTrue("parent".equals(result.getFrom()));
assertTrue("notation".equals(result.getTo()));
assertTrue("has".equals(result.getLabel()));
@@ -190,95 +217,97 @@ public class EdgeIngestorTest {
assertTrue(AAIDirection.NONE.toString().equals(result.getPreventDelete()));
assertTrue("parent contains notation".equals(result.getDescription()));
}
-
+
@Test
public void getRuleWithDefaultTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface","logical-link").version(new SchemaVersion("v11")).build();
- EdgeRule res = ei.getRule(q);
+ EdgeRule res = edgeIngestor.getRule(q);
assertTrue(res.isDefault());
assertTrue("tosca.relationships.network.LinksTo".equals(res.getLabel()));
}
-
+
@Test
public void getRuleWithNonDefault() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface","logical-link").label("org.onap.relationships.inventory.Source").version(new SchemaVersion("v11")).build();
- EdgeRule res = ei.getRule(q);
+ EdgeRule res = edgeIngestor.getRule(q);
assertFalse(res.isDefault());
assertTrue("org.onap.relationships.inventory.Source".equals(res.getLabel()));
}
-
+
@Test
public void getRuleNoneFoundTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
thrown.expect(EdgeRuleNotFoundException.class);
thrown.expectMessage("No rule found for");
EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface","nonexistent").build();
- ei.getRule(q);
+ edgeIngestor.getRule(q);
}
-
+
@Test
public void getRuleTooManyPairsTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
thrown.expect(AmbiguousRuleChoiceException.class);
thrown.expectMessage("No way to select single rule from these pairs:");
EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo").build();
- ei.getRule(q);
+ edgeIngestor.getRule(q);
}
-
+
@Test
public void getRuleAmbiguousDefaultTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
thrown.expect(AmbiguousRuleChoiceException.class);
thrown.expectMessage("Multiple defaults found.");
EdgeRuleQuery q = new EdgeRuleQuery.Builder("seed","plant").version(new SchemaVersion("v11")).build();
- ei.getRule(q);
+ edgeIngestor.getRule(q);
}
-
+
@Test
public void getRuleNoDefaultTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException {
thrown.expect(AmbiguousRuleChoiceException.class);
thrown.expectMessage("No default found.");
EdgeRuleQuery q = new EdgeRuleQuery.Builder("apple", "orange").version(new SchemaVersion("v11")).build();
- ei.getRule(q);
+ edgeIngestor.getRule(q);
}
-
+
@Test
public void hasRuleTest() {
- assertTrue(ei.hasRule(new EdgeRuleQuery.Builder("l-interface").version(new SchemaVersion("v11")).build()));
- assertFalse(ei.hasRule(new EdgeRuleQuery.Builder("l-interface").build()));
+ assertTrue(edgeIngestor.hasRule(new EdgeRuleQuery.Builder("l-interface").version(new SchemaVersion("v11")).build()));
+ assertFalse(edgeIngestor.hasRule(new EdgeRuleQuery.Builder("l-interface").version(new SchemaVersion("v10")).build()));
+ assertTrue(edgeIngestor.hasRule(new EdgeRuleQuery.Builder("l-interface").build()));
+// assertFalse(edgeIngestor.hasRule(new EdgeRuleQuery.Builder("l-interface").build()));
}
-
+
@Test
public void getCousinRulesTest() {
- Multimap<String, EdgeRule> results = ei.getCousinRules("dog");
+ Multimap<String, EdgeRule> results = edgeIngestor.getCousinRules("dog");
assertTrue(results.size() == 2);
assertTrue(results.containsKey("dog|puppy"));
assertTrue(results.containsKey("dog|foo"));
}
-
+
@Test
public void getCousinRulesWithVersionTest() {
- Multimap<String, EdgeRule> results = ei.getCousinRules("foo", new SchemaVersion("v10"));
+ Multimap<String, EdgeRule> results = edgeIngestor.getCousinRules("foo", new SchemaVersion("v10"));
assertTrue(results.size() == 2);
assertTrue(results.containsKey("bar|foo"));
assertTrue(results.get("bar|foo").size() == 2);
}
-
+
@Test
public void getCousinsNoneInVersionTest() {
- Multimap<String, EdgeRule> results = ei.getCousinRules("foo", new SchemaVersion("v11"));
+ Multimap<String, EdgeRule> results = edgeIngestor.getCousinRules("foo", new SchemaVersion("v11"));
assertTrue(results.isEmpty());
}
-
+
@Test
public void hasCousinTest() {
- assertTrue(ei.hasCousinRule("foo"));
- assertTrue(ei.hasCousinRule("foo", new SchemaVersion("v10")));
- assertFalse(ei.hasCousinRule("parent"));
- assertFalse(ei.hasCousinRule("foo", new SchemaVersion("v11")));
+ assertTrue(edgeIngestor.hasCousinRule("foo"));
+ assertTrue(edgeIngestor.hasCousinRule("foo", new SchemaVersion("v10")));
+ assertFalse(edgeIngestor.hasCousinRule("parent"));
+ assertFalse(edgeIngestor.hasCousinRule("foo", new SchemaVersion("v11")));
}
@Test
public void getChildRulesTest() {
- Multimap<String, EdgeRule> results = ei.getChildRules("parent");
+ Multimap<String, EdgeRule> results = edgeIngestor.getChildRules("parent");
assertTrue(results.size() == 6);
assertTrue(results.containsKey("notation|parent"));
assertTrue(results.containsKey("not-notation|parent"));
@@ -287,32 +316,32 @@ public class EdgeIngestorTest {
assertTrue(results.containsKey("in-out|parent"));
assertTrue(results.containsKey("out-in|parent"));
}
-
+
@Test
public void getChildRulesWithVersionTest() {
- Multimap<String, EdgeRule> results = ei.getChildRules("foo", new SchemaVersion("v10"));
+ Multimap<String, EdgeRule> results = edgeIngestor.getChildRules("foo", new SchemaVersion("v10"));
assertTrue(results.size() == 2);
assertTrue(results.containsKey("baz|foo"));
assertTrue(results.containsKey("foo|quux"));
}
-
+
@Test
public void getChildRulesNoneInVersionTest() {
- Multimap<String, EdgeRule> results = ei.getChildRules("foo", new SchemaVersion("v11"));
+ Multimap<String, EdgeRule> results = edgeIngestor.getChildRules("foo", new SchemaVersion("v11"));
assertTrue(results.isEmpty());
}
-
+
@Test
public void hasChildTest() {
- assertTrue(ei.hasChildRule("foo"));
- assertTrue(ei.hasChildRule("foo", new SchemaVersion("v10")));
- assertFalse(ei.hasChildRule("puppy"));
- assertFalse(ei.hasChildRule("foo", new SchemaVersion("v11")));
+ assertTrue(edgeIngestor.hasChildRule("foo"));
+ assertTrue(edgeIngestor.hasChildRule("foo", new SchemaVersion("v10")));
+ assertFalse(edgeIngestor.hasChildRule("puppy"));
+ assertFalse(edgeIngestor.hasChildRule("foo", new SchemaVersion("v11")));
}
-
+
@Test
public void getParentRulesTest() {
- Multimap<String, EdgeRule> results = ei.getParentRules("parent");
+ Multimap<String, EdgeRule> results = edgeIngestor.getParentRules("parent");
assertTrue(results.size() == 6);
assertTrue(results.containsKey("grandparent1|parent"));
assertTrue(results.containsKey("grandparent2|parent"));
@@ -321,45 +350,45 @@ public class EdgeIngestorTest {
assertTrue(results.containsKey("grandparent5|parent"));
assertTrue(results.containsKey("grandparent6|parent"));
}
-
+
@Test
public void getParentRulesWithVersionTest() {
- Multimap<String, EdgeRule> results = ei.getParentRules("baz", new SchemaVersion("v10"));
+ Multimap<String, EdgeRule> results = edgeIngestor.getParentRules("baz", new SchemaVersion("v10"));
assertTrue(results.size() == 1);
assertTrue(results.containsKey("baz|foo"));
}
-
+
@Test
public void getParentRulesNoneInVersionTest() {
- Multimap<String, EdgeRule> results = ei.getParentRules("baz", new SchemaVersion("v11"));
+ Multimap<String, EdgeRule> results = edgeIngestor.getParentRules("baz", new SchemaVersion("v11"));
assertTrue(results.isEmpty());
}
-
+
@Test
public void hasParentTest() {
- assertTrue(ei.hasParentRule("parent"));
- assertTrue(ei.hasParentRule("quux", new SchemaVersion("v10")));
- assertFalse(ei.hasParentRule("puppy"));
- assertFalse(ei.hasParentRule("foo", new SchemaVersion("v11")));
+ assertTrue(edgeIngestor.hasParentRule("parent"));
+ assertTrue(edgeIngestor.hasParentRule("quux", new SchemaVersion("v10")));
+ assertFalse(edgeIngestor.hasParentRule("puppy"));
+ assertFalse(edgeIngestor.hasParentRule("foo", new SchemaVersion("v11")));
}
-
+
@Test
public void getAllCurrentRulesTest() throws EdgeRuleNotFoundException {
- Multimap<String, EdgeRule> res = ei.getAllCurrentRules();
- assertTrue(res.size() == 18);
+ Multimap<String, EdgeRule> res = edgeIngestor.getAllCurrentRules();
+ assertTrue(res.size() == 24);
}
-
+
@Test
public void getAllRulesTest() throws EdgeRuleNotFoundException {
- Multimap<String, EdgeRule> res = ei.getAllRules(new SchemaVersion("v10"));
+ Multimap<String, EdgeRule> res = edgeIngestor.getAllRules(new SchemaVersion("v10"));
assertTrue(res.size() == 4);
assertTrue(res.containsKey("bar|foo"));
assertTrue(res.get("bar|foo").size() == 2);
assertTrue(res.containsKey("baz|foo"));
assertTrue(res.containsKey("foo|quux"));
-
+
thrown.expect(EdgeRuleNotFoundException.class);
thrown.expectMessage("No rules found for version v9.");
- ei.getAllRules(new SchemaVersion("v9"));
+ edgeIngestor.getAllRules(new SchemaVersion("v9"));
}
}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorWiringTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorWiringTest.java
index cae3bf78..395c9cc7 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorWiringTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorWiringTest.java
@@ -22,12 +22,14 @@ package org.onap.aai.edges;
import static org.junit.Assert.*;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.aai.config.EdgesConfiguration;
import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException;
-import org.onap.aai.setup.SchemaLocationsBean;
import org.onap.aai.setup.SchemaVersion;
-import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.setup.SchemaVersionsBean;
+
import org.onap.aai.testutils.ConfigTranslatorForWiringTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -38,8 +40,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.google.common.collect.Multimap;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, ConfigTranslatorForWiringTest.class, EdgeIngestor.class})
-@TestPropertySource(properties = {"schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties"})
+@ContextConfiguration(classes = {EdgesConfiguration.class, ConfigTranslatorForWiringTest.class})
+@TestPropertySource(properties = {"schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties"})
@SpringBootTest
public class EdgeIngestorWiringTest {
@Autowired
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeRuleQueryTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeRuleQueryTest.java
index 856ebb70..27c8d6e1 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeRuleQueryTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeRuleQueryTest.java
@@ -33,6 +33,7 @@ import org.onap.aai.edges.enums.EdgeType;
import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath;
+
public class EdgeRuleQueryTest {
private DocumentContext testRules;
private String readStart = "$.rules.[?]";
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java
index b718c0fd..4475b3f2 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java
@@ -23,7 +23,6 @@ package org.onap.aai.edges;
import static org.junit.Assert.*;
import java.util.*;
-
import org.junit.Test;
import org.onap.aai.setup.SchemaVersion;
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/TypeAlphabetizerTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/TypeAlphabetizerTest.java
index 4e3d61dd..3f49428f 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/edges/TypeAlphabetizerTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/TypeAlphabetizerTest.java
@@ -21,7 +21,6 @@
package org.onap.aai.edges;
import static org.junit.Assert.*;
-
import org.junit.Test;
public class TypeAlphabetizerTest {
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorLocalTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorLocalTest.java
new file mode 100644
index 00000000..cec3f9d8
--- /dev/null
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorLocalTest.java
@@ -0,0 +1,176 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-18 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.nodes;
+
+import org.eclipse.persistence.dynamic.DynamicEntity;
+import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.onap.aai.restclient.MockProvider;
+import org.onap.aai.config.NodesConfiguration;
+import org.onap.aai.setup.SchemaVersion;
+import org.onap.aai.testutils.TestUtilConfigTranslator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.w3c.dom.Document;
+
+import javax.xml.bind.SchemaOutputResolver;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.*;
+
+@RunWith(SpringRunner.class)
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local-node.properties" })
+@ContextConfiguration(classes = {TestUtilConfigTranslator.class, NodesConfiguration.class})
+
+@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
+
+@SpringBootTest
+public class NodeIngestorLocalTest {
+
+ //set thrown.expect to whatever a specific test needs
+ //this establishes a default of expecting no exceptions to be thrown
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+ @Autowired
+ NodeIngestor nodeIngestor;
+
+ public static void printDocument(Document doc, OutputStream out) throws IOException, TransformerException {
+ TransformerFactory tf = TransformerFactory.newInstance();
+ Transformer transformer = tf.newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+ transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
+
+ transformer.transform(new DOMSource(doc),
+ new StreamResult(new OutputStreamWriter(out, "UTF-8")));
+ }
+
+ @Test
+ public void testGetContextForVersion11() {
+ DynamicJAXBContext ctx10 = nodeIngestor.getContextForVersion(new SchemaVersion("v10"));
+
+ //should work bc Foo is valid in test_network_v10 schema
+ DynamicEntity foo10 = ctx10.newDynamicEntity("Foo");
+
+ foo10.set("fooId", "bar");
+ assertTrue("bar".equals(foo10.get("fooId")));
+
+ //should work bc Bar is valid in test_business_v10 schema
+ DynamicEntity bar10 = ctx10.newDynamicEntity("Bar");
+ bar10.set("barId", "bar2");
+ assertTrue("bar2".equals(bar10.get("barId")));
+ XSDOutputResolver outputResolver10 = new XSDOutputResolver();
+ ctx10.generateSchema(outputResolver10);
+
+ DynamicJAXBContext ctx11 = nodeIngestor.getContextForVersion(new SchemaVersion("v11"));
+
+ //should work bc Foo.quantity is valid in test_network_v11 schema
+ DynamicEntity foo11 = ctx11.newDynamicEntity("Foo");
+ foo11.set("quantity", "12");
+ assertTrue("12".equals(foo11.get("quantity")));
+
+ DynamicEntity quux11 = ctx11.newDynamicEntity("Quux");
+ quux11.set("qManagerName", "some guy");
+ assertTrue("some guy".equals(quux11.get("qManagerName")));
+ XSDOutputResolver outputResolver11 = new XSDOutputResolver();
+ ctx11.generateSchema(outputResolver11);
+
+
+ thrown.expect(IllegalArgumentException.class);
+ //should fail bc Quux not in v10 test schema
+ ctx10.newDynamicEntity("Quux");
+ }
+
+ @Test
+ public void testHasNodeType() {
+ assertTrue(nodeIngestor.hasNodeType("foo", new SchemaVersion("v11")));
+ assertTrue(nodeIngestor.hasNodeType("quux", new SchemaVersion("v11")));
+ assertFalse(nodeIngestor.hasNodeType("quux", new SchemaVersion("v10")));
+ }
+
+ @Test
+ public void testGetVersionFromClassName() {
+ assertEquals(nodeIngestor.getVersionFromClassName("inventory.aai.onap.org.v13.Evc"), new SchemaVersion("v13"));
+
+ }
+
+ @Test
+ public void testGetVersionFromClassNameNull() {
+ assertEquals(nodeIngestor.getVersionFromClassName("blah"), new SchemaVersion("v15"));
+
+ }
+
+ @Test
+ public void testGetObjectsInVersion() {
+ assertEquals(nodeIngestor.getObjectsInVersion(new SchemaVersion("v13")).size(), 148);
+
+ }
+
+ @Test
+ public void testCombinedSchema() throws TransformerException, IOException {
+ DynamicJAXBContext ctx13 = nodeIngestor.getContextForVersion(new SchemaVersion("v13"));
+ XSDOutputResolver outputResolver13 = new XSDOutputResolver();
+ ctx13.generateSchema(outputResolver13);
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ printDocument(nodeIngestor.getSchema(new SchemaVersion("v13")), buffer);
+ String content = new String(Files.readAllBytes(Paths.get("src/test/resources/forWiringTests/aai_oxm_v13.xml")));
+ content = content.replaceAll("\\s+", "");
+ String expected = buffer.toString().replaceAll("\\s+", "");
+
+ assertThat("OXM:\n" + expected, expected, is(content));
+ }
+
+ private class XSDOutputResolver extends SchemaOutputResolver {
+
+ @Override
+ public Result createOutput(String namespaceUri, String suggestedFileName)
+ throws IOException {
+
+ // create new file
+ // create stream result
+ File temp = File.createTempFile("schema", ".xsd");
+ StreamResult result = new StreamResult(temp);
+ System.out.println("Schema file: " + temp.getAbsolutePath());
+
+ // set system id
+ result.setSystemId(temp.toURI().toURL().toString());
+
+ // return result
+ return result;
+ }
+ }
+}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java
index 2de5847e..ec529f9d 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java
@@ -20,54 +20,45 @@
package org.onap.aai.nodes;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.*;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-
-import javax.xml.bind.SchemaOutputResolver;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.jaxb.JAXBContext;
import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
-import org.onap.aai.setup.SchemaLocationsBean;
+import org.onap.aai.restclient.MockProvider;
+import org.onap.aai.config.NodesConfiguration;
import org.onap.aai.setup.SchemaVersion;
-import org.onap.aai.setup.SchemaVersions;
-import org.onap.aai.testutils.TestUtilConfigTranslator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.w3c.dom.Document;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
+
+import javax.xml.bind.SchemaOutputResolver;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.*;
+
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, TestUtilConfigTranslator.class, NodeIngestor.class})
-@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties" })
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-ss-wiring-test.properties" })
+
+@ContextConfiguration(classes = { MockProvider.class, NodesConfiguration.class})
+@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
@SpringBootTest
public class NodeIngestorTest {
@Autowired
- NodeIngestor ni;
-
+ NodeIngestor nodeIngestor;
+
//set thrown.expect to whatever a specific test needs
//this establishes a default of expecting no exceptions to be thrown
@Rule
@@ -75,7 +66,7 @@ public class NodeIngestorTest {
@Test
public void testGetContextForVersion() {
- DynamicJAXBContext ctx10 = ni.getContextForVersion(new SchemaVersion("v10"));
+ DynamicJAXBContext ctx10 = nodeIngestor.getContextForVersion(new SchemaVersion("v10"));
//should work bc Foo is valid in test_network_v10 schema
DynamicEntity foo10 = ctx10.newDynamicEntity("Foo");
@@ -90,7 +81,7 @@ public class NodeIngestorTest {
XSDOutputResolver outputResolver10 = new XSDOutputResolver();
ctx10.generateSchema(outputResolver10);
- DynamicJAXBContext ctx11 = ni.getContextForVersion(new SchemaVersion("v11"));
+ DynamicJAXBContext ctx11 = nodeIngestor.getContextForVersion(new SchemaVersion("v11"));
//should work bc Foo.quantity is valid in test_network_v11 schema
DynamicEntity foo11 = ctx11.newDynamicEntity("Foo");
@@ -108,23 +99,47 @@ public class NodeIngestorTest {
//should fail bc Quux not in v10 test schema
ctx10.newDynamicEntity("Quux");
}
-
+
@Test
public void testHasNodeType() {
- assertTrue(ni.hasNodeType("foo", new SchemaVersion("v11")));
- assertTrue(ni.hasNodeType("quux", new SchemaVersion("v11")));
- assertFalse(ni.hasNodeType("quux", new SchemaVersion("v10")));
+ //TODO remove for integration tests
+ assertTrue(nodeIngestor.hasNodeType("foo", new SchemaVersion("v11")));
+ assertTrue(nodeIngestor.hasNodeType("quux", new SchemaVersion("v11")));
+ assertFalse(nodeIngestor.hasNodeType("quux", new SchemaVersion("v10")));
+ }
+
+ @Test
+ public void testGetVersionFromClassName() {
+ assertEquals(nodeIngestor.getVersionFromClassName("inventory.aai.onap.org.v13.Evc"),new SchemaVersion("v13"));
+
+ }
+
+ @Test
+ public void testGetVersionFromClassNameNull() {
+ assertEquals(nodeIngestor.getVersionFromClassName("blah"), new SchemaVersion("v15"));
+
}
+
+ @Test
+ public void testGetObjectsInVersion() {
+ assertEquals(nodeIngestor.getObjectsInVersion(new SchemaVersion("v13")).size(), 148);
+ //comment for IntegrationTest
+ //assertEquals(nodeIngestor.getObjectsInVersion(new SchemaVersion("v13")).size(), 229);
+
+ }
+
@Test
public void testCombinedSchema() throws TransformerException, IOException {
- DynamicJAXBContext ctx13 = ni.getContextForVersion(new SchemaVersion("v13"));
+ DynamicJAXBContext ctx13 = nodeIngestor.getContextForVersion(new SchemaVersion("v13"));
XSDOutputResolver outputResolver13 = new XSDOutputResolver();
ctx13.generateSchema(outputResolver13);
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- printDocument(ni.getSchema(new SchemaVersion("v13")),buffer);
+ printDocument(nodeIngestor.getSchema(new SchemaVersion("v13")),buffer);
String content = new String(Files.readAllBytes(Paths.get("src/test/resources/forWiringTests/aai_oxm_v13.xml")));
content = content.replaceAll("\\s+", "");
String expected = buffer.toString().replaceAll("\\s+", "");
+
+
assertThat("OXM:\n"+expected,expected, is(content));
}
@@ -160,6 +175,7 @@ public class NodeIngestorTest {
return result;
}
}
+
}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorWiringTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorWiringTest.java
index a7987fa3..0aaa8802 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorWiringTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorWiringTest.java
@@ -24,11 +24,13 @@ import static org.junit.Assert.*;
import org.eclipse.persistence.dynamic.DynamicEntity;
import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.aai.setup.SchemaLocationsBean;
+import org.onap.aai.config.NodesConfiguration;
import org.onap.aai.setup.SchemaVersion;
-import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.setup.SchemaVersionsBean;
+
import org.onap.aai.testutils.ConfigTranslatorForWiringTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
@@ -37,8 +39,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, ConfigTranslatorForWiringTest.class, NodeIngestor.class})
-@TestPropertySource(properties = {"schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties"})
+@ContextConfiguration(classes = {ConfigTranslatorForWiringTest.class, NodesConfiguration.class})
+@TestPropertySource(properties = {"schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local-node.properties"})
@SpringBootTest
public class NodeIngestorWiringTest {
@Autowired
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockProvider.java b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockProvider.java
new file mode 100644
index 00000000..6f8b7367
--- /dev/null
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockProvider.java
@@ -0,0 +1,58 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.restclient;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+
+@Configuration
+@PropertySource(value = "classpath:schema-ingest.properties", ignoreResourceNotFound=true)
+@PropertySource(value = "file:${schema.ingest.file}", ignoreResourceNotFound=true)
+public class MockProvider {
+
+ @Value("${mock.filename}")
+ private String fileName;
+
+ @Autowired
+ private RestClient restClient;
+
+ @Bean
+ public RestClientFactory restClientFactory() {
+
+ return new RestClientFactory() {
+ @Override
+ public RestClient getRestClient(String clientType) {
+ return restClient;
+
+ }
+ };
+ }
+
+ @Bean(name="restClient")
+ @ConditionalOnProperty(name = "schema.service.client", havingValue = "mock-no-auth")
+ public RestClient getSchemaServiceNoAuthClient() {
+ return new MockRestClient(fileName);
+ }
+}
+
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockRestClient.java b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockRestClient.java
new file mode 100644
index 00000000..87e4bfe8
--- /dev/null
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/MockRestClient.java
@@ -0,0 +1,295 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import org.apache.commons.io.IOUtils;
+import org.springframework.core.io.Resource;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import org.springframework.test.web.client.ExpectedCount;
+import org.springframework.test.web.client.MockRestServiceServer;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertNotNull;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.*;
+import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus;
+
+@Component
+public class MockRestClient extends RestClient {
+
+private RestTemplate restTemplate;
+ private MockRestServiceServer mockRestServiceServer;
+
+ String fileName = "mockrequests";
+
+ public MockRestClient(String fileName) {
+ /*
+ List<MockRestServiceServer> mockedAAIRequests = new ArrayList<>(aaiRequests.size());
+ */
+ List<MockRestServiceServer> mockedAAIRequests = new ArrayList<>();
+
+ restTemplate = new RestTemplate();
+ /* MockRestServiceServer server = MockRestServiceServer
+ .bindTo(restClientFactory.getRestClient(ClientType.SchemaService).getRestTemplate())
+ .build();
+ server.expect(MockRestRequestMatchers.requestTo(url))
+ .andRespond(withSuccess("{}", MediaType.APPLICATION_JSON));*/
+
+ // RestTemplateBuilder mockBuilder = mock(RestTemplateBuilder.class);
+ //when(mockBuilder.build()).thenReturn(restTemplate);
+
+ JsonObject payload = null;
+ try {
+ payload = getPayload(fileName + ".json");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ JsonArray mockUris = payload.getAsJsonArray("mock-uri");
+
+
+ mockRestServiceServer = MockRestServiceServer.createServer(restTemplate);
+ String url = "https://localhost:8447/aai/v14";
+ /*mockRestServiceServer.expect(requestTo(url))
+ .andRespond(withSuccess("{}", MediaType.APPLICATION_JSON));*/
+
+
+ for (int i = 0; i < mockUris.size(); i++) {
+ String responseFile = mockUris.get(i).getAsJsonObject().get("response-file").getAsString();
+ String contentTypeValue = mockUris.get(i).getAsJsonObject().get("content").getAsString();
+
+
+ String uri = mockUris.get(i).getAsJsonObject().get("aai-uri").getAsString();
+
+ InputStream inputStream = getClass()
+ .getClassLoader()
+ .getResourceAsStream(responseFile);
+ String responseBody = null;
+ try {
+ responseBody = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+
+ mockRestServiceServer.expect(ExpectedCount.manyTimes(), requestTo(url + uri))
+ .andExpect(method(HttpMethod.GET))
+ .andExpect(content().contentType(contentTypeValue))
+ .andRespond(withStatus(HttpStatus.OK).body(responseBody.toString()).contentType(MediaType.valueOf(contentTypeValue)));
+
+
+ }
+ }
+
+ public MockRestClient() {
+
+ restTemplate = new RestTemplate();
+ /* MockRestServiceServer server = MockRestServiceServer
+ .bindTo(restClientFactory.getRestClient(ClientType.SchemaService).getRestTemplate())
+ .build();
+ server.expect(MockRestRequestMatchers.requestTo(url))
+ .andRespond(withSuccess("{}", MediaType.APPLICATION_JSON));*/
+
+ // RestTemplateBuilder mockBuilder = mock(RestTemplateBuilder.class);
+ //when(mockBuilder.build()).thenReturn(restTemplate);
+
+ JsonObject payload = null;
+ try {
+ payload = getPayload( fileName + ".json");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ JsonArray mockUris = payload.getAsJsonArray("mock-uri");
+
+
+
+ mockRestServiceServer = MockRestServiceServer.createServer(restTemplate);
+ String url="https://localhost:8447/aai/v14";
+ /*mockRestServiceServer.expect(requestTo(url))
+ .andRespond(withSuccess("{}", MediaType.APPLICATION_JSON));*/
+
+
+
+
+ for (int i = 0; i < mockUris.size(); i++) {
+ String responseFile = mockUris.get(i).getAsJsonObject().get("response-file").getAsString();
+ String contentTypeValue = mockUris.get(i).getAsJsonObject().get("content").getAsString();
+
+
+ String uri = mockUris.get(i).getAsJsonObject().get("aai-uri").getAsString();
+
+ InputStream inputStream = getClass()
+ .getClassLoader()
+ .getResourceAsStream(responseFile);
+ String responseBody = null;
+ try {
+ responseBody = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+
+ mockRestServiceServer.expect(ExpectedCount.manyTimes(), requestTo(url + uri))
+ .andExpect(method(HttpMethod.GET))
+ .andExpect(content().contentType(contentTypeValue))
+ .andRespond(withStatus(HttpStatus.OK).body(responseBody.toString()).contentType(MediaType.valueOf(contentTypeValue)));
+
+
+ }
+
+
+ }
+
+ public JsonObject getTestDetails(String fileName) throws IOException {
+
+ JsonObject payload = getPayload(fileName );
+
+ return payload;
+ }
+
+ public JsonObject getPayload(String filename) throws IOException {
+ InputStream inputStream = getClass()
+ .getClassLoader()
+ .getResourceAsStream(filename);
+
+ //InputStream inputStream = new FileInputStream(filename);
+
+ String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
+ String message = String.format("Unable to find the %s in src/test/resources", filename);
+ assertNotNull(message, inputStream);
+
+ JsonParser parser = new JsonParser();
+ JsonObject payload = parser.parse(result).getAsJsonObject();
+ return payload;
+ }
+
+ @Override
+ public ResponseEntity execute(String uri, HttpMethod method, Map<String,String> headers, String body) {
+
+ String url="https://localhost:8447/aai/v14/"+ uri;
+
+ /* MockRestServiceServer server = MockRestServiceServer
+ .bindTo(restClientFactory.getRestClient(ClientType.SchemaService).getRestTemplate())
+ .build();
+ server.expect(MockRestRequestMatchers.requestTo(url))
+ .andRespond(withSuccess("{}", MediaType.APPLICATION_JSON));*/
+
+ // RestTemplateBuilder mockBuilder = mock(RestTemplateBuilder.class);
+ //when(mockBuilder.build()).thenReturn(restTemplate);
+
+ /*MockRestServiceServer server = MockRestServiceServer.createServer(restTemplate);
+ server.expect(requestTo(url))
+ .andRespond(withSuccess("{}", MediaType.APPLICATION_JSON));
+ return new ResponseEntity("blah", HttpStatus.OK);
+ server.expect(ExpectedCount.manyTimes(), requestTo(Matchers.startsWith(aaiBaseUrl + aaiRequests.get(i).get("aai-uri").asText())))
+ .andExpect(method(HttpMethod.GET))
+ .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+ .andRespond(withStatus(HttpStatus.OK).body(aaiResponses.get(i).toString()).contentType(MediaType.APPLICATION_JSON));*/
+
+
+ HttpHeaders headersMap = new HttpHeaders();
+
+ headersMap.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
+ headersMap.setContentType(MediaType.APPLICATION_JSON);
+ headersMap.add("Real-Time", "true");
+ headersMap.add("X-FromAppId", "JUNIT");
+ headersMap.add("X-TransactionId", "JUNIT");
+
+ HttpEntity httpEntity = new HttpEntity(headers);
+
+ ResponseEntity responseEntity = restTemplate.exchange(url , HttpMethod.GET, httpEntity, String.class);
+
+ // mockRestServiceServer.verify();
+ return responseEntity;
+ }
+
+ @Override
+ public ResponseEntity executeResource(String uri, HttpMethod method, Map<String,String> headers, String body) {
+
+ String url="https://localhost:8447/aai/v14/"+ uri;
+
+ /* MockRestServiceServer server = MockRestServiceServer
+ .bindTo(restClientFactory.getRestClient(ClientType.SchemaService).getRestTemplate())
+ .build();
+ server.expect(MockRestRequestMatchers.requestTo(url))
+ .andRespond(withSuccess("{}", MediaType.APPLICATION_JSON));*/
+
+ // RestTemplateBuilder mockBuilder = mock(RestTemplateBuilder.class);
+ //when(mockBuilder.build()).thenReturn(restTemplate);
+
+ /*MockRestServiceServer server = MockRestServiceServer.createServer(restTemplate);
+ server.expect(requestTo(url))
+ .andRespond(withSuccess("{}", MediaType.APPLICATION_JSON));
+ return new ResponseEntity("blah", HttpStatus.OK);
+ server.expect(ExpectedCount.manyTimes(), requestTo(Matchers.startsWith(aaiBaseUrl + aaiRequests.get(i).get("aai-uri").asText())))
+ .andExpect(method(HttpMethod.GET))
+ .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+ .andRespond(withStatus(HttpStatus.OK).body(aaiResponses.get(i).toString()).contentType(MediaType.APPLICATION_JSON));*/
+
+
+ HttpHeaders headersMap = new HttpHeaders();
+
+ headersMap.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
+ headersMap.setContentType(MediaType.APPLICATION_JSON);
+ headersMap.add("Real-Time", "true");
+ headersMap.add("X-FromAppId", "JUNIT");
+ headersMap.add("X-TransactionId", "JUNIT");
+
+ HttpEntity httpEntity = new HttpEntity(headers);
+
+ ResponseEntity responseEntity = restTemplate.exchange(url , HttpMethod.GET, httpEntity, Resource.class);
+
+ // mockRestServiceServer.verify();
+ return responseEntity;
+ }
+
+ @Override
+ public RestTemplate getRestTemplate() {
+ RestTemplate restTemplate = null;
+ return restTemplate;
+ }
+
+ public String getBaseUrl(){
+ return "";
+ }
+
+ protected MultiValueMap<String,String> getHeaders(Map<String,String> headers){
+ return null;
+ }
+
+ protected EELFLogger getLogger(){
+ return null;
+ }
+
+}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/restclient/RestClientTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/RestClientTest.java
new file mode 100644
index 00000000..4c3b0fcf
--- /dev/null
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/RestClientTest.java
@@ -0,0 +1,24 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+public class RestClientTest {
+
+}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/restclient/SchemaRestClientTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/SchemaRestClientTest.java
new file mode 100644
index 00000000..cd161dea
--- /dev/null
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/restclient/SchemaRestClientTest.java
@@ -0,0 +1,67 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2018-19 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.restclient;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.aai.restclient.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Ignore
+@RunWith(SpringJUnit4ClassRunner.class)
+@TestPropertySource(locations = "/schemaService/schema-service-rest.properties" )
+@ContextConfiguration(classes = {RestClientFactoryConfiguration.class, SchemaServiceRestClient.class, RestClientFactory.class, PropertyPasswordConfiguration.class})
+
+@SpringBootTest
+public class SchemaRestClientTest {
+
+ private String SCHEMA_SERVICE = "schema-service";
+ @Autowired
+ private RestClientFactory restClientFactory;
+
+ @Test
+ public void testGetRequestToSchemaService() {
+ ResponseEntity aaiResponse;
+ RestClient restClient = null;
+
+ restClient = restClientFactory
+ .getRestClient(SCHEMA_SERVICE);
+
+ String uri = "";
+ Map<String, String> headersMap = new HashMap<>();
+ String content = "";
+ aaiResponse = restClient.execute(
+ uri,
+ HttpMethod.GET,
+ headersMap,
+ content);
+ System.out.println("Helo"+aaiResponse.getStatusCode());
+ }
+}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/ConfigTranslatorWiringTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/ConfigTranslatorWiringTest.java
index 03b40db5..565c99c8 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/setup/ConfigTranslatorWiringTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/ConfigTranslatorWiringTest.java
@@ -20,11 +20,6 @@
package org.onap.aai.setup;
-import static org.junit.Assert.*;
-
-import java.util.List;
-import java.util.Map;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.aai.testutils.ConfigTranslatorForWiringTest;
@@ -34,9 +29,15 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, ConfigTranslatorForWiringTest.class})
-@TestPropertySource(properties = {"schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties"})
+@TestPropertySource(properties = {"schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties"})
@SpringBootTest
public class ConfigTranslatorWiringTest {
@Autowired
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanDefaultInjectionTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanDefaultInjectionTest.java
index b5fb0e19..45ed88fa 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanDefaultInjectionTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanDefaultInjectionTest.java
@@ -20,14 +20,15 @@
package org.onap.aai.setup;
-import static org.junit.Assert.*;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {SchemaLocationsBean.class})
public class SchemaLocationsBeanDefaultInjectionTest {
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanEnvVarInjectionTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanEnvVarInjectionTest.java
index 6ccc418a..886dfe02 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanEnvVarInjectionTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanEnvVarInjectionTest.java
@@ -20,8 +20,6 @@
package org.onap.aai.setup;
-import static org.junit.Assert.*;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +27,9 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {SchemaLocationsBean.class})
@TestPropertySource(properties = {"schema.ingest.file = src/test/resources/forWiringTests/schema-ingest2.properties"})
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterTest.java
index d72d3d3c..105cb1de 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterTest.java
@@ -20,14 +20,15 @@
package org.onap.aai.setup;
-import static org.junit.Assert.*;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:forWiringTests/testContext.xml"})
public class SchemaLocationsBeanXMLSetterTest {
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java
index 5e49b4f0..a9b5d0c5 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java
@@ -20,14 +20,15 @@
package org.onap.aai.setup;
-import static org.junit.Assert.*;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:forWiringTests/testUsingPropFileContext.xml"})
public class SchemaLocationsBeanXMLSetterWithPropFileTest {
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaVersionsBeanTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaVersionsBeanTest.java
new file mode 100644
index 00000000..b1208d62
--- /dev/null
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaVersionsBeanTest.java
@@ -0,0 +1,87 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.setup;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.onap.aai.restclient.MockProvider;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import java.io.IOException;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-ss-wiring-test.properties" })
+@ContextConfiguration(classes = {MockProvider.class, SchemaVersionsBean.class})
+@SpringBootTest
+public class SchemaVersionsBeanTest {
+
+ //set thrown.expect to whatever a specific test needs
+ //this establishes a default of expecting no exceptions to be thrown
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+ @Autowired
+ SchemaVersionsBean SchemaVersionsBean;
+
+ @Test
+ public void testGetContextForVersion() throws IOException {
+
+ SchemaVersions versions = SchemaVersionsBean.getSchemaVersions();
+ assertEquals(versions.getDefaultVersion(), new SchemaVersion("v15"));
+ }
+
+ @Test
+ public void testGetVersions() throws IOException {
+
+ List<SchemaVersion> versions = SchemaVersionsBean.getVersions();
+ assertNotNull(versions);
+ }
+
+ @Test
+ public void testGetters() throws IOException {
+
+ List<SchemaVersion> versionsList = SchemaVersionsBean.getVersions();
+ assertNotNull(versionsList);
+ SchemaVersions versions = SchemaVersionsBean.getSchemaVersions();
+ /*//assertEquals(versions.getAppRootVersion(), new SchemaVersion("v15"));
+ assertEquals(versions.getAppRootVersion(), new SchemaVersion("v11"));
+ assertEquals(versions.getDepthVersion(), new SchemaVersion("v10"));
+ assertEquals(versions.getEdgeLabelVersion(), new SchemaVersion("v12"));
+ assertEquals(versions.getNamespaceChangeVersion(), new SchemaVersion("v11"));
+ assertEquals(versions.getRelatedLinkVersion(), new SchemaVersion("v10"));*/
+
+ assertEquals(versions.getAppRootVersion(), new SchemaVersion("v15"));
+ assertEquals(versions.getDepthVersion(), new SchemaVersion("v15"));
+ assertEquals(versions.getEdgeLabelVersion(), new SchemaVersion("v15"));
+ assertEquals(versions.getNamespaceChangeVersion(), new SchemaVersion("v15"));
+ assertEquals(versions.getRelatedLinkVersion(), new SchemaVersion("v15"));
+
+ }
+
+}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/BadEdgeConfigForValidationTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/BadEdgeConfigForValidationTest.java
index ff2f22f6..fa57f976 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/BadEdgeConfigForValidationTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/BadEdgeConfigForValidationTest.java
@@ -20,9 +20,12 @@
package org.onap.aai.testutils;
-import java.util.*;
+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.*;
+import java.util.*;
/**
* Good oxm, bad edge rules for rainy day edge rule validation testing
@@ -53,5 +56,4 @@ public class BadEdgeConfigForValidationTest extends ConfigTranslator {
return input;
}
-
}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/BadNodeConfigForValidationTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/BadNodeConfigForValidationTest.java
index a1a0e32a..829638fe 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/BadNodeConfigForValidationTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/BadNodeConfigForValidationTest.java
@@ -20,9 +20,15 @@
package org.onap.aai.testutils;
-import java.util.*;
+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.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
/**
* All schema files here are valid for sunny day validator testing
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/ConfigTranslatorForWiringTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/ConfigTranslatorForWiringTest.java
index 043f80e7..06e07f9a 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/ConfigTranslatorForWiringTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/ConfigTranslatorForWiringTest.java
@@ -20,9 +20,15 @@
package org.onap.aai.testutils;
-import java.util.*;
+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.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
public class ConfigTranslatorForWiringTest extends ConfigTranslator {
@@ -32,6 +38,7 @@ public class ConfigTranslatorForWiringTest extends ConfigTranslator {
@Override
public Map<SchemaVersion, List<String>> getNodeFiles() {
+
String f = bean.getNodeDirectory() + "test_business_v10.xml";
List<String> files = new ArrayList<>();
files.add(f);
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/GoodConfigForValidationTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/GoodConfigForValidationTest.java
index dbb24ec9..41f35371 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/GoodConfigForValidationTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/GoodConfigForValidationTest.java
@@ -20,13 +20,16 @@
package org.onap.aai.testutils;
-import java.util.*;
-
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 java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
/**
* All schema files here are valid for sunny day validator testing
*/
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/SchemaIncompleteTranslator.java b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/SchemaIncompleteTranslator.java
index d3df9dcc..23549e3f 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/SchemaIncompleteTranslator.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/SchemaIncompleteTranslator.java
@@ -20,17 +20,16 @@
package org.onap.aai.testutils;
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
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 java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
public class SchemaIncompleteTranslator extends ConfigTranslator {
public SchemaIncompleteTranslator(SchemaLocationsBean bean, SchemaVersions schemaVersions) {
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslator.java b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslator.java
index bbc0c3f9..3704b7cd 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslator.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslator.java
@@ -20,13 +20,22 @@
package org.onap.aai.testutils;
-import java.util.*;
+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.springframework.context.annotation.PropertySource;
-import org.onap.aai.setup.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+@PropertySource(value = "classpath:schema-ingest.properties", ignoreResourceNotFound = true)
+@PropertySource(value = "file:${schema.ingest.file}", ignoreResourceNotFound = true)
public class TestUtilConfigTranslator extends ConfigTranslator {
- public static final SchemaVersion LATEST = new SchemaVersion("v14");
+ public static final SchemaVersion LATEST = new SchemaVersion("v15");
public TestUtilConfigTranslator(SchemaLocationsBean bean, SchemaVersions schemaVersions) {
super(bean, schemaVersions);
}
@@ -74,7 +83,6 @@ public class TestUtilConfigTranslator extends ConfigTranslator {
files3.add("src/test/resources/edgeRules/test3.json");
files3.add("src/test/resources/edgeRules/defaultEdgesTest.json");
input.put(new SchemaVersion("v11"), files3);
-
return input;
}
}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslatorforBusiness.java b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslatorforBusiness.java
index 81644de8..2e515ec1 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslatorforBusiness.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslatorforBusiness.java
@@ -20,17 +20,16 @@
package org.onap.aai.testutils;
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
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 java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
public class TestUtilConfigTranslatorforBusiness extends ConfigTranslator {
public TestUtilConfigTranslatorforBusiness(SchemaLocationsBean bean, SchemaVersions schemaVersions) {
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/validation/VersionValidatorRainyDayTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/validation/VersionValidatorRainyDayTest.java
index 15396135..667a76ab 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/validation/VersionValidatorRainyDayTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/validation/VersionValidatorRainyDayTest.java
@@ -22,12 +22,13 @@ package org.onap.aai.validation;
import static org.junit.Assert.*;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.aai.config.NodesConfiguration;
import org.onap.aai.nodes.NodeIngestor;
-import org.onap.aai.setup.SchemaLocationsBean;
import org.onap.aai.setup.SchemaVersion;
-import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.setup.SchemaVersionsBean;
import org.onap.aai.testutils.BadNodeConfigForValidationTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -36,9 +37,9 @@ import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, BadNodeConfigForValidationTest.class, NodeIngestor.class,
+@ContextConfiguration(classes = {NodesConfiguration.class, BadNodeConfigForValidationTest.class,
CheckEverythingStrategy.class, DefaultVersionValidationModule.class, VersionValidator.class})
-@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties" })
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties" })
@SpringBootTest
public class VersionValidatorRainyDayTest {
@Autowired
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/validation/VersionValidatorSunnyDayTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/validation/VersionValidatorSunnyDayTest.java
index 3c67c0d1..2be68558 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/validation/VersionValidatorSunnyDayTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/validation/VersionValidatorSunnyDayTest.java
@@ -22,11 +22,13 @@ package org.onap.aai.validation;
import static org.junit.Assert.*;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.aai.config.NodesConfiguration;
import org.onap.aai.nodes.NodeIngestor;
-import org.onap.aai.setup.SchemaLocationsBean;
-import org.onap.aai.setup.SchemaVersions;
+
+import org.onap.aai.setup.SchemaVersionsBean;
import org.onap.aai.testutils.GoodConfigForValidationTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -36,15 +38,13 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {
- SchemaLocationsBean.class,
- SchemaVersions.class,
+ NodesConfiguration.class,
GoodConfigForValidationTest.class,
- NodeIngestor.class,
CheckEverythingStrategy.class,
DefaultVersionValidationModule.class,
VersionValidator.class
})
-@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties" })
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties" })
@SpringBootTest
public class VersionValidatorSunnyDayTest {
@Autowired
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/DefaultEdgeFieldsValidationModuleTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/DefaultEdgeFieldsValidationModuleTest.java
index a38632b3..f92c636b 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/DefaultEdgeFieldsValidationModuleTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/DefaultEdgeFieldsValidationModuleTest.java
@@ -28,8 +28,6 @@ import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.aai.edges.enums.EdgeField;
-import org.onap.aai.validation.edges.DefaultEdgeFieldsValidationModule;
-import org.onap.aai.validation.edges.EdgeFieldsValidationModule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/EdgeRuleValidatorRainyDayTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/EdgeRuleValidatorRainyDayTest.java
index 8bd66565..5f553ed5 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/EdgeRuleValidatorRainyDayTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/EdgeRuleValidatorRainyDayTest.java
@@ -22,19 +22,15 @@ package org.onap.aai.validation.edges;
import static org.junit.Assert.*;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.aai.config.NodesConfiguration;
import org.onap.aai.nodes.NodeIngestor;
-import org.onap.aai.setup.SchemaLocationsBean;
-import org.onap.aai.setup.SchemaVersions;
+
+import org.onap.aai.setup.SchemaVersionsBean;
import org.onap.aai.testutils.BadEdgeConfigForValidationTest;
import org.onap.aai.validation.CheckEverythingStrategy;
-import org.onap.aai.validation.edges.CousinDefaultingValidationModule;
-import org.onap.aai.validation.edges.DefaultEdgeFieldsValidationModule;
-import org.onap.aai.validation.edges.EdgeRuleValidator;
-import org.onap.aai.validation.edges.NodeTypesValidationModule;
-import org.onap.aai.validation.edges.SingleContainmentValidationModule;
-import org.onap.aai.validation.edges.UniqueLabelValidationModule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
@@ -42,11 +38,11 @@ import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, BadEdgeConfigForValidationTest.class, NodeIngestor.class,
+@ContextConfiguration(classes = {NodesConfiguration.class, BadEdgeConfigForValidationTest.class,
CheckEverythingStrategy.class, DefaultEdgeFieldsValidationModule.class, UniqueLabelValidationModule.class,
SingleContainmentValidationModule.class, CousinDefaultingValidationModule.class, NodeTypesValidationModule.class,
EdgeRuleValidator.class})
-@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties" })
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties" })
@SpringBootTest
public class EdgeRuleValidatorRainyDayTest {
@Autowired
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/EdgeRuleValidatorSunnyDayTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/EdgeRuleValidatorSunnyDayTest.java
index a918356c..6c68027b 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/EdgeRuleValidatorSunnyDayTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/EdgeRuleValidatorSunnyDayTest.java
@@ -22,19 +22,15 @@ package org.onap.aai.validation.edges;
import static org.junit.Assert.*;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.aai.config.NodesConfiguration;
import org.onap.aai.nodes.NodeIngestor;
-import org.onap.aai.setup.SchemaLocationsBean;
-import org.onap.aai.setup.SchemaVersions;
+
+import org.onap.aai.setup.SchemaVersionsBean;
import org.onap.aai.testutils.GoodConfigForValidationTest;
import org.onap.aai.validation.CheckEverythingStrategy;
-import org.onap.aai.validation.edges.CousinDefaultingValidationModule;
-import org.onap.aai.validation.edges.DefaultEdgeFieldsValidationModule;
-import org.onap.aai.validation.edges.EdgeRuleValidator;
-import org.onap.aai.validation.edges.NodeTypesValidationModule;
-import org.onap.aai.validation.edges.SingleContainmentValidationModule;
-import org.onap.aai.validation.edges.UniqueLabelValidationModule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
@@ -42,11 +38,11 @@ import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, GoodConfigForValidationTest.class, NodeIngestor.class,
+@ContextConfiguration(classes = {NodesConfiguration.class, GoodConfigForValidationTest.class,
CheckEverythingStrategy.class, DefaultEdgeFieldsValidationModule.class, UniqueLabelValidationModule.class,
SingleContainmentValidationModule.class, CousinDefaultingValidationModule.class, NodeTypesValidationModule.class,
EdgeRuleValidator.class})
-@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties" })
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties" })
@SpringBootTest
public class EdgeRuleValidatorSunnyDayTest {
@Autowired
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/NodeTypesValidationModuleTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/NodeTypesValidationModuleTest.java
index 245e0600..fc854061 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/NodeTypesValidationModuleTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/validation/edges/NodeTypesValidationModuleTest.java
@@ -25,12 +25,14 @@ import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.List;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.aai.config.NodesConfiguration;
import org.onap.aai.nodes.NodeIngestor;
-import org.onap.aai.setup.SchemaLocationsBean;
+
import org.onap.aai.setup.SchemaVersion;
-import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.setup.SchemaVersionsBean;
import org.onap.aai.testutils.TestUtilConfigTranslator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -39,8 +41,8 @@ import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, TestUtilConfigTranslator.class, NodeIngestor.class, NodeTypesValidationModule.class})
-@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties" })
+@ContextConfiguration(classes = {NodesConfiguration.class, TestUtilConfigTranslator.class, NodeTypesValidationModule.class})
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties" })
@SpringBootTest
public class NodeTypesValidationModuleTest {
@Autowired
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorRainyDayTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorRainyDayTest.java
index 86fe8a77..fc4ddd45 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorRainyDayTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorRainyDayTest.java
@@ -24,23 +24,25 @@ import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.aai.nodes.NodeIngestor;
-import org.onap.aai.setup.SchemaLocationsBean;
-import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.config.NodesConfiguration;
+
import org.onap.aai.testutils.BadNodeConfigForValidationTest;
import org.onap.aai.validation.CheckEverythingStrategy;
import org.onap.aai.validation.nodes.DefaultDuplicateNodeDefinitionValidationModule;
import org.onap.aai.validation.nodes.NodeValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, BadNodeConfigForValidationTest.class, NodeIngestor.class,
- CheckEverythingStrategy.class, DefaultDuplicateNodeDefinitionValidationModule.class, NodeValidator.class})
-@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties" })
+@ContextConfiguration(classes = {BadNodeConfigForValidationTest.class, NodesConfiguration.class,
+ CheckEverythingStrategy.class, DefaultDuplicateNodeDefinitionValidationModule.class, NodeValidator.class})
+
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties" })
+@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
@SpringBootTest
public class NodeValidatorRainyDayTest {
@Autowired
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorSchemaIncompleteTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorSchemaIncompleteTest.java
index e40f9301..c6fe190d 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorSchemaIncompleteTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorSchemaIncompleteTest.java
@@ -20,18 +20,18 @@
package org.onap.aai.validation.nodes;
-import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
+import org.onap.aai.config.NodesConfiguration;
import org.onap.aai.nodes.NodeIngestor;
-import org.onap.aai.setup.SchemaLocationsBean;
+
import org.onap.aai.setup.SchemaVersion;
-import org.onap.aai.setup.SchemaVersions;
+
import org.onap.aai.testutils.SchemaIncompleteTranslator;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -48,11 +48,12 @@ import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-@Ignore
+
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, SchemaIncompleteTranslator.class, NodeIngestor.class})
-@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties" })
-//@SpringBootTest
+@ContextConfiguration(classes = { SchemaIncompleteTranslator.class, NodesConfiguration.class})
+
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties" })
+@SpringBootTest
public class NodeValidatorSchemaIncompleteTest {
@Autowired
NodeIngestor ni;
@@ -65,9 +66,9 @@ public class NodeValidatorSchemaIncompleteTest {
//Throws a NullPointerException because a JavaType is referenced, but not defined
@Test
public void testIncompleteCombinedSchema() throws TransformerException, IOException, IllegalStateException {
- thrown.expect(NullPointerException.class);
+ //thrown.expect(NullPointerException.class);
-
+ //TODO Change for Exception
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
printDocument(ni.getSchema(new SchemaVersion("v12")),buffer);
}
@@ -84,5 +85,4 @@ public class NodeValidatorSchemaIncompleteTest {
transformer.transform(new DOMSource(doc),
new StreamResult(new OutputStreamWriter(out, "UTF-8")));
}
-
}
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorSunnyDayTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorSunnyDayTest.java
index 257d6e18..b69182fc 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorSunnyDayTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/validation/nodes/NodeValidatorSunnyDayTest.java
@@ -24,9 +24,8 @@ import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.aai.nodes.NodeIngestor;
-import org.onap.aai.setup.SchemaLocationsBean;
-import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.config.NodesConfiguration;
+
import org.onap.aai.testutils.GoodConfigForValidationTest;
import org.onap.aai.validation.CheckEverythingStrategy;
import org.onap.aai.validation.nodes.DefaultDuplicateNodeDefinitionValidationModule;
@@ -36,12 +35,12 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {SchemaLocationsBean.class, SchemaVersions.class, GoodConfigForValidationTest.class, NodeIngestor.class,
+@ContextConfiguration(classes = { NodesConfiguration.class, GoodConfigForValidationTest.class,
CheckEverythingStrategy.class, DefaultDuplicateNodeDefinitionValidationModule.class, NodeValidator.class})
-@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test.properties" })
+@TestPropertySource(properties = { "schema.ingest.file = src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties" })
@SpringBootTest
+
public class NodeValidatorSunnyDayTest {
@Autowired
NodeValidator validator;
@@ -52,5 +51,4 @@ public class NodeValidatorSunnyDayTest {
assertTrue(validator.validate());
assertTrue("No errors found.".equals(validator.getErrorMsg()));
}
-
}
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test_v10.json b/aai-schema-ingest/src/test/resources/edgeRules/test_v10.json
new file mode 100644
index 00000000..66691ebf
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/test_v10.json
@@ -0,0 +1,48 @@
+{
+ "rules": [
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eats",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eatz",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "baz",
+ "label": "isVeryHappyAbout",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "quux",
+ "to": "foo",
+ "label": "dancesWith",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ }
+ ]
+} \ No newline at end of file
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test_v11.json b/aai-schema-ingest/src/test/resources/edgeRules/test_v11.json
new file mode 100644
index 00000000..4ca64030
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/test_v11.json
@@ -0,0 +1,124 @@
+{
+ "rules": [
+ {
+ "from": "l-interface",
+ "to": "logical-link",
+ "label": "tosca.relationships.network.LinksTo",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "logical-link",
+ "to": "l-interface",
+ "label": "org.onap.relationships.inventory.Source",
+ "direction": "OUT",
+ "multiplicity": "ONE2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "!${direction}",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":""
+ },
+ {
+ "from": "logical-link",
+ "to": "l-interface",
+ "label": "org.onap.relationships.inventory.Destination",
+ "direction": "OUT",
+ "multiplicity": "ONE2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "!${direction}",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":""
+ },
+ {
+ "from": "l-interface",
+ "to": "lag-interface",
+ "label": "org.onap.relationships.inventory.BelongsTo",
+ "direction": "OUT",
+ "multiplicity": "MANY2ONE",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "!${direction}",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "lag-interface",
+ "to": "logical-link",
+ "label": "org.onap.relationships.inventory.Uses",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "bloop",
+ "to": "bloop",
+ "label": "links",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "IN",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description": "for testing same type direction flip requirement"
+ },
+ {
+ "from": "apple",
+ "to": "orange",
+ "label": "sitsBy",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":"for testing pairs with no default"
+ },
+ {
+ "from": "apple",
+ "to": "orange",
+ "label": "makesSaladWith",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":"for testing pairs with no default"
+ },
+ {
+ "from": "seed",
+ "to": "plant",
+ "label": "grows",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "seed",
+ "to": "plant",
+ "label": "becomes",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ }
+ ]
+}
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test_v12.json b/aai-schema-ingest/src/test/resources/edgeRules/test_v12.json
new file mode 100644
index 00000000..483af52d
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/test_v12.json
@@ -0,0 +1,71 @@
+{
+ "rules": [
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eats",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eatz",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "baz",
+ "label": "isVeryHappyAbout",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "quux",
+ "to": "foo",
+ "label": "dancesWith",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "dog",
+ "label": "pets",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "dog",
+ "to": "puppy",
+ "label": "caresFor",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe",
+ "default": "true"
+ }
+ ]
+}
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test_v13.json b/aai-schema-ingest/src/test/resources/edgeRules/test_v13.json
new file mode 100644
index 00000000..483af52d
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/test_v13.json
@@ -0,0 +1,71 @@
+{
+ "rules": [
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eats",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eatz",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "baz",
+ "label": "isVeryHappyAbout",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "quux",
+ "to": "foo",
+ "label": "dancesWith",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "dog",
+ "label": "pets",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "dog",
+ "to": "puppy",
+ "label": "caresFor",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe",
+ "default": "true"
+ }
+ ]
+}
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test_v14.json b/aai-schema-ingest/src/test/resources/edgeRules/test_v14.json
new file mode 100644
index 00000000..483af52d
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/test_v14.json
@@ -0,0 +1,71 @@
+{
+ "rules": [
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eats",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eatz",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "baz",
+ "label": "isVeryHappyAbout",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "quux",
+ "to": "foo",
+ "label": "dancesWith",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "dog",
+ "label": "pets",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "dog",
+ "to": "puppy",
+ "label": "caresFor",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe",
+ "default": "true"
+ }
+ ]
+}
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test_v15.json b/aai-schema-ingest/src/test/resources/edgeRules/test_v15.json
new file mode 100644
index 00000000..0932014c
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/test_v15.json
@@ -0,0 +1,275 @@
+{
+ "rules": [
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eats",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eatz",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "baz",
+ "label": "isVeryHappyAbout",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "quux",
+ "to": "foo",
+ "label": "dancesWith",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "dog",
+ "label": "pets",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "dog",
+ "to": "puppy",
+ "label": "caresFor",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe",
+ "default": "true"
+ },
+ {
+ "from": "l-interface",
+ "to": "logical-link",
+ "label": "tosca.relationships.network.LinksTo",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "logical-link",
+ "to": "l-interface",
+ "label": "org.onap.relationships.inventory.Source",
+ "direction": "OUT",
+ "multiplicity": "ONE2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "!${direction}",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":""
+ },
+ {
+ "from": "logical-link",
+ "to": "l-interface",
+ "label": "org.onap.relationships.inventory.Destination",
+ "direction": "OUT",
+ "multiplicity": "ONE2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "!${direction}",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":""
+ },
+ {
+ "from": "l-interface",
+ "to": "lag-interface",
+ "label": "org.onap.relationships.inventory.BelongsTo",
+ "direction": "OUT",
+ "multiplicity": "MANY2ONE",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "!${direction}",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "lag-interface",
+ "to": "logical-link",
+ "label": "org.onap.relationships.inventory.Uses",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "bloop",
+ "to": "bloop",
+ "label": "links",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "IN",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description": "for testing same type direction flip requirement"
+ },
+ {
+ "from": "parent",
+ "to": "notation",
+ "label": "has",
+ "direction": "OUT",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "${direction}",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contains notation"
+ },
+ {
+ "from": "not-notation",
+ "to": "parent",
+ "label": "contains",
+ "direction": "OUT",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contains not-notation"
+ },
+ {
+ "from": "parent",
+ "to": "out-out",
+ "label": "eats",
+ "direction": "OUT",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contains out-out"
+ },
+ {
+ "from": "parent",
+ "to": "in-in",
+ "label": "verbs",
+ "direction": "IN",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "IN",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contains in-in"
+ },
+ {
+ "from": "out-in",
+ "to": "parent",
+ "label": "alarms",
+ "direction": "OUT",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "IN",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contains out-in"
+ },
+ {
+ "from": "in-out",
+ "to": "parent",
+ "label": "befriends",
+ "direction": "IN",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contains in-out"
+ },
+ {
+ "from": "parent",
+ "to": "grandparent1",
+ "label": "has",
+ "direction": "OUT",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contained by grandparent1"
+ },
+ {
+ "from": "grandparent2",
+ "to": "parent",
+ "label": "contains",
+ "direction": "OUT",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "${direction}",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contained by grandparent2"
+ },
+ {
+ "from": "parent",
+ "to": "grandparent3",
+ "label": "eats",
+ "direction": "OUT",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "IN",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contained by grandparent3"
+ },
+ {
+ "from": "parent",
+ "to": "grandparent4",
+ "label": "verbs",
+ "direction": "IN",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contained by grandparent4"
+ },
+ {
+ "from": "grandparent5",
+ "to": "parent",
+ "label": "alarms",
+ "direction": "OUT",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contained by grandparent5"
+ },
+ {
+ "from": "grandparent6",
+ "to": "parent",
+ "label": "befriends",
+ "direction": "IN",
+ "multiplicity": "Many2Many",
+ "contains-other-v": "IN",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "description": "parent contained by grandparent6"
+ }
+ ]
+}
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test_v8.json b/aai-schema-ingest/src/test/resources/edgeRules/test_v8.json
new file mode 100644
index 00000000..483af52d
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/test_v8.json
@@ -0,0 +1,71 @@
+{
+ "rules": [
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eats",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "bar",
+ "label": "eatz",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "baz",
+ "label": "isVeryHappyAbout",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "quux",
+ "to": "foo",
+ "label": "dancesWith",
+ "direction": "IN",
+ "multiplicity": "One2Many",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "foo",
+ "to": "dog",
+ "label": "pets",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe"
+ },
+ {
+ "from": "dog",
+ "to": "puppy",
+ "label": "caresFor",
+ "direction": "OUT",
+ "multiplicity": "One2Many",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "description": "Hard to describe",
+ "default": "true"
+ }
+ ]
+}
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test_v9.json b/aai-schema-ingest/src/test/resources/edgeRules/test_v9.json
new file mode 100644
index 00000000..6fa9c6c4
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/test_v9.json
@@ -0,0 +1,4 @@
+{
+ "rules": [
+ ]
+}
diff --git a/aai-schema-ingest/src/test/resources/edgerequests.json b/aai-schema-ingest/src/test/resources/edgerequests.json
new file mode 100644
index 00000000..0878686f
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgerequests.json
@@ -0,0 +1,50 @@
+{
+ "mock-uri":
+ [
+ {
+ "aai-uri": "/versions",
+ "response-file": "payload/versions.json",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/edgerules?version=v8",
+ "response-file": "edgeRules/test_v8.json",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/edgerules?version=v9",
+ "response-file": "edgeRules/test_v9.json",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/edgerules?version=v10",
+ "response-file": "edgeRules/test_v10.json",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/edgerules?version=v11",
+ "response-file": "edgeRules/test_v11.json",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/edgerules?version=v12",
+ "response-file": "edgeRules/test_v12.json",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/edgerules?version=v13",
+ "response-file": "edgeRules/test_v13.json",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/edgerules?version=v14",
+ "response-file": "edgeRules/test_v14.json",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/edgerules?version=v15",
+ "response-file": "edgeRules/test_v15.json",
+ "content": "application/json;charset=UTF-8"
+ }
+ ]
+}
diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/aai_oxm_v13.xml b/aai-schema-ingest/src/test/resources/forWiringTests/aai_oxm_v13.xml
index ec814118..1c862965 100644
--- a/aai-schema-ingest/src/test/resources/forWiringTests/aai_oxm_v13.xml
+++ b/aai-schema-ingest/src/test/resources/forWiringTests/aai_oxm_v13.xml
@@ -4627,4 +4627,5 @@
<xml-property name="container" value="evcs"/>
</xml-properties>
</java-type>
- </java-types>\n</xml-bindings>
+ </java-types>
+</xml-bindings>
diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-ss-wiring-test.properties b/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-ss-wiring-test.properties
new file mode 100644
index 00000000..d27198da
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-ss-wiring-test.properties
@@ -0,0 +1,20 @@
+schema.configuration.location=NA
+server.local.startpath=src/main/resources/
+schema.service.base.url=https://localhost:8452/aai/schema-service/v1/
+schema.service.nodes.endpoint=nodes?version=
+schema.service.edges.endpoint=edgerules?version=
+schema.service.versions.endpoint=versions
+#Remove the below once we remove dependencies on schema-version value
+schema.version.list=v8,v9,v10,v11,v12,v13,v14,v15
+schema.version.depth.start=v10
+schema.version.related.link.start=v10
+schema.version.app.root.start=v11
+schema.version.namespace.change.start=v11
+schema.version.edge.label.start=v12
+schema.version.api.default=v15
+schema.local=true
+mock.filename=mockrequests
+spring.application.name=aai
+schema.translator.list=schema-service
+schema.service.client=mock-no-auth
+
diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test-local-node.properties b/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test-local-node.properties
new file mode 100644
index 00000000..5d1173d0
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test-local-node.properties
@@ -0,0 +1,14 @@
+schema.configuration.location=NA
+schema.nodes.location=src/test/resources/oxm/
+schema.edges.location=src/test/resources/edgeRules/
+schema.version.list=v9,v10,v11,v12,v13,v14,v15
+schema.version.depth.start=v10
+schema.version.related.link.start=v10
+schema.version.app.root.start=v11
+schema.version.namespace.change.start=v11
+schema.version.edge.label.start=v12
+schema.version.api.default=v15
+server.local.startpath=src/main/resources/
+schema.local=true
+spring.application.name=aai
+schema.translator.list=config
diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties b/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties
new file mode 100644
index 00000000..c213a558
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test-local.properties
@@ -0,0 +1,15 @@
+schema.configuration.location=NA
+schema.nodes.location=src/test/resources/oxm/
+schema.edges.location=src/test/resources/edgeRules/
+schema.version.list=v8,v9,v10,v11,v12,v13,v14,v15
+schema.version.depth.start=v10
+schema.version.related.link.start=v10
+schema.version.app.root.start=v11
+schema.version.namespace.change.start=v11
+schema.version.edge.label.start=v12
+schema.version.api.default=v15
+server.local.startpath=src/main/resources/
+schema.local=true
+spring.application.name=aai
+schema.translator.list=config
+
diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test.properties b/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test.properties
index 393b8f12..f372d06d 100644
--- a/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test.properties
+++ b/aai-schema-ingest/src/test/resources/forWiringTests/schema-ingest-wiring-test.properties
@@ -1,10 +1,20 @@
schema.configuration.location=NA
schema.nodes.location=src/test/resources/oxm/
schema.edges.location=src/test/resources/edgeRules/
-schema.version.list=v7,v8,v9,v10,v11,v12,v13,v14
-schema.version.depth.start=v9
+schema.version.list=v8,v9,v10,v11,v12,v13,v14,v15
+schema.version.depth.start=v10
schema.version.related.link.start=v10
schema.version.app.root.start=v11
schema.version.namespace.change.start=v11
schema.version.edge.label.start=v12
-schema.version.api.default=v14 \ No newline at end of file
+schema.version.api.default=v15
+server.local.startpath=src/main/resources/
+schema.service.base.url=https://localhost:8452/aai/schema-service/v1
+schema.service.nodes.endpoint=node-schema?version=
+schema.service.edges.endpoint=edgerules?version=
+schema.service.versions.endpoint=versions
+schema.local=false
+mock.filename=edgerequests
+spring.application.name=aai
+schema.translator.list=schema-service
+schema.service.client=mock-no-auth
diff --git a/aai-schema-ingest/src/test/resources/mockrequests.json b/aai-schema-ingest/src/test/resources/mockrequests.json
new file mode 100644
index 00000000..7d669007
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/mockrequests.json
@@ -0,0 +1,52 @@
+{
+ "mock-uri":
+ [
+ {
+ "aai-uri": "/versions",
+ "response-file": "payload/versions.json",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/nodes?version=v8",
+ "response-file": "oxm/test_combined_network_business_v8.xml",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/nodes?version=v9",
+ "response-file": "oxm/test_combined_network_business_v9.xml",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/nodes?version=v10",
+ "response-file": "oxm/test_combined_network_business_v10.xml",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/nodes?version=v11",
+ "response-file": "oxm/test_combined_network_business_v11.xml",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/nodes?version=v12",
+ "response-file": "oxm/test_combined_network_business_v12.xml",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/nodes?version=v13",
+ "response-file": "oxm/test_combined_v13.xml",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/nodes?version=v14",
+ "response-file": "oxm/test_combined_network_business_v14.xml",
+ "content": "application/json;charset=UTF-8"
+ },
+ {
+ "aai-uri": "/nodes?version=v15",
+ "response-file": "oxm/test_combined_network_business_v15.xml",
+ "content": "application/json;charset=UTF-8"
+ }
+ ]
+
+
+}
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml b/aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml
index 5ead4178..c3b60dbd 100644
--- a/aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml
+++ b/aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml
@@ -19,9 +19,9 @@
============LICENSE_END=========================================================
-->
-<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v12" xml-mapping-metadata-complete="true">
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v10" xml-mapping-metadata-complete="true">
<xml-schema element-form-default="QUALIFIED">
- <xml-ns namespace-uri="http://org.onap.aai.inventory/v12" />
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v10" />
</xml-schema>
<java-types>
@@ -47,4 +47,4 @@
</java-type>
</java-types>
-</xml-bindings> \ No newline at end of file
+</xml-bindings>
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v10.xml b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v10.xml
new file mode 100644
index 00000000..a0fd77ca
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v10.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ ============LICENSE_START=======================================================
+ org.openecomp.aai
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ 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=========================================================
+ -->
+
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v10" xml-mapping-metadata-complete="true">
+ <xml-schema element-form-default="QUALIFIED">
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v10" />
+ </xml-schema>
+ <java-types>
+
+ <java-type name="Foo">
+ <xml-root-element name="foo" />
+ <java-attributes>
+ <xml-element java-attribute="fooId" name="foo-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Foo. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="fooName" name="foo-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of Foo." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="nameProps" value="foo-name" />
+ <xml-property name="uniqueProps" value="foo-id" />
+ </xml-properties>
+ </java-type>
+
+
+
+ <java-type name="Bar">
+ <xml-root-element name="bar" />
+ <java-attributes>
+ <xml-element java-attribute="barId" name="bar-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Bar This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="uniqueProps" value="bar-id" />
+ </xml-properties>
+ </java-type>
+
+
+ </java-types>
+</xml-bindings>
+
+
+
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v11.xml b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v11.xml
new file mode 100644
index 00000000..17ae17af
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v11.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ ============LICENSE_START=======================================================
+ org.openecomp.aai
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ 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=========================================================
+ -->
+
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v11" xml-mapping-metadata-complete="true">
+ <xml-schema element-form-default="QUALIFIED">
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v11" />
+ </xml-schema>
+ <java-types>
+
+ <java-type name="Foo">
+ <xml-root-element name="foo" />
+ <java-attributes>
+ <xml-element java-attribute="fooId" name="foo-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Foo. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="fooName" name="foo-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of Foo." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="nameProps" value="foo-name" />
+ <xml-property name="uniqueProps" value="foo-id" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Quux">
+ <xml-root-element name="quux" />
+ <java-attributes>
+ <xml-element java-attribute="qManagerName" name="q-manager-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Quux owner. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="color" name="color" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="color" />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Bar">
+ <xml-root-element name="bar" />
+ <java-attributes>
+ <xml-element java-attribute="barId" name="bar-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Bar This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="uniqueProps" value="bar-id" />
+ </xml-properties>
+ </java-type>
+
+
+ </java-types>
+</xml-bindings>
+
+
+
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v12.xml b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v12.xml
new file mode 100644
index 00000000..d59cd5a9
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v12.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ ============LICENSE_START=======================================================
+ org.openecomp.aai
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ 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=========================================================
+ -->
+
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v12" xml-mapping-metadata-complete="true">
+ <xml-schema element-form-default="QUALIFIED">
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v12" />
+ </xml-schema>
+ <java-types>
+
+ <java-type name="Foo">
+ <xml-root-element name="foo" />
+ <java-attributes>
+ <xml-element java-attribute="fooId" name="foo-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Foo. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="fooName" name="foo-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of Foo." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="nameProps" value="foo-name" />
+ <xml-property name="uniqueProps" value="foo-id" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Quux">
+ <xml-root-element name="quux" />
+ <java-attributes>
+ <xml-element java-attribute="qManagerName" name="q-manager-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Quux owner. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="color" name="color" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="color" />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Bar">
+ <xml-root-element name="bar" />
+ <java-attributes>
+ <xml-element java-attribute="barId" name="bar-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Bar This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="uniqueProps" value="bar-id" />
+ </xml-properties>
+ </java-type>
+
+
+ </java-types>
+</xml-bindings>
+
+
+
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v13.xml b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v13.xml
new file mode 100644
index 00000000..f3fef9a5
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v13.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ ============LICENSE_START=======================================================
+ org.openecomp.aai
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ 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=========================================================
+ -->
+
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v13" xml-mapping-metadata-complete="true">
+ <xml-schema element-form-default="QUALIFIED">
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v13" />
+ </xml-schema>
+ <java-types>
+
+ <java-type name="Foo">
+ <xml-root-element name="foo" />
+ <java-attributes>
+ <xml-element java-attribute="fooId" name="foo-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Foo. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="fooName" name="foo-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of Foo." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="nameProps" value="foo-name" />
+ <xml-property name="uniqueProps" value="foo-id" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Quux">
+ <xml-root-element name="quux" />
+ <java-attributes>
+ <xml-element java-attribute="qManagerName" name="q-manager-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Quux owner. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="color" name="color" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="color" />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Bar">
+ <xml-root-element name="bar" />
+ <java-attributes>
+ <xml-element java-attribute="barId" name="bar-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Bar This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="uniqueProps" value="bar-id" />
+ </xml-properties>
+ </java-type>
+
+
+ </java-types>
+</xml-bindings>
+
+
+
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v14.xml b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v14.xml
new file mode 100644
index 00000000..a0cc0ed4
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v14.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ ============LICENSE_START=======================================================
+ org.openecomp.aai
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ 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=========================================================
+ -->
+
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v14" xml-mapping-metadata-complete="true">
+ <xml-schema element-form-default="QUALIFIED">
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v14" />
+ </xml-schema>
+ <java-types>
+
+ <java-type name="Foo">
+ <xml-root-element name="foo" />
+ <java-attributes>
+ <xml-element java-attribute="fooId" name="foo-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Foo. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="fooName" name="foo-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of Foo." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="nameProps" value="foo-name" />
+ <xml-property name="uniqueProps" value="foo-id" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Quux">
+ <xml-root-element name="quux" />
+ <java-attributes>
+ <xml-element java-attribute="qManagerName" name="q-manager-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Quux owner. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="color" name="color" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="color" />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Bar">
+ <xml-root-element name="bar" />
+ <java-attributes>
+ <xml-element java-attribute="barId" name="bar-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Bar This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="uniqueProps" value="bar-id" />
+ </xml-properties>
+ </java-type>
+
+
+ </java-types>
+</xml-bindings>
+
+
+
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v15.xml b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v15.xml
new file mode 100644
index 00000000..b1c5519c
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v15.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ ============LICENSE_START=======================================================
+ org.openecomp.aai
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ 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=========================================================
+ -->
+
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v15" xml-mapping-metadata-complete="true">
+ <xml-schema element-form-default="QUALIFIED">
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v15" />
+ </xml-schema>
+ <java-types>
+
+ <java-type name="Foo">
+ <xml-root-element name="foo" />
+ <java-attributes>
+ <xml-element java-attribute="fooId" name="foo-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Foo. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="fooName" name="foo-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of Foo." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="nameProps" value="foo-name" />
+ <xml-property name="uniqueProps" value="foo-id" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Quux">
+ <xml-root-element name="quux" />
+ <java-attributes>
+ <xml-element java-attribute="qManagerName" name="q-manager-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Quux owner. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="color" name="color" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="color" />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Bar">
+ <xml-root-element name="bar" />
+ <java-attributes>
+ <xml-element java-attribute="barId" name="bar-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Bar This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="uniqueProps" value="bar-id" />
+ </xml-properties>
+ </java-type>
+
+
+ </java-types>
+</xml-bindings>
+
+
+
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v8.xml b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v8.xml
new file mode 100644
index 00000000..06c7c4e5
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v8.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ ============LICENSE_START=======================================================
+ org.openecomp.aai
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ 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=========================================================
+ -->
+
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v8" xml-mapping-metadata-complete="true">
+ <xml-schema element-form-default="QUALIFIED">
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v8" />
+ </xml-schema>
+ <java-types>
+
+ <java-type name="Foo">
+ <xml-root-element name="foo" />
+ <java-attributes>
+ <xml-element java-attribute="fooId" name="foo-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Foo. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="fooName" name="foo-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of Foo." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="nameProps" value="foo-name" />
+ <xml-property name="uniqueProps" value="foo-id" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Quux">
+ <xml-root-element name="quux" />
+ <java-attributes>
+ <xml-element java-attribute="qManagerName" name="q-manager-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Quux owner. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="color" name="color" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="color" />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Bar">
+ <xml-root-element name="bar" />
+ <java-attributes>
+ <xml-element java-attribute="barId" name="bar-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Bar This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="uniqueProps" value="bar-id" />
+ </xml-properties>
+ </java-type>
+
+
+ </java-types>
+</xml-bindings>
+
+
+
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v9.xml b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v9.xml
new file mode 100644
index 00000000..838a728a
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/oxm/test_combined_network_business_v9.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ ============LICENSE_START=======================================================
+ org.openecomp.aai
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ 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=========================================================
+ -->
+
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v9" xml-mapping-metadata-complete="true">
+ <xml-schema element-form-default="QUALIFIED">
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v9" />
+ </xml-schema>
+ <java-types>
+
+ <java-type name="Foo">
+ <xml-root-element name="foo" />
+ <java-attributes>
+ <xml-element java-attribute="fooId" name="foo-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Foo. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="fooName" name="foo-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of Foo." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="nameProps" value="foo-name" />
+ <xml-property name="uniqueProps" value="foo-id" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Quux">
+ <xml-root-element name="quux" />
+ <java-attributes>
+ <xml-element java-attribute="qManagerName" name="q-manager-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Quux owner. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="color" name="color" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="color" />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ </xml-properties>
+ </java-type>
+
+ <java-type name="Bar">
+ <xml-root-element name="bar" />
+ <java-attributes>
+ <xml-element java-attribute="barId" name="bar-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of Bar This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="quantity" name="quantity" required="false" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="How many." />
+ </xml-properties>
+ </xml-element>
+
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose metasyntactic variable" />
+ <xml-property name="uniqueProps" value="bar-id" />
+ </xml-properties>
+ </java-type>
+
+
+ </java-types>
+</xml-bindings>
+
+
+
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_combined_v13.xml b/aai-schema-ingest/src/test/resources/oxm/test_combined_v13.xml
new file mode 100644
index 00000000..14da0168
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/oxm/test_combined_v13.xml
@@ -0,0 +1,4629 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v13" xml-mapping-metadata-complete="true">
+ <xml-schema element-form-default="QUALIFIED">
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v13" />
+ </xml-schema>
+ <java-types>
+ <java-type name="AllottedResources">
+ <xml-properties>
+ <xml-property name="description" value="This object is used to store slices of services being offered" />
+ </xml-properties>
+ <xml-root-element name="allotted-resources" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="allottedResource" name="allotted-resource" type="inventory.aai.onap.org.v13.AllottedResource" />
+ </java-attributes>
+ </java-type>
+ <java-type name="AllottedResource">
+ <xml-root-element name="allotted-resource" />
+ <java-attributes>
+ <xml-element java-attribute="id" name="id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Allotted Resource id UUID assigned to this instance." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="description" name="description" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The descriptive information assigned to this allotted resource instance" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="selflink" name="selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Link back to more information in the controller" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model id for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="internal" />
+ <xml-property name="dataCopy" value="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Concurrency value" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Orchestration status" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="operationalStatus" name="operational-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicator for whether the resource is considered operational" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="type" name="type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Generic description of the type of allotted resource." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="role" name="role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="role in the network that this resource will be providing." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="tunnelXconnects" name="tunnel-xconnects" type="inventory.aai.onap.org.v13.TunnelXconnects" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Represents a slice or partial piece of a resource that gets separately allotted" />
+ <xml-property name="nameProps" value="description" />
+ <xml-property name="uniqueProps" value="id" />
+ <xml-property name="indexedProps" value="id,model-invariant-id,model-version-id,type,role" />
+ <xml-property name="dependentOn" value="service-instance" />
+ <xml-property name="container" value="allotted-resources" />
+ <!-- <xml-property name="namespace" value="network" /> -->
+ </xml-properties>
+ </java-type>
+ <java-type name="Business">
+ <xml-properties>
+ <xml-property name="description" value="Namespace for business related constructs" />
+ </xml-properties>
+ <xml-root-element name="business" />
+ <java-attributes>
+ <xml-element java-attribute="connectors" name="connectors" type="inventory.aai.onap.org.v13.Connectors" />
+ <xml-element java-attribute="customers" name="customers" type="inventory.aai.onap.org.v13.Customers" />
+ <xml-element java-attribute="linesOfBusiness" name="lines-of-business" type="inventory.aai.onap.org.v13.LinesOfBusiness" />
+ <xml-element java-attribute="owningEntities" name="owning-entities" type="inventory.aai.onap.org.v13.OwningEntities" />
+ <xml-element java-attribute="platforms" name="platforms" type="inventory.aai.onap.org.v13.Platforms" />
+ <xml-element java-attribute="projects" name="projects" type="inventory.aai.onap.org.v13.Projects" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Connectors">
+ <xml-properties>
+ <xml-property name="description" value="Collection of resource instances used to connect a variety of disparate inventory widgets" />
+ </xml-properties>
+ <xml-root-element name="connectors" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="connector" name="connector" type="inventory.aai.onap.org.v13.Connector" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Connector">
+ <xml-root-element name="connector" />
+ <java-attributes>
+ <xml-element java-attribute="resourceInstanceId" name="resource-instance-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of resource instance." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model id for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="internal" />
+ <xml-property name="dataCopy" value="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&amp;AI widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&amp;AI version of the widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element java-attribute="metadata" name="metadata" type="inventory.aai.onap.org.v13.Metadata" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Collection of resource instances used to connect a variety of disparate inventory widgets" />
+ <xml-property name="indexedProps" value="resource-instance-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version" />
+ <xml-property name="container" value="connectors" />
+ <xml-property name="namespace" value="business" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Customers">
+ <xml-properties>
+ <xml-property name="description" value="Collection of customer identifiers to provide linkage back to BSS information." />
+ </xml-properties>
+ <xml-root-element name="customers" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="customer" name="customer" type="inventory.aai.onap.org.v13.Customer" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="maximumDepth" value="0" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Customer">
+ <xml-root-element name="customer" />
+ <java-attributes>
+ <xml-element java-attribute="globalCustomerId" name="global-customer-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Global customer id used across ECOMP to uniquely identify customer." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="subscriberName" name="subscriber-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Subscriber name, an alternate way to retrieve a customer." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="subscriberType" name="subscriber-type" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Subscriber type, a way to provide VID with only the INFRA customers." />
+ <xml-property name="defaultValue" value="CUST" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceSubscriptions" name="service-subscriptions" type="inventory.aai.onap.org.v13.ServiceSubscriptions" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="customer identifiers to provide linkage back to BSS information." />
+ <xml-property name="nameProps" value="subscriber-name" />
+ <xml-property name="indexedProps" value="subscriber-name,global-customer-id,subscriber-type" />
+ <xml-property name="searchable" value="global-customer-id,subscriber-name" />
+ <xml-property name="uniqueProps" value="global-customer-id" />
+ <xml-property name="container" value="customers" />
+ <xml-property name="namespace" value="business" />
+ </xml-properties>
+ </java-type>
+ <java-type name="LinesOfBusiness">
+ <xml-properties>
+ <xml-property name="description" value="Collection of lines-of-business" />
+ </xml-properties>
+ <xml-root-element name="lines-of-business" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="lineOfBusiness" name="line-of-business" type="inventory.aai.onap.org.v13.LineOfBusiness" />
+ </java-attributes>
+ </java-type>
+ <java-type name="LineOfBusiness">
+ <xml-root-element name="line-of-business" />
+ <java-attributes>
+ <xml-element java-attribute="lineOfBusinessName" name="line-of-business-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Name of the line-of-business (product)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="describes a line-of-business" />
+ <xml-property name="indexedProps" value="line-of-business-name" />
+ <xml-property name="uniqueProps" value="line-of-business-name" />
+ <xml-property name="container" value="lines-of-business" />
+ <xml-property name="namespace" value="business" />
+ </xml-properties>
+ </java-type>
+ <java-type name="OwningEntities">
+ <xml-properties>
+ <xml-property name="description" value="Collection of owning-entities" />
+ </xml-properties>
+ <xml-root-element name="owning-entities" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="owningEntity" name="owning-entity" type="inventory.aai.onap.org.v13.OwningEntity" />
+ </java-attributes>
+ </java-type>
+ <java-type name="OwningEntity">
+ <xml-root-element name="owning-entity" />
+ <java-attributes>
+ <xml-element java-attribute="owningEntityId" name="owning-entity-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="UUID of an owning entity" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="owningEntityName" name="owning-entity-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Owning entity name" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="describes an owning-entity" />
+ <xml-property name="indexedProps" value="owning-entity-id,owning-entity-name" />
+ <xml-property name="searchable" value="owning-entity-id" />
+ <xml-property name="uniqueProps" value="owning-entity-id,owning-entity-name" />
+ <xml-property name="container" value="owning-entities" />
+ <xml-property name="namespace" value="business" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Platforms">
+ <xml-properties>
+ <xml-property name="description" value="Collection of platforms" />
+ </xml-properties>
+ <xml-root-element name="platforms" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="platform" name="platform" type="inventory.aai.onap.org.v13.Platform" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Platform">
+ <xml-root-element name="platform" />
+ <java-attributes>
+ <xml-element java-attribute="platformName" name="platform-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Name of the platform" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="describes a platform" />
+ <xml-property name="indexedProps" value="platform-name" />
+ <xml-property name="uniqueProps" value="platform-name" />
+ <xml-property name="container" value="platforms" />
+ <xml-property name="namespace" value="business" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Projects">
+ <xml-properties>
+ <xml-property name="description" value="Collection of projects" />
+ </xml-properties>
+ <xml-root-element name="projects" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="project" name="project" type="inventory.aai.onap.org.v13.Project" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Project">
+ <xml-root-element name="project" />
+ <java-attributes>
+ <xml-element java-attribute="projectName" name="project-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Name of the project deploying a service" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="describes the project" />
+ <xml-property name="indexedProps" value="project-name" />
+ <xml-property name="uniqueProps" value="project-name" />
+ <xml-property name="container" value="projects" />
+ <xml-property name="namespace" value="business" />
+ </xml-properties>
+ </java-type>
+ <java-type name="ServiceSubscriptions">
+ <xml-properties>
+ <xml-property name="description" value="Collection of objects that group service instances." />
+ </xml-properties>
+ <xml-root-element name="service-subscriptions" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="serviceSubscription" name="service-subscription" type="inventory.aai.onap.org.v13.ServiceSubscription" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ServiceSubscription">
+ <xml-root-element name="service-subscription" />
+ <java-attributes>
+ <xml-element java-attribute="serviceType" name="service-type" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Value defined by orchestration to identify this service across ECOMP." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="tempUbSubAccountId" name="temp-ub-sub-account-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="This property will be deleted from A&amp;AI in the near future. Only stop gap solution." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceInstances" name="service-instances" type="inventory.aai.onap.org.v13.ServiceInstances">
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Object that group service instances." />
+ <xml-property name="indexedProps" value="service-type" />
+ <xml-property name="dependentOn" value="customer" />
+ <xml-property name="container" value="service-subscriptions" />
+ <xml-property name="crossEntityReference" value="service-instance,service-type" />
+ </xml-properties>
+ </java-type>
+ <java-type name="ServiceInstances">
+ <xml-properties>
+ <xml-property name="description" value="Collection of service instances" />
+ </xml-properties>
+ <xml-root-element name="service-instances" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="serviceInstance" name="service-instance" type="inventory.aai.onap.org.v13.ServiceInstance" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ServiceInstance">
+ <xml-root-element name="service-instance" />
+ <java-attributes>
+ <xml-element java-attribute="serviceInstanceId" name="service-instance-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Uniquely identifies this instance of a service" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceInstanceName" name="service-instance-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="This field will store a name assigned to the service-instance." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceType" name="service-type" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="String capturing type of service." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceRole" name="service-role" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="String capturing the service role." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="environmentContext" name="environment-context" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="This field will store the environment context assigned to the service-instance." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="workloadContext" name="workload-context" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="This field will store the workload context assigned to the service-instance." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model id for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="internal" />
+ <xml-property name="dataCopy" value="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&amp;AI widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&amp;AI version of the widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="bandwidthTotal" name="bandwidth-total" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicates the total bandwidth to be used for this service." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="bandwidthUpWan1" name="bandwidth-up-wan1" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="indicates the upstream bandwidth this service will use on the WAN1 port of the physical device." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="bandwidthDownWan1" name="bandwidth-down-wan1" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="indicates the downstream bandwidth this service will use on the WAN1 port of the physical device." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="bandwidthUpWan2" name="bandwidth-up-wan2" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="indicates the upstream bandwidth this service will use on the WAN2 port of the physical device." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="bandwidthDownWan2" name="bandwidth-down-wan2" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="indicates the downstream bandwidth this service will use on the WAN2 port of the physical device." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vhnPortalUrl" name="vhn-portal-url" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="URL customers will use to access the vHN Portal." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceInstanceLocationId" name="service-instance-location-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="An identifier that customers assign to the location where this service is being used." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="selflink" name="selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Path to the controller object." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Orchestration status of this service." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element java-attribute="metadata" name="metadata" type="inventory.aai.onap.org.v13.Metadata" />
+ <xml-element java-attribute="allottedResources" name="allotted-resources" type="inventory.aai.onap.org.v13.AllottedResources" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Instance of a service" />
+ <xml-property name="indexedProps" value="service-instance-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,service-instance-name,service-instance-location-id,orchestration-status,environment-context,workload-context" />
+ <xml-property name="nameProps" value="service-instance-name" />
+ <xml-property name="searchable" value="service-instance-id,service-instance-name" />
+ <xml-property name="uniqueProps" value="service-instance-id" />
+ <xml-property name="dependentOn" value="service-subscription" />
+ <xml-property name="container" value="service-instances" />
+ </xml-properties>
+ </java-type>
+ <java-type name="TunnelXconnects">
+ <xml-properties>
+ <xml-property name="description" value="This object is used to store the specific tunnel cross connect aspects of an allotted resource" />
+ </xml-properties>
+ <xml-root-element name="tunnel-xconnects" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="tunnelXconnect" name="tunnel-xconnect" type="inventory.aai.onap.org.v13.TunnelXconnect" />
+ </java-attributes>
+ </java-type>
+ <java-type name="TunnelXconnect">
+ <xml-root-element name="tunnel-xconnect" />
+ <java-attributes>
+ <xml-element java-attribute="id" name="id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Allotted Resource id UUID assigned to this instance." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="bandwidthUpWan1" name="bandwidth-up-wan1" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The WAN uplink bandwidth for WAN1" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="bandwidthDownWan1" name="bandwidth-down-wan1" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The WAN downlink bandwidth for WAN1" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="bandwidthUpWan2" name="bandwidth-up-wan2" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The WAN uplink bandwidth for WAN2" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="bandwidthDownWan2" name="bandwidth-down-wan2" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The WAN downlink bandwidth for WAN2" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Concurrency value" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Represents the specifics of a tunnel cross connect piece of a resource that gets separately allotted" />
+ <xml-property name="uniqueProps" value="id" />
+ <xml-property name="indexedProps" value="id" />
+ <xml-property name="dependentOn" value="allotted-resource" />
+ <xml-property name="container" value="tunnel-xconnects" />
+ <!-- <xml-property name="namespace" value="network" /> -->
+ </xml-properties>
+ </java-type>
+ <java-type name="RelationshipList">
+ <xml-root-element name="relationship-list" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="relationship" name="relationship" type="inventory.aai.onap.org.v13.Relationship" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Relationship">
+ <xml-root-element name="relationship" />
+ <java-attributes>
+ <xml-element java-attribute="relatedTo" name="related-to" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="A keyword provided by A&amp;AI to indicate type of node." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipLabel" name="relationship-label" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The edge label for this relationship." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relatedLink" name="related-link" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="URL to the object in A&amp;AI." />
+ </xml-properties>
+ </xml-element>
+ <xml-element container-type="java.util.ArrayList" java-attribute="relationshipData" name="relationship-data" type="inventory.aai.onap.org.v13.RelationshipData" />
+ <xml-element container-type="java.util.ArrayList" java-attribute="relatedToProperty" name="related-to-property" type="inventory.aai.onap.org.v13.RelatedToProperty" />
+ </java-attributes>
+ </java-type>
+ <java-type name="RelatedToProperty">
+ <xml-root-element name="related-to-property" />
+ <java-attributes>
+ <xml-element java-attribute="propertyKey" name="property-key" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Key part of a key/value pair" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="propertyValue" name="property-value" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Value part of a key/value pair" />
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ </java-type>
+ <java-type name="RelationshipData">
+ <xml-root-element name="relationship-data" />
+ <java-attributes>
+ <xml-element java-attribute="relationshipKey" name="relationship-key" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="A keyword provided by A&amp;AI to indicate an attribute." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipValue" name="relationship-value" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Value of the attribute." />
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ </java-type>
+ <java-type name="Metadata">
+ <xml-properties>
+ <xml-property name="description" value="Collection of metadatum (key/value pairs)" />
+ </xml-properties>
+ <xml-root-element name="metadata" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="metadatum" name="metadatum" type="inventory.aai.onap.org.v13.Metadatum" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Metadatum">
+ <xml-root-element name="metadatum" />
+ <java-attributes>
+ <xml-element java-attribute="metaname" name="metaname" required="true" type="java.lang.String" xml-key="true" />
+ <xml-element java-attribute="metaval" name="metaval" required="true" type="java.lang.String" />
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Key/value pairs" />
+ <xml-property name="indexedProps" value="metaname" />
+ <xml-property name="dependentOn" value="tenant,image,service-instance,connector,model" />
+ <xml-property name="container" value="metadata" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Collections">
+ <xml-root-element name="collections" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="collection" name="collection" type="inventory.aai.onap.org.v13.Collection" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Collection">
+ <xml-root-element name="collection"/>
+ <java-attributes>
+ <xml-element java-attribute="collectionId" name="collection-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Collection Object UUID"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ASDC model id for this resource or service model" />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Model Version" />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="collectionName" name="collection-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="collection name" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="collectionType" name="collection-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Collection type" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="collectionRole" name="collection-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Collection Role" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="collectionFunction" name="collection-function" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Collection function" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="orchestration status" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="collectionCustomizationId" name="collection-customization-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the id of all the configuration used to customize the resource for the service" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList"/>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="namespace" value="network" />
+ <xml-property name="description" value="represents the collection resource in the TOSCA model" />
+ <xml-property name="uniqueProps" value="collection-id" />
+ <xml-property name="indexedProps" value="collection-id,model-invariant-id,model-version-id" />
+ <xml-property name="container" value="collections" />
+ </xml-properties>
+ </java-type>
+ <java-type name="ConstrainedElementSets">
+ <xml-root-element name="constrained-element-sets" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="constrainedElementSet" name="constrained-element-set" type="inventory.aai.onap.org.v13.ConstrainedElementSet" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ConstrainedElementSet">
+ <xml-properties>
+ <xml-property name="description" value="This is how we would capture constraints defining allowed sets of elements." />
+ <xml-property name="uniqueProps" value="constrained-element-set-uuid" />
+ <xml-property name="indexedProps" value="constrained-element-set-uuid" />
+ <xml-property name="allowDirectRead" value="true" />
+ <xml-property name="allowDirectWrite" value="false" />
+ <xml-property name="container" value="constrained-element-sets" />
+ </xml-properties>
+ <xml-root-element name="constrained-element-set" />
+ <java-attributes>
+ <xml-element java-attribute="constrainedElementSetUuid" name="constrained-element-set-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="autoGenerateUuid" value="true" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="constraintType" name="constraint-type" required="true" type="java.lang.String" />
+ <xml-element java-attribute="checkType" name="check-type" required="true" type="java.lang.String" />
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" />
+ <xml-element java-attribute="elementChoiceSets" name="element-choice-sets" type="inventory.aai.onap.org.v13.ElementChoiceSets" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ElementChoiceSets">
+ <xml-root-element name="element-choice-sets" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="elementChoiceSet" name="element-choice-set" type="inventory.aai.onap.org.v13.ElementChoiceSet" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ElementChoiceSet">
+ <xml-properties>
+ <xml-property name="description" value="This is how we would capture constraints defining allowed sets of elements." />
+ <xml-property name="uniqueProps" value="element-choice-set-uuid" />
+ <xml-property name="indexedProps" value="element-choice-set-uuid" />
+ <xml-property name="allowDirectRead" value="true" />
+ <xml-property name="allowDirectWrite" value="false" />
+ <xml-property name="container" value="element-choice-sets" />
+ </xml-properties>
+ <xml-root-element name="element-choice-set" />
+ <java-attributes>
+ <xml-element java-attribute="elementChoiceSetUuid" name="element-choice-set-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="autoGenerateUuid" value="true" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="elementChoiceSetName" name="element-choice-set-name" required="true" type="java.lang.String" />
+ <xml-element java-attribute="cardinality" name="cardinality" type="java.lang.String" />
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" />
+ <xml-element java-attribute="modelElements" name="model-elements" type="inventory.aai.onap.org.v13.ModelElements" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ </java-type>
+ <java-type name="NamedQueries">
+ <xml-root-element name="named-queries" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="namedQuery" name="named-query" type="inventory.aai.onap.org.v13.NamedQuery" />
+ </java-attributes>
+ </java-type>
+ <java-type name="NamedQuery">
+ <xml-properties>
+ <xml-property name="description" value="TBD" />
+ <xml-property name="nameProps" value="named-query-name" />
+ <xml-property name="uniqueProps" value="named-query-uuid" />
+ <xml-property name="indexedProps" value="named-query-uuid,named-query-name" />
+ <xml-property name="container" value="named-queries" />
+ <xml-property name="namespace" value="service-design-and-creation" />
+ </xml-properties>
+ <xml-root-element name="named-query" />
+ <java-attributes>
+ <xml-element java-attribute="namedQueryUuid" name="named-query-uuid" required="true" type="java.lang.String" xml-key="true" />
+ <xml-element java-attribute="namedQueryName" name="named-query-name" required="true" type="java.lang.String" />
+ <xml-element java-attribute="namedQueryVersion" name="named-query-version" required="true" type="java.lang.String" />
+ <xml-element container-type="java.util.ArrayList" java-attribute="requiredInputParams" name="required-input-param" type="java.lang.String" >
+ <xml-element-wrapper name="required-input-params" />
+ </xml-element>
+ <xml-element java-attribute="description" name="description" type="java.lang.String" />
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" />
+ <xml-element java-attribute="namedQueryElements" name="named-query-elements" type="inventory.aai.onap.org.v13.NamedQueryElements" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ </java-type>
+ <java-type name="NamedQueryElements">
+ <xml-root-element name="named-query-elements" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="namedQueryElement" name="named-query-element" type="inventory.aai.onap.org.v13.NamedQueryElement" />
+ </java-attributes>
+ </java-type>
+ <java-type name="NamedQueryElement">
+ <xml-properties>
+ <xml-property name="description" value="TBD" />
+ <xml-property name="uniqueProps" value="named-query-element-uuid" />
+ <xml-property name="indexedProps" value="named-query-element-uuid" />
+ <xml-property name="allowDirectRead" value="true" />
+ <xml-property name="allowDirectWrite" value="false" />
+ <xml-property name="container" value="named-query-elements" />
+ </xml-properties>
+ <xml-root-element name="named-query-element" />
+ <java-attributes>
+ <xml-element java-attribute="namedQueryElementUuid" name="named-query-element-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="autoGenerateUuid" value="true" />
+ </xml-properties>
+ </xml-element>
+ <xml-element container-type="java.util.ArrayList" java-attribute="propertyCollectList" name="property-collect-list" type="java.lang.String" />
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" />
+ <xml-element java-attribute="propertyLimitDesc" name="property-limit-desc" type="java.lang.String" />
+ <xml-element java-attribute="doNotOutput" name="do-not-output" type="java.lang.String" />
+ <xml-element java-attribute="namedQueryElements" name="named-query-elements" type="inventory.aai.onap.org.v13.NamedQueryElements" />
+ <xml-element java-attribute="relatedLookups" name="related-lookups" type="inventory.aai.onap.org.v13.RelatedLookups" />
+ <xml-element java-attribute="propertyConstraints" name="property-constraints" type="inventory.aai.onap.org.v13.PropertyConstraints" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ </java-type>
+ <java-type name="RelatedLookups">
+ <xml-root-element name="related-lookups" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="relatedLookup" name="related-lookup" type="inventory.aai.onap.org.v13.RelatedLookup" />
+ </java-attributes>
+ </java-type>
+ <java-type name="RelatedLookup">
+ <xml-properties>
+ <xml-property name="description" value="TBD" />
+ <xml-property name="uniqueProps" value="related-lookup-uuid" />
+ <xml-property name="indexedProps" value="related-lookup-uuid" />
+ <xml-property name="allowDirectRead" value="true" />
+ <xml-property name="allowDirectWrite" value="false" />
+ <xml-property name="container" value="related-lookups" />
+ </xml-properties>
+ <xml-root-element name="related-lookup" />
+ <java-attributes>
+ <xml-element java-attribute="relatedLookupUuid" name="related-lookup-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="autoGenerateUuid" value="true" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="sourceNodeType" name="source-node-type" required="true" type="java.lang.String" />
+ <xml-element java-attribute="sourceNodeProperty" name="source-node-property" required="true" type="java.lang.String" />
+ <xml-element java-attribute="targetNodeType" name="target-node-type" required="true" type="java.lang.String" />
+ <xml-element java-attribute="targetNodeProperty" name="target-node-property" required="true" type="java.lang.String" />
+ <xml-element container-type="java.util.ArrayList" java-attribute="propertyCollectList" name="property-collect-list" type="java.lang.String" />
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ </java-type>
+ <java-type name="PropertyConstraints">
+ <xml-root-element name="property-constraints" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="propertyConstraint" name="property-constraint" type="inventory.aai.onap.org.v13.PropertyConstraint" />
+ </java-attributes>
+ </java-type>
+ <java-type name="PropertyConstraint">
+ <xml-properties>
+ <xml-property name="description" value="TBD" />
+ <xml-property name="uniqueProps" value="property-constraint-uuid" />
+ <xml-property name="indexedProps" value="property-constraint-uuid" />
+ <xml-property name="allowDirectRead" value="true" />
+ <xml-property name="allowDirectWrite" value="false" />
+ <xml-property name="container" value="property-constraints" />
+ </xml-properties>
+ <xml-root-element name="property-constraint" />
+ <java-attributes>
+ <xml-element java-attribute="propertyConstraintUuid" name="property-constraint-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="autoGenerateUuid" value="true" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="constraintType" name="constraint-type" required="true" type="java.lang.String" />
+ <xml-element java-attribute="propertyName" name="property-name" required="true" type="java.lang.String" />
+ <xml-element java-attribute="propertyValue" name="property-value" required="true" type="java.lang.String" />
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ServiceDesignAndCreation">
+ <xml-properties>
+ <xml-property name="description" value="Namespace for objects managed by ASDC" />
+ </xml-properties>
+ <xml-root-element name="service-design-and-creation" />
+ <java-attributes>
+ <xml-element java-attribute="vnfImages" name="vnf-images" type="inventory.aai.onap.org.v13.VnfImages" />
+ <xml-element java-attribute="services" name="services" type="inventory.aai.onap.org.v13.Services" />
+ <xml-element java-attribute="serviceCapabilities" name="service-capabilities" type="inventory.aai.onap.org.v13.ServiceCapabilities" />
+ <xml-element java-attribute="models" name="models" type="inventory.aai.onap.org.v13.Models" />
+ <xml-element java-attribute="namedQueries" name="named-queries" type="inventory.aai.onap.org.v13.NamedQueries" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Services">
+ <xml-properties>
+ <xml-property name="description" value="Collection of service model definitions. Likely to be deprecated in favor of models from ASDC." />
+ </xml-properties>
+ <xml-root-element name="services" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="service" name="service" type="inventory.aai.onap.org.v13.Service" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Service">
+ <xml-root-element name="service" />
+ <java-attributes>
+ <xml-element java-attribute="serviceId" name="service-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="This gets defined by others to provide a unique ID for the service, we accept what is sent." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceDescription" name="service-description" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Description of the service" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceSelflink" name="service-selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="URL to endpoint where AAI can get more details" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceVersion" name="service-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="service version" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Stand-in for service model definitions. Likely to be deprecated in favor of models from ASDC. Does not strictly map to ASDC services." />
+ <xml-property name="indexedProps" value="service-description,service-id" />
+ <xml-property name="container" value="services" />
+ <xml-property name="namespace" value="service-design-and-creation" />
+ </xml-properties>
+ </java-type>
+ <java-type name="ServiceCapabilities">
+ <xml-properties>
+ <xml-property name="description" value="Collection of service capabilities." />
+ </xml-properties>
+ <xml-root-element name="service-capabilities" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="serviceCapability" name="service-capability" type="inventory.aai.onap.org.v13.ServiceCapability" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ServiceCapability">
+ <xml-root-element name="service-capability" />
+ <java-attributes>
+ <xml-element java-attribute="serviceType" name="service-type" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="This gets defined by others to provide a unique ID for the service, we accept what is sent." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vnfType" name="vnf-type" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Early definition of server/resource pairings, likely to be replaced by models. No new use should be made of this." />
+ <xml-property name="indexedProps" value="service-type,vnf-type" />
+ <xml-property name="container" value="service-capabilities" />
+ <xml-property name="namespace" value="service-design-and-creation" />
+ </xml-properties>
+ </java-type>
+ <java-type name="VnfImages">
+ <xml-properties>
+ <xml-property name="description" value="Collection of image objects that pertain to a VNF that doesn't have associated vservers. This is a kludge." />
+ </xml-properties>
+ <xml-root-element name="vnf-images" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="vnfImage" name="vnf-image" type="inventory.aai.onap.org.v13.VnfImage" />
+ </java-attributes>
+ </java-type>
+ <java-type name="VnfImage">
+ <xml-root-element name="vnf-image" />
+ <java-attributes>
+ <xml-element java-attribute="vnfImageUuid" name="vnf-image-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID of this asset" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="application" name="application" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The application that the image instantiates." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="applicationVendor" name="application-vendor" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The vendor of the application." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="applicationVersion" name="application-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The version of the application." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="selflink" name="selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="URL to endpoint where AAI can get more details" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Image object that pertain to a VNF that doesn't have associated vservers. This is a kludge." />
+ <xml-property name="indexedProps" value="application,vnf-image-uuid,application-vendor,application-version" />
+ <xml-property name="uniqueProps" value="vnf-image-uuid" />
+ <xml-property name="container" value="vnf-images" />
+ <xml-property name="namespace" value="service-design-and-creation" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Models">
+ <xml-properties>
+ <xml-property name="description" value="Collection of subgraph definitions provided by ASDC to describe the inventory assets and their connections related to ASDC models" />
+ </xml-properties>
+ <xml-root-element name="models" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="model" name="model" type="inventory.aai.onap.org.v13.Model" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Model">
+ <xml-root-element name="model" />
+ <xml-properties>
+ <xml-property name="description" value="Subgraph definition provided by ASDC to describe an inventory asset and its connections related to ASDC models, independent of version" />
+ <xml-property name="nameProps" value="model-type" />
+ <xml-property name="indexedProps" value="model-invariant-id,model-type" />
+ <xml-property name="uniqueProps" value="model-invariant-id" />
+ <xml-property name="container" value="models" />
+ <xml-property name="namespace" value="service-design-and-creation" />
+ </xml-properties>
+ <java-attributes>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique identifier corresponding to the main definition of a model in ASDC" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelType" name="model-type" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Type of the model, e.g., service, resource, widget, etc." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVers" name="model-vers" type="inventory.aai.onap.org.v13.ModelVers" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ModelVers">
+ <xml-root-element name="model-vers" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="modelVer" name="model-ver" type="inventory.aai.onap.org.v13.ModelVer" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ModelVer">
+ <xml-root-element name="model-ver" />
+ <xml-properties>
+ <xml-property name="description" value="Subgraph definition provided by ASDC to describe a specific version of an inventory asset and its connections related to ASDC models" />
+ <xml-property name="nameProps" value="model-name" />
+ <xml-property name="indexedProps" value="model-version-id,model-name,model-version,distribution-status" />
+ <xml-property name="uniqueProps" value="model-version-id" />
+ <xml-property name="container" value="model-vers" />
+ </xml-properties>
+ <java-attributes>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique identifier corresponding to one version of a model in ASDC" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelName" name="model-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of the model, which can change from version to version." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersion" name="model-version" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Version" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="distributionStatus" name="distribution-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Distribution Status" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelDescription" name="model-description" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Description" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelElements" name="model-elements" type="inventory.aai.onap.org.v13.ModelElements" />
+ <xml-element java-attribute="metadata" name="metadata" type="inventory.aai.onap.org.v13.Metadata" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ModelElements">
+ <xml-root-element name="model-elements" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="modelElement" name="model-element" type="inventory.aai.onap.org.v13.ModelElement" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ModelElement">
+ <xml-properties>
+ <xml-property name="description" value="Defines how other models combine to make up a higher-level model." />
+ <xml-property name="uniqueProps" value="model-element-uuid" />
+ <xml-property name="indexedProps" value="model-element-uuid" />
+ <xml-property name="allowDirectRead" value="true" />
+ <xml-property name="allowDirectWrite" value="false" />
+ <xml-property name="container" value="model-elements" />
+ </xml-properties>
+ <xml-root-element name="model-element" />
+ <java-attributes>
+ <xml-element java-attribute="modelElementUuid" name="model-element-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="autoGenerateUuid" value="true" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="newDataDelFlag" name="new-data-del-flag" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicates whether this element was created as part of instantiation from this model" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="cardinality" name="cardinality" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="How many of this type of element are required/allowed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element container-type="java.util.ArrayList" java-attribute="linkagePoints" name="linkage-points" type="java.lang.String" >
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelElements" name="model-elements" type="inventory.aai.onap.org.v13.ModelElements">
+ <xml-properties>
+ <xml-property name="description" value="Defines how other models combine to make up a higher-level model" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelConstraints" name="model-constraints" type="inventory.aai.onap.org.v13.ModelConstraints">
+ <xml-properties>
+ <xml-property name="description" value="Describes new constraints on this model element that are not part of that model's definition" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ModelConstraints">
+ <xml-root-element name="model-constraints" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="modelConstraint" name="model-constraint" type="inventory.aai.onap.org.v13.ModelConstraint" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ModelConstraint">
+ <xml-properties>
+ <xml-property name="description" value="This is how we would capture constraints defining allowed sets of elements." />
+ <xml-property name="uniqueProps" value="model-constraint-uuid" />
+ <xml-property name="indexedProps" value="model-constraint-uuid" />
+ <xml-property name="allowDirectRead" value="true" />
+ <xml-property name="allowDirectWrite" value="false" />
+ <xml-property name="container" value="model-constraints" />
+ </xml-properties>
+ <xml-root-element name="model-constraint" />
+ <java-attributes>
+ <xml-element java-attribute="modelConstraintUuid" name="model-constraint-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="autoGenerateUuid" value="true" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="constrainedElementSetUuidToReplace" name="constrained-element-set-uuid-to-replace" required="true" type="java.lang.String" />
+ <xml-element java-attribute="constrainedElementSets" name="constrained-element-sets" type="inventory.aai.onap.org.v13.ConstrainedElementSets" />
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ </java-type>
+ <java-type name="LInterfaces">
+ <xml-properties>
+ <xml-property name="description" value="Collection of logical interfaces." />
+ </xml-properties>
+ <xml-root-element name="l-interfaces" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="lInterface" name="l-interface" type="inventory.aai.onap.org.v13.LInterface" />
+ </java-attributes>
+ </java-type>
+ <java-type name="LInterface">
+ <xml-root-element name="l-interface" />
+ <java-attributes>
+ <xml-element java-attribute="interfaceName" name="interface-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Name given to the interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="interfaceRole" name="interface-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="E.g., CUSTOMER, UPLINK, etc." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="v6WanLinkIp" name="v6-wan-link-ip" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Questionably placed - v6 ip addr of this interface (is in vr-lan-interface from Mary B." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="selflink" name="selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="URL to endpoint where AAI can get more details" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="interfaceId" name="interface-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ID of interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="macaddr" name="macaddr" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="MAC address for the interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="networkName" name="network-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of the network" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="managementOption" name="management-option" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Whether A&amp;AI should be managing this interface of not. Could have value like CUSTOMER" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="interfaceDescription" name="interface-description" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Human friendly text regarding this interface." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="isPortMirrored" name="is-port-mirrored" required="true" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="boolean indicatating whether or not port is a mirrored." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" java-attribute="inMaint" name="in-maint" required="true" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Prov Status of the logical interface. Valid values [PREPROV/NVTPROV/PROV]." />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" java-attribute="isIpUnnumbered" name="is-ip-unnumbered" required="true" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="Flag indicating the interface uses the IP Unnumbered configuration." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="allowedAddressPairs" name="allowed-address-pairs" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Freeform field for storing an ip address, list of ip addresses or a subnet block." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlans" name="vlans" type="inventory.aai.onap.org.v13.Vlans" />
+ <xml-element java-attribute="sriovVfs" name="sriov-vfs" type="inventory.aai.onap.org.v13.SriovVfs" />
+ <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.onap.org.v13.LInterfaces" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element container-type="java.util.ArrayList" java-attribute="l3InterfaceIpv4AddressList" name="l3-interface-ipv4-address-list" type="inventory.aai.onap.org.v13.L3InterfaceIpv4AddressList" />
+ <xml-element container-type="java.util.ArrayList" java-attribute="l3InterfaceIpv6AddressList" name="l3-interface-ipv6-address-list" type="inventory.aai.onap.org.v13.L3InterfaceIpv6AddressList" />
+ <xml-element java-attribute="adminStatus" name="admin-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Administrative status of the interface. Valid values are 'up', 'down', or 'testing'." />
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Logical interfaces, e.g., a vnic." />
+ <xml-property name="indexedProps" value="macaddr,interface-id,interface-name,network-name" />
+ <xml-property name="dependentOn" value="generic-vnf,newvce,p-interface,vserver,lag-interface" />
+ <xml-property name="container" value="l-interfaces" />
+ </xml-properties>
+ </java-type>
+ <java-type name="SriovVfs">
+ <xml-properties>
+ <xml-property name="description" value="Collection of SR-IOV Virtual Functions." />
+ </xml-properties>
+ <xml-root-element name="sriov-vfs" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="sriovVf" name="sriov-vf" type="inventory.aai.onap.org.v13.SriovVf" />
+ </java-attributes>
+ </java-type>
+ <java-type name="SriovVf">
+ <xml-root-element name="sriov-vf" />
+ <java-attributes>
+ <xml-element java-attribute="pciId" name="pci-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="PCI ID used to identify the sriov-vf" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfVlanFilter" name="vf-vlan-filter" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="This metadata provides option to specify list of VLAN filters applied on VF to pass the traffic to VM." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfMacFilter" name="vf-mac-filter" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="When MAC filters are specified, VF-agent service configures VFs to do MAC level filtering before the traffic is passed to VM." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfVlanStrip" name="vf-vlan-strip" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="description" value="When this field is set to true, VF will configured to strip the outer TAG before the traffic is passed to VM." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfVlanAntiSpoofCheck" name="vf-vlan-anti-spoof-check" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="description" value="This option ensures anti VLAN spoof checks are done at the VF level to comply with security. The disable check will also be honored per the VNF needs for trusted VMs." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfMacAntiSpoofCheck" name="vf-mac-anti-spoof-check" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="description" value="This option ensures anti MAC spoof checks are done at the VF level to comply with security. The disable check will also be honored per the VNF needs for trusted VMs." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfMirrors" name="vf-mirrors" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="This option defines the set of Mirror objects which essentially mirrors the traffic from source to set of collector VNF Ports." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfBroadcastAllow" name="vf-broadcast-allow" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="description" value="This option, if set to true, sets the VF in promiscuous mode and allows all broadcast traffic to reach the VM" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfUnknownMulticastAllow" name="vf-unknown-multicast-allow" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="description" value="This option, if set to true, sets the VF in promiscuous mode and allows unknown multicast traffic to reach the VM" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfUnknownUnicastAllow" name="vf-unknown-unicast-allow" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="description" value="This option, if set to true, sets the VF in promiscuous mode and allows unknown unicast traffic to reach the VM" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfInsertStag" name="vf-insert-stag" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="description" value="This option, if set to true, instructs to insert outer tag after traffic comes out of VM." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfLinkStatus" name="vf-link-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="This option is used to set the link status. Valid values as of 1607 are on, off, and auto." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Neutron network id of the interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="SR-IOV Virtual Function (not to be confused with virtual network function)" />
+ <xml-property name="indexedProps" value="pci-id,vf-vlan-filter,vf-mac-filter,vf-vlan-strip,neutron-network-id" />
+ <xml-property name="dependentOn" value="l-interface" />
+ <xml-property name="container" value="sriov-vfs" />
+ </xml-properties>
+ </java-type>
+ <java-type name="L3InterfaceIpv4AddressList">
+ <xml-root-element name="l3-interface-ipv4-address-list" />
+ <java-attributes>
+ <xml-element java-attribute="l3InterfaceIpv4Address" name="l3-interface-ipv4-address" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="IP address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="l3InterfaceIpv4PrefixLength" name="l3-interface-ipv4-prefix-length" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="Prefix length, 32 for single address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlanIdInner" name="vlan-id-inner" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="Inner VLAN tag" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlanIdOuter" name="vlan-id-outer" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="Outer VLAN tag" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="isFloating" name="is-floating" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="description" value="Indicator of fixed or floating address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Neutron network id of the interface that address belongs to" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="neutronSubnetId" name="neutron-subnet-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Neutron id of subnet that address belongs to" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="IPv4 Address Range" />
+ <xml-property name="indexedProps" value="l3-interface-ipv4-address,vlan-id-inner,neutron-network-id,neutron-subnet-id" />
+ <xml-property name="dependentOn" value="vlan,l-interface,vnfc" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Vlans">
+ <xml-root-element name="vlans" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="vlan" name="vlan" type="inventory.aai.onap.org.v13.Vlan" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Vlan">
+ <xml-root-element name="vlan" />
+ <java-attributes>
+ <xml-element java-attribute="vlanInterface" name="vlan-interface" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="String that identifies the interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlanIdInner" name="vlan-id-inner" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="Inner VLAN tag" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlanIdOuter" name="vlan-id-outer" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="Outer VLAN tag" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="speedValue" name="speed-value" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the numeric part of the speed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="speedUnits" name="speed-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the units corresponding to the speed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlanDescription" name="vlan-description" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used to describe (the service associated with) the vlan" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="backdoorConnection" name="backdoor-connection" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Whether customer is going to use this VLAN for backdoor connection to another customer premise device." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vpnKey" name="vpn-key" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="This indicates the customers VPN ID associated with this vlan" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Status of a vnf's vlan interface, on which the customer circuit resides, mastered by SDN-C." />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" java-attribute="inMaint" name="in-maint" required="true" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Prov Status of the VLAN configuration related to a logical interface. Valid values [PREPROV/NVTPROV/PROV]." />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" java-attribute="isIpUnnumbered" name="is-ip-unnumbered" required="true" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="Flag indicating the interface uses the IP Unnumbered configuration." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element container-type="java.util.ArrayList" java-attribute="l3InterfaceIpv4AddressList" name="l3-interface-ipv4-address-list" type="inventory.aai.onap.org.v13.L3InterfaceIpv4AddressList" />
+ <xml-element container-type="java.util.ArrayList" java-attribute="l3InterfaceIpv6AddressList" name="l3-interface-ipv6-address-list" type="inventory.aai.onap.org.v13.L3InterfaceIpv6AddressList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Definition of vlan" />
+ <xml-property name="indexedProps" value="vlan-interface,vlan-id-inner,vpn-key" />
+ <xml-property name="dependentOn" value="l-interface" />
+ <xml-property name="container" value="vlans" />
+ </xml-properties>
+ </java-type>
+ <java-type name="L3InterfaceIpv6AddressList">
+ <xml-root-element name="l3-interface-ipv6-address-list" />
+ <java-attributes>
+ <xml-element java-attribute="l3InterfaceIpv6Address" name="l3-interface-ipv6-address" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="IP address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="l3InterfaceIpv6PrefixLength" name="l3-interface-ipv6-prefix-length" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="Prefix length, 128 for single address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlanIdInner" name="vlan-id-inner" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="Inner VLAN tag" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlanIdOuter" name="vlan-id-outer" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="Outer VLAN tag" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="isFloating" name="is-floating" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="description" value="Indicator of fixed or floating address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Neutron network id of the interface that address belongs to" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="neutronSubnetId" name="neutron-subnet-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Neutron id of subnet that address belongs to" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="IPv6 Address Range" />
+ <xml-property name="indexedProps" value="l3-interface-ipv6-address,vlan-id-inner,neutron-network-id,neutron-subnet-id" />
+ <xml-property name="dependentOn" value="vlan,l-interface,vnfc" />
+ </xml-properties>
+ </java-type>
+ <java-type name="PInterfaces">
+ <xml-properties>
+ <xml-property name="description" value="Collection of physical interfaces." />
+ </xml-properties>
+ <xml-root-element name="p-interfaces" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="pInterface" name="p-interface" type="inventory.aai.onap.org.v13.PInterface" />
+ </java-attributes>
+ </java-type>
+ <java-type name="PInterface">
+ <xml-root-element name="p-interface" />
+ <java-attributes>
+ <xml-element java-attribute="interfaceName" name="interface-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Name that identifies the physical interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="selflink" name="selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="URL to endpoint where AAI can get more details." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="speedValue" name="speed-value" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the numeric part of the speed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="speedUnits" name="speed-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the units corresponding to the speed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="portDescription" name="port-description" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Nature of the services and connectivity on this port." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="equipmentIdentifier" name="equipment-identifier" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="CLEI or other specification for p-interface hardware." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="interfaceRole" name="interface-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Role specification for p-interface hardware." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="interfaceType" name="interface-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicates the physical properties of the interface." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Trigger for operational monitoring of this resource by Service Assurance systems." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" java-attribute="inMaint" name="in-maint" required="true" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="invStatus" name="inv-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="inventory status" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element java-attribute="sriovPfs" name="sriov-pfs" type="inventory.aai.onap.org.v13.SriovPfs" />
+ <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.onap.org.v13.LInterfaces" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Physical interface (e.g., nic)" />
+ <xml-property name="indexedProps" value="interface-name,prov-status" />
+ <xml-property name="nameProps" value="prov-status" />
+ <xml-property name="dependentOn" value="vpls-pe,pserver,pnf" />
+ <xml-property name="container" value="p-interfaces" />
+ </xml-properties>
+ </java-type>
+ <java-type name="LagInterfaces">
+ <xml-properties>
+ <xml-property name="description" value="Collection of link aggregate interfaces." />
+ </xml-properties>
+ <xml-root-element name="lag-interfaces" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="lagInterface" name="lag-interface" type="inventory.aai.onap.org.v13.LagInterface" />
+ </java-attributes>
+ </java-type>
+ <java-type name="LagInterface">
+ <xml-root-element name="lag-interface" />
+ <java-attributes>
+ <xml-element java-attribute="interfaceName" name="interface-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Name that identifies the link aggregate interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="interfaceDescription" name="interface-description" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Human friendly text regarding this interface." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="speedValue" name="speed-value" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the numeric part of the speed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="speedUnits" name="speed-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the units corresponding to the speed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="interfaceId" name="interface-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ID of interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="interfaceRole" name="interface-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Role assigned to this Interface, should use values as defined in ECOMP Yang models." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Trigger for operational monitoring of this resource by Service Assurance systems." />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" java-attribute="inMaint" name="in-maint" required="true" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.onap.org.v13.LInterfaces" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Link aggregate interface" />
+ <xml-property name="indexedProps" value="interface-name,interface-id,interface-role" />
+ <xml-property name="dependentOn" value="generic-vnf,pserver,vpls-pe,pnf" />
+ <xml-property name="container" value="lag-interfaces" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Network">
+ <xml-properties>
+ <xml-property name="description" value="Namespace for network inventory resources." />
+ </xml-properties>
+ <xml-root-element name="network" />
+ <java-attributes>
+ <xml-element java-attribute="logicalLinks" name="logical-links" type="inventory.aai.onap.org.v13.LogicalLinks" />
+ <xml-element java-attribute="sitePairSets" name="site-pair-sets" type="inventory.aai.onap.org.v13.SitePairSets" />
+ <xml-element java-attribute="vpnBindings" name="vpn-bindings" type="inventory.aai.onap.org.v13.VpnBindings" />
+ <xml-element java-attribute="vplsPes" name="vpls-pes" type="inventory.aai.onap.org.v13.VplsPes" />
+ <xml-element java-attribute="multicastConfigurations" name="multicast-configurations" type="inventory.aai.onap.org.v13.MulticastConfigurations" />
+ <xml-element java-attribute="vces" name="vces" type="inventory.aai.onap.org.v13.Vces" />
+ <xml-element java-attribute="vnfcs" name="vnfcs" type="inventory.aai.onap.org.v13.Vnfcs" />
+ <xml-element java-attribute="l3Networks" name="l3-networks" type="inventory.aai.onap.org.v13.L3Networks" />
+ <xml-element java-attribute="networkPolicies" name="network-policies" type="inventory.aai.onap.org.v13.NetworkPolicies" />
+ <xml-element java-attribute="genericVnfs" name="generic-vnfs" type="inventory.aai.onap.org.v13.GenericVnfs" />
+ <xml-element java-attribute="lagLinks" name="lag-links" type="inventory.aai.onap.org.v13.LagLinks" />
+ <xml-element java-attribute="newvces" name="newvces" type="inventory.aai.onap.org.v13.Newvces" />
+ <xml-element java-attribute="pnfs" name="pnfs" type="inventory.aai.onap.org.v13.Pnfs" />
+ <xml-element java-attribute="physicalLinks" name="physical-links" type="inventory.aai.onap.org.v13.PhysicalLinks" />
+ <xml-element java-attribute="ipsecConfigurations" name="ipsec-configurations" type="inventory.aai.onap.org.v13.IpsecConfigurations" />
+ <xml-element java-attribute="routeTableReferences" name="route-table-references" type="inventory.aai.onap.org.v13.RouteTableReferences" />
+ <xml-element java-attribute="instanceGroups" name="instance-groups" type="inventory.aai.onap.org.v13.InstanceGroups" />
+ <xml-element java-attribute="zones" name="zones" type="inventory.aai.onap.org.v13.Zones" />
+ <xml-element java-attribute="configurations" name="configurations" type="inventory.aai.onap.org.v13.Configurations" />
+ <xml-element java-attribute="forwardingPaths" name="forwarding-paths" type="inventory.aai.onap.org.v13.ForwardingPaths" />
+ <xml-element java-attribute="collections" name="collections" type="inventory.aai.onap.org.v13.Collections" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Configurations">
+ <xml-properties>
+ <xml-property name="description" value="Collection of configurations" />
+ </xml-properties>
+ <xml-root-element name="configurations" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="configuration" name="configuration" type="inventory.aai.onap.org.v13.Configuration" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Configuration">
+ <xml-root-element name="configuration" />
+ <java-attributes>
+ <xml-element java-attribute="configurationId" name="configuration-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="UUID assigned to configuration." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="managementOption" name="management-option" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicates the entity that will manage this feature. Could be an organization or the name of the application as well." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="configurationName" name="configuration-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of the configuration." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="configurationType" name="configuration-type" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="port-mirroring-configuration." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="configurationSubType" name="configuration-sub-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="vprobe, pprobe." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model id for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Orchestration status of the configuration." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="operationalStatus" name="operational-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicator for whether the resource is considered operational." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="configurationSelflink" name="configuration-selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="URL to endpoint where AAI can get more details from SDN-GC." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelCustomizationId" name="model-customization-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="id of the configuration used to customize the resource" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="tunnelBandwidth" name="tunnel-bandwidth" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="DHV Site Effective Bandwidth" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vendorAllowedMaxBandwidth" name="vendor-allowed-max-bandwidth" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Velocloud Nominal Throughput - VNT" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element java-attribute="metadata" name="metadata" type="inventory.aai.onap.org.v13.Metadata" />
+ <xml-element java-attribute="forwarderEvcs" name="forwarder-evcs" type="inventory.aai.onap.org.v13.ForwarderEvcs" />
+ <xml-element java-attribute="evcs" name="evcs" type="inventory.aai.onap.org.v13.Evcs" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Generic configuration object." />
+ <xml-property name="indexedProps" value="configuration-id,model-invariant-id,model-version-id" />
+ <xml-property name="uniqueProps" value="configuration-id" />
+ <xml-property name="container" value="configurations" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="LogicalLinks">
+ <xml-properties>
+ <xml-property name="description" value="Collection of logical connections" />
+ </xml-properties>
+ <xml-root-element name="logical-links" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="logicalLink" name="logical-link" type="inventory.aai.onap.org.v13.LogicalLink" />
+ </java-attributes>
+ </java-type>
+ <java-type name="LogicalLink">
+ <xml-root-element name="logical-link" />
+ <java-attributes>
+ <xml-element java-attribute="linkName" name="link-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="e.g., evc-name, or vnf-nameA_interface-nameA_vnf-nameZ_interface-nameZ" />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" required="true" java-attribute="inMaint" name="in-maint" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="linkType" name="link-type" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Type of logical link, e.g., evc" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="speedValue" name="speed-value" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the numeric part of the speed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="speedUnits" name="speed-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the units corresponding to the speed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipVersion" name="ip-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="v4, v6, or ds for dual stack (should be att-ip-version)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="routingProtocol" name="routing-protocol" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="For example, static or BGP" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model id for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="internal" />
+ <xml-property name="dataCopy" value="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&amp;AI widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&amp;AI version of the widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="operationalStatus" name="operational-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indication of operational status of the logical link." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Trigger for operational monitoring of this VNF by BAU Service Assurance systems." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="linkRole" name="link-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indication of the network use of the logical link." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="linkName2" name="link-name2" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Alias or alternate name (CLCI or D1 name)." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="linkId" name="link-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="UUID of the logical-link, SDNC generates this." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="circuitId" name="circuit-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Circuit id" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="purpose" name="purpose" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Reason for this entity, role it is playing" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Logical links generally connect l-interfaces but are used to express logical connectivity between two points" />
+ <xml-property name="indexedProps" value="link-name,model-invariant-id,model-version-id,widget-model-id,widget-model-version,link-id,prov-status,circuit-id,purpose" />
+ <xml-property name="uniqueProps" value="link-id" />
+ <xml-property name="container" value="logical-links" />
+ <xml-property name="namespace" value="network" />
+ <xml-property name="searchable" value="link-name" />
+ </xml-properties>
+ </java-type>
+ <java-type name="SitePairSets">
+ <xml-properties>
+ <xml-property name="description" value="Collection of sets of instances for probes related to generic-vnf" />
+ </xml-properties>
+ <xml-root-element name="site-pair-sets" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="sitePairSet" name="site-pair-set" type="inventory.aai.onap.org.v13.SitePairSet" />
+ </java-attributes>
+ </java-type>
+ <java-type name="SitePairSet">
+ <xml-root-element name="site-pair-set" />
+ <java-attributes>
+ <xml-element java-attribute="sitePairSetId" name="site-pair-set-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of site pair set." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="routingInstances" name="routing-instances" type="inventory.aai.onap.org.v13.RoutingInstances" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Set of instances for probes used to measure service level agreements" />
+ <xml-property name="indexedProps" value="site-pair-set-id" />
+ <xml-property name="uniqueProps" value="site-pair-set-id" />
+ <xml-property name="container" value="site-pair-sets" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="RoutingInstances">
+ <xml-properties>
+ <xml-property name="description" value="set of probes related to generic-vnf routing instance" />
+ </xml-properties>
+ <xml-root-element name="routing-instances" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="routingInstance" name="routing-instance" type="inventory.aai.onap.org.v13.RoutingInstance" />
+ </java-attributes>
+ </java-type>
+ <java-type name="RoutingInstance">
+ <xml-root-element name="routing-instance" />
+ <java-attributes>
+ <xml-element java-attribute="routingInstanceId" name="routing-instance-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of routing instance" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="rpmOwner" name="rpm-owner" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="rpm owner" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="sitePairs" name="site-pairs" type="inventory.aai.onap.org.v13.SitePairs" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="indexedProps" value="routing-instance-id" />
+ <xml-property name="dependentOn" value="site-pair-set" />
+ <xml-property name="container" value="routing-instances" />
+ </xml-properties>
+ </java-type>
+ <java-type name="SitePairs">
+ <xml-properties>
+ <xml-property name="description" value="probe within a set" />
+ </xml-properties>
+ <xml-root-element name="site-pairs" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="sitePair" name="site-pair" type="inventory.aai.onap.org.v13.SitePair" />
+ </java-attributes>
+ </java-type>
+ <java-type name="SitePair">
+ <xml-root-element name="site-pair" />
+ <java-attributes>
+ <xml-element java-attribute="sitePairId" name="site-pair-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="unique identifier of probe" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="sourceIp" name="source-ip" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Prefix address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="destinationIp" name="destination-ip" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Prefix address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipVersion" name="ip-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ip version, v4, v6" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="destinationHostname" name="destination-hostname" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Hostname of the destination equipment to which SLAs are measured against." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="destinationEquipType" name="destination-equip-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The type of destinatination equipment. Could be Router, UCPE, etc." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="classesOfService" name="classes-of-service" type="inventory.aai.onap.org.v13.ClassesOfService" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="indexedProps" value="site-pair-id" />
+ <xml-property name="uniqueProps" value="site-pair-id" />
+ <xml-property name="dependentOn" value="routing-instance" />
+ <xml-property name="container" value="site-pairs" />
+ </xml-properties>
+ </java-type>
+ <java-type name="ClassesOfService">
+ <xml-properties>
+ <xml-property name="description" value="class-of-service of probe" />
+ </xml-properties>
+ <xml-root-element name="classes-of-service" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="classOfService" name="class-of-service" type="inventory.aai.onap.org.v13.ClassOfService" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ClassOfService">
+ <xml-root-element name="class-of-service" />
+ <java-attributes>
+ <xml-element java-attribute="cos" name="cos" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="unique identifier of probe" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="probeId" name="probe-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="identifier of probe" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="probeType" name="probe-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="type of probe" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="indexedProps" value="cos" />
+ <xml-property name="dependentOn" value="site-pair" />
+ <xml-property name="container" value="classes-of-service" />
+ </xml-properties>
+ </java-type>
+ <java-type name="VpnBindings">
+ <xml-root-element name="vpn-bindings" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="vpnBinding" name="vpn-binding" type="inventory.aai.onap.org.v13.VpnBinding" />
+ </java-attributes>
+ </java-type>
+ <java-type name="VpnBinding">
+ <xml-root-element name="vpn-binding" />
+ <java-attributes>
+ <xml-element java-attribute="vpnId" name="vpn-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="VPN ID, globally unique within A&amp;AI" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vpnName" name="vpn-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="VPN Name" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vpnPlatform" name="vpn-platform" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the platform associated with the VPN example AVPN, Mobility" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vpnType" name="vpn-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Type of the vpn, should be taken from enumerated/valid values" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vpnRegion" name="vpn-region" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="region of customer vpn" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="customerVpnId" name="customer-vpn-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="id for this customer vpn" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="routeDistinguisher" name="route-distinguisher" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used to distinguish the distinct VPN routes of separate customers who connect to the provider in an MPLS network." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="routeTargets" name="route-targets" type="inventory.aai.onap.org.v13.RouteTargets" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList">
+ <xml-properties>
+ <xml-property name="description" value="l3-networks relate to vpn-bindings" />
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="VPN binding" />
+ <xml-property name="nameProps" value="vpn-name,vpn-type" />
+ <xml-property name="indexedProps" value="vpn-name,vpn-id,vpn-type" />
+ <xml-property name="searchable" value="vpn-id,vpn-name" />
+ <xml-property name="uniqueProps" value="vpn-id" />
+ <xml-property name="container" value="vpn-bindings" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="VplsPes">
+ <xml-properties>
+ <xml-property name="description" value="Collection of VPLS Provider Edge routers" />
+ </xml-properties>
+ <xml-root-element name="vpls-pes" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="vplsPe" name="vpls-pe" type="inventory.aai.onap.org.v13.VplsPe" />
+ </java-attributes>
+ </java-type>
+ <java-type name="VplsPe">
+ <xml-root-element name="vpls-pe" />
+ <java-attributes>
+ <xml-element java-attribute="equipmentName" name="equipment-name" required="true" type="java.lang.String" xml-key="true" />
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Trigger for operational monitoring of this VNF by BAU Service Assurance systems." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Address tail-f uses to configure generic-vnf, also used for troubleshooting and is IP used for traps generated by GenericVnf (v4-loopback0-ip-address)." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="equipmentRole" name="equipment-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Client should send valid enumerated value, e.g., VPLS-PE." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlanIdOuter" name="vlan-id-outer" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="Temporary location for stag to get to VCE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element java-attribute="pInterfaces" name="p-interfaces" type="inventory.aai.onap.org.v13.PInterfaces" />
+ <xml-element java-attribute="lagInterfaces" name="lag-interfaces" type="inventory.aai.onap.org.v13.LagInterfaces" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="VPLS Provider Edge routers." />
+ <xml-property name="indexedProps" value="prov-status,equipment-name" />
+ <xml-property name="container" value="vpls-pes" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="MulticastConfigurations">
+ <xml-properties>
+ <xml-property name="description" value="multicast configuration of generic-vnf ip-address" />
+ </xml-properties>
+ <xml-root-element name="multicast-configurations" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="multicastConfiguration" name="multicast-configuration" type="inventory.aai.onap.org.v13.MulticastConfiguration" />
+ </java-attributes>
+ </java-type>
+ <java-type name="MulticastConfiguration">
+ <xml-root-element name="multicast-configuration" />
+ <java-attributes>
+ <xml-element java-attribute="multicastConfigurationId" name="multicast-configuration-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of multicast configuration." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="multicastProtocol" name="multicast-protocol" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="protocol of multicast configuration" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="rpType" name="rp-type" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="rp type of multicast configuration" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="indexedProps" value="multicast-configuration-id" />
+ <xml-property name="uniqueProps" value="multicast-configuration-id" />
+ <xml-property name="container" value="multicast-configurations" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Vces">
+ <xml-properties>
+ <xml-property name="description" value="Collection of Virtual Customer Edge Routers, used specifically for Gamma. This object is deprecated." />
+ </xml-properties>
+ <xml-root-element name="vces" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="vce" name="vce" type="inventory.aai.onap.org.v13.Vce" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Vce">
+ <xml-root-element name="vce" />
+ <java-attributes>
+ <xml-element java-attribute="vnfId" name="vnf-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of VNF. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vnfName" name="vnf-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of VNF." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vnfName2" name="vnf-name2" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Alternate name of VNF." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vnfType" name="vnf-type" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceId" name="service-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Unique identifier of service, does not strictly map to ASDC services, SOON TO BE DEPRECATED." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="regionalResourceZone" name="regional-resource-zone" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Regional way of organizing pservers, source of truth should define values" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Trigger for operational monitoring of this resource by Service Assurance systems." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="operationalStatus" name="operational-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicator for whether the resource is considered operational" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="licenseKey" name="license-key" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="OBSOLETE - do not use" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="equipmentRole" name="equipment-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Network role being played by this VNF" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Heat stack id corresponding to this instance, managed by MSO" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="msoCatalogKey" name="mso-catalog-key" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vpeId" name="vpe-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID of VPE connected to this VCE." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="v6VceWanAddress" name="v6-vce-wan-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Valid v6 IP address for the WAN Link on this router. Implied length of /64." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Address tail-f uses to configure vce, also used for troubleshooting and is IP used for traps generated by VCE." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipv4Loopback0Address" name="ipv4-loopback0-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Loopback0 address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="entitlementResourceUuid" name="entitlement-resource-uuid" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="OBSOLETE - see child relationships" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="portGroups" name="port-groups" type="inventory.aai.onap.org.v13.PortGroups" />
+ <xml-element java-attribute="licenses" name="licenses" type="inventory.aai.onap.org.v13.Licenses" />
+ <xml-element java-attribute="entitlements" name="entitlements" type="inventory.aai.onap.org.v13.Entitlements" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Virtual Customer Edge Router, used specifically for Gamma. This object is deprecated." />
+ <xml-property name="nameProps" value="vnf-name" />
+ <xml-property name="indexedProps" value="vnf-name,vnf-name2,vnf-type,heat-stack-id,vnf-id,interface-name,regional-resource-zone,vpe-id,prov-status,service-id" />
+ <xml-property name="searchable" value="vnf-id,vnf-name,vnf-name2" />
+ <xml-property name="uniqueProps" value="vnf-id" />
+ <xml-property name="container" value="vces" />
+ <xml-property name="namespace" value="network" />
+ <xml-property name="extends" value="vnf" />
+ </xml-properties>
+ </java-type>
+ <java-type name="PortGroups">
+ <xml-root-element name="port-groups" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="portGroup" name="port-group" type="inventory.aai.onap.org.v13.PortGroup" />
+ </java-attributes>
+ </java-type>
+ <java-type name="PortGroup">
+ <xml-root-element name="port-group" />
+ <java-attributes>
+ <xml-element java-attribute="interfaceId" name="interface-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID of the interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Neutron network id of this Interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="neutronNetworkName" name="neutron-network-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Neutron network name of this Interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="interfaceRole" name="interface-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Role assigned to this Interface, should use values as defined in ECOMP Yang models." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="portGroupId" name="port-group-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID for port group in vmware" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="portGroupName" name="port-group-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Likely to duplicate value of neutron network name" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="switchName" name="switch-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="DVS or standard switch name (should be non-null for port groups associated with DVS)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Heat stack id corresponding to this instance, managed by MSO" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="msoCatalogKey" name="mso-catalog-key" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="cvlanTags" name="cvlan-tags" type="inventory.aai.onap.org.v13.CvlanTags" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Used to capture the network interfaces of this VCE" />
+ <xml-property name="nameProps" value="port-group-name" />
+ <xml-property name="indexedProps" value="port-group-id,heat-stack-id,interface-id,interface-name,switch-name" />
+ <xml-property name="dependentOn" value="vce" />
+ <xml-property name="container" value="port-groups" />
+ </xml-properties>
+ </java-type>
+ <java-type name="CvlanTags">
+ <xml-root-element name="cvlan-tags" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="cvlanTagEntry" name="cvlan-tag-entry" type="inventory.aai.onap.org.v13.CvlanTagEntry" />
+ </java-attributes>
+ </java-type>
+ <java-type name="CvlanTagEntry">
+ <xml-root-element name="cvlan-tag-entry" />
+ <java-attributes>
+ <xml-element java-attribute="cvlanTag" name="cvlan-tag" required="true" type="java.lang.Long" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="See mis-na-virtualization-platform.yang" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="dependentOn" value="port-group" />
+ <xml-property name="indexedProps" value="cvlan-tag" />
+ <xml-property name="container" value="cvlan-tags" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Vnfcs">
+ <xml-properties>
+ <xml-property name="description" value="virtual network components associated with a vserver from application controller." />
+ </xml-properties>
+ <xml-root-element name="vnfcs" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="vnfc" name="vnfc" type="inventory.aai.onap.org.v13.Vnfc" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Vnfc">
+ <xml-root-element name="vnfc" />
+ <java-attributes>
+ <xml-element java-attribute="vnfcName" name="vnfc-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID of vnfc." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nfcNamingCode" name="nfc-naming-code" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Short code that is used in naming instances of the item being modeled" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nfcFunction" name="nfc-function" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="English description of function that the specific resource deployment is providing. Assigned as part of the customization of a resource in a service" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="prov status of this vnfc" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Orchestration status of this VNF, mastered by APP-C" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipaddressV4OamVip" name="ipaddress-v4-oam-vip" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Oam V4 vip address of this vnfc" />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" required="true" java-attribute="inMaint" name="in-maint" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" required="true" java-attribute="isClosedLoopDisabled" name="is-closed-loop-disabled" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="used to indicate whether closed loop function is enabled on this node" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="groupNotation" name="group-notation" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Group notation of VNFC" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model id for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element container-type="java.util.ArrayList" java-attribute="l3InterfaceIpv4AddressList" name="l3-interface-ipv4-address-list" type="inventory.aai.onap.org.v13.L3InterfaceIpv4AddressList" />
+ <xml-element container-type="java.util.ArrayList" java-attribute="l3InterfaceIpv6AddressList" name="l3-interface-ipv6-address-list" type="inventory.aai.onap.org.v13.L3InterfaceIpv6AddressList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="indexedProps" value="vnfc-name,prov-status,nfc-function,nfc-naming-code,ipaddress-v4-oam-vip,in-maint,is-closed-loop-disabled,group-notation,model-invariant-id,model-version-id" />
+ <xml-property name="searchable" value="vnfc-name" />
+ <xml-property name="container" value="vnfcs" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="L3Networks">
+ <xml-root-element name="l3-networks" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="l3Network" name="l3-network" type="inventory.aai.onap.org.v13.L3Network" />
+ </java-attributes>
+ </java-type>
+ <java-type name="L3Network">
+ <xml-root-element name="l3-network" />
+ <java-attributes>
+ <xml-element java-attribute="networkId" name="network-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Network ID, should be uuid. Unique across A&amp;AI." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="networkName" name="network-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of the network, governed by some naming convention.." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="networkType" name="network-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Type of the network - who defines these values?" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="networkRole" name="network-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Role the network plans - who defines these values?" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="networkTechnology" name="network-technology" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Network technology - who defines these values?" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Neutron network id of this Interface" />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" required="true" java-attribute="isBoundToVpn" name="is-bound-to-vpn" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="Set to true if bound to VPN" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceId" name="service-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Unique identifier of service from ASDC. Does not strictly map to ASDC services. SOON TO BE DEPRECATED" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="networkRoleInstance" name="network-role-instance" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="network role instance" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Heat stack id corresponding to this instance, managed by MSO" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="msoCatalogKey" name="mso-catalog-key" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="contrailNetworkFqdn" name="contrail-network-fqdn" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Contrail FQDN for the network" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model id for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="internal" />
+ <xml-property name="dataCopy" value="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelCustomizationId" name="model-customization-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="captures the id of all the configuration used to customize the resource for the service." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&amp;AI widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&amp;AI version of the widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="physicalNetworkName" name="physical-network-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name associated with the physical network." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="isProviderNetwork" name="is-provider-network" required="true" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="boolean indicatating whether or not network is a provider network." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="isSharedNetwork" name="is-shared-network" required="true" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="boolean indicatating whether or not network is a shared network." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="isExternalNetwork" name="is-external-network" required="true" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="boolean indicatating whether or not network is an external network." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="selflink" name="selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Path to the controller object." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="operationalStatus" name="operational-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicator for whether the resource is considered operational." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="subnets" name="subnets" type="inventory.aai.onap.org.v13.Subnets" />
+ <xml-element java-attribute="ctagAssignments" name="ctag-assignments" type="inventory.aai.onap.org.v13.CtagAssignments" />
+ <xml-element java-attribute="segmentationAssignments" name="segmentation-assignments" type="inventory.aai.onap.org.v13.SegmentationAssignments" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" >
+ <xml-properties>
+ <xml-property name="description" value="Relates to tenant (or is it a child of tenant), complex, service, vpn-binding" />
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Generic network definition" />
+ <xml-property name="nameProps" value="network-name" />
+ <xml-property name="indexedProps" value="heat-stack-id,network-uuid,service-id,network-id,network-name,model-invariant-id,model-version-id,widget-model-id,widget-model-version,contrail-network-fqdn,network-role" />
+ <xml-property name="searchable" value="network-id,network-name" />
+ <xml-property name="uniqueProps" value="network-id" />
+ <xml-property name="container" value="l3-networks" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="NetworkPolicies">
+ <xml-root-element name="network-policies" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="networkPolicy" name="network-policy" type="inventory.aai.onap.org.v13.NetworkPolicy" />
+ </java-attributes>
+ </java-type>
+ <java-type name="NetworkPolicy">
+ <xml-root-element name="network-policy" />
+ <java-attributes>
+ <xml-element java-attribute="networkPolicyId" name="network-policy-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="UUID representing unique key to this instance" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="networkPolicyFqdn" name="network-policy-fqdn" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Contrail FQDN for the policy" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ID for the openStack Heat instance" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="nameProps" value="network-policy-fqdn" />
+ <xml-property name="indexedProps" value="network-policy-id,network-policy-fqdn" />
+ <xml-property name="searchable" value="network-policy-id,network-policy-fqdn" />
+ <xml-property name="uniqueProps" value="network-policy-id" />
+ <xml-property name="container" value="network-policies" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="CtagAssignments">
+ <xml-root-element name="ctag-assignments" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="ctagAssignment" name="ctag-assignment" type="inventory.aai.onap.org.v13.CtagAssignment" />
+ </java-attributes>
+ </java-type>
+ <java-type name="CtagAssignment">
+ <xml-root-element name="ctag-assignment" />
+ <java-attributes>
+ <xml-element java-attribute="vlanIdInner" name="vlan-id-inner" required="true" type="java.lang.Long" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="id." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="indexedProps" value="vlan-id-inner" />
+ <xml-property name="dependentOn" value="l3-network" />
+ <xml-property name="container" value="ctag-assignments" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Subnets">
+ <xml-root-element name="subnets" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="subnet" name="subnet" type="inventory.aai.onap.org.v13.Subnet" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Subnet">
+ <xml-root-element name="subnet" />
+ <java-attributes>
+ <xml-element java-attribute="subnetId" name="subnet-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Subnet ID, should be UUID." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="subnetName" name="subnet-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name associated with the subnet." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="neutronSubnetId" name="neutron-subnet-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Neutron id of this subnet" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="gatewayAddress" name="gateway-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="gateway ip address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="networkStartAddress" name="network-start-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="network start address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="cidrMask" name="cidr-mask" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="cidr mask" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipVersion" name="ip-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ip version" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO" />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" required="true" java-attribute="dhcpEnabled" name="dhcp-enabled" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="dhcp enabled" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="dhcpStart" name="dhcp-start" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the start address reserved for use by dhcp" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="dhcpEnd" name="dhcp-end" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the last address reserved for use by dhcp" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="subnetRole" name="subnet-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="role of the subnet, referenced when assigning IPs" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipAssignmentDirection" name="ip-assignment-direction" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ip address assignment direction of the subnet" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="subnetSequence" name="subnet-sequence" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="sequence of the subnet" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="hostRoutes" name="host-routes" type="inventory.aai.onap.org.v13.HostRoutes" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="indexedProps" value="subnet-id,subnet-name" />
+ <xml-property name="nameProps" value="subnet-name" />
+ <xml-property name="uniqueProps" value="subnet-id" />
+ <xml-property name="dependentOn" value="l3-network" />
+ <xml-property name="container" value="subnets" />
+ </xml-properties>
+ </java-type>
+ <java-type name="GenericVnfs">
+ <xml-properties>
+ <xml-property name="description" value="Collection of VNFs" />
+ </xml-properties>
+ <xml-root-element name="generic-vnfs" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="genericVnf" name="generic-vnf" type="inventory.aai.onap.org.v13.GenericVnf" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="maximumDepth" value="0" />
+ </xml-properties>
+ </java-type>
+ <java-type name="GenericVnf">
+ <xml-root-element name="generic-vnf" />
+ <java-attributes>
+ <xml-element java-attribute="vnfId" name="vnf-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of VNF. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vnfName" name="vnf-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of VNF." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vnfName2" name="vnf-name2" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Alternate name of VNF." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vnfType" name="vnf-type" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceId" name="service-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Unique identifier of service, does not necessarily map to ASDC service models. SOON TO BE DEPRECATED" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="regionalResourceZone" name="regional-resource-zone" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Regional way of organizing pservers, source of truth should define values" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Trigger for operational monitoring of this resource by Service Assurance systems." />
+ <xml-property name="suggestibleOnSearch" value="true"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="operationalStatus" name="operational-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicator for whether the resource is considered operational. Valid values are in-service-path and out-of-service-path." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="licenseKey" name="license-key" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="OBSOLETE - do not use" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="equipmentRole" name="equipment-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Client should send valid enumerated value" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Orchestration status of this VNF, used by MSO." />
+ <xml-property name="suggestibleOnSearch" value="true"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Heat stack id corresponding to this instance, managed by MSO" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="msoCatalogKey" name="mso-catalog-key" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="managementOption" name="management-option" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="identifier of managed by ATT or customer" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Address tail-f uses to configure generic-vnf, also used for troubleshooting and is IP used for traps generated by generic-vnf." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipv4Loopback0Address" name="ipv4-loopback0-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="v4 Loopback0 address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nmLanV6Address" name="nm-lan-v6-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="v6 Loopback address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="managementV6Address" name="management-v6-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="v6 management address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vcpu" name="vcpu" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="number of vcpus ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only by uCPE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vcpuUnits" name="vcpu-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="units associated with vcpu, used for VNFs with no vservers/flavors, to be used only by uCPE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vmemory" name="vmemory" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="number of GB of memory ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only by uCPE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vmemoryUnits" name="vmemory-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="units associated with vmemory, used for VNFs with no vservers/flavors, to be used only by uCPE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vdisk" name="vdisk" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="number of vdisks ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only uCPE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vdiskUnits" name="vdisk-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="units associated with vdisk, used for VNFs with no vservers/flavors, to be used only by uCPE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" required="true" java-attribute="inMaint" name="in-maint" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs." />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" required="true" java-attribute="isClosedLoopDisabled" name="is-closed-loop-disabled" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="used to indicate whether closed loop function is enabled on this node" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="summaryStatus" name="summary-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="details regarding the generic-vnf operation, PLEASE DISCONTINUE USE OF THIS FIELD." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="encryptedAccessFlag" name="encrypted-access-flag" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="description" value="indicates whether generic-vnf access uses SSH" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="entitlementAssignmentGroupUuid" name="entitlement-assignment-group-uuid" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="UUID of the Entitlement group used for licensing VNFs, OBSOLETE - See child relationships." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="entitlementResourceUuid" name="entitlement-resource-uuid" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="UUID of the specific entitlement resource. OBSOLETE - See child relationships." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="licenseAssignmentGroupUuid" name="license-assignment-group-uuid" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="UUID of the license assignment group. OBSOLETE - See child relationships." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="licenseKeyUuid" name="license-key-uuid" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="UUID of the actual license resource. OBSOLETE - See child relationships." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model id for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="internal" />
+ <xml-property name="dataCopy" value="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelCustomizationId" name="model-customization-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="captures the id of all the configuration used to customize the resource for the service." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&amp;AI widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&amp;AI version of the widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="asNumber" name="as-number" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="as-number of the VNF" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="regionalResourceSubzone" name="regional-resource-subzone" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="represents sub zone of the rr plane" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nfType" name="nf-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Generic description of the type of NF" />
+ <xml-property name="suggestibleOnSearch" value="true"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nfFunction" name="nf-function" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="English description of Network function that the specific VNF deployment is providing" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nfRole" name="nf-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="role in the network that this model will be providing" />
+ <xml-property name="suggestibleOnSearch" value="true"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nfNamingCode" name="nf-naming-code" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="string assigned to this model used for naming purposes" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="selflink" name="selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Path to the controller object." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipv4OamGatewayAddress" name="ipv4-oam-gateway-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Gateway address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipv4OamGatewayAddressPrefixLength" name="ipv4-oam-gateway-address-prefix-length" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="Prefix length for oam-address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlanIdOuter" name="vlan-id-outer" type="java.lang.Long">
+ <xml-properties>
+ <xml-property name="description" value="Temporary location for S-TAG to get to VCE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nmProfileName" name="nm-profile-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Network Management profile of this VNF" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.onap.org.v13.LInterfaces" />
+ <xml-element java-attribute="lagInterfaces" name="lag-interfaces" type="inventory.aai.onap.org.v13.LagInterfaces" />
+ <xml-element java-attribute="vfModules" name="vf-modules" type="inventory.aai.onap.org.v13.VfModules" />
+ <xml-element java-attribute="licenses" name="licenses" type="inventory.aai.onap.org.v13.Licenses" />
+ <xml-element java-attribute="entitlements" name="entitlements" type="inventory.aai.onap.org.v13.Entitlements" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="General purpose VNF" />
+ <xml-property name="nameProps" value="vnf-name" />
+ <xml-property name="indexedProps" value="is-closed-loop-disabled,vnf-name2,vnf-type,heat-stack-id,in-maint,vnf-name,vnf-id,regional-resource-zone,prov-status,service-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,nf-type,nf-function,nf-naming-code,nf-role" />
+ <xml-property name="searchable" value="vnf-id,vnf-name,vnf-name2" />
+ <xml-property name="uniqueProps" value="vnf-id" />
+ <xml-property name="container" value="generic-vnfs" />
+ <xml-property name="namespace" value="network" />
+ <xml-property name="extends" value="vnf" />
+ <xml-property name="containsSuggestibleProps" value="true"/>
+ <xml-property name="suggestionAliases" value="VNFs"/>
+ </xml-properties>
+ </java-type>
+ <java-type name="VfModules">
+ <xml-properties>
+ <xml-property name="description" value="Collection of vf-modules, a deployment unit of VNFCs" />
+ </xml-properties>
+ <xml-root-element name="vf-modules" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="vfModule" name="vf-module" type="inventory.aai.onap.org.v13.VfModule" />
+ </java-attributes>
+ </java-type>
+ <java-type name="VfModule">
+ <xml-root-element name="vf-module" />
+ <java-attributes>
+ <xml-element java-attribute="vfModuleId" name="vf-module-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID of vf-module." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vfModuleName" name="vf-module-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of vf-module" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Heat stack id corresponding to this instance." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="orchestration status of this vf-module, mastered by MSO" />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" required="true" java-attribute="isBaseVfModule" name="is-base-vf-module" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="used to indicate whether or not this object is base vf module" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model id for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC model version for this resource or service model." />
+ <xml-property name="visibility" value="internal" />
+ <xml-property name="dataCopy" value="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelCustomizationId" name="model-customization-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="captures the id of all the configuration used to customize the resource for the service." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&amp;AI widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&amp;AI version of the widget." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="contrailServiceInstanceFqdn" name="contrail-service-instance-fqdn" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the Contrail unique ID for a service-instance" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="moduleIndex" name="module-index" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="the index will track the number of modules of a given type that have been deployed in a VNF, starting with 0, and always choosing the lowest available digit" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="selflink" name="selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Path to the controller object." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="a deployment unit of VNFCs" />
+ <xml-property name="indexedProps" value="vf-module-id,vf-module-name,heat-stack-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,contrail-service-instance-fqdn" />
+ <xml-property name="searchable" value="vf-module-id,vf-module-name" />
+ <xml-property name="dependentOn" value="generic-vnf" />
+ <xml-property name="container" value="vf-modules" />
+ </xml-properties>
+ </java-type>
+ <java-type name="LagLinks">
+ <xml-properties>
+ <xml-property name="description" value="Collection of link aggregation connections" />
+ </xml-properties>
+ <xml-root-element name="lag-links" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="lagLink" name="lag-link" type="inventory.aai.onap.org.v13.LagLink" />
+ </java-attributes>
+ </java-type>
+ <java-type name="LagLink">
+ <xml-root-element name="lag-link" />
+ <java-attributes>
+ <xml-element java-attribute="linkName" name="link-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Alphabetical concatenation of lag-interface names" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="LAG links can connect lag-interfaces" />
+ <xml-property name="indexedProps" value="link-name" />
+ <xml-property name="container" value="lag-links" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Newvces">
+ <xml-properties>
+ <xml-property name="description" value="This object fills in the gaps from vce that were incorporated into generic-vnf. This object will be retired with vce." />
+ </xml-properties>
+ <xml-root-element name="newvces" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="newvce" name="newvce" type="inventory.aai.onap.org.v13.Newvce" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Newvce">
+ <xml-root-element name="newvce" />
+ <java-attributes>
+ <xml-element java-attribute="vnfId2" name="vnf-id2" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of VNF, can't use same attribute name right now until we promote this new object" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vnfName" name="vnf-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of VNF." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vnfName2" name="vnf-name2" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Alternate name of VNF." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vnfType" name="vnf-type" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Trigger for operational monitoring of this VNF by BAU Service Assurance systems." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="operationalStatus" name="operational-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicator for whether the resource is considered operational" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="licenseKey" name="license-key" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="OBSOLETE - do not use" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Address tail-f uses to configure generic-vnf, also used for troubleshooting and is IP used for traps generated by GenericVnf (v4-loopback0-ip-address)." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="equipmentRole" name="equipment-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Client should send valid enumerated value." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipv4Loopback0Address" name="ipv4-loopback0-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="v4 Loopback0 address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Heat stack id corresponding to this instance, managed by MSO" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="msoCatalogKey" name="mso-catalog-key" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.onap.org.v13.LInterfaces" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="This object fills in the gaps from vce that were incorporated into generic-vnf. This object will be retired with vce." />
+ <xml-property name="nameProps" value="vnf-name" />
+ <xml-property name="indexedProps" value="vnf-name,vnf-name2,vnf-type,heat-stack-id,prov-status,vnf-id2" />
+ <xml-property name="searchable" value="vnf-id2,vnf-name,vnf-name2" />
+ <xml-property name="uniqueProps" value="vnf-id2" />
+ <xml-property name="container" value="newvces" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Pnfs">
+ <xml-properties>
+ <xml-property name="description" value="Collection of Physical Network Functions." />
+ </xml-properties>
+ <xml-root-element name="pnfs" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="pnf" name="pnf" type="inventory.aai.onap.org.v13.Pnf" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="maximumDepth" value="0" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Pnf">
+ <xml-root-element name="pnf" />
+ <java-attributes>
+ <xml-element java-attribute="pnfName" name="pnf-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="unique name of Physical Network Function." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="pnfName2" name="pnf-name2" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="name of Physical Network Function." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="selflink" name="selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="URL to endpoint where AAI can get more details." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="pnfName2Source" name="pnf-name2-source" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="source of name2" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="pnfId" name="pnf-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="id of pnf" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="equipType" name="equip-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Equipment type. Source of truth should define valid values." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="equipVendor" name="equip-vendor" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Equipment vendor. Source of truth should define valid values." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="equipModel" name="equip-model" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Equipment model. Source of truth should define valid values." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="managementOption" name="management-option" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="identifier of managed by ATT or customer" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipaddressV4Oam" name="ipaddress-v4-oam" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ipv4-oam-address with new naming convention for IP addresses" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="swVersion" name="sw-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="sw-version is the version of SW for the hosted application on the PNF." />
+ </xml-properties>
+ </xml-element>
+ <xml-element default-value="false" required="true" java-attribute="inMaint" name="in-maint" type="java.lang.Boolean">
+ <xml-properties>
+ <xml-property name="defaultValue" value="false"/>
+ <xml-property name="description" value="Used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="frameId" name="frame-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ID of the physical frame (relay rack) where pnf is installed." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serialNumber" name="serial-number" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Serial number of the device" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipaddressV4Loopback0" name="ipaddress-v4-loopback-0" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="IPV4 Loopback 0 address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipaddressV6Loopback0" name="ipaddress-v6-loopback-0" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="IPV6 Loopback 0 address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipaddressV4Aim" name="ipaddress-v4-aim" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="IPV4 AIM address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipaddressV6Aim" name="ipaddress-v6-aim" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="IPV6 AIM address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipaddressV6Oam" name="ipaddress-v6-oam" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="IPV6 OAM address" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="invStatus" name="inv-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="CANOPI's inventory status. Only set with values exactly as defined by CANOPI." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Prov Status of this device (not under canopi control) Valid values [PREPROV/NVTPROV/PROV]" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nfRole" name="nf-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Nf Role is the role performed by this instance in the network." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The ASDC model id for this resource model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The ASDC model version for this resource model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element java-attribute="pInterfaces" name="p-interfaces" type="inventory.aai.onap.org.v13.PInterfaces" />
+ <xml-element java-attribute="lagInterfaces" name="lag-interfaces" type="inventory.aai.onap.org.v13.LagInterfaces" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="PNF represents a physical network function. typically equipment used in the D1 world. in 1607, this will be populated by SDN-C to represent a premises router that a uCPE connects to. But this can be used to represent any physical device that is not an AIC node or uCPE." />
+ <xml-property name="indexedProps" value="pnf-name,orchestration-status,inv-status,model-invariant-id,model-version-id" />
+ <xml-property name="searchable" value="pnf-name" />
+ <xml-property name="uniqueProps" value="pnf-name" />
+ <xml-property name="container" value="pnfs" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="PhysicalLinks">
+ <xml-properties>
+ <xml-property name="description" value="Collection of physical connections, typically between p-interfaces" />
+ </xml-properties>
+ <xml-root-element name="physical-links" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="physicalLink" name="physical-link" type="inventory.aai.onap.org.v13.PhysicalLink" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="maximumDepth" value="0" />
+ </xml-properties>
+ </java-type>
+ <java-type name="PhysicalLink">
+ <xml-root-element name="physical-link" />
+ <java-attributes>
+ <xml-element java-attribute="linkName" name="link-name" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="e.g., hostnameA_p-connection_nameA_hostnameZ+p_connection-nameZ" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="speedValue" name="speed-value" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the numeric part of the speed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="speedUnits" name="speed-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Captures the units corresponding to the speed" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="circuitId" name="circuit-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Circuit it" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="dualMode" name="dual-mode" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Dual access mode (e.g., primary, secondary" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="managementOption" name="management-option" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="To provide information on who manages this circuit. A&amp;AI or 3rd party transport provider" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceProviderName" name="service-provider-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of the service Provider on this link." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceProviderBandwidthUpValue" name="service-provider-bandwidth-up-value" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="Upstream Bandwidth value agreed with the service provider" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceProviderBandwidthUpUnits" name="service-provider-bandwidth-up-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Units for the upstream BW value" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceProviderBandwidthDownValue" name="service-provider-bandwidth-down-value" type="java.lang.Integer">
+ <xml-properties>
+ <xml-property name="description" value="Downstream Bandwidth value agreed with the service provider" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceProviderBandwidthDownUnits" name="service-provider-bandwidth-down-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Units for downstream BW value" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Collection of physical connections, typically between p-interfaces" />
+ <xml-property name="indexedProps" value="circuit-id,link-name" />
+ <xml-property name="alternateKeys1" value="circuit-id" />
+ <xml-property name="container" value="physical-links" />
+ <xml-property name="namespace" value="network" />
+ <xml-property name="searchable" value="link-name,circuit-id" />
+ </xml-properties>
+ </java-type>
+ <java-type name="VigServers">
+ <xml-root-element name="vig-servers" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="vigServer" name="vig-server" type="inventory.aai.onap.org.v13.VigServer" />
+ </java-attributes>
+ </java-type>
+ <java-type name="VigServer">
+ <xml-root-element name="vig-server" />
+ <java-attributes>
+ <xml-element java-attribute="vigAddressType" name="vig-address-type" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="indicates whether the VIG is for AVPN or INTERNET" />
+ </xml-properties>
+ </xml-element>
+ <xml-element container-type="java.util.ArrayList" java-attribute="ipaddressV4Vig" name="ipaddress-v4-vig" type="java.lang.String" >
+ <xml-properties>
+ <xml-property name="description" value="v4 IP of the vig server" />
+ </xml-properties>
+ </xml-element>
+ <xml-element container-type="java.util.ArrayList" java-attribute="ipaddressV6Vig" name="ipaddress-v6-vig" type="java.lang.String" >
+ <xml-properties>
+ <xml-property name="description" value="v6 IP of the vig server" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="vig-server contains information about a vig server used for IPSec-configuration. Populated by SDN-C from 1607" />
+ <xml-property name="indexedProps" value="vig-address-type" />
+ <xml-property name="dependentOn" value="ipsec-configuration" />
+ <xml-property name="container" value="vig-servers" />
+ </xml-properties>
+ </java-type>
+ <java-type name="IpsecConfigurations">
+ <xml-root-element name="ipsec-configurations" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="ipsecConfiguration" name="ipsec-configuration" type="inventory.aai.onap.org.v13.IpsecConfiguration" />
+ </java-attributes>
+ </java-type>
+ <java-type name="IpsecConfiguration">
+ <xml-root-element name="ipsec-configuration" />
+ <java-attributes>
+ <xml-element java-attribute="ipsecConfigurationId" name="ipsec-configuration-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="UUID of this configuration" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="requestedVigAddressType" name="requested-vig-address-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Indicate the type of VIG server like AVPN, INTERNET, BOTH" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="requestedEncryptionStrength" name="requested-encryption-strength" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="requestedDmzType" name="requested-dmz-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ATT can offer a shared DMZ or a DMZ specific to a customer" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="sharedDmzNetworkAddress" name="shared-dmz-network-address" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Network address of shared DMZ" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="requestedCustomerName" name="requested-customer-name" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="If the DMZ is a custom DMZ, this field will indicate the customer information" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ikeVersion" name="ike-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="can be 1 or 2" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ikev1Authentication" name="ikev1-authentication" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Contains values like md5, sha1, sha256, sha384" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Diffie-Hellman group like DH-GROUP2, DH-GROUP5, DH-GROUP14" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ikev1AmGroupId" name="ikev1-am-group-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Group name defined in VIG for clients using aggressive mode" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ikev1AmPassword" name="ikev1-am-password" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="pre-shared key for the above group name " />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ikev1SaLifetime" name="ikev1-sa-lifetime" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Lifetime for IKEv1 SA" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipsecAuthentication" name="ipsec-authentication" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="md5, sha1, sha256, sha384" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Life time for IPSec SA" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ipsecPfs" name="ipsec-pfs" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="enable PFS or not" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="xauthUserId" name="xauth-userid" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="user ID for xAuth, sm-user,ucpeHostName,nmteHostName" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="xauthUserPassword" name="xauth-user-password" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Encrypted using the Juniper $9$ algorithm" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="dpdInterval" name="dpd-interval" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The time between DPD probe" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="dpdFrequency" name="dpd-frequency" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Maximum number of DPD before claiming the tunnel is down" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ <xml-element java-attribute="vigServers" name="vig-servers" type="inventory.aai.onap.org.v13.VigServers" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="IPSec configuration node will contain various configuration data for the NMTE VNF. This node will have an edge to the generic-vnf (vnf type = TE). Starting 1607, this data will be populated by SDN-C" />
+ <xml-property name="indexedProps" value="ipsec-configuration-id" />
+ <xml-property name="uniqueProps" value="ipsec-configuration-id" />
+ <xml-property name="container" value="ipsec-configurations" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="RouteTableReferences">
+ <xml-properties>
+ <xml-property name="description" value="Collection of openstack route table references"/>
+ </xml-properties>
+ <xml-root-element name="route-table-references"/>
+ <java-attributes>
+ <xml-element name="route-table-reference" type="inventory.aai.onap.org.v13.RouteTableReference" java-attribute="routeTableReference" container-type="java.util.ArrayList"/>
+ </java-attributes>
+ </java-type>
+ <java-type name="RouteTableReference">
+ <xml-root-element name="route-table-reference" />
+ <java-attributes>
+ <xml-element java-attribute="routeTableReferenceId" name="route-table-reference-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Route Table Reference id, UUID assigned to this instance." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="routeTableReferenceFqdn" name="route-table-reference-fqdn" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="FQDN entry in the route table." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Concurrency value" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+
+ <xml-properties>
+ <xml-property name="description" value="Openstack route table reference." />
+ <xml-property name="nameProps" value="route-table-reference-fqdn" />
+ <xml-property name="uniqueProps" value="route-table-reference-id" />
+ <xml-property name="indexedProps" value="route-table-reference-id,route-table-reference-fqdn" />
+ <xml-property name="container" value="route-table-references" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="InstanceGroups">
+ <xml-properties>
+ <xml-property name="description" value="Collection of openstack route table references" />
+ </xml-properties>
+ <xml-root-element name="instance-groups" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="instanceGroup" name="instance-group" type="inventory.aai.onap.org.v13.InstanceGroup" />
+ </java-attributes>
+ </java-type>
+ <java-type name="InstanceGroup">
+ <xml-root-element name="instance-group" />
+ <java-attributes>
+
+ <xml-element java-attribute="id" name="id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Instance Group ID, UUID assigned to this instance." />
+ </xml-properties>
+ </xml-element>
+
+ <xml-element java-attribute="instanceGroupRole" name="instance-group-role" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="role of the instance group." />
+ </xml-properties>
+ </xml-element>
+
+ <xml-element java-attribute="modelInvariantId" name="model-invariant-id" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ASDC model id for this resource or service model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-version-id" />
+ <xml-property name="dbAlias" value="model-invariant-id-local" />
+ </xml-properties>
+ </xml-element>
+
+ <xml-element java-attribute="modelVersionId" name="model-version-id" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ASDC model version uid for this resource model." />
+ <xml-property name="visibility" value="deployment" />
+ <xml-property name="requires" value="model-invariant-id" />
+ <xml-property name="dbAlias" value="model-version-id-local" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="description" name="description" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Descriptive text to help identify the usage of this instance-group" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="instanceGroupType" name="instance-group-type" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Only valid value today is lower case ha for high availability" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Concurrency value" />
+ </xml-properties>
+ </xml-element>
+
+ <xml-element java-attribute="instanceGroupName" name="instance-group-name" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Instance-Group Name." />
+ </xml-properties>
+ </xml-element>
+
+ <xml-element java-attribute="instanceGroupFunction" name="instance-group-function" required="false" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Instance-Group Function" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+
+ <xml-properties>
+ <xml-property name="description" value="General mechanism for grouping instances" />
+ <xml-property name="nameProps" value="description,instance-group-name" />
+ <xml-property name="uniqueProps" value="id" />
+ <xml-property name="searchable" value="id,description"/>
+ <xml-property name="indexedProps" value="id,description,type,sub-type,model-invariant-id,model-version-id" />
+ <xml-property name="container" value="instance-groups" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="SegmentationAssignments">
+ <xml-properties>
+ <xml-property name="description" value="Collection of openstack segmentation assignments" />
+ </xml-properties>
+ <xml-root-element name="segmentation-assignments" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="segmentationAssignment" name="segmentation-assignment" type="inventory.aai.onap.org.v13.SegmentationAssignment" />
+ </java-attributes>
+ </java-type>
+ <java-type name="SegmentationAssignment">
+ <xml-root-element name="segmentation-assignment" />
+ <java-attributes>
+ <xml-element java-attribute="segmentationId" name="segmentation-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Route Table Reference id, UUID assigned to this instance." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Concurrency value" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Openstack segmentation assignment." />
+ <xml-property name="indexedProps" value="segmentation-id" />
+ <xml-property name="dependentOn" value="l3-network" />
+ <xml-property name="container" value="segmentation-assignments" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Entitlements">
+ <xml-properties>
+ <xml-property name="description" value="Entitlements, keyed by group-uuid and resource-uuid, related to license management" />
+ </xml-properties>
+ <xml-root-element name="entitlements" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="entitlement" name="entitlement" type="inventory.aai.onap.org.v13.Entitlement" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Entitlement">
+ <xml-root-element name="entitlement" />
+ <java-attributes>
+ <xml-element java-attribute="groupUuid" name="group-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID for the entitlement group the resource comes from, should be uuid." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceUuid" name="resource-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID of an entitlement resource. " />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Concurrency value" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Metadata for entitlement group." />
+ <xml-property name="indexedProps" value="group-uuid,resource-uuid" />
+ <xml-property name="dependentOn" value="generic-vnf,vce" />
+ <xml-property name="container" value="entitlements" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Licenses">
+ <xml-properties>
+ <xml-property name="description" value="Licenses to be allocated across resources, keyed by group-uuid and resource-uuid, related to license management" />
+ </xml-properties>
+ <xml-root-element name="licenses" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="license" name="license" type="inventory.aai.onap.org.v13.License" />
+ </java-attributes>
+ </java-type>
+ <java-type name="License">
+ <xml-root-element name="license" />
+ <java-attributes>
+ <xml-element java-attribute="groupUuid" name="group-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID for the license group the resource belongs to, should be uuid." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceUuid" name="resource-uuid" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID of a license resource. " />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Concurrency value" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Metadata for license group." />
+ <xml-property name="indexedProps" value="group-uuid,resource-uuid" />
+ <xml-property name="dependentOn" value="generic-vnf,vce" />
+ <xml-property name="container" value="licenses" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Vnf">
+ <xml-root-element name="vnf"/>
+ <java-attributes>
+ <xml-element java-attribute="vnfId" name="vnf-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique id of VNF. This is unique across the graph." />
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Abstract vnf class" />
+ <xml-property name="indexedProps" value="vnf-id" />
+ <xml-property name="uniqueProps" value="vnf-id" />
+ <xml-property name="inheritors" value="vce,generic-vnf" />
+ <xml-property name="abstract" value="true" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Zones">
+ <xml-properties>
+ <xml-property name="description" value="Collection of zones" />
+ </xml-properties>
+ <xml-root-element name="zones" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="zone" name="zone" type="inventory.aai.onap.org.v13.Zone" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Zone">
+ <xml-root-element name="zone" />
+ <java-attributes>
+ <xml-element java-attribute="zoneId" name="zone-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Code assigned by AIC to the zone" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="zoneName" name="zone-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="English name associated with the zone" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Design of zone [Medium/Large…]" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Context of zone [production/test]" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="status" name="status" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Status of a zone." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Concurrency value" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="A zone is a grouping of assets in a location homing to the same connections into the CBB" />
+ <xml-property name="nameProps" value="zone-name" />
+ <xml-property name="indexedProps" value="zone-id,design-type,zone-context" />
+ <xml-property name="uniqueProps" value="zone-id" />
+ <xml-property name="container" value="zones" />
+ <xml-property name="namespace" value="network" />
+ </xml-properties>
+ </java-type>
+ <java-type name="RouteTargets">
+ <xml-properties>
+ <xml-property name="description" value="Collection of route target information" />
+ </xml-properties>
+ <xml-root-element name="route-targets" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="routeTarget" name="route-target" type="inventory.aai.onap.org.v13.RouteTarget" />
+ </java-attributes>
+ </java-type>
+ <java-type name="RouteTarget">
+ <xml-root-element name="route-target" />
+ <java-attributes>
+ <xml-element java-attribute="globalRouteTarget" name="global-route-target" required="true" xml-key="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Number used to identify an RT, globally unique in the network" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="routeTargetRole" name="route-target-role" required="true" xml-key="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Role assigned to this route target" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="Route target information" />
+ <xml-property name="container" value="route-targets" />
+ <xml-property name="dependentOn" value="vpn-binding" />
+ <xml-property name="canBeLinked" value="true" />
+ </xml-properties>
+ </java-type>
+ <java-type name="SriovPfs">
+ <xml-properties>
+ <xml-property name="description" value="Collection of SR-IOV Physical Functions." />
+ </xml-properties>
+ <xml-root-element name="sriov-pfs" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="sriovPf" name="sriov-pf" type="inventory.aai.onap.org.v13.SriovPf" />
+ </java-attributes>
+ </java-type>
+ <java-type name="SriovPf">
+ <xml-root-element name="sriov-pf" />
+ <java-attributes>
+ <xml-element java-attribute="pfPciId" name="pf-pci-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Identifier for the sriov-pf" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="SR-IOV Physical Function" />
+ <xml-property name="indexedProps" value="pf-pci-id" />
+ <xml-property name="dependentOn" value="p-interface" />
+ <xml-property name="container" value="sriov-pfs" />
+ </xml-properties>
+ </java-type>
+ <java-type name="HostRoutes">
+ <xml-root-element name="host-routes" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="hostRoute" name="host-route" type="inventory.aai.onap.org.v13.HostRoute" />
+ </java-attributes>
+ </java-type>
+ <java-type name="HostRoute">
+ <xml-root-element name="host-route" />
+ <java-attributes>
+ <xml-element java-attribute="hostRouteId" name="host-route-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="host-route id" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="routePrefix" name="route-prefix" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="subnet prefix" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nextHop" name="next-hop" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Could be ip-address, hostname, or service-instance" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nextHopType" name="next-hop-type" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Should be ip-address, hostname, or service-instance to match next-hop" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="indexedProps" value="host-route-id" />
+ <xml-property name="dependentOn" value="subnet" />
+ <xml-property name="container" value="host-routes" />
+ </xml-properties>
+ </java-type>
+ <java-type name="ForwardingPaths">
+ <xml-root-element name="forwarding-paths" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="forwardingPath" name="forwarding-path" type="inventory.aai.onap.org.v13.ForwardingPath" />
+ </java-attributes>
+ </java-type>
+ <java-type name="ForwardingPath">
+ <xml-root-element name="forwarding-path"/>
+ <xml-properties>
+ <xml-property name="namespace" value="network"/>
+ <xml-property name="indexedProps" value="forwarding-path-id,forwarding-path-name"/>
+ <xml-property name="description" value="Entity that describes the sequenced forwarding path between interfaces of services or resources"/>
+ <xml-property name="container" value="forwarding-paths" />
+ <xml-property name="nameProps" value="forwarding-path-name" />
+ <xml-property name="uniqueProps" value="forwarding-path-id" />
+ </xml-properties>
+ <java-attributes>
+ <xml-element java-attribute="forwardingPathId" name="forwarding-path-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID of this FP"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="forwardingPathName" name="forwarding-path-name" required="true" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Name of the FP"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList"/>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete."/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="selflink" name="selflink" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="the self link for this FP"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="forwarders" name="forwarders" type="inventory.aai.onap.org.v13.Forwarders" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Forwarders">
+ <xml-root-element name="forwarders" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="forwarder" name="forwarder" type="inventory.aai.onap.org.v13.Forwarder" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Forwarder">
+ <xml-root-element name="forwarder"/>
+ <xml-properties>
+ <xml-property name="indexedProps" value="sequence"/>
+ <xml-property name="description" value="Entity describing a sequenced segment of forwarding path"/>
+ <xml-property name="container" value="forwarders" />
+ <xml-property name="dependentOn" value="forwarding-path" />
+ </xml-properties>
+ <java-attributes>
+ <xml-element java-attribute="sequence" name="sequence" required="true" type="java.lang.Integer" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique ID of this segmentation"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="forwarderRole" name="forwarder-role" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="ingress, intermediate, egress"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList"/>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete."/>
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ </java-type>
+ <java-type name="ForwarderEvcs">
+ <xml-root-element name="forwarder-evcs"/>
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="forwarderEvc" name="forwarder-evc" type="inventory.aai.onap.org.v13.ForwarderEvc"/>
+ </java-attributes>
+ </java-type>
+ <java-type name="ForwarderEvc">
+ <xml-root-element name="forwarder-evc"/>
+ <java-attributes>
+ <xml-element java-attribute="forwarderEvcId" name="forwarder-evc-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Key for forwarder-evc object"/>
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="circuitId" name="circuit-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Circuit ID from customer/ESP/ingress end of EVC, or reference to beater circuit on gateway/network/egress end of EVC" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ivlan" name="ivlan" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Internal VLAN." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="svlan" name="svlan" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="SVLAN value for ingress of egress forwarder." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="cvlan" name="cvlan" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="CVLAN value for ingress of egress forwarder." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="vlanMappings" name="vlan-mappings" type="inventory.aai.onap.org.v13.VlanMappings" />
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList"/>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete."/>
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="forwarder object is an optional child object of the Configuration object." />
+ <xml-property name="dependentOn" value="configuration" />
+ <xml-property name="uniqueProps" value="forwarder-evc-id" />
+ <xml-property name="container" value="forwarder-evcs" />
+ </xml-properties>
+ </java-type>
+ <java-type name="VlanMappings">
+ <xml-properties>
+ <xml-property name="description" value="Collection of vlan mappings." />
+ </xml-properties>
+ <xml-root-element name="vlan-mappings" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="vlanMapping" name="vlan-mapping" type="inventory.aai.onap.org.v13.VlanMapping" />
+ </java-attributes>
+ </java-type>
+ <java-type name="VlanMapping">
+ <xml-root-element name="vlan-mapping" />
+ <java-attributes>
+ <xml-element java-attribute="vlanMappingId" name="vlan-mapping-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Key for vlan-mapping object." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="uniCvlan" name="uni-cvlan" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="CVLAN value from the UNI/ingress side of the SAREA gateway access device." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nniSvlan" name="nni-svlan" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="SVLAN value from the NNI/egress side of the SAREA gateway access device." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="nniCvlan" name="nni-cvlan" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="CVLAN value from the NNI/egress side of the SAREA gateway access device." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="ivLan" name="ivlan" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="The internal VLAN ('IVLAN') value. Specific to Arista devices." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList"/>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" />
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="vlan-mapping object is an optional child object of the forwarder-evc object. A given forwarder-evc object may have multiple vlan-mapping objects." />
+ <xml-property name="dependentOn" value="forwarder-evc" />
+ <xml-property name="uniqueProps" value="vlan-mapping-id" />
+ <xml-property name="container" value="vlan-mappings" />
+ </xml-properties>
+ </java-type>
+ <java-type name="Evcs">
+ <xml-root-element name="evcs" />
+ <java-attributes>
+ <xml-element container-type="java.util.ArrayList" java-attribute="evc" name="evc" type="inventory.aai.onap.org.v13.Evc" />
+ </java-attributes>
+ </java-type>
+ <java-type name="Evc">
+ <xml-root-element name="evc" />
+ <java-attributes>
+ <xml-element java-attribute="evcId" name="evc-id" required="true" type="java.lang.String" xml-key="true">
+ <xml-properties>
+ <xml-property name="description" value="Unique/key field for the evc object" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="forwardingPathTopology" name="forwarding-path-topology" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Point-to-Point, Multi-Point" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="cirValue" name="cir-value" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Commited Information Rate" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="cirUnits" name="cir-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="CIR units" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="connectionDiversityGroupId" name="connection-diversity-group-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Diversity Group ID" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="serviceHours" name="service-hours" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="formerly Performance Group" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="espEvcCircuitId" name="esp-evc-circuit-id" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="EVC Circuit ID of ESP EVC" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="espEvcCirValue" name="esp-evc-cir-value" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Committed Information Rate (For ESP)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="espEvcCirUnits" name="esp-evc-cir-units" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="CIR units (For ESP)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="espItuCode" name="esp-itu-code" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Identifies ESP" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="collectorPopClli" name="collector-pop-clli" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Collector POP CLLI (from the hostname of the access pnf)" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="interConnectTypeIngress" name="inter-connect-type-ingress" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Interconnect type on ingress side of EVC." />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="tagmodeAccessIngress" name="tagmode-access-ingress" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="tagode for collector side of EVC" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="tagmodeAccessEgress" name="tagmode-access-egress" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="tagMode for network side of EVC" />
+ </xml-properties>
+ </xml-element>
+ <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v13.RelationshipList"/>
+ <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String">
+ <xml-properties>
+ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete."/>
+ </xml-properties>
+ </xml-element>
+ </java-attributes>
+ <xml-properties>
+ <xml-property name="description" value="evc object is an optional child object of the Configuration object." />
+ <xml-property name="dependentOn" value="configuration" />
+ <xml-property name="uniqueProps" value="evc-id" />
+ <xml-property name="container" value="evcs" />
+ </xml-properties>
+ </java-type></java-types></xml-bindings>
diff --git a/aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml b/aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml
index e7d77ac9..e52a58c2 100644
--- a/aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml
+++ b/aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml
@@ -19,9 +19,9 @@
============LICENSE_END=========================================================
-->
-<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v12" xml-mapping-metadata-complete="true">
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="inventory.aai.onap.org.v10" xml-mapping-metadata-complete="true">
<xml-schema element-form-default="QUALIFIED">
- <xml-ns namespace-uri="http://org.onap.aai.inventory/v12" />
+ <xml-ns namespace-uri="http://org.onap.aai.inventory/v10" />
</xml-schema>
<java-types>
@@ -48,4 +48,4 @@
</java-type>
</java-types>
-</xml-bindings> \ No newline at end of file
+</xml-bindings>
diff --git a/aai-schema-ingest/src/test/resources/payload/versions.json b/aai-schema-ingest/src/test/resources/payload/versions.json
new file mode 100644
index 00000000..a1b608ba
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/payload/versions.json
@@ -0,0 +1,18 @@
+{
+"versions": [
+"v8",
+"v9",
+"v10",
+ "v11",
+ "v12",
+ "v13",
+ "v14",
+ "v15"
+],
+"edge-version": "v15",
+"default-version": "v15",
+"depth-version": "v15",
+"app-root-version": "v15",
+"related-link-version": "v15",
+"namespace-change-version": "v15"
+}
diff --git a/aai-schema-ingest/src/test/resources/schemaservice-endpoints.json b/aai-schema-ingest/src/test/resources/schemaservice-endpoints.json
new file mode 100644
index 00000000..07d637dd
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/schemaservice-endpoints.json
@@ -0,0 +1,9 @@
+"schema-service-endpoints" : {
+ "version-endpoint": {
+ "uri": "/versions",
+ "response" : {
+ "versions" : ["v9", "v10", "v11"],
+ "default" : "v14",
+ }
+ }
+}
diff --git a/aai-schema/.classpath b/aai-schema/.classpath
deleted file mode 100644
index 8c0f651e..00000000
--- a/aai-schema/.classpath
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" path="target/generated-sources"/>
- <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git a/aai-schema/pom.xml b/aai-schema/pom.xml
index e949d236..d364d224 100644
--- a/aai-schema/pom.xml
+++ b/aai-schema/pom.xml
@@ -27,11 +27,11 @@
<parent>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-common</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>aai-schema</artifactId>
<name>aai-schema</name>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<properties>
<onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
<!-- Start of Default ONAP Schema Properties -->
diff --git a/aai-schema/src/main/resources/onap/aai_schema/aai_schema_v14.xsd b/aai-schema/src/main/resources/onap/aai_schema/aai_schema_v14.xsd
index 1261cf49..4fb1ae1c 100644
--- a/aai-schema/src/main/resources/onap/aai_schema/aai_schema_v14.xsd
+++ b/aai-schema/src/main/resources/onap/aai_schema/aai_schema_v14.xsd
@@ -7755,7 +7755,7 @@ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
<xs:complexType>
<xs:annotation>
<xs:appinfo>
- <annox:annotate target="class">@org.onap.aai.annotations.Metadata(description="General mechanism for grouping instances",nameProps="description,instance-group-name",uniqueProps="id",searchable="id,description",indexedProps="id,description,type,sub-type,model-invariant-id,model-version-id",container="instance-groups",namespace="network",uriTemplate="/network/instance-groups/instance-group/{id}",requiredProps="id,description,instance-group-type")</annox:annotate>
+ <annox:annotate target="class">@org.onap.aai.annotations.Metadata(description="General mechanism for grouping instances",nameProps="description,instance-group-name",uniqueProps="id",searchable="id,description",indexedProps="id,type,sub-type,model-invariant-id,model-version-id",container="instance-groups",namespace="network",uriTemplate="/network/instance-groups/instance-group/{id}",requiredProps="id,instance-group-type")</annox:annotate>
</xs:appinfo>
</xs:annotation>
<xs:sequence>
diff --git a/aai-schema/src/main/resources/onap/aai_schema/aai_schema_v15.xsd b/aai-schema/src/main/resources/onap/aai_schema/aai_schema_v15.xsd
index 545efe03..b6cf1a30 100644
--- a/aai-schema/src/main/resources/onap/aai_schema/aai_schema_v15.xsd
+++ b/aai-schema/src/main/resources/onap/aai_schema/aai_schema_v15.xsd
@@ -7906,7 +7906,7 @@ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
<xs:complexType>
<xs:annotation>
<xs:appinfo>
- <annox:annotate target="class">@org.onap.aai.annotations.Metadata(description="General mechanism for grouping instances",nameProps="description,instance-group-name",uniqueProps="id",searchable="id,description",indexedProps="id,description,type,sub-type,model-invariant-id,model-version-id",container="instance-groups",namespace="network",uriTemplate="/network/instance-groups/instance-group/{id}",requiredProps="id,description,instance-group-type")</annox:annotate>
+ <annox:annotate target="class">@org.onap.aai.annotations.Metadata(description="General mechanism for grouping instances",nameProps="description,instance-group-name",uniqueProps="id",searchable="id,description",indexedProps="id,type,sub-type,model-invariant-id,model-version-id",container="instance-groups",namespace="network",uriTemplate="/network/instance-groups/instance-group/{id}",requiredProps="id,instance-group-type")</annox:annotate>
</xs:appinfo>
</xs:annotation>
<xs:sequence>
@@ -9762,7 +9762,7 @@ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
<xs:complexType>
<xs:annotation>
<xs:appinfo>
- <annox:annotate target="class">@org.onap.aai.annotations.Metadata(description="Internal map to define some reserved properties of a vertex",uniqueProps="aai-unique-key",indexedProps="aai-unique-key,source-of-truth,aai-node-type,aai-uri")</annox:annotate>
+ <annox:annotate target="class">@org.onap.aai.annotations.Metadata(description="Internal map to define some reserved properties of a vertex",uniqueProps="aai-unique-key,aai-uri,aai-uuid",indexedProps="aai-unique-key,source-of-truth,aai-node-type,aai-uri,aai-uuid")</annox:annotate>
</xs:appinfo>
</xs:annotation>
<xs:sequence>
diff --git a/aai-schema/src/main/resources/onap/dbedgerules/v14/DbEdgeRules_v14.json b/aai-schema/src/main/resources/onap/dbedgerules/v14/DbEdgeRules_v14.json
index 9db424d5..2eed8007 100644
--- a/aai-schema/src/main/resources/onap/dbedgerules/v14/DbEdgeRules_v14.json
+++ b/aai-schema/src/main/resources/onap/dbedgerules/v14/DbEdgeRules_v14.json
@@ -613,6 +613,30 @@
"description":""
},
{
+ "from": "generic-vnf",
+ "to": "cloud-region",
+ "label": "org.onap.relationships.inventory.LocatedIn",
+ "direction": "OUT",
+ "multiplicity": "MANY2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "generic-vnf",
+ "to": "tenant",
+ "label": "org.onap.relationships.inventory.BelongsTo",
+ "direction": "OUT",
+ "multiplicity": "MANY2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
"from": "lag-interface",
"to": "generic-vnf",
"label": "org.onap.relationships.inventory.BelongsTo",
diff --git a/aai-schema/src/main/resources/onap/dbedgerules/v15/DbEdgeRules_v15.json b/aai-schema/src/main/resources/onap/dbedgerules/v15/DbEdgeRules_v15.json
index a0dbf258..1f6829c5 100644
--- a/aai-schema/src/main/resources/onap/dbedgerules/v15/DbEdgeRules_v15.json
+++ b/aai-schema/src/main/resources/onap/dbedgerules/v15/DbEdgeRules_v15.json
@@ -565,6 +565,30 @@
"description":""
},
{
+ "from": "generic-vnf",
+ "to": "cloud-region",
+ "label": "org.onap.relationships.inventory.LocatedIn",
+ "direction": "OUT",
+ "multiplicity": "MANY2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "generic-vnf",
+ "to": "tenant",
+ "label": "org.onap.relationships.inventory.BelongsTo",
+ "direction": "OUT",
+ "multiplicity": "MANY2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
"from": "vnfc",
"to": "generic-vnf",
"label": "org.onap.relationships.inventory.BelongsTo",
diff --git a/aai-schema/src/main/resources/onap/oxm/v14/aai_oxm_v14.xml b/aai-schema/src/main/resources/onap/oxm/v14/aai_oxm_v14.xml
index 05decfb9..2f729cb4 100644
--- a/aai-schema/src/main/resources/onap/oxm/v14/aai_oxm_v14.xml
+++ b/aai-schema/src/main/resources/onap/oxm/v14/aai_oxm_v14.xml
@@ -6318,7 +6318,7 @@
<xml-property name="privateEdge" value="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}"/>
</xml-properties>
</xml-element>
- <xml-element java-attribute="description" name="description" required="true" type="java.lang.String">
+ <xml-element java-attribute="description" name="description" required="false" type="java.lang.String">
<xml-properties>
<xml-property name="description" value="Descriptive text to help identify the usage of this instance-group"/>
</xml-properties>
@@ -6353,11 +6353,11 @@
<xml-property name="nameProps" value="description,instance-group-name"/>
<xml-property name="uniqueProps" value="id"/>
<xml-property name="searchable" value="id,description"/>
- <xml-property name="indexedProps" value="id,description,type,sub-type,model-invariant-id,model-version-id"/>
+ <xml-property name="indexedProps" value="id,type,sub-type,model-invariant-id,model-version-id"/>
<xml-property name="container" value="instance-groups"/>
<xml-property name="namespace" value="network"/>
<xml-property name="uriTemplate" value="/network/instance-groups/instance-group/{id}"/>
- <xml-property name="requiredProps" value="id,description,instance-group-type"/>
+ <xml-property name="requiredProps" value="id,instance-group-type"/>
</xml-properties>
</java-type>
diff --git a/aai-schema/src/main/resources/onap/oxm/v15/aai_oxm_v15.xml b/aai-schema/src/main/resources/onap/oxm/v15/aai_oxm_v15.xml
index 644fc9fa..ce7f2d52 100644
--- a/aai-schema/src/main/resources/onap/oxm/v15/aai_oxm_v15.xml
+++ b/aai-schema/src/main/resources/onap/oxm/v15/aai_oxm_v15.xml
@@ -5704,8 +5704,8 @@
<java-type name="ReservedPropNames">
<xml-properties>
<xml-property name="description" value="Internal map to define some reserved properties of a vertex"/>
- <xml-property name="uniqueProps" value="aai-unique-key"/>
- <xml-property name="indexedProps" value="aai-unique-key,source-of-truth,aai-node-type,aai-uri"/>
+ <xml-property name="uniqueProps" value="aai-unique-key,aai-uri,aai-uuid"/>
+ <xml-property name="indexedProps" value="aai-unique-key,source-of-truth,aai-node-type,aai-uri,aai-uuid"/>
</xml-properties>
<xml-root-element name="reserved-prop-names"/>
<java-attributes>
@@ -6396,7 +6396,7 @@
<xml-property name="privateEdge" value="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}"/>
</xml-properties>
</xml-element>
- <xml-element java-attribute="description" name="description" required="true" type="java.lang.String">
+ <xml-element java-attribute="description" name="description" required="false" type="java.lang.String">
<xml-properties>
<xml-property name="description" value="Descriptive text to help identify the usage of this instance-group"/>
</xml-properties>
@@ -6431,11 +6431,11 @@
<xml-property name="nameProps" value="description,instance-group-name"/>
<xml-property name="uniqueProps" value="id"/>
<xml-property name="searchable" value="id,description"/>
- <xml-property name="indexedProps" value="id,description,type,sub-type,model-invariant-id,model-version-id"/>
+ <xml-property name="indexedProps" value="id,type,sub-type,model-invariant-id,model-version-id"/>
<xml-property name="container" value="instance-groups"/>
<xml-property name="namespace" value="network"/>
<xml-property name="uriTemplate" value="/network/instance-groups/instance-group/{id}"/>
- <xml-property name="requiredProps" value="id,description,instance-group-type"/>
+ <xml-property name="requiredProps" value="id,instance-group-type"/>
</xml-properties>
</java-type>
diff --git a/aai-utils/pom.xml b/aai-utils/pom.xml
index 0f02b995..5ad28352 100644
--- a/aai-utils/pom.xml
+++ b/aai-utils/pom.xml
@@ -29,11 +29,11 @@
<parent>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-common</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<artifactId>aai-utils</artifactId>
<name>aai-utils</name>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<properties>
<onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
@@ -71,7 +71,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
- <version>4.3.18.RELEASE</version>
+ <version>4.3.21.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
diff --git a/docs/AAI REST API Documentation/AAIRESTAPI_CASABLANCA.rst b/docs/AAI REST API Documentation/AAIRESTAPI_CASABLANCA.rst
index 49dc1077..cb23ae50 100644
--- a/docs/AAI REST API Documentation/AAIRESTAPI_CASABLANCA.rst
+++ b/docs/AAI REST API Documentation/AAIRESTAPI_CASABLANCA.rst
@@ -1715,3 +1715,13 @@ List of Queries and Payloads
For a full list of available custom queries, please refer to our
`Custom Queries <customQueries.html>`_ document
+Nodes Query
+-----------
+
+In working with AAI's standard REST API, you may have noticed that
+certain API paths have a hierarchy to them and require a client to
+know multiple object keys to preform GETs. The nodes API allows for
+more freedom in querying AAI, allowing clients to circumvent the need
+to know every key in the hierarchy.
+
+See `Nodes Query <nodesQuery.html>`_ for more information.
diff --git a/docs/AAI REST API Documentation/nodesQuery.rst b/docs/AAI REST API Documentation/nodesQuery.rst
new file mode 100644
index 00000000..6064020b
--- /dev/null
+++ b/docs/AAI REST API Documentation/nodesQuery.rst
@@ -0,0 +1,94 @@
+.. contents::
+ :depth: 3
+..
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+
+Nodes Query
+===========
+
+In working with AAI's standard REST API, you may have noticed that
+certain API paths have a hierarchy to them and require a client to
+know multiple object keys to preform GETs. For example: the vserver
+object is under tenant, which is itself under cloud-region. If you
+wanted to look up a vserver by name, you would still need to know the
+tenant-id and cloud-region-id (and cloud-owner) in order to
+successfully perform that GET. The nodes API allows for more freedom
+in querying AAI, allowing clients to circumvent the need to know
+every key in the hierarchy. Using the previous example, the below is
+how the API called would change for looking up a vserver by name:
+
+.. code::
+
+ GET /aai/v$/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers?vserver-name={vserver-name}
+ becomes
+ GET /aai/v$/nodes/vservers?vserver-name={vserver-name}
+
+A side effect of this is that if the same vserver name was reused between
+multiple cloud-regions or tenants the client will receive multiple
+vservers in the response. Vserver ID and vserver name are
+intentionally non-unique outside of their cloud-region/tenant
+hierarchy, as are many other keys for nested objects.
+
+API URI
+~~~~~~~
+
+.. code::
+
+ GET /aai/v$/nodes/{plural}?{property}={value}
+ OR
+ GET /aai/v$/nodes/{plural}/{singular}/{key}
+
+Optional Query Parameters
+~~~~~~~~~~~~~~~~~~~~~~~~~
+The Nodes API can make use of all the optional query
+parameters available on the standard REST API.
+
+Depth
+~~~~~
+
+You can pass a depth query parameter to indicate what level of child objects you want
+returned. By default the output will be depth = 0 (no "children", only
+"cousin" relationships). When using depth in conjunction with the
+format query parameter, it will only apply to the on the resource or
+resource_and_url formats.
+
+.. code::
+
+ GET /aai/v$/nodes/{plural}/{singular}/{key}?depth={integer}
+
+Nodes Only
+~~~~~~~~~~
+
+You can pass a nodes only query parameter to have the output only contain
+the object properties with no relationships.
+
+.. code::
+
+ GET /aai/v$/nodes/{plural}/{singular}/{key}?nodes-only
+ OR
+ GET /aai/v$/nodes/{plural}/{singular}/{key}?format={format}&nodesOnly=true
+
+Format
+~~~~~~
+
+You can optionally request an output format different from the default
+REST API output. You can reference the list of formats on the `Custom
+Query <customQueries.html>`_ wiki page for the full list of available
+formats and examples.
+
+.. code::
+
+ GET /aai/v$/nodes/{plural}/{singular}/{key}?format={format}
+
+Usage with Custom Query
+~~~~~~~~~~~~~~~~~~~~~~~
+
+The Nodes API can be called directly or as the start node for Custom
+Queries. Please reference the Custom Queries wiki page for full
+documentation on how to use that interface.
+
+.. code::
+
+ PUT /aai/v$/query?format={format} with payload like..
+ { "start": ["nodes/{plural}/{singular}/{key}"], "query": "query/{query-name}" }
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index dcea52d9..03e085b0 100644
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -9,7 +9,7 @@ AAI Release Notes
Version: 1.3.0
--------------
-:Release Date: TBD
+:Release Date: 2018-11-30
**New Features**
@@ -17,27 +17,57 @@ The R3 Casablanca release of ONAP again focuses on platform maturity
and deployablity. AAI continued to leverage oom and kubernetes, and
added new data types in support of multiple R3 use cases. AAI added a
new schema ingest library which moves AAI closer to being more
-model-driven.
+model-driven and a new microservice called "graphadmin" which provides
+graph maintenance and configuration facilities.
-Authentication and Authorization is performed using AAF with the CADI
-framework. We use basic authentication with RBAC (Role Based Access
-Control) to secure the AAI REST APIs.
+AAI is more model driven in Casablanca, which means it dynamically
+operationalize new and updated models at run-time, with minimal
+downtime and coding, so that the latest service and resource models
+can be delivered quickly. To do this, AAI must update its internal
+model, external API and behavior to respond to change to service and
+resource models, including schema changes. There are changes required
+to align on implementation across different ONAP components to provide
+a more strategic model-driven A&AI implementation. For this release
+decomposing AAI model/schema artifacts (OXM/XSD) into a more granular
+approach better enables extensibility and support logical
+subdivision of models.
-**Epic**
+AAI added support fo the Cross Domain and Carrier Layer VPN use case
+by adding new object types, models, and edge rules.
+
+AAI delivered 50%+ test coverage on all Java-based repos.
+
+Added support Support for SR-IOV.
+
+Authentication and Authorization is performed using AAF with the
+CADI framework. We use basic authentication with RBAC (Role Based
+Access Control) to secure the AAI REST APIs.
+
+AAI added automation support for orchestrating SR-IOV Provider
+Networks that are compatible with the Network Cloud 1.0
+infrastructure solution based on standard SR-IOV. Allow for standard
+SR-IOV Provider Networks to be defined with a set of one or more
+VLAN associations.
+
+AAI added suport to allow clients to specify the format on GET
+operations in the resources micoservices to output like the custom
+query API does.
+
+Added support for VLAN tagging.
+
+**Known Issues**
-- `AAI-32 <https://jira.onap.org/browse/AAI-32>`_ Integrate with AAF
-- `AAI-766 <https://jira.onap.org/browse/AAI-766>`_ Microservice for administering the AAI graph db
-- `AAI-767 <https://jira.onap.org/browse/AAI-767>`_ Make AAI More Model Driven
-- `AAI-981 <https://jira.onap.org/browse/AAI-981>`_ Schema updates required for the R3 Casablanca use cases
-- `AAI-1340 <https://jira.onap.org/browse/AAI-1340>`_ Support CCVPN use case in AAI
-- `AAI-1409 <https://jira.onap.org/browse/AAI-1409>`_ SONAR Coverage
-- `AAI-1410 <https://jira.onap.org/browse/AAI-1410>`_ Logging Enhancements
-- `AAI-1411 <https://jira.onap.org/browse/AAI-1411>`_ SRIOV Automation
-- `AAI-1413 <https://jira.onap.org/browse/AAI-1413>`_ 5G Core Scale over Network Cloud
-- `AAI-1415 <https://jira.onap.org/browse/AAI-1415>`_ SVLAN and CVLAN rewrite
-- `AAI-1416 <https://jira.onap.org/browse/AAI-1416>`_ Enhance CRUD APIs to take Optional "format"
-- `AAI-1418 <https://jira.onap.org/browse/AAI-1418>`_ VLAN Tagging
-- `AAI-1419 <https://jira.onap.org/browse/AAI-1419>`_ Schema Ingest Library
+Please find at this link the list of issues that will be fixed in the `Casablanca Maintenance Release <https://jira.onap.org/issues/?jql=fixVersion%20%3D%20%22Casablanca%20Maintenance%20Release%22%20and%20type%20%3D%20Bug%20and%20project%20%3D%20%22Active%20and%20Available%20Inventory%22>`_
+
+**Security Notes**
+
+AAI code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and determined to be false positive. The AAI open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=45307817>`_.
+
+Quick Links:
+
+- `AAI project page <https://wiki.onap.org/display/DW/Active+and+Available+Inventory+Project>`_
+- `Passing Badge information for AAI <https://bestpractices.coreinfrastructure.org/en/projects/1591>`_
+- `Project Vulnerability Review Table for AAI <https://wiki.onap.org/pages/viewpage.action?pageId=45307817>`_
Version: 1.2.0
diff --git a/pom.xml b/pom.xml
index d7b47a65..1a3290c9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,12 +30,13 @@
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-common</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>aai-aai-common</name>
<description>Contains all of the common code for resources and traversal repos</description>
<modules>
+ <module>aai-rest</module>
<module>aai-schema-ingest</module>
<module>aai-annotations</module>
<module>aai-core</module>
diff --git a/version.properties b/version.properties
index 66827fd3..e653a662 100644
--- a/version.properties
+++ b/version.properties
@@ -5,7 +5,7 @@
major_version=1
minor_version=4
-patch_version=0
+patch_version=1
base_version=${major_version}.${minor_version}.${patch_version}