[AAI-148 Amsterdam] schema change.
[aai/aai-common.git] / aai-core / src / main / java / org / openecomp / aai / dbmodel / DbEdgeRules.java
index f4b5550..1e6a149 100644 (file)
@@ -151,6 +151,8 @@ public class DbEdgeRules {
                                        "isMemberOf,OUT,Many2Many,false,false,false,true")
                        .putAll("l3-network|vpn-binding",
                                        "usesVpnBinding,OUT,Many2Many,false,false,false,false")
+                       .putAll("l3-network|instance-group",
+                                       "memberOf,OUT,Many2Many,false,false,false,false")
                        .putAll("l3-network|subnet",
                                        "hasSubnet,OUT,Many2Many,true,false,false,reverse")
                        .putAll("l3-network|service-instance",
@@ -328,6 +330,7 @@ public class DbEdgeRules {
             .putAll("allotted-resource|instance-group", "isMemberOf,OUT,Many2Many,false,false,false,false")
             .putAll("allotted-resource|network-policy", "uses,OUT,One2One,false,false,false,false")
             .putAll("allotted-resource|vlan", "isPartOf,OUT,Many2Many,false,false,false,false")
+            .putAll("allotted-resource|l-interface", "uses,OUT,One2Many,false,false,false,false")
             .putAll("generic-vnf|instance-group", "isMemberOf,OUT,Many2Many,false,false,false,false")
             .putAll("service-instance|instance-group", "isMemberOf,OUT,Many2Many,false,false,false,false")      
             .putAll("allotted-resource|tunnel-xconnect", "has,OUT,One2One,true,false,false,false")
@@ -342,8 +345,10 @@ public class DbEdgeRules {
             .putAll("zone|complex", "existsIn,OUT,Many2One,false,false,false,false")
             .putAll("service-instance|allotted-resource", "has,OUT,Many2Many,true,false,false,false")
             .putAll("service-instance|allotted-resource", "uses,OUT,Many2Many,false,false,false,false")
+                       .putAll("allotted-resource|vpn-binding", "belongsTo,OUT,Many2Many,false,false,false,false")
+                       .putAll("allotted-resource|allotted-resource", "bindsTo,OUT,One2One,false,false,false,false")
                        .build();
-
+       
        public static final Multimap<String, String> DefaultDeleteScope = new ImmutableSetMultimap.Builder<String, String>()
                        .putAll("customer", "CASCADE_TO_CHILDREN")
                        .putAll("cloud-region", "THIS_NODE_ONLY")
@@ -395,7 +400,7 @@ public class DbEdgeRules {
                        .putAll("generic-vnf", "CASCADE_TO_CHILDREN")
                        .putAll("l3-network", "CASCADE_TO_CHILDREN")
                        .putAll("ctag-pool", "THIS_NODE_ONLY")
-                       .putAll("subnet", "THIS_NODE_ONLY")
+                       .putAll("subnet", "ERROR_IF_ANY_IN_EDGES")
                        .putAll("sriov-vf", "THIS_NODE_ONLY")
                        .putAll("vpn-binding", "ERROR_4_IN_EDGES_OR_CASCADE")
                        .putAll("vnf-image", "ERROR_IF_ANY_IN_EDGES")
@@ -423,50 +428,6 @@ public class DbEdgeRules {
                        .putAll("entitlement","THIS_NODE_ONLY")
                        .putAll("license","THIS_NODE_ONLY")
                        .putAll("zone", "THIS_NODE_ONLY")
-                       .putAll("route-target", "CASCADE_TO_CHILDREN").build();
-
-       // NOTE -- Sorry, this is ugly, but we are mapping the nodeTypeCategory two
-       // ways just to
-       // make the code a little less bulky. But that means that we need to ensure
-       // that
-       // nodeTypeCategory and nodeTypeCatMap are kept in synch.
-
-       // NodeTypeCategory: key is: nodeTypeCategory, value is:
-       // "nodeTypes,keyProperties,AltKeyProps,depNode4UniquenessFlag"
-       public static final Multimap<String, String> NodeTypeCategory = new ImmutableSetMultimap.Builder<String, String>()
-                       .putAll("vnf", "vce|vpe|generic-vnf,vnf-id,,true").build();
-
-       // NodeTypeCatMap: key is nodeType; value is: "nodeTypeCategory"
-       // So -- we're assuming that a nodeType can only be in one nodeTypeCategory.
-       public static final Map<String, String> NodeTypeCatMap;
-       static {
-               NodeTypeCatMap = new HashMap<String, String>();
-               NodeTypeCatMap.put("vpe", "vnf");
-               NodeTypeCatMap.put("vce", "vnf");
-               NodeTypeCatMap.put("generic-vnf", "vnf");
-       }
-
-       // ReservedPropNames: keys are property names of (node) properties that are
-       // common to all nodes and
-       // should not be removed if not passed in on an UPDATE request.
-       public static final Map<String, String> ReservedPropNames;
-       static {
-               ReservedPropNames = new HashMap<String, String>();
-               ReservedPropNames.put("source-of-truth", "");
-               ReservedPropNames.put("last-mod-source-of-truth", "");
-               ReservedPropNames.put("aai-created-ts", "");
-               ReservedPropNames.put("aai-last-mod-ts", "");
-       }
-       
-       // This just lists which node types can be connected to themselves recursively.
-       // It's temporary - since DbEdgeRules is going to be overhauled in 16-10, this will
-       // get generated automatically.   But for 1607, it can work like this.
-       public static final Map<String, String> CanBeRecursiveNT;
-       static {
-               CanBeRecursiveNT = new HashMap<String, String>();
-               CanBeRecursiveNT.put("model-element", "");
-               CanBeRecursiveNT.put("service-instance", "");
-               CanBeRecursiveNT.put("named-query-element", "");
-       }
-
+                       .putAll("route-target", "CASCADE_TO_CHILDREN")
+                       .putAll("sriov-pf", "THIS_NODE_ONLY").build();
 }