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.sdc.be.dao.jsongraph.types;
23 import lombok.AllArgsConstructor;
25 import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterDataDefinition;
26 import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition;
27 import org.openecomp.sdc.be.datatypes.elements.AttributeDataDefinition;
28 import org.openecomp.sdc.be.datatypes.elements.CINodeFilterDataDefinition;
29 import org.openecomp.sdc.be.datatypes.elements.CompositionDataDefinition;
30 import org.openecomp.sdc.be.datatypes.elements.DataTypeDataDefinition;
31 import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
32 import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition;
33 import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition;
34 import org.openecomp.sdc.be.datatypes.elements.ListCapabilityDataDefinition;
35 import org.openecomp.sdc.be.datatypes.elements.ListRequirementDataDefinition;
36 import org.openecomp.sdc.be.datatypes.elements.MapArtifactDataDefinition;
37 import org.openecomp.sdc.be.datatypes.elements.MapAttributesDataDefinition;
38 import org.openecomp.sdc.be.datatypes.elements.MapCapabilityProperty;
39 import org.openecomp.sdc.be.datatypes.elements.MapComponentInstanceExternalRefs;
40 import org.openecomp.sdc.be.datatypes.elements.MapGroupsDataDefinition;
41 import org.openecomp.sdc.be.datatypes.elements.MapInterfaceDataDefinition;
42 import org.openecomp.sdc.be.datatypes.elements.MapListCapabilityDataDefinition;
43 import org.openecomp.sdc.be.datatypes.elements.MapListRequirementDataDefinition;
44 import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition;
45 import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
46 import org.openecomp.sdc.be.datatypes.elements.PolicyDataDefinition;
47 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
48 import org.openecomp.sdc.be.datatypes.elements.SubstitutionFilterDataDefinition;
52 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 GROUPS ("groups", GroupDataDefinition.class),
73 INST_ATTRIBUTES ("instAttributes", MapAttributesDataDefinition.class),
74 INST_PROPERTIES ("instProperties", MapPropertiesDataDefinition.class),
75 INST_INPUTS ("instInputs", MapPropertiesDataDefinition.class),
76 INST_GROUPS ("instGroups", MapGroupsDataDefinition.class),
77 SERVICE_API_ARTIFACTS ("serviceApiArtifacts", ArtifactDataDefinition.class),
78 CALCULATED_CAPABILITIES ("calculatedCapabilities", MapListCapabilityDataDefinition.class),
79 FULLFILLED_CAPABILITIES ("fullfilledCapabilities", MapListCapabilityDataDefinition.class),
80 CALCULATED_REQUIREMENTS ("calculatedRequirements", MapListRequirementDataDefinition.class),
81 FULLFILLED_REQUIREMENTS ("fullfilledRequirements", MapListRequirementDataDefinition.class),
82 CALCULATED_CAP_PROPERTIES ("calculatedCapProperties", MapCapabilityProperty.class),
83 FORWARDING_PATH ("path", ForwardingPathDataDefinition.class),
84 POLICIES ("policies", PolicyDataDefinition.class),
85 EXTERNAL_REF ("componentInstanceExtRefs", MapComponentInstanceExternalRefs.class),
86 CATALOG_ROOT ("catalogRoot", null),
87 ARCHIVE_ROOT ("archiveRoot", null),
88 INTERFACE ("interface", InterfaceDataDefinition.class),
89 INTERFACE_OPERATION ("interfaceOperation", OperationDataDefinition.class),
90 NODE_FILTER_TEMPLATE ("NodeTemplateFilter", CINodeFilterDataDefinition.class),
91 SUBSTITUTION_FILTER_TEMPLATE ("substitution_mapping", SubstitutionFilterDataDefinition.class),
92 INST_INTERFACES ("InstInterfaces", MapInterfaceDataDefinition.class),
93 DATA_TYPES ("data_types", DataTypeDataDefinition.class);
95 private final String name;
96 private final Class classOfJson;
98 public static VertexTypeEnum getByName(String name){
99 for ( VertexTypeEnum inst : VertexTypeEnum.values() ){
100 if ( inst.getName().equals(name) ){