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.datatypes.enums;
23 import com.fasterxml.jackson.annotation.JsonCreator;
24 import com.fasterxml.jackson.annotation.JsonValue;
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 RESOURCE_VENDOR_MODEL_NUMBER("reourceVendorModelNumber", null),
51 SERVICE_TYPE("serviceType", null),
52 SERVICE_ROLE("serviceRole", null),
53 INSTANTIATION_TYPE("instantiationType", null),
54 CONFORMANCE_LEVEL("conformanceLevel", null),
57 INVARIANT_UUID("invariantUuid", GraphPropertyEnum.INVARIANT_UUID),
58 CSAR_UUID("csarUuid", GraphPropertyEnum.CSAR_UUID),
59 CSAR_VERSION("csarVersion", null),
60 IMPORTED_TOSCA_CHECKSUM("importedToscaChecksum", null),
61 CONTACT_ID("contactId", null),
62 PROJECT_CODE("projectCode", null),
63 DISTRIBUTION_STATUS("distributionStatus", GraphPropertyEnum.DISTRIBUTION_STATUS),
64 DERIVED_FROM_GENERIC_TYPE("derivedFromGenericType", null),
65 DERIVED_FROM_GENERIC_VERSION("derivedFromGenericVersion", null),
68 ANNOTATIONS("annotations", null),
71 ARTIFACT_TYPE("artifactType", null),
72 ARTIFACT_REF("artifactRef", null),
73 ARTIFACT_REPOSITORY("artifactRepository", null),
74 ARTIFACT_CHECKSUM("artifactChecksum", null),
75 ARTIFACT_CREATOR("artifactCreator", null),
76 USER_ID_CREATOR("userIdCreator", null),
77 USER_ID_LAST_UPDATER("userIdLastUpdater", null),
78 CREATOR_FULL_NAME("creatorFullName", null),
79 UPDATER_FULL_NAME("updaterFullName", null),
80 IS_FROM_CSAR("isFromCsar", null),
83 ARTIFACT_LABEL("artifactLabel", null),
84 IS_ABSTRACT("mandatory", null),
85 ARTIFACT_DISPLAY_NAME("artifactDisplayName", null),
86 API_URL("apiUrl", null),
87 SERVICE_API("serviceApi", null),
88 ARTIFACT_VERSION("artifactVersion", null),
89 ARTIFACT_UUID("artifactUUID", null),
90 PAYLOAD_UPDATE_DATE("payloadUpdateDate", null),
91 HEAT_PARAMS_UPDATE_DATE("heatParamsUpdateDate", null),
92 GENERATED("generated", null),
93 ARTIFACT_GROUP_TYPE("artifactGroupType", null),
94 ARTIFACT_TIMEOUT("timeout", null),
95 REQUIRED_ARTIFACTS("requiredArtifacts", null),
96 DUPLICATED("duplicated", null),
97 HEAT_PARAMETERS("heatParameters", null),
98 GENERATED_FROM_ID("generatedFromId", null),
105 DEFINITION("definition", null),
106 DEFAULT_VALUE("defaultValue", null),
107 REQUIRED("required", null),
108 PASSWORD("password", null),
109 CONSTRAINTS("constraints", null),
110 PROPERTIES("properties", null),
111 PROPERTY("property", null),
112 SCHEMA("schema", null),
113 VALUE("value", null),
114 PARENT_UNIQUE_ID("parentUniqueId", null),
116 COMPONENT_INSTANCES("componentInstances", null),
117 RELATIONS("relations", null),
120 STATUS("status", null),
122 VALID_SOURCE_TYPE("validSourceTypes", null),
123 CREATION_TIME("creationTime", null),
124 MODIFICATION_TIME("modificationTime", null),
125 CAPABILITY_SOURCES("capabilitySources", null),
126 MAX_OCCURRENCES("maxOccurrences", null),
127 MIN_OCCURRENCES("minOccurrences", null),
128 OWNER_TYPE ("ownerType", null),
129 OWNER_NAME("ownerName", null),
130 OWNER_ID("ownerId", null),
131 LEFT_OCCURRENCES("leftOccurences", null),
132 CAPABILITY_ID("capabiltyId", null),
134 SOURCE("source", null),
137 CAPAPILITY("capability", null),
139 RELATIONSHIP("relationship", null),
140 VALID_SOURCE_TYPES("validSourceTypes", null),
141 REQUIREMENT_ID("requirementId", null),
142 PARENT_NAME("parentName", null),
143 PREVIOUS_NAME("previousName", null),
145 CAPABILTY_OWNER_ID("capabilityOwnerId", null),
146 REQUIREMENT_OWNER_ID("requirementOwnerId", null),
147 FROM_ID("fromId", null),
149 REQUIREMENT("requirement", null),
150 ORIGIN_UI("originUI",null),
154 GROUP_INVARIANT_UUID("invariantUUID", null),
155 GROUP_UUID("groupUUID", null),
156 GROUP_MEMBER("members", null),
157 GROUP_ARTIFACTS("artifacts", null),
158 GROUP_ARTIFACTS_UUID("artifactsUuid", null),
159 GROUP_PROPERTIES("properties", null),
160 GROUP_UNIQUE_ID("groupUid", null),
163 PROPERTY_VALUE_COUNTER("propertyValueCounter", null),
164 CUSTOMIZATION_UUID("customizationUUID", null),
165 GROUP_NAME("groupName", null),
166 GROUP_INSTANCE_ARTIFACTS("groupInstanceArtifacts", null),
167 GROUP_INSTANCE_ARTIFACTS_UUID("groupInstanceArtifactsUuid", null),
168 GROUP_INSTANCE_PROPERTIES("groupInstancesProperties", null),
172 CI_COMPONENT_UID("componentUid", null),
173 CI_POS_X("posX", null),
174 CI_POS_Y("posY", null),
175 CI_PROP_VALUE_COUNTER("propertyValueCounter", null),
176 CI_ATTR_VALUE_COUNTER("attributeValueCounter", null),
177 CI_INPUT_VALUE_COUNTER("inputValueCounter", null),
178 CI_ORIGIN_TYPE("originType", null),
179 CI_COMPONENT_NAME("componentName", null),
180 CI_COMPONENT_VERSION("componentVersion", null),
181 CI_TOSCA_COMPONENT_NAME("toscaComponentName", null),
182 CI_INVARIANT_NAME("invariantName", null),
183 CI_ICON("icon", null),
184 CI_SOURCE_MODEL_UUID("sourceModelUuid", null),
185 CI_SOURCE_MODEL_UID("sourceModelUid", null),
186 CI_SOURCE_MODEL_INVARIANT("sourceModelInvariant", null),
187 CI_SOURCE_MODEL_NAME("sourceModelName", null),
188 CI_IS_PROXY("isProxy", null),
192 FORWARDING_PATH("forwardingPath", null),
193 FROM_NODE("fromNode", null),
194 TO_NODE("toNode", null),
195 PATH_FROM_CP("fromCP", null),
196 PATH_TO_CP("toCP", null),
197 PATH_TO_CP_ORIGIN("toCPOrigin", null),
198 PATH_FROM_CP_ORIGIN("fromCPOrigin", null),
199 PATH_NAME("pathName", null),
200 PATH_PROTOCOL("pathProtocol", null),
201 PATH_DESTINATION_PORT_NUMBER("destinationPortNumber", null),
202 PATH_ELEMENT_LIST("pathElementList", null),
204 TYPE_UNIQUE_ID("typeUniqueId", null),
205 METADATA("metadata", null),
206 TARGETS("targets", null),
209 EXTERNAL_REF("externalRef", null),
210 CREATED_FROM("createdFrom", null),
213 IS_ARCHIVED("isArchived", GraphPropertyEnum.IS_ARCHIVED),
214 ARCHIVE_TIME("archiveTime", GraphPropertyEnum.ARCHIVE_TIME),
215 IS_VSP_ARCHIVED("isVspArchived", GraphPropertyEnum.IS_VSP_ARCHIVED),
216 CI_IS_ORIGIN_ARCHIVED("isOriginArchived", null),
217 //Interface Operation
218 IO_OPERATION_TYPE("operationType",null),
219 IO_INPUT_PARAMETERS("inputParams",null),
220 IO_OUTPUT_PARAMETERS("outputParams",null),
221 IO_PARAM_NAME("paramName", null),
222 IO_PARAM_ID("paramId", null),
223 IO_WORKFLOW_ID("workflowId", null),
226 INTERFACE ("interface", null),
227 INTERFACE_OPERATION ("operation", null),
228 OPERATION_IMPLEMENTATION("operationImplementation",null),
229 OPERATION_INPUT("operationInput",null),
230 OPERATION_OUTPUT("operationOutput", null)
234 private String presentation;
235 private GraphPropertyEnum storedAs;
237 JsonPresentationFields(String presentation, GraphPropertyEnum storedAs) {
238 this.presentation = presentation;
239 this.storedAs = storedAs;
243 public String getPresentation() {
247 public void setPresentation(String presentation) {
248 this.presentation = presentation;
251 public GraphPropertyEnum getStoredAs() {
255 public void setStoredAs(GraphPropertyEnum storedAs) {
256 this.storedAs = storedAs;
259 public static String getPresentationByGraphProperty(GraphPropertyEnum property) {
260 for (JsonPresentationFields currPresentation : JsonPresentationFields.values()) {
261 if (currPresentation.getStoredAs() == property) {
262 return currPresentation.getPresentation();
269 public String toString() {
270 // TODO Auto-generated method stub
275 public static JsonPresentationFields getByPresentation(String presentation) {
276 for (JsonPresentationFields inst : JsonPresentationFields.values()) {
277 if (inst.getPresentation().equals(presentation)) {