Add edge rules oxm changes for complex services 69/25469/1
authorVenkata Harish K Kajur <vk250x@att.com>
Mon, 4 Dec 2017 18:52:34 +0000 (13:52 -0500)
committerVenkata Harish K Kajur <vk250x@att.com>
Mon, 4 Dec 2017 18:52:46 +0000 (13:52 -0500)
Issue-ID: AAI-530
Change-Id: Ib9b91a638e72da76ece9d9e34d6e62354601492a
Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java
aai-core/src/main/resources/dbedgerules/DbEdgeRules_v12.json
aai-schema/src/main/resources/aai_schema/aai_schema_v12.xsd
aai-schema/src/main/resources/oxm/aai_oxm_v12.xml

index ce04fb7..c5f4570 100644 (file)
@@ -292,14 +292,8 @@ public class MoxyStrategy extends Introspector {
                keys = this.getKeys();
                List<String> results = new ArrayList<>();
                for (String key : keys) {
-                       if (this.getType(key).toLowerCase().contains("long")) {
-                               key = ((Long)this.getValue(key)).toString();
-                       } else {
-                               key = (String)this.getValue(key);
-                       }
-                       key = UriUtils.encode(key, "UTF-8");
-
-                       results.add(key);
+                       String value = UriUtils.encode(this.getValue(key).toString(), "UTF-8");
+                       results.add(value);
                }
                
                return Joiner.on("/").join(results);
index 4c72156..770124d 100644 (file)
                        "SVC-INFRA": "${direction}",
                        "prevent-delete": "NONE",
                        "default": "true"
+               },
+               {
+                       "from": "configuration",
+                       "to": "l-interface",
+                       "label": "has",
+                       "direction": "OUT",
+                       "multiplicity": "ONE2MANY",
+                       "contains-other-v": "NONE",
+                       "delete-other-v": "NONE",
+                       "SVC-INFRA": "NONE",
+                       "prevent-delete": "NONE",
+                       "default": "true"
+               },
+               {
+                       "from": "configuration",
+                       "to": "pnf",
+                       "label": "uses",
+                       "direction": "OUT",
+                       "multiplicity": "ONE2MANY",
+                       "contains-other-v": "NONE",
+                       "delete-other-v": "NONE",
+                       "SVC-INFRA": "NONE",
+                       "prevent-delete": "NONE",
+                       "default": "true"
+               },
+               {
+                       "from": "forwarder",
+                       "to": "p-interface",
+                       "label": "forwardsTo",
+                       "direction": "OUT",
+                       "multiplicity": "ONE2ONE",
+                       "contains-other-v": "NONE",
+                       "delete-other-v": "NONE",
+                       "SVC-INFRA": "NONE",
+                       "prevent-delete": "NONE",
+                       "default": "true"
+               },
+               {
+                       "from": "forwarder",
+                       "to": "l-interface",
+                       "label": "forwardsTo",
+                       "direction": "OUT",
+                       "multiplicity": "ONE2ONE",
+                       "contains-other-v": "NONE",
+                       "delete-other-v": "NONE",
+                       "SVC-INFRA": "NONE",
+                       "prevent-delete": "NONE",
+                       "default": "true"
+               },
+               {
+                       "from": "forwarder",
+                       "to": "forwarding-path",
+                       "label": "belongsTo",
+                       "direction": "OUT",
+                       "multiplicity": "MANY2ONE",
+                       "contains-other-v": "!${direction}",
+                       "delete-other-v": "!${direction}",
+                       "SVC-INFRA": "NONE",
+                       "prevent-delete": "NONE",
+                       "default": "true"
+               },
+               {
+                       "from": "forwarding-path",
+                       "to": "service-instance",
+                       "label": "implements",
+                       "direction": "OUT",
+                       "multiplicity": "MANY2ONE",
+                       "contains-other-v": "NONE",
+                       "delete-other-v": "!${direction}",
+                       "SVC-INFRA": "NONE",
+                       "prevent-delete": "NONE",
+                       "default": "true"
                }
        ]
 }
index 9d25a6f..78f918e 100644 (file)
@@ -7292,6 +7292,87 @@ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
       </xs:sequence>
     </xs:complexType>
   </xs:element>
+  <xs:element name="forwarder">
+    <xs:complexType>
+      <xs:annotation>
+        <xs:appinfo>
+          <annox:annotate target="class">@org.onap.aai.annotations.Metadata(indexedProps="sequence",description="Entity describing a sequenced segment of forwarding path",container="forwarders",dependentOn="forwarding-path")</annox:annotate>
+        </xs:appinfo>
+      </xs:annotation>
+      <xs:sequence>
+        <xs:element name="sequence" type="xs:int">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(isKey=true,description="Unique ID of this segmentation")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element ref="tns:relationship-list" minOccurs="0"/>
+        <xs:element name="resource-version" type="xs:string" minOccurs="0">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="forwarders">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="tns:forwarder" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="forwarding-path">
+    <xs:complexType>
+      <xs:annotation>
+        <xs:appinfo>
+          <annox:annotate target="class">@org.onap.aai.annotations.Metadata(namespace="network",indexedProps="forwarding-path-id,forwarding-path-name",description="Entity that describes the sequenced forwarding path between interfaces of services or resources",container="forwarding-paths",nameProps="forwarding-path-name",uniqueProps="forwarding-path-id")</annox:annotate>
+        </xs:appinfo>
+      </xs:annotation>
+      <xs:sequence>
+        <xs:element name="forwarding-path-id" type="xs:string">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(isKey=true,description="Unique ID of this FP")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="forwarding-path-name" type="xs:string">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(description="Name of the FP")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element ref="tns:relationship-list" minOccurs="0"/>
+        <xs:element name="resource-version" type="xs:string" minOccurs="0">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="selflink" type="xs:string" minOccurs="0">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(description="the self link for this FP")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element ref="tns:forwarders" minOccurs="0"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="forwarding-paths">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="tns:forwarding-path" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
   <xs:element name="network">
     <xs:complexType>
       <xs:annotation>
@@ -7319,6 +7400,7 @@ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
         <xs:element ref="tns:instance-groups" minOccurs="0"/>
         <xs:element ref="tns:zones" minOccurs="0"/>
         <xs:element ref="tns:configurations" minOccurs="0"/>
+        <xs:element ref="tns:forwarding-paths" minOccurs="0"/>
       </xs:sequence>
     </xs:complexType>
   </xs:element>
@@ -7628,4 +7710,77 @@ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
       </xs:sequence>
     </xs:complexType>
   </xs:element>
+  <xs:element name="operational-environment">
+    <xs:complexType>
+      <xs:annotation>
+        <xs:appinfo>
+          <annox:annotate target="class">@org.onap.aai.annotations.Metadata(description="It is a logical partition of the cloud which allows to have multiple environments in the production AIC.",indexedProps="operational-environment-id",uniqueProps="operational-environment-id",container="operational-environments",namespace="cloud-infrastructure")</annox:annotate>
+        </xs:appinfo>
+      </xs:annotation>
+      <xs:sequence>
+        <xs:element name="operational-environment-id" type="xs:string">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(isKey=true,description="UUID of an operational environment")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="operational-environment-name" type="xs:string">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(description="Operational Environment name")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="operational-environment-type" type="xs:string">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(description="Operational Environment Type.")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="operational-environment-status" type="xs:string">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(description="Status")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="tenant-context" type="xs:string">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(description="Tenant Context.")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="workload-context" type="xs:string">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(description="Workload Context.")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element name="resource-version" type="xs:string" minOccurs="0">
+          <xs:annotation>
+            <xs:appinfo>
+              <annox:annotate target="field">@org.onap.aai.annotations.Metadata(description="Used for optimistic concurrency.  Must be empty on create, valid on update and delete.")</annox:annotate>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:element>
+        <xs:element ref="tns:relationship-list" minOccurs="0"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="operational-environments">
+    <xs:complexType>
+      <xs:annotation>
+        <xs:appinfo>
+          <annox:annotate target="class">@org.onap.aai.annotations.Metadata(description="a logical partition of the cloud which allows to have multiple environments in the production AIC.")</annox:annotate>
+        </xs:appinfo>
+      </xs:annotation>
+      <xs:sequence>
+        <xs:element ref="tns:operational-environment" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
 </xs:schema>
index 008e7f9..79bbdf8 100644 (file)
                                <xml-element java-attribute="instanceGroups" name="instance-groups" type="inventory.aai.onap.org.v12.InstanceGroups" />
                                <xml-element java-attribute="zones" name="zones" type="inventory.aai.onap.org.v12.Zones" />
                                <xml-element java-attribute="configurations" name="configurations" type="inventory.aai.onap.org.v12.Configurations" />
+                               <xml-element java-attribute="forwardingPaths" name="forwarding-paths" type="inventory.aai.onap.org.v12.ForwardingPaths" />
                        </java-attributes>
                </java-type>
         <java-type name="Configurations">
                                <xml-property name="dependentOn" value="cloud-region" />
                        </xml-properties>
                </java-type>
+               
+               <java-type name="OperationalEnvironments">
+                       <xml-properties>
+                               <xml-property name="description" value="a logical partition of the cloud which allows to have multiple environments in the production AIC." />
+                       </xml-properties>
+                       <xml-root-element name="operational-environments" />
+                       <java-attributes>
+                               <xml-element container-type="java.util.ArrayList" java-attribute="operationalEnvironment" name="operational-environment" type="inventory.aai.onap.org.v12.OperationalEnvironment" />
+                       </java-attributes>
+                       <xml-properties>
+                               <xml-property name="maximumDepth" value="0" />
+                       </xml-properties>
+               </java-type>
+
+               <java-type name="OperationalEnvironment">
+                       <xml-root-element name="operational-environment" />
+                       <java-attributes>
+                               <xml-element java-attribute="operationalEnvironmentId" name="operational-environment-id" required="true" type="java.lang.String" xml-key="true">
+                                       <xml-properties>
+                                               <xml-property name="description" value="UUID of an operational environment" />
+                                       </xml-properties>
+                               </xml-element>
+                               <xml-element java-attribute="operationalEnvironmentName" name="operational-environment-name" required="true" type="java.lang.String">
+                                       <xml-properties>
+                                               <xml-property name="description" value="Operational Environment name" />
+                                       </xml-properties>
+                               </xml-element>
+                               <xml-element java-attribute="operationalEnvironmentType" name="operational-environment-type" required="true" type="java.lang.String">
+                                       <xml-properties>
+                                               <xml-property name="description" value="Operational Environment Type." />
+                                       </xml-properties>
+                               </xml-element>
+                               <xml-element java-attribute="operationalEnvironmentStatus" name="operational-environment-status" required="true" type="java.lang.String">
+                                       <xml-properties>
+                                               <xml-property name="description" value="Status" />
+                                       </xml-properties>
+                               </xml-element>
+                               <xml-element java-attribute="tenantContext" name="tenant-context" required="true" type="java.lang.String">
+                                       <xml-properties>
+                                               <xml-property name="description" value="Tenant Context." />
+                                       </xml-properties>
+                               </xml-element>
+                               <xml-element java-attribute="workloadContext" name="workload-context" required="true" type="java.lang.String">
+                                       <xml-properties>
+                                               <xml-property name="description" value="Workload Context." />
+                                       </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.v12.RelationshipList" />
+                       </java-attributes>
+                       <xml-properties>
+                               <xml-property name="description" value="It is a logical partition of the cloud which allows to have multiple environments in the production AIC." />
+                               <xml-property name="indexedProps" value="operational-environment-id" />
+                               <xml-property name="uniqueProps" value="operational-environment-id" />
+                               <xml-property name="container" value="operational-environments" />
+                               <xml-property name="namespace" value="cloud-infrastructure" />
+                       </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.v12.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.v12.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.v12.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.v12.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="relationshipList" name="relationship-list" type="inventory.aai.onap.org.v12.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-types>
 </xml-bindings>