1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
package org.onap.sdc.ci.tests.devObjects;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
//@JsonDeserialize(using = MyDeserializer.class)
public enum JsonPresentationFields {
UNIQUE_ID ("uniqueId", GraphPropertyEnum.UNIQUE_ID),
HIGHEST_VERSION ("highestVersion", GraphPropertyEnum.IS_HIGHEST_VERSION),
LIFECYCLE_STATE ("lifecycleState", GraphPropertyEnum.STATE),
CREATION_DATE ("creationDate", null),
LAST_UPDATE_DATE ("lastUpdateDate", null),
SYSTEM_NAME ("systemName", GraphPropertyEnum.SYSTEM_NAME),
NAME ("name", GraphPropertyEnum.NAME),
VERSION ("version", GraphPropertyEnum.VERSION),
NORMALIZED_NAME ("normalizedName", GraphPropertyEnum.NORMALIZED_NAME),
UUID ("UUID", GraphPropertyEnum.UUID),
RESOURCE_TYPE ("resourceType", GraphPropertyEnum.RESOURCE_TYPE),
COMPONENT_TYPE ("componentType", GraphPropertyEnum.COMPONENT_TYPE),
IS_DELETED ("isDeleted", GraphPropertyEnum.IS_DELETED),
ECOMP_GENERATED_NAMING ("ecompGeneratedNaming", null),
NAMING_POLICY ("namingPolicy", null),
TOSCA_RESOURCE_NAME ("toscaResourceName", GraphPropertyEnum.TOSCA_RESOURCE_NAME),
DESCRIPTION ("description", null),
TYPE ("type", null),
DERIVED_FROM ("derivedFrom", null),
VENDOR_NAME ("vendorName", null),
VENDOR_RELEASE ("vendorRelease", null),
CONFORMANCE_LEVEL ("conformanceLevel", null),
ICON ("icon", null),
TAGS ("tags", null),
INVARIANT_UUID ("invariantUuid", GraphPropertyEnum.INVARIANT_UUID),
CSAR_UUID ("csarUuid", GraphPropertyEnum.CSAR_UUID),
CSAR_VERSION ("csarVersion", null),
IMPORTED_TOSCA_CHECKSUM ("importedToscaChecksum", null),
CONTACT_ID ("contactId", null),
PROJECT_CODE ("projectCode", null),
DISTRIBUTION_STATUS ("distributionStatus", GraphPropertyEnum.DISTRIBUTION_STATUS),
DERIVED_FROM_GENERIC_TYPE ("derivedFromGenericType", null),
DERIVED_FROM_GENERIC_VERSION ("derivedFromGenericVersion", null),
////Artifact
ARTIFACT_TYPE ("artifactType", null),
ARTIFACT_REF ("artifactRef", null),
ARTIFACT_REPOSITORY ("artifactRepository", null),
ARTIFACT_CHECKSUM ("artifactChecksum", null),
ARTIFACT_CREATOR ("artifactCreator", null),
USER_ID_CREATOR ("userIdCreator", null),
USER_ID_LAST_UPDATER ("userIdLastUpdater", null),
CREATOR_FULL_NAME ("creatorFullName", null),
UPDATER_FULL_NAME ("updaterFullName", null),
ES_ID ("esId", null),
ARTIFACT_LABEL ("artifactLabel", null),
IS_ABSTRACT ("mandatory", null),
ARTIFACT_DISPLAY_NAME ("artifactDisplayName", null),
API_URL ("apiUrl", null),
SERVICE_API ("serviceApi", null),
ARTIFACT_VERSION ("artifactVersion", null),
ARTIFACT_UUID ("artifactUUID", null),
PAYLOAD_UPDATE_DATE ("payloadUpdateDate", null),
HEAT_PARAMS_UPDATE_DATE ("heatParamsUpdateDate", null),
GENERATED ("generated", null),
ARTIFACT_GROUP_TYPE ("artifactGroupType", null),
ARTIFACT_TIMEOUT ("timeout", null),
REQUIRED_ARTIFACTS ("requiredArtifacts", null),
DUPLICATED ("duplicated", null),
HEAT_PARAMETERS ("heatParameters", null),
GENERATED_FROM_ID ("generatedFromId", null),
// end artifacts
//property
DEFINITION ("definition", null),
DEFAULT_VALUE ("defaultValue", null),
REQUIRED ("required", null),
PASSWORD ("password", null),
CONSTRAINTS ("constraints", null),
PROPERTIES ("properties", null),
PROPERTY ("property", null),
SCHEMA ("schema", null),
VALUE ("value", null),
PARENT_UNIQUE_ID ("parentUniqueId", null),
COMPONENT_INSTANCES ("componentInstances", null),
RELATIONS ("relations", null),
//attribute
STATUS ("status", null),
//capability
VALID_SOURCE_TYPE ("validSourceTypes", null),
CREATION_TIME ("creationTime", null),
MODIFICATION_TIME ("modificationTime", null),
CAPABILITY_SOURCES ("capabilitySources", null),
MAX_OCCURRENCES ("maxOccurrences", null),
MIN_OCCURRENCES ("minOccurrences", null),
OWNER_NAME ("ownerName", null),
OWNER_ID ("ownerId", null),
LEFT_OCCURRENCES ("leftOccurences", null),
CAPABILITY_ID ("capabiltyId", null),
PATH ("path", null),
SOURCE ("source", null),
//Requirement
CAPAPILITY ("capability", null),
NODE ("node", null),
RELATIONSHIP ("relationship", null),
VALID_SOURCE_TYPES ("validSourceTypes", null),
REQUIREMENT_ID ("requirementId", null),
//Relation
CAPABILTY_OWNER_ID ("capabilityOwnerId", null),
REQUIREMENT_OWNER_ID ("requirementOwnerId", null),
FROM_ID ("fromId", null),
TO_ID ("toId", null),
REQUIREMENT ("requirement", null),
//Groups
GROUP_INVARIANT_UUID ("invariantUUID", null),
GROUP_UUID ("groupUUID", null),
GROUP_MEMBER ("members", null),
GROUP_ARTIFACTS ("artifacts", null),
GROUP_ARTIFACTS_UUID ("artifactsUuid", null),
GROUP_PROPERTIES ("properties", null),
GROUP_UNIQUE_ID ("groupUid", null),
POS_X ("posX", null),
POS_Y ("posY", null),
PROPERTY_VALUE_COUNTER ("propertyValueCounter", null),
CUSTOMIZATION_UUID ("customizationUUID", null),
GROUP_NAME ("groupName", null),
GROUP_INSTANCE_ARTIFACTS ("groupInstanceArtifacts", null),
GROUP_INSTANCE_ARTIFACTS_UUID ("groupInstanceArtifactsUuid", null),
GROUP_INSTANCE_PROPERTIES ("groupInstancesProperties", null),
;
private String presentation;
private GraphPropertyEnum storedAs;
JsonPresentationFields(String presentation, GraphPropertyEnum storedAs) {
this.presentation = presentation;
this.storedAs = storedAs;
}
@JsonValue
public String getPresentation() {
return presentation;
}
public void setPresentation(String presentation) {
this.presentation = presentation;
}
public GraphPropertyEnum getStoredAs() {
return storedAs;
}
public void setStoredAs(GraphPropertyEnum storedAs) {
this.storedAs = storedAs;
}
public static String getPresentationByGraphProperty(GraphPropertyEnum property) {
for(JsonPresentationFields currPresentation : JsonPresentationFields.values()){
if(currPresentation.getStoredAs() == property){
return currPresentation.getPresentation();
}
}
return null;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return presentation;
}
@JsonCreator
public static JsonPresentationFields getByPresentation(String presentation) {
for (JsonPresentationFields inst : JsonPresentationFields.values()) {
if (inst.getPresentation().equals(presentation)) {
return inst;
}
}
return null;
}
}
|