2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.aai.dbmodel;
23 import java.util.HashMap;
26 import com.google.common.collect.ImmutableSetMultimap;
27 import com.google.common.collect.Multimap;
29 public class DbEdgeRules {
32 * The EdgeRules data is set up as a key (fromNodeTypeA|toNodeTypeB) mapped
33 * to a string which holds the info we need to build an edge from nodeTypeA
34 * to nodeTypeB. Note -- the MultiMap will let us define more than one type
35 * of edge between a given pair of nodeTypes, but for now we never define
38 * The edgeInfo part is comma separated and looks like this:
39 * "edgeLabel,direction,multiplicityRule,isParent,usesResource,hasDelTarget,SVC-INFRA" This
40 * format is encoded into the EdgeInfoMap below.
41 * MultiplicityRule can be either "Many2Many", "Many2One", "One2Many" or "One2One"
42 * The values for the things after multiplicityRule can be either "true", "false" or "reverse". "reverse" is
43 * really saying that this tag does apply, but the edge will be traversed
44 * the opposite way from the same tag that just has "true".
46 public static final Map<Integer, String> EdgeInfoMap;
48 EdgeInfoMap = new HashMap<Integer, String>();
49 EdgeInfoMap.put(0, "edgeLabel");
50 EdgeInfoMap.put(1, "direction");
51 EdgeInfoMap.put(2, "multiplicityRule");
52 EdgeInfoMap.put(3, "isParent");
53 EdgeInfoMap.put(4, "usesResource");
54 EdgeInfoMap.put(5, "hasDelTarget");
55 EdgeInfoMap.put(6, "SVC-INFRA");
58 public static Integer firstTagIndex = 3;
60 public static final Multimap<String, String> EdgeRules = new ImmutableSetMultimap.Builder<String, String>()
61 .putAll("availability-zone|complex",
62 "groupsResourcesIn,OUT,Many2Many,false,false,false,false")
63 .putAll("availability-zone|service-capability",
64 "supportsServiceCapability,OUT,Many2Many,false,false,false,false")
65 .putAll("cloud-region|complex",
66 "locatedIn,OUT,Many2One,false,false,false,false")
67 .putAll("cloud-region|l3-network",
68 "uses,OUT,Many2Many,false,false,false,false")
69 .putAll("cloud-region|tenant",
70 "has,OUT,One2Many,true,false,false,reverse")
71 .putAll("cloud-region|image",
72 "has,OUT,One2Many,true,false,false,false")
73 .putAll("cloud-region|flavor",
74 "has,OUT,One2Many,true,false,false,false")
75 .putAll("cloud-region|availability-zone",
76 "has,OUT,One2Many,true,false,false,false")
77 .putAll("cloud-region|oam-network",
78 "has,OUT,One2Many,true,false,false,false")
79 .putAll("cloud-region|dvs-switch",
80 "has,OUT,One2Many,true,false,false,false")
81 .putAll("cloud-region|volume-group",
82 "has,OUT,One2Many,true,true,false,false")
83 .putAll("cloud-region|group-assignment",
84 "has,OUT,One2Many,true,false,false,false")
85 .putAll("cloud-region|snapshot",
86 "has,OUT,One2Many,true,false,false,false")
87 .putAll("cloud-region|zone",
88 "isMemberOf,OUT,Many2One,false,false,false,false")
89 .putAll("complex|ctag-pool",
90 "hasCtagPool,OUT,Many2Many,true,false,false,false")
91 .putAll("complex|l3-network",
92 "usesL3Network,OUT,Many2Many,false,false,false,true")
93 .putAll("ctag-pool|availability-zone",
94 "supportsAvailabilityZone,OUT,Many2Many,false,false,false,false")
95 .putAll("customer|service-subscription",
96 "subscribesTo,OUT,Many2Many,true,false,false,reverse")
97 .putAll("dvs-switch|availability-zone",
98 "existsIn,OUT,Many2Many,false,false,false,false")
99 .putAll("generic-vnf|l-interface",
100 "hasLInterface,OUT,Many2Many,true,false,false,true")
101 .putAll("generic-vnf|availability-zone",
102 "hasAvailabilityZone,OUT,Many2Many,false,false,false,true")
103 .putAll("generic-vnf|lag-interface",
104 "hasLAGInterface,OUT,Many2Many,true,false,false,true")
105 .putAll("generic-vnf|l3-network",
106 "usesL3Network,OUT,Many2Many,false,true,false,true")
107 .putAll("generic-vnf|pserver",
108 "runsOnPserver,OUT,Many2Many,false,true,false,true")
109 .putAll("generic-vnf|vnf-image",
110 "usesVnfImage,OUT,Many2One,false,false,false,true")
111 .putAll("generic-vnf|vserver",
112 "runsOnVserver,OUT,One2Many,false,true,false,true")
113 .putAll("generic-vnf|service-instance",
114 "hasInstance,OUT,Many2Many,false,true,false,true")
115 .putAll("generic-vnf|site-pair-set",
116 "hasSitePairSet,OUT,Many2Many,false,false,false,false")
117 .putAll("generic-vnf|network-profile",
118 "hasNetworkProfile,OUT,Many2Many,false,false,false,false")
119 .putAll("group-assignment|tenant",
120 "has,OUT,Many2Many,false,false,false,false")
121 .putAll("group-assignment|pserver",
122 "has,OUT,One2Many,false,false,false,false")
123 .putAll("image|metadata", "hasMetaData,OUT,Many2Many,true,false,false,false")
124 .putAll("image|metadatum",
125 "hasMetaDatum,OUT,Many2Many,true,false,false,false")
126 .putAll("l-interface|instance-group",
127 "isMemberOf,OUT,Many2Many,false,false,false,false")
128 .putAll("l-interface|l3-interface-ipv4-address-list",
129 "hasIpAddress,OUT,Many2Many,true,false,false,true")
130 .putAll("l-interface|l3-interface-ipv6-address-list",
131 "hasIpAddress,OUT,Many2Many,true,false,false,true")
132 .putAll("l-interface|l-interface",
133 "has,OUT,One2Many,true,false,false,true")
134 .putAll("l-interface|logical-link",
135 "usesLogicalLink,OUT,Many2Many,false,false,true,true")
136 .putAll("lag-interface|logical-link",
137 "uses,OUT,Many2Many,false,false,true,true")
138 .putAll("l-interface|vlan","hasVlan,OUT,Many2Many,true,false,false,false")
139 .putAll("l-interface|sriov-vf","has,OUT,One2One,true,false,false,false")
140 .putAll("l3-interface-ipv4-address-list|instance-group",
141 "isMemberOf,OUT,Many2Many,false,false,false,false")
142 .putAll("l3-interface-ipv6-address-list|instance-group",
143 "isMemberOf,OUT,Many2Many,false,false,false,false")
144 .putAll("l3-interface-ipv4-address-list|l3-network",
145 "isMemberOf,OUT,Many2Many,false,false,false,true")
146 .putAll("l3-interface-ipv6-address-list|l3-network",
147 "isMemberOf,OUT,Many2Many,false,false,false,true")
148 .putAll("l3-interface-ipv4-address-list|subnet",
149 "isMemberOf,OUT,Many2Many,false,false,false,true")
150 .putAll("l3-interface-ipv6-address-list|subnet",
151 "isMemberOf,OUT,Many2Many,false,false,false,true")
152 .putAll("l3-network|vpn-binding",
153 "usesVpnBinding,OUT,Many2Many,false,false,false,false")
154 .putAll("l3-network|subnet",
155 "hasSubnet,OUT,Many2Many,true,false,false,reverse")
156 .putAll("l3-network|service-instance",
157 "hasInstance,OUT,Many2Many,false,false,false,reverse")
158 .putAll("l3-network|ctag-assignment",
159 "hasCtagAssignment,OUT,Many2Many,true,false,false,true")
160 .putAll("l3-network|network-policy",
161 "uses,OUT,Many2Many,false,false,false,true")
162 .putAll("l3-network|segmentation-assignment",
163 "has,OUT,One2Many,true,false,false,false")
164 .putAll("l3-network|route-table-reference",
165 "uses,OUT,Many2Many,false,false,false,false")
166 .putAll("lag-interface|lag-link",
167 "usesLAGLink,OUT,Many2Many,false,true,true,true")
168 .putAll("lag-interface|p-interface",
169 "usesPInterface,OUT,Many2Many,false,true,false,true")
170 .putAll("lag-interface|l-interface",
171 "hasLInterface,OUT,Many2Many,true,false,false,true")
172 .putAll("logical-link|lag-link",
173 "usesLAGLink,OUT,Many2Many,false,true,false,true")
174 .putAll("logical-link|pnf",
175 "bridgedTo,OUT,Many2Many,false,false,false,false")
176 .putAll("logical-link|logical-link",
177 "uses,OUT,One2Many,false,false,false,true")
178 .putAll("model|model-ver",
179 "has,OUT,One2Many,true,false,false,false")
180 .putAll("model-ver|model-element",
181 "startsWith,OUT,One2Many,true,false,false,false")
182 .putAll("model-element|model-ver",
183 "isA,OUT,Many2One,false,false,false,false")
184 .putAll("model-ver|metadatum",
185 "hasMetaData,OUT,One2Many,true,false,false,false")
186 .putAll("model-element|model-element",
187 "connectsTo,OUT,One2Many,true,false,false,false")
188 .putAll("model-element|model-constraint",
189 "uses,OUT,One2Many,true,false,false,false")
190 .putAll("model-element|constrained-element-set",
191 "connectsTo,OUT,One2Many,true,false,false,false")
192 .putAll("model-constraint|constrained-element-set",
193 "uses,OUT,One2Many,true,false,false,false")
194 .putAll("constrained-element-set|element-choice-set",
195 "uses,OUT,One2Many,true,false,false,false")
196 .putAll("element-choice-set|model-element",
197 "has,OUT,One2Many,true,false,false,false")
198 .putAll("named-query|model",
199 "relatedTo,OUT,One2Many,false,false,false,false")
200 .putAll("named-query|named-query-element",
201 "startsWith,OUT,One2One,true,false,false,false")
202 .putAll("named-query-element|named-query-element",
203 "connectsTo,OUT,Many2Many,true,false,false,false")
204 .putAll("named-query-element|model",
205 "isA,OUT,Many2One,false,false,false,false")
206 .putAll("named-query-element|property-constraint",
207 "uses,OUT,One2Many,true,false,false,false")
208 .putAll("named-query-element|related-lookup",
209 "uses,OUT,One2Many,true,false,false,false")
210 .putAll("instance-group|model",
211 "targets,OUT,Many2Many,false,false,false,false")
212 .putAll("newvce|l-interface",
213 "hasLInterface,OUT,Many2Many,true,false,false,false")
214 .putAll("oam-network|complex",
215 "definedFor,OUT,Many2Many,false,false,false,false")
216 .putAll("oam-network|service-capability",
217 "supportsServiceCapability,OUT,Many2Many,false,false,false,false")
218 .putAll("p-interface|l-interface",
219 "hasLInterface,OUT,Many2Many,true,false,false,true")
220 .putAll("p-interface|physical-link",
221 "usesPhysicalLink,OUT,Many2Many,false,false,true,false")
222 .putAll("p-interface|logical-link",
223 "usesLogicalLink,OUT,Many2One,false,false,false,true")
224 .putAll("port-group|cvlan-tag", "hasCTag,OUT,Many2Many,true,true,false,true")
225 .putAll("pserver|complex", "locatedIn,OUT,Many2One,false,false,false,true")
226 .putAll("pserver|cloud-region","locatedIn,OUT,Many2One,false,false,false,true")
227 .putAll("pserver|availability-zone","existsIn,OUT,Many2One,false,false,false,true")
228 .putAll("pserver|lag-interface",
229 "hasLAGInterface,OUT,Many2Many,true,false,false,true")
230 .putAll("pserver|p-interface",
231 "hasPinterface,OUT,Many2Many,true,true,false,true")
232 .putAll("pserver|zone",
233 "isMemberOf,OUT,Many2One,false,false,false,false")
234 .putAll("pnf|p-interface",
235 "hasPinterface,OUT,Many2Many,true,true,false,true")
236 .putAll("pnf|lag-interface",
237 "has,OUT,One2Many,true,false,false,true")
238 .putAll("pnf|complex",
239 "locatedIn,OUT,Many2One,false,false,false,false")
240 .putAll("pnf|instance-group",
241 "isMemberOf,OUT,Many2Many,false,false,false,false")
243 "isMemberOf,OUT,Many2One,false,false,false,false")
244 .putAll("service-instance|cvlan-tag",
245 "hasIPAGFacingVLAN,OUT,Many2Many,false,true,false,false")
246 .putAll("service-instance|pnf",
247 "uses,OUT,One2Many,false,true,false,false")
248 .putAll("service-subscription|service-instance",
249 "hasInstance,OUT,Many2Many,true,false,false,reverse")
250 .putAll("site-pair-set|routing-instance",
251 "hasRoutingInstance,OUT,Many2Many,true,false,false,false")
252 .putAll("routing-instance|site-pair",
253 "hasSitePair,OUT,Many2Many,true,false,false,false")
254 .putAll("site-pair|class-of-service",
255 "hasClassOfService,OUT,Many2Many,true,false,false,false")
256 .putAll("tenant|l3-network",
257 "usesL3Network,OUT,Many2Many,false,false,false,false")
258 .putAll("tenant|service-subscription",
259 "relatedTo,OUT,Many2Many,false,false,false,false")
260 .putAll("tenant|vserver", "owns,OUT,One2Many,true,false,false,reverse")
261 .putAll("vce|availability-zone",
262 "hasAvailabilityZone,OUT,Many2Many,false,false,false,false")
263 .putAll("vce|complex", "locatedIn,OUT,Many2Many,false,false,false,true")
264 .putAll("vce|port-group", "hasPortGroup,OUT,Many2Many,true,true,false,true")
265 .putAll("vce|vserver", "runsOnVserver,OUT,Many2Many,false,true,false,true")
266 .putAll("vce|service-instance",
267 "hasServiceInstance,OUT,Many2Many,false,false,false,reverse")
268 .putAll("virtual-data-center|generic-vnf",
269 "hasVNF,OUT,Many2Many,false,false,false,reverse")
270 .putAll("vlan|l3-interface-ipv4-address-list",
271 "hasIpAddress,OUT,Many2Many,true,false,false,true")
272 .putAll("vlan|l3-interface-ipv6-address-list",
273 "hasIpAddress,OUT,Many2Many,true,false,false,true")
274 .putAll("vpe|complex", "locatedIn,OUT,Many2Many,false,false,false,false")
275 .putAll("vpe|ctag-pool", "usesCtagPool,OUT,Many2Many,false,false,false,false")
276 .putAll("vpe|l-interface",
277 "hasLInterface,OUT,Many2Many,true,false,false,false")
278 .putAll("vpe|lag-interface",
279 "hasLAGInterface,OUT,Many2Many,true,false,false,false")
280 .putAll("vpe|vserver", "runsOnVserver,OUT,Many2Many,false,true,false,false")
281 .putAll("vpls-pe|complex", "locatedIn,OUT,Many2Many,false,false,false,false")
282 .putAll("vpls-pe|ctag-pool",
283 "usesCtagPool,OUT,Many2Many,false,false,false,false")
284 .putAll("vpls-pe|p-interface",
285 "hasPinterface,OUT,Many2Many,true,false,false,false")
286 .putAll("vpls-pe|lag-interface",
287 "hasLAGinterface,OUT,Many2Many,true,false,false,false")
288 .putAll("vserver|flavor", "hasFlavor,OUT,Many2One,false,false,false,true")
289 .putAll("vserver|image", "hasImage,OUT,Many2One,false,false,false,true")
290 .putAll("vserver|ipaddress",
291 "hasIpAddress,OUT,Many2Many,true,true,false,false")
292 .putAll("vserver|l-interface",
293 "hasLInterface,OUT,Many2Many,true,false,false,true")
294 .putAll("vserver|pserver",
295 "runsOnPserver,OUT,Many2One,false,true,false,true")
296 .putAll("vserver|volume", "hasVolume,OUT,Many2Many,true,true,false,true")
297 .putAll("vserver|vnfc", "hosts,OUT,Many2Many,false,true,false,true")
298 .putAll("vserver|snapshot", "uses,OUT,One2One,false,false,false,true")
299 .putAll("service-instance|connector", "uses,OUT,Many2Many,false,true,false,false")
300 .putAll("service-instance|metadatum", "hasMetaData,OUT,Many2Many,true,false,false,false")
301 .putAll("service-instance|logical-link", "uses,OUT,Many2Many,false,false,true,false")
302 .putAll("service-instance|vlan", "dependsOn,OUT,One2Many,false,true,false,false")
303 .putAll("service-instance|service-instance", "dependsOn,OUT,One2Many,false,true,false,false")
304 .putAll("connector|virtual-data-center", "contains,OUT,Many2Many,false,false,false,false")
305 .putAll("connector|metadatum", "hasMetaData,OUT,Many2Many,true,false,false,false")
306 .putAll("virtual-data-center|logical-link", "contains,OUT,Many2Many,false,true,false,false")
307 .putAll("logical-link|generic-vnf", "bridgedTo,OUT,Many2Many,false,false,false,false")
308 .putAll("logical-link|pserver", "bridgedTo,OUT,Many2Many,false,false,false,false")
309 .putAll("vlan|multicast-configuration", "uses,OUT,Many2Many,false,true,false,false")
310 .putAll("volume-group|complex", "existsIn,OUT,Many2Many,false,false,false,true")
311 .putAll("volume-group|tenant", "belongsTo,OUT,Many2Many,false,false,false,true")
312 .putAll("ipsec-configuration|vig-server", "hasVigServer,OUT,One2Many,true,true,false,false")
313 .putAll("generic-vnf|ipsec-configuration", "uses,OUT,Many2One,false,true,false,false")
314 .putAll("vf-module|volume-group", "uses,OUT,One2One,false,false,false,true")
315 .putAll("vserver|vf-module", "isPartOf,OUT,Many2One,false,false,false,true")
316 .putAll("vf-module|l3-network", "uses,OUT,Many2Many,false,false,false,true")
317 .putAll("vf-module|vnfc", "uses,OUT,One2Many,false,false,true,true")
318 .putAll("generic-vnf|vf-module", "has,OUT,One2Many,true,false,false,true")
319 .putAll("generic-vnf|volume-group", "uses,OUT,One2Many,false,false,false,true")
320 .putAll("generic-vnf|vnfc", "uses,OUT,One2Many,false,false,true,true")
321 .putAll("vlan|logical-link", "usesLogicalLink,OUT,Many2Many,false,false,true,true")
322 .putAll("vpn-binding|route-target", "has,OUT,One2Many,true,false,false,false")
323 .putAll("service-instance|ctag-assignment","uses,OUT,One2Many,false,false,false,false")
324 // The next edge is needed in 1702 but will be worked in user story AAI-6848
325 //.putAll("service-instance|allotted-resource", "uses,OUT,Many2Many,false,false,false,false")
326 .putAll("allotted-resource|generic-vnf", "isPartOf,OUT,Many2Many,false,false,false,false")
327 .putAll("allotted-resource|l3-network", "isPartOf,OUT,Many2Many,false,false,false,false")
328 .putAll("allotted-resource|instance-group", "isMemberOf,OUT,Many2Many,false,false,false,false")
329 .putAll("allotted-resource|network-policy", "uses,OUT,One2One,false,false,false,false")
330 .putAll("allotted-resource|vlan", "isPartOf,OUT,Many2Many,false,false,false,false")
331 .putAll("generic-vnf|instance-group", "isMemberOf,OUT,Many2Many,false,false,false,false")
332 .putAll("service-instance|instance-group", "isMemberOf,OUT,Many2Many,false,false,false,false")
333 .putAll("allotted-resource|tunnel-xconnect", "has,OUT,One2One,true,false,false,false")
334 .putAll("logical-link|cloud-region", "existsIn,OUT,Many2Many,false,false,false,false")
335 .putAll("logical-link|vpn-binding", "uses,OUT,Many2Many,false,false,false,false")
336 .putAll("generic-vnf|entitlement", "has,OUT,One2Many,true,false,false,false")
337 .putAll("generic-vnf|license", "has,OUT,One2Many,true,false,false,false")
338 .putAll("vce|entitlement", "has,OUT,One2Many,true,false,false,false")
339 .putAll("vce|license", "has,OUT,One2Many,true,false,false,false")
340 .putAll("vpe|entitlement", "has,OUT,One2Many,true,false,false,false")
341 .putAll("vpe|license", "has,OUT,One2Many,true,false,false,false")
342 .putAll("zone|complex", "existsIn,OUT,Many2One,false,false,false,false")
343 .putAll("service-instance|allotted-resource", "has,OUT,Many2Many,true,false,false,false")
344 .putAll("service-instance|allotted-resource", "uses,OUT,Many2Many,false,false,false,false")
347 public static final Multimap<String, String> DefaultDeleteScope = new ImmutableSetMultimap.Builder<String, String>()
348 .putAll("customer", "CASCADE_TO_CHILDREN")
349 .putAll("cloud-region", "THIS_NODE_ONLY")
350 .putAll("service-subscription", "CASCADE_TO_CHILDREN")
351 .putAll("service-instance", "CASCADE_TO_CHILDREN")
352 .putAll("vce", "CASCADE_TO_CHILDREN")
353 .putAll("port-group", "CASCADE_TO_CHILDREN")
354 .putAll("cvlan-tag", "THIS_NODE_ONLY")
355 .putAll("tenant", "THIS_NODE_ONLY")
356 .putAll("vserver", "CASCADE_TO_CHILDREN")
357 .putAll("volume", "THIS_NODE_ONLY")
358 .putAll("ipaddress", "THIS_NODE_ONLY")
359 .putAll("image", "ERROR_4_IN_EDGES_OR_CASCADE")
360 .putAll("pserver", "ERROR_4_IN_EDGES_OR_CASCADE")
361 .putAll("availability-zone", "ERROR_IF_ANY_IN_EDGES")
362 .putAll("oam-network", "ERROR_IF_ANY_IN_EDGES")
363 .putAll("dvs-switch", "THIS_NODE_ONLY")
364 .putAll("service-capability", "ERROR_IF_ANY_IN_EDGES")
365 .putAll("complex", "ERROR_4_IN_EDGES_OR_CASCADE")
366 .putAll("flavor", "ERROR_IF_ANY_IN_EDGES")
367 .putAll("metadata", "THIS_NODE_ONLY")
368 .putAll("metadatum", "THIS_NODE_ONLY")
369 .putAll("model", "ERROR_4_IN_EDGES_OR_CASCADE")
370 .putAll("model-ver", "ERROR_4_IN_EDGES_OR_CASCADE")
371 .putAll("model-element", "CASCADE_TO_CHILDREN")
372 .putAll("model-constraint", "CASCADE_TO_CHILDREN")
373 .putAll("property-constraint", "CASCADE_TO_CHILDREN")
374 .putAll("related-lookup", "CASCADE_TO_CHILDREN")
375 .putAll("constrained-element-set", "CASCADE_TO_CHILDREN")
376 .putAll("element-choice-set", "CASCADE_TO_CHILDREN")
377 .putAll("named-query", "CASCADE_TO_CHILDREN")
378 .putAll("named-query-element", "CASCADE_TO_CHILDREN")
379 .putAll("network-policy", "THIS_NODE_ONLY")
380 .putAll("collect-lookup", "THIS_NODE_ONLY")
381 .putAll("service", "ERROR_IF_ANY_IN_EDGES")
382 .putAll("newvce", "CASCADE_TO_CHILDREN")
383 .putAll("vpe", "CASCADE_TO_CHILDREN")
384 .putAll("vpls-pe", "CASCADE_TO_CHILDREN")
385 .putAll("l-interface", "CASCADE_TO_CHILDREN")
386 .putAll("vlan", "CASCADE_TO_CHILDREN")
387 .putAll("p-interface", "CASCADE_TO_CHILDREN")
388 .putAll("l3-interface-ipv6-address-list", "THIS_NODE_ONLY")
389 .putAll("l3-interface-ipv4-address-list", "THIS_NODE_ONLY")
390 .putAll("logical-link", "THIS_NODE_ONLY")
391 .putAll("physical-link", "THIS_NODE_ONLY")
392 .putAll("lag-link", "THIS_NODE_ONLY")
393 .putAll("lag-interface", "CASCADE_TO_CHILDREN")
394 .putAll("virtual-data-center", "CASCADE_TO_CHILDREN")
395 .putAll("generic-vnf", "CASCADE_TO_CHILDREN")
396 .putAll("l3-network", "CASCADE_TO_CHILDREN")
397 .putAll("ctag-pool", "THIS_NODE_ONLY")
398 .putAll("subnet", "THIS_NODE_ONLY")
399 .putAll("sriov-vf", "THIS_NODE_ONLY")
400 .putAll("vpn-binding", "ERROR_IF_ANY_IN_EDGES")
401 .putAll("vnf-image", "ERROR_IF_ANY_IN_EDGES")
402 .putAll("site-pair-set", "CASCADE_TO_CHILDREN")
403 .putAll("routing-instance", "CASCADE_TO_CHILDREN")
404 .putAll("site-pair", "CASCADE_TO_CHILDREN")
405 .putAll("class-of-service", "THIS_NODE_ONLY")
406 .putAll("connector", "CASCADE_TO_CHILDREN")
407 .putAll("vnfc", "THIS_NODE_ONLY")
408 .putAll("multicast-configuration", "THIS_NODE_ONLY")
409 .putAll("volume-group", "THIS_NODE_ONLY")
410 .putAll("ctag-assignment", "THIS_NODE_ONLY")
411 .putAll("pnf", "CASCADE_TO_CHILDREN")
412 .putAll("ipsec-configuration", "CASCADE_TO_CHILDREN")
413 .putAll("vig-server", "THIS_NODE_ONLY")
414 .putAll("vf-module", "THIS_NODE_ONLY")
415 .putAll("snapshot", "THIS_NODE_ONLY")
416 .putAll("group-assignment", "THIS_NODE_ONLY")
417 .putAll("segmentation-assignment", "THIS_NODE_ONLY")
418 .putAll("route-table-reference", "THIS_NODE_ONLY")
419 .putAll("network-profile", "THIS_NODE_ONLY")
420 .putAll("allotted-resource", "CASCADE_TO_CHILDREN")
421 .putAll("tunnel-xconnect", "THIS_NODE_ONLY")
422 .putAll("instance-group","THIS_NODE_ONLY")
423 .putAll("entitlement","THIS_NODE_ONLY")
424 .putAll("license","THIS_NODE_ONLY")
425 .putAll("zone", "THIS_NODE_ONLY")
426 .putAll("route-target", "CASCADE_TO_CHILDREN").build();
428 // NOTE -- Sorry, this is ugly, but we are mapping the nodeTypeCategory two
430 // make the code a little less bulky. But that means that we need to ensure
432 // nodeTypeCategory and nodeTypeCatMap are kept in synch.
434 // NodeTypeCategory: key is: nodeTypeCategory, value is:
435 // "nodeTypes,keyProperties,AltKeyProps,depNode4UniquenessFlag"
436 public static final Multimap<String, String> NodeTypeCategory = new ImmutableSetMultimap.Builder<String, String>()
437 .putAll("vnf", "vce|vpe|generic-vnf,vnf-id,,true").build();
439 // NodeTypeCatMap: key is nodeType; value is: "nodeTypeCategory"
440 // So -- we're assuming that a nodeType can only be in one nodeTypeCategory.
441 public static final Map<String, String> NodeTypeCatMap;
443 NodeTypeCatMap = new HashMap<String, String>();
444 NodeTypeCatMap.put("vpe", "vnf");
445 NodeTypeCatMap.put("vce", "vnf");
446 NodeTypeCatMap.put("generic-vnf", "vnf");
449 // ReservedPropNames: keys are property names of (node) properties that are
450 // common to all nodes and
451 // should not be removed if not passed in on an UPDATE request.
452 public static final Map<String, String> ReservedPropNames;
454 ReservedPropNames = new HashMap<String, String>();
455 ReservedPropNames.put("source-of-truth", "");
456 ReservedPropNames.put("last-mod-source-of-truth", "");
457 ReservedPropNames.put("aai-created-ts", "");
458 ReservedPropNames.put("aai-last-mod-ts", "");
461 // This just lists which node types can be connected to themselves recursively.
462 // It's temporary - since DbEdgeRules is going to be overhauled in 16-10, this will
463 // get generated automatically. But for 1607, it can work like this.
464 public static final Map<String, String> CanBeRecursiveNT;
466 CanBeRecursiveNT = new HashMap<String, String>();
467 CanBeRecursiveNT.put("model-element", "");
468 CanBeRecursiveNT.put("service-instance", "");
469 CanBeRecursiveNT.put("named-query-element", "");