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.
16 package org.openecomp.sdc.be.datatypes.enums;
18 import com.fasterxml.jackson.annotation.JsonCreator;
19 import com.fasterxml.jackson.annotation.JsonValue;
21 public enum JsonPresentationFields {
23 UNIQUE_ID("uniqueId", GraphPropertyEnum.UNIQUE_ID),
24 HIGHEST_VERSION("highestVersion", GraphPropertyEnum.IS_HIGHEST_VERSION),
25 LIFECYCLE_STATE("lifecycleState", GraphPropertyEnum.STATE),
26 CREATION_DATE("creationDate", null),
27 LAST_UPDATE_DATE("lastUpdateDate", null),
28 SYSTEM_NAME("systemName", GraphPropertyEnum.SYSTEM_NAME),
29 NAME("name", GraphPropertyEnum.NAME),
30 VERSION("version", GraphPropertyEnum.VERSION),
31 NORMALIZED_NAME("normalizedName", GraphPropertyEnum.NORMALIZED_NAME),
32 UUID("UUID", GraphPropertyEnum.UUID),
33 RESOURCE_TYPE("resourceType", GraphPropertyEnum.RESOURCE_TYPE),
34 COMPONENT_TYPE("componentType", GraphPropertyEnum.COMPONENT_TYPE),
35 IS_DELETED("isDeleted", GraphPropertyEnum.IS_DELETED),
36 ECOMP_GENERATED_NAMING("ecompGeneratedNaming", null),
37 NAMING_POLICY("namingPolicy", null),
38 ENVIRONMENT_CONTEXT("environmentContext", null),
39 TOSCA_RESOURCE_NAME("toscaResourceName", GraphPropertyEnum.TOSCA_RESOURCE_NAME),
40 DESCRIPTION("description", null),
42 DERIVED_FROM("derivedFrom", null),
43 VENDOR_NAME("vendorName", null),
44 VENDOR_RELEASE("vendorRelease", null),
45 RESOURCE_VENDOR_MODEL_NUMBER("reourceVendorModelNumber", null),
46 SERVICE_TYPE("serviceType", null),
47 SERVICE_ROLE("serviceRole", null),
48 INSTANTIATION_TYPE("instantiationType", null),
49 CONFORMANCE_LEVEL("conformanceLevel", null),
52 INVARIANT_UUID("invariantUuid", GraphPropertyEnum.INVARIANT_UUID),
53 CSAR_UUID("csarUuid", GraphPropertyEnum.CSAR_UUID),
54 CSAR_VERSION("csarVersion", null),
55 IMPORTED_TOSCA_CHECKSUM("importedToscaChecksum", null),
56 CONTACT_ID("contactId", null),
57 PROJECT_CODE("projectCode", null),
58 DISTRIBUTION_STATUS("distributionStatus", GraphPropertyEnum.DISTRIBUTION_STATUS),
59 DERIVED_FROM_GENERIC_TYPE("derivedFromGenericType", null),
60 DERIVED_FROM_GENERIC_VERSION("derivedFromGenericVersion", null),
63 ANNOTATIONS("annotations", null),
66 ARTIFACT_TYPE("artifactType", null),
67 ARTIFACT_REF("artifactRef", null),
68 ARTIFACT_REPOSITORY("artifactRepository", null),
69 ARTIFACT_CHECKSUM("artifactChecksum", null),
70 ARTIFACT_CREATOR("artifactCreator", null),
71 USER_ID_CREATOR("userIdCreator", null),
72 USER_ID_LAST_UPDATER("userIdLastUpdater", null),
73 CREATOR_FULL_NAME("creatorFullName", null),
74 UPDATER_FULL_NAME("updaterFullName", null),
75 IS_FROM_CSAR("isFromCsar", null),
78 ARTIFACT_LABEL("artifactLabel", null),
79 IS_ABSTRACT("mandatory", null),
80 ARTIFACT_DISPLAY_NAME("artifactDisplayName", null),
81 API_URL("apiUrl", null),
82 SERVICE_API("serviceApi", null),
83 ARTIFACT_VERSION("artifactVersion", null),
84 ARTIFACT_UUID("artifactUUID", null),
85 PAYLOAD_UPDATE_DATE("payloadUpdateDate", null),
86 HEAT_PARAMS_UPDATE_DATE("heatParamsUpdateDate", null),
87 GENERATED("generated", null),
88 ARTIFACT_GROUP_TYPE("artifactGroupType", null),
89 ARTIFACT_TIMEOUT("timeout", null),
90 REQUIRED_ARTIFACTS("requiredArtifacts", null),
91 DUPLICATED("duplicated", null),
92 HEAT_PARAMETERS("heatParameters", null),
93 GENERATED_FROM_ID("generatedFromId", null),
100 DEFINITION("definition", null),
101 DEFAULT_VALUE("defaultValue", null),
102 REQUIRED("required", null),
103 PASSWORD("password", null),
104 CONSTRAINTS("constraints", null),
105 PROPERTIES("properties", null),
106 PROPERTY("property", null),
107 SCHEMA("schema", null),
108 VALUE("value", null),
109 PARENT_UNIQUE_ID("parentUniqueId", null),
111 COMPONENT_INSTANCES("componentInstances", null),
112 RELATIONS("relations", null),
115 STATUS("status", null),
117 VALID_SOURCE_TYPE("validSourceTypes", null),
118 CREATION_TIME("creationTime", null),
119 MODIFICATION_TIME("modificationTime", null),
120 CAPABILITY_SOURCES("capabilitySources", null),
121 MAX_OCCURRENCES("maxOccurrences", null),
122 MIN_OCCURRENCES("minOccurrences", null),
123 OWNER_TYPE("ownerType",null),
124 OWNER_NAME("ownerName", null),
125 OWNER_ID("ownerId", null),
126 LEFT_OCCURRENCES("leftOccurences", null),
127 CAPABILITY_ID("capabiltyId", null),
129 SOURCE("source", null),
132 CAPAPILITY("capability", null),
134 RELATIONSHIP("relationship", null),
135 VALID_SOURCE_TYPES("validSourceTypes", null),
136 REQUIREMENT_ID("requirementId", null),
137 PARENT_NAME("parentName", null),
138 PREVIOUS_NAME("previousName", null),
140 CAPABILTY_OWNER_ID("capabilityOwnerId", null),
141 REQUIREMENT_OWNER_ID("requirementOwnerId", null),
142 FROM_ID("fromId", null),
144 REQUIREMENT("requirement", null),
145 ORIGIN_UI("originUI",null),
149 GROUP_INVARIANT_UUID("invariantUUID", null),
150 GROUP_UUID("groupUUID", null),
151 GROUP_MEMBER("members", null),
152 GROUP_ARTIFACTS("artifacts", null),
153 GROUP_ARTIFACTS_UUID("artifactsUuid", null),
154 GROUP_PROPERTIES("properties", null),
155 GROUP_UNIQUE_ID("groupUid", null),
158 PROPERTY_VALUE_COUNTER("propertyValueCounter", null),
159 CUSTOMIZATION_UUID("customizationUUID", null),
160 GROUP_NAME("groupName", null),
161 GROUP_INSTANCE_ARTIFACTS("groupInstanceArtifacts", null),
162 GROUP_INSTANCE_ARTIFACTS_UUID("groupInstanceArtifactsUuid", null),
163 GROUP_INSTANCE_PROPERTIES("groupInstancesProperties", null),
167 CI_COMPONENT_UID("componentUid", null),
168 CI_POS_X("posX", null),
169 CI_POS_Y("posY", null),
170 CI_PROP_VALUE_COUNTER("propertyValueCounter", null),
171 CI_ATTR_VALUE_COUNTER("attributeValueCounter", null),
172 CI_INPUT_VALUE_COUNTER("inputValueCounter", null),
173 CI_ORIGIN_TYPE("originType", null),
174 CI_COMPONENT_NAME("componentName", null),
175 CI_COMPONENT_VERSION("componentVersion", null),
176 CI_TOSCA_COMPONENT_NAME("toscaComponentName", null),
177 CI_INVARIANT_NAME("invariantName", null),
178 CI_ICON("icon", null),
179 CI_SOURCE_MODEL_UUID("sourceModelUuid", null),
180 CI_SOURCE_MODEL_UID("sourceModelUid", null),
181 CI_SOURCE_MODEL_INVARIANT("sourceModelInvariant", null),
182 CI_SOURCE_MODEL_NAME("sourceModelName", null),
183 CI_IS_PROXY("isProxy", null),
187 FORWARDING_PATH("forwardingPath", null),
188 FROM_NODE("fromNode", null),
189 TO_NODE("toNode", null),
190 PATH_FROM_CP("fromCP", null),
191 PATH_TO_CP("toCP", null),
192 PATH_TO_CP_ORIGIN("toCPOrigin", null),
193 PATH_FROM_CP_ORIGIN("fromCPOrigin", null),
194 PATH_NAME("pathName", null),
195 PATH_PROTOCOL("pathProtocol", null),
196 PATH_DESTINATION_PORT_NUMBER("destinationPortNumber", null),
197 PATH_ELEMENT_LIST("pathElementList", null),
199 TYPE_UNIQUE_ID("typeUniqueId", null),
200 METADATA("metadata", null),
201 TARGETS("targets", null),
204 EXTERNAL_REF("externalRef", null),
205 CREATED_FROM("createdFrom", null),
208 IS_ARCHIVED("isArchived", GraphPropertyEnum.IS_ARCHIVED),
209 ARCHIVE_TIME("archiveTime", GraphPropertyEnum.ARCHIVE_TIME),
210 IS_VSP_ARCHIVED("isVspArchived", GraphPropertyEnum.IS_VSP_ARCHIVED),
211 CI_IS_ORIGIN_ARCHIVED("isOriginArchived", null),
213 //Interface Operation
214 IO_WORKFLOW_ID("workflowId", null),
215 IO_WORKFLOW_VERSION_ID("workflowVersionId", null),
216 IO_WORKFLOW_ASSOCIATION_TYPE("workflowAssociationType", null),
217 INTERFACES("interfaces", null),
218 OPERATIONS("operations", null),
219 OPERATION_IMPLEMENTATION("implementation",null),
220 OPERATION_INPUTS("inputs",null),
221 OPERATION_OUTPUTS("outputs", null);
223 private String presentation;
224 private GraphPropertyEnum storedAs;
226 JsonPresentationFields(String presentation, GraphPropertyEnum storedAs) {
227 this.presentation = presentation;
228 this.storedAs = storedAs;
232 public String getPresentation() {
236 public void setPresentation(String presentation) {
237 this.presentation = presentation;
240 public GraphPropertyEnum getStoredAs() {
244 public void setStoredAs(GraphPropertyEnum storedAs) {
245 this.storedAs = storedAs;
248 public static String getPresentationByGraphProperty(GraphPropertyEnum property) {
249 for (JsonPresentationFields currPresentation : JsonPresentationFields.values()) {
250 if (currPresentation.getStoredAs() == property) {
251 return currPresentation.getPresentation();
258 public String toString() {
259 // TODO Auto-generated method stub
264 public static JsonPresentationFields getByPresentation(String presentation) {
265 for (JsonPresentationFields inst : JsonPresentationFields.values()) {
266 if (inst.getPresentation().equals(presentation)) {