79c2ec460fa4121b663f6fefad66214eea5b778d
[sdc.git] / catalog-dao / src / main / java / org / openecomp / sdc / be / dao / jsongraph / types / VertexTypeEnum.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.openecomp.sdc.be.dao.jsongraph.types;
22
23 import lombok.AllArgsConstructor;
24 import lombok.Getter;
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.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;
48
49 @Getter
50 @AllArgsConstructor
51 public enum VertexTypeEnum {
52         NODE_TYPE                                       ("node_type",                                   null),
53         TOPOLOGY_TEMPLATE                       ("topology_template",           CompositionDataDefinition.class),
54         ARTIFACTS                                       ("artifacts",                                   ArtifactDataDefinition.class),
55         TOSCA_ARTIFACTS                         ("tosca_artifacts",                     ArtifactDataDefinition.class),
56         DEPLOYMENT_ARTIFACTS            ("deployment_artifacts",                ArtifactDataDefinition.class),
57         INST_DEPLOYMENT_ARTIFACTS       ("inst_deployment_artifacts",   MapArtifactDataDefinition.class),
58         INTERFACE_ARTIFACTS                     ("interface_artifacts",         InterfaceDataDefinition.class),
59         INSTANCE_ARTIFACTS                      ("instance_artifacts",          MapArtifactDataDefinition.class),
60         PROPERTIES                                      ("properties",                          PropertyDataDefinition.class),
61         CAPABILITIES                            ("capabilities",                                ListCapabilityDataDefinition.class),
62         CAPABILITIES_PROPERTIES         ("capabilities_properties",     MapPropertiesDataDefinition.class),
63         REQUIREMENTS                            ("requirements",                                ListRequirementDataDefinition.class),
64         ATTRIBUTES                                      ("attributes",                          AttributeDataDefinition.class),
65         RESOURCE_CATEGORY                       ("resourceNewCategory",         null),
66         RESOURCE_SUBCATEGORY            ("resourceSubcategory",         null),
67         SERVICE_CATEGORY                        ("serviceNewCategory",          null),
68         ADDITIONAL_INFORMATION          ("additional_information",    AdditionalInfoParameterDataDefinition.class),
69         USER                                            ("user",                                                null),
70         INPUTS                                          ("inputs",                                      PropertyDataDefinition.class),
71         GROUPS                                          ("groups",                                      GroupDataDefinition.class),
72         INST_ATTRIBUTES                         ("instAttributes",                      MapPropertiesDataDefinition.class),
73         INST_PROPERTIES                         ("instProperties",                      MapPropertiesDataDefinition.class),
74         INST_INPUTS                                     ("instInputs",                          MapPropertiesDataDefinition.class),
75         INST_GROUPS                                     ("instGroups",                          MapGroupsDataDefinition.class),
76         SERVICE_API_ARTIFACTS           ("serviceApiArtifacts",         ArtifactDataDefinition.class),
77         CALCULATED_CAPABILITIES         ("calculatedCapabilities",      MapListCapabilityDataDefinition.class),
78         FULLFILLED_CAPABILITIES         ("fullfilledCapabilities",      MapListCapabilityDataDefinition.class),
79         CALCULATED_REQUIREMENTS         ("calculatedRequirements",      MapListRequirementDataDefinition.class),
80         FULLFILLED_REQUIREMENTS         ("fullfilledRequirements",      MapListRequirementDataDefinition.class),
81         CALCULATED_CAP_PROPERTIES       ("calculatedCapProperties",     MapCapabilityProperty.class),
82         FORWARDING_PATH             ("path",                    ForwardingPathDataDefinition.class),
83         POLICIES                                        ("policies",                                    PolicyDataDefinition.class),
84         EXTERNAL_REF                            ("componentInstanceExtRefs",  MapComponentInstanceExternalRefs.class),
85         CATALOG_ROOT                ("catalogRoot",               null),
86         ARCHIVE_ROOT                ("archiveRoot",               null),
87         INTERFACE                           ("interface",                               InterfaceDataDefinition.class),
88         INTERFACE_OPERATION                     ("interfaceOperation",          OperationDataDefinition.class),
89         NODE_FILTER_TEMPLATE            ("NodeTemplateFilter",        CINodeFilterDataDefinition.class),
90         SUBSTITUTION_FILTER_TEMPLATE ("substitution_mapping",     SubstitutionFilterDataDefinition.class),
91         INST_INTERFACES             ("InstInterfaces",            MapInterfaceDataDefinition.class),
92         DATA_TYPES                                      ("data_types",                          DataTypeDataDefinition.class);
93
94         private final String name;
95         private final Class classOfJson;
96
97         public static VertexTypeEnum getByName(String name){
98                 for ( VertexTypeEnum inst : VertexTypeEnum.values() ){
99                         if ( inst.getName().equals(name) ){
100                                 return inst;
101                         }
102                 }
103                 return null;
104         }
105 }