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=========================================================
20 package org.openecomp.sdc.be.dao.jsongraph.types;
22 import lombok.AllArgsConstructor;
24 import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterDataDefinition;
25 import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition;
26 import org.openecomp.sdc.be.datatypes.elements.AttributeDataDefinition;
27 import org.openecomp.sdc.be.datatypes.elements.CINodeFilterDataDefinition;
28 import org.openecomp.sdc.be.datatypes.elements.CompositionDataDefinition;
29 import org.openecomp.sdc.be.datatypes.elements.DataTypeDataDefinition;
30 import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
31 import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition;
32 import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition;
33 import org.openecomp.sdc.be.datatypes.elements.ListCapabilityDataDefinition;
34 import org.openecomp.sdc.be.datatypes.elements.ListRequirementDataDefinition;
35 import org.openecomp.sdc.be.datatypes.elements.MapArtifactDataDefinition;
36 import org.openecomp.sdc.be.datatypes.elements.MapAttributesDataDefinition;
37 import org.openecomp.sdc.be.datatypes.elements.MapCapabilityProperty;
38 import org.openecomp.sdc.be.datatypes.elements.MapComponentInstanceExternalRefs;
39 import org.openecomp.sdc.be.datatypes.elements.MapGroupsDataDefinition;
40 import org.openecomp.sdc.be.datatypes.elements.MapInterfaceDataDefinition;
41 import org.openecomp.sdc.be.datatypes.elements.MapListCapabilityDataDefinition;
42 import org.openecomp.sdc.be.datatypes.elements.MapListRequirementDataDefinition;
43 import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition;
44 import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
45 import org.openecomp.sdc.be.datatypes.elements.PolicyDataDefinition;
46 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
47 import org.openecomp.sdc.be.datatypes.elements.SubstitutionFilterDataDefinition;
51 public enum VertexTypeEnum {
53 NODE_TYPE ("node_type", null),
54 TOPOLOGY_TEMPLATE ("topology_template", CompositionDataDefinition.class),
55 ARTIFACTS ("artifacts", ArtifactDataDefinition.class),
56 TOSCA_ARTIFACTS ("tosca_artifacts", ArtifactDataDefinition.class),
57 DEPLOYMENT_ARTIFACTS ("deployment_artifacts", ArtifactDataDefinition.class),
58 INST_DEPLOYMENT_ARTIFACTS ("inst_deployment_artifacts", MapArtifactDataDefinition.class),
59 INTERFACE_ARTIFACTS ("interface_artifacts", InterfaceDataDefinition.class),
60 INSTANCE_ARTIFACTS ("instance_artifacts", MapArtifactDataDefinition.class),
61 PROPERTIES ("properties", PropertyDataDefinition.class),
62 CAPABILITIES ("capabilities", ListCapabilityDataDefinition.class),
63 CAPABILITIES_PROPERTIES ("capabilities_properties", MapPropertiesDataDefinition.class),
64 REQUIREMENTS ("requirements", ListRequirementDataDefinition.class),
65 ATTRIBUTES ("attributes", AttributeDataDefinition.class),
66 RESOURCE_CATEGORY ("resourceNewCategory", null),
67 RESOURCE_SUBCATEGORY ("resourceSubcategory", null),
68 SERVICE_CATEGORY ("serviceNewCategory", null),
69 ADDITIONAL_INFORMATION ("additional_information", AdditionalInfoParameterDataDefinition.class),
71 INPUTS ("inputs", PropertyDataDefinition.class),
72 OUTPUTS ("outputs", AttributeDataDefinition.class),
73 GROUPS ("groups", GroupDataDefinition.class),
74 INST_ATTRIBUTES ("instAttributes", MapAttributesDataDefinition.class),
75 INST_PROPERTIES ("instProperties", MapPropertiesDataDefinition.class),
76 INST_INPUTS ("instInputs", MapPropertiesDataDefinition.class),
77 INST_OUTPUTS ("instOutputs", MapAttributesDataDefinition.class),
78 INST_GROUPS ("instGroups", MapGroupsDataDefinition.class),
79 SERVICE_API_ARTIFACTS ("serviceApiArtifacts", ArtifactDataDefinition.class),
80 CALCULATED_CAPABILITIES ("calculatedCapabilities", MapListCapabilityDataDefinition.class),
81 FULLFILLED_CAPABILITIES ("fullfilledCapabilities", MapListCapabilityDataDefinition.class),
82 CALCULATED_REQUIREMENTS ("calculatedRequirements", MapListRequirementDataDefinition.class),
83 FULLFILLED_REQUIREMENTS ("fullfilledRequirements", MapListRequirementDataDefinition.class),
84 CALCULATED_CAP_PROPERTIES ("calculatedCapProperties", MapCapabilityProperty.class),
85 FORWARDING_PATH ("path", ForwardingPathDataDefinition.class),
86 POLICIES ("policies", PolicyDataDefinition.class),
87 EXTERNAL_REF ("componentInstanceExtRefs", MapComponentInstanceExternalRefs.class),
88 CATALOG_ROOT ("catalogRoot", null),
89 ARCHIVE_ROOT ("archiveRoot", null),
90 INTERFACE ("interface", InterfaceDataDefinition.class),
91 INTERFACE_OPERATION ("interfaceOperation", OperationDataDefinition.class),
92 NODE_FILTER_TEMPLATE ("NodeTemplateFilter", CINodeFilterDataDefinition.class),
93 SUBSTITUTION_FILTER_TEMPLATE ("substitution_mapping", SubstitutionFilterDataDefinition.class),
94 INST_INTERFACES ("InstInterfaces", MapInterfaceDataDefinition.class),
95 DATA_TYPES ("data_types", DataTypeDataDefinition.class),
96 MODEL ("model", null);
99 private final String name;
100 private final Class classOfJson;
102 public static VertexTypeEnum getByName(String name) {
103 for (VertexTypeEnum inst : VertexTypeEnum.values()) {
104 if (inst.getName().equals(name)) {