2 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
15 package org.openecomp.sdc.be.datatypes.enums;
17 import com.fasterxml.jackson.annotation.JsonCreator;
18 import com.fasterxml.jackson.annotation.JsonValue;
19 import lombok.AllArgsConstructor;
21 import lombok.ToString;
25 @ToString(onlyExplicitlyIncluded = true)
26 public enum JsonPresentationFields {
28 UNIQUE_ID("uniqueId", GraphPropertyEnum.UNIQUE_ID),
29 HIGHEST_VERSION("highestVersion", GraphPropertyEnum.IS_HIGHEST_VERSION),
30 LIFECYCLE_STATE("lifecycleState", GraphPropertyEnum.STATE),
31 CREATION_DATE("creationDate", null),
32 LAST_UPDATE_DATE("lastUpdateDate", null),
33 SYSTEM_NAME("systemName", GraphPropertyEnum.SYSTEM_NAME),
34 NAME("name", GraphPropertyEnum.NAME),
35 VERSION("version", GraphPropertyEnum.VERSION),
36 NORMALIZED_NAME("normalizedName", GraphPropertyEnum.NORMALIZED_NAME),
37 UUID("UUID", GraphPropertyEnum.UUID),
38 RESOURCE_TYPE("resourceType", GraphPropertyEnum.RESOURCE_TYPE),
39 COMPONENT_TYPE("componentType", GraphPropertyEnum.COMPONENT_TYPE),
40 IS_DELETED("isDeleted", GraphPropertyEnum.IS_DELETED),
41 ECOMP_GENERATED_NAMING("ecompGeneratedNaming", null),
42 NAMING_POLICY("namingPolicy", null),
43 ENVIRONMENT_CONTEXT("environmentContext", null),
44 TOSCA_RESOURCE_NAME("toscaResourceName", GraphPropertyEnum.TOSCA_RESOURCE_NAME),
45 DESCRIPTION("description", null),
47 DERIVED_FROM("derivedFrom", null),
48 VENDOR_NAME("vendorName", null),
49 VENDOR_RELEASE("vendorRelease", null),
50 CATEGORY("category", null),
51 SUB_CATEGORY("subcategory", null),
52 RESOURCE_VENDOR("resourceVendor", null),
53 RESOURCE_VENDOR_RELEASE("resourceVendorRelease", null),
54 RESOURCE_VENDOR_MODEL_NUMBER("reourceVendorModelNumber", null),
55 SERVICE_TYPE("serviceType", null),
56 SERVICE_ROLE("serviceRole", null),
57 INSTANTIATION_TYPE("instantiationType", null),
58 CONFORMANCE_LEVEL("conformanceLevel", null),
61 INVARIANT_UUID("invariantUuid", GraphPropertyEnum.INVARIANT_UUID),
62 CSAR_UUID("csarUuid", GraphPropertyEnum.CSAR_UUID),
63 CSAR_VERSION("csarVersion", null),
64 CSAR_VERSION_ID("csarVersionId", null),
65 IMPORTED_TOSCA_CHECKSUM("importedToscaChecksum", null),
66 CONTACT_ID("contactId", null),
67 PROJECT_CODE("projectCode", null),
68 DISTRIBUTION_STATUS("distributionStatus", GraphPropertyEnum.DISTRIBUTION_STATUS),
69 DERIVED_FROM_GENERIC_TYPE("derivedFromGenericType", null),
70 DERIVED_FROM_GENERIC_VERSION("derivedFromGenericVersion", null),
71 SERVICE_FUNCTION("serviceFunction", null),
73 NORMATIVE("normative", null),
74 DATA_TYPES("data_types", GraphPropertyEnum.DATA_TYPES),
77 ANNOTATIONS("annotations", null),
79 ARTIFACT_TYPE("artifactType", null),
80 ARTIFACT_REF("artifactRef", null),
81 ARTIFACT_REPOSITORY("artifactRepository", null),
82 ARTIFACT_CHECKSUM("artifactChecksum", null),
83 ARTIFACT_CREATOR("artifactCreator", null),
84 USER_ID_CREATOR("userIdCreator", null),
85 USER_ID_LAST_UPDATER("userIdLastUpdater", null),
86 CREATOR_FULL_NAME("creatorFullName", null),
87 UPDATER_FULL_NAME("updaterFullName", null),
88 IS_FROM_CSAR("isFromCsar", null),
91 ARTIFACT_LABEL("artifactLabel", null),
92 IS_ABSTRACT("mandatory", null),
93 ARTIFACT_DISPLAY_NAME("artifactDisplayName", null),
94 API_URL("apiUrl", null),
95 SERVICE_API("serviceApi", null),
96 ARTIFACT_VERSION("artifactVersion", null),
97 ARTIFACT_UUID("artifactUUID", null),
98 PAYLOAD_UPDATE_DATE("payloadUpdateDate", null),
99 HEAT_PARAMS_UPDATE_DATE("heatParamsUpdateDate", null),
100 GENERATED("generated", null),
101 ARTIFACT_GROUP_TYPE("artifactGroupType", null),
102 ARTIFACT_TIMEOUT("timeout", null),
103 REQUIRED_ARTIFACTS("requiredArtifacts", null),
104 DUPLICATED("duplicated", null),
105 HEAT_PARAMETERS("heatParameters", null),
106 GENERATED_FROM_ID("generatedFromId", null),
111 DEFINITION("definition", null),
112 DEFAULT_VALUE("defaultValue", null),
113 DEFAULT("default", null),
114 REQUIRED("required", null),
115 PASSWORD("password", null),
116 CONSTRAINTS("constraints", null),
117 PROPERTIES("properties", null),
118 PROPERTY("property", null),
119 SCHEMA("schema", null),
120 ENTRY_SCHEMA("entry_schema", null),
121 VALUE("value", null),
122 PARENT_UNIQUE_ID("parentUniqueId", null),
124 COMPONENT_INSTANCES("componentInstances", null),
125 RELATIONS("relations", null),
128 STATUS("status", null),
130 VALID_SOURCE_TYPE("validSourceTypes", null),
131 CREATION_TIME("creationTime", null),
132 MODIFICATION_TIME("modificationTime", null),
133 CAPABILITY_SOURCES("capabilitySources", null),
134 MAX_OCCURRENCES("maxOccurrences", null),
135 MIN_OCCURRENCES("minOccurrences", null),
136 OWNER_TYPE("ownerType", null),
137 OWNER_NAME("ownerName", null),
138 OWNER_ID("ownerId", null),
139 LEFT_OCCURRENCES("leftOccurences", null),
140 CAPABILITY_ID("capabiltyId", null),
142 SOURCE("source", null),
145 CAPABILITY("capability", null),
147 RELATIONSHIP("relationship", null),
148 VALID_SOURCE_TYPES("validSourceTypes", null),
149 VALID_TARGET_TYPES("validTargetTypes", null),
150 REQUIREMENT_ID("requirementId", null),
151 PARENT_NAME("parentName", null),
152 PREVIOUS_NAME("previousName", null),
153 NODE_FILTER_CAPABILITIES("capabilities", null),
154 PROPERTY_FILTER_NAME("propertyName", null),
155 PROPERTY_FILTER_CONSTRAINT("propertyFilterConstraint", null),
156 EQUAL_CONSTRAINT("equal", null),
157 CONSTRAINT_VALUE("constraintValue", null),
158 CONSTRAINT_FUNCTION("constraintFunction", null),
159 NODE_FILTER("nodeFilter", null),
160 TOSCA_ID("tosca_id", null),
163 CAPABILTY_OWNER_ID("capabilityOwnerId", null), REQUIREMENT_OWNER_ID("requirementOwnerId", null), FROM_ID("fromId", null), TO_ID("toId",
164 null), REQUIREMENT("requirement", null), ORIGIN_UI("originUI", null),
167 GROUP_INVARIANT_UUID("invariantUUID", null),
168 GROUP_UUID("groupUUID", null),
169 GROUP_MEMBER("members", null),
170 GROUP_ARTIFACTS("artifacts", null),
171 GROUP_ARTIFACTS_UUID("artifactsUuid", null),
172 GROUP_PROPERTIES("properties", null),
173 GROUP_UNIQUE_ID("groupUid", null),
176 PROPERTY_VALUE_COUNTER("propertyValueCounter", null),
177 CUSTOMIZATION_UUID("customizationUUID", null),
178 GROUP_NAME("groupName", null),
179 GROUP_INSTANCE_ARTIFACTS("groupInstanceArtifacts", null),
180 GROUP_INSTANCE_ARTIFACTS_UUID("groupInstanceArtifactsUuid", null),
181 GROUP_INSTANCE_PROPERTIES("groupInstancesProperties", null),
185 CI_COMPONENT_UID("componentUid", null),
186 CI_POS_X("posX", null),
187 CI_POS_Y("posY", null),
188 CI_PROP_VALUE_COUNTER("propertyValueCounter", null),
189 CI_ATTR_VALUE_COUNTER("attributeValueCounter", null),
190 CI_INPUT_VALUE_COUNTER("inputValueCounter", null),
191 CI_ORIGIN_TYPE("originType", null),
192 CI_COMPONENT_NAME("componentName", null),
193 CI_COMPONENT_VERSION("componentVersion", null),
194 CI_TOSCA_COMPONENT_NAME("toscaComponentName", null),
195 CI_INVARIANT_NAME("invariantName", null),
196 CI_ICON("icon", null),
197 CI_SOURCE_MODEL_UUID("sourceModelUuid", null),
198 CI_SOURCE_MODEL_UID("sourceModelUid", null),
199 CI_SOURCE_MODEL_INVARIANT("sourceModelInvariant", null),
200 CI_SOURCE_MODEL_NAME("sourceModelName", null),
201 CI_IS_PROXY("isProxy", null),
202 CI_DIRECTIVES("directives", null),
203 CI_ARTIFACTS("artifacts", null),
204 CI_MAX_OCCURRENCES("maxOccurrences", null),
205 CI_MIN_OCCURRENCES("minOccurrences", null),
206 CI_INSTANCE_COUNT("instanceCount", null),
209 FORWARDING_PATH("forwardingPath", null),
210 FROM_NODE("fromNode", null),
211 TO_NODE("toNode", null),
212 PATH_FROM_CP("fromCP", null),
213 PATH_TO_CP("toCP", null),
214 PATH_TO_CP_ORIGIN("toCPOrigin", null),
215 PATH_FROM_CP_ORIGIN("fromCPOrigin", null),
216 PATH_NAME("pathName", null),
217 PATH_PROTOCOL("pathProtocol", null),
218 PATH_DESTINATION_PORT_NUMBER("destinationPortNumber", null),
219 PATH_ELEMENT_LIST("pathElementList", null),
221 TYPE_UNIQUE_ID("typeUniqueId", null),
222 METADATA("metadata", null),
223 TARGETS("targets", null),
226 EXTERNAL_REF("externalRef", null), CREATED_FROM("createdFrom", null),
228 IS_ARCHIVED("isArchived", GraphPropertyEnum.IS_ARCHIVED),
229 ARCHIVE_TIME("archiveTime", GraphPropertyEnum.ARCHIVE_TIME),
230 IS_VSP_ARCHIVED("isVspArchived", GraphPropertyEnum.IS_VSP_ARCHIVED),
231 CI_IS_ORIGIN_ARCHIVED("isOriginArchived", null),
233 //Interface Operation
234 IO_OPERATION_TYPE("operationType", null),
235 IO_INPUT_PARAMETERS("inputParams", null),
236 IO_OUTPUT_PARAMETERS("outputParams", null),
237 IO_PARAM_NAME("paramName", null),
238 IO_PARAM_ID("paramId", null),
239 IO_NAME("name", null),
240 IO_MANDATORY("mandatory", null),
241 IO_TYPE("type", null),
242 IO_PROPERTY("property", null),
243 IO_WORKFLOW_NAME("workflowName", null),
244 IO_WORKFLOW_VERSION("workflowVersion", null),
245 IO_WORKFLOW_ID("workflowId", null),
246 IO_WORKFLOW_VERSION_ID("workflowVersionId", null),
247 IO_WORKFLOW_ASSOCIATION_TYPE("workflowAssociationType", null),
250 INTERFACES("interfaces", null),
251 INTERFACE_INPUT("input", null),
252 OPERATIONS("operations", null),
253 OPERATION_IMPLEMENTATION("implementation", null),
254 OPERATION_INPUTS("inputs", null),
255 OPERATION_OUTPUTS("outputs", null),
256 INPUTS("inputs", null),
258 GET_PROPERTY("get_property", null),
259 GET_INPUT("get_input", null),
260 GET_OPERATION_OUTPUT("get_operation_output", null),
262 ATTRIBUTES("attributes", null),
264 TOSCA_DEFINITIONS_VERSION("tosca_definitions_version", null);
268 private final String presentation;
270 private final GraphPropertyEnum storedAs;
272 public static String getPresentationByGraphProperty(GraphPropertyEnum property) {
273 for (JsonPresentationFields currPresentation : JsonPresentationFields.values()) {
274 if (currPresentation.getStoredAs() == property) {
275 return currPresentation.getPresentation();
282 public static JsonPresentationFields getByPresentation(String presentation) {
283 for (JsonPresentationFields inst : JsonPresentationFields.values()) {
284 if (inst.getPresentation().equals(presentation)) {
292 public String getPresentation() {