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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
|
/*-
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
*/
package org.onap.so.bpmn.common.recipe;
import org.onap.so.bpmn.core.domain.ModelInfo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* the inputs for the resource recipe <br>
* <p>
* </p>
*
* @author
* @version ONAP Beijing Release 2018-03-08
*/
@JsonPropertyOrder({"resourceInstanceName", "resourceInstanceDes", "globalSubscriberId", "serviceType", "serviceId",
"operationId", "serviceModelInfo", "resourceModelInfo", "resourceInstancenUuid", "resourceParameters",
"operationType"})
@JsonRootName("variables")
public class ResourceInput {
private static Logger logger = LoggerFactory.getLogger(ResourceInput.class);
@JsonProperty("resourceInstanceName")
private String resourceInstanceName;
@JsonProperty("resourceInstanceDes")
private String resourceInstanceDes;
@JsonProperty("globalSubscriberId")
private String globalSubscriberId;
@JsonProperty("serviceType")
private String serviceType;
@JsonProperty("serviceInstanceId")
private String serviceInstanceId;
@JsonProperty("operationId")
private String operationId;
@JsonProperty("serviceModelInfo")
private ModelInfo serviceModelInfo;
@JsonProperty("resourceModelInfo")
private ModelInfo resourceModelInfo;
// for delete resource
@JsonProperty("resourceInstancenUuid")
private String resourceInstancenUuid;
@JsonProperty("resourceParameters")
private String resourceParameters;
@JsonProperty("requestsInputs")
private String requestsInputs;
@JsonProperty("operationType")
private String operationType;
/**
* @return Returns the requestsInputs.
*/
@JsonProperty("requestsInputs")
public String getRequestsInputs() {
return requestsInputs;
}
/**
* @param requestsInputs The requestsInputs to set.
*/
@JsonProperty("requestsInputs")
public void setRequestsInputs(String requestsInputs) {
this.requestsInputs = requestsInputs;
}
/**
* @return Returns the resourceInstanceName.
*/
@JsonProperty("resourceInstanceName")
public String getResourceInstanceName() {
return resourceInstanceName;
}
/**
* @param resourceInstanceName The resourceInstanceName to set.
*/
@JsonProperty("resourceInstanceName")
public void setResourceInstanceName(String resourceInstanceName) {
this.resourceInstanceName = resourceInstanceName;
}
/**
* @return Returns the resourceInstanceDes.
*/
@JsonProperty("resourceInstanceDes")
public String getResourceInstanceDes() {
return resourceInstanceDes;
}
/**
* @param resourceInstanceDes The resourceInstanceDes to set.
*/
@JsonProperty("resourceInstanceDes")
public void setResourceInstanceDes(String resourceInstanceDes) {
this.resourceInstanceDes = resourceInstanceDes;
}
/**
* @return Returns the globalSubscriberId.
*/
@JsonProperty("globalSubscriberId")
public String getGlobalSubscriberId() {
return globalSubscriberId;
}
/**
* @param globalSubscriberId The globalSubscriberId to set.
*/
@JsonProperty("globalSubscriberId")
public void setGlobalSubscriberId(String globalSubscriberId) {
this.globalSubscriberId = globalSubscriberId;
}
/**
* @return Returns the serviceType.
*/
@JsonProperty("serviceType")
public String getServiceType() {
return serviceType;
}
/**
* @param serviceType The serviceType to set.
*/
@JsonProperty("serviceType")
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
/**
* @return Returns the serviceId.
*/
@JsonProperty("serviceInstanceId")
public String getServiceInstanceId() {
return serviceInstanceId;
}
/**
* @param serviceId The serviceId to set.
*/
@JsonProperty("serviceInstanceId")
public void setServiceInstanceId(String serviceId) {
this.serviceInstanceId = serviceId;
}
/**
* @return Returns the operationId.
*/
@JsonProperty("operationId")
public String getOperationId() {
return operationId;
}
/**
* @param operationId The operationId to set.
*/
@JsonProperty("operationId")
public void setOperationId(String operationId) {
this.operationId = operationId;
}
/**
* @return Returns the serviceModelInfo.
*/
@JsonProperty("serviceModelInfo")
public ModelInfo getServiceModelInfo() {
return serviceModelInfo;
}
/**
* @param serviceModelInfo The serviceModelInfo to set.
*/
@JsonProperty("serviceModelInfo")
public void setServiceModelInfo(ModelInfo serviceModelInfo) {
this.serviceModelInfo = serviceModelInfo;
}
/**
* @return Returns the resourceModelInfo.
*/
@JsonProperty("resourceModelInfo")
public ModelInfo getResourceModelInfo() {
return resourceModelInfo;
}
/**
* @param resourceModelInfo The resourceModelInfo to set.
*/
@JsonProperty("resourceModelInfo")
public void setResourceModelInfo(ModelInfo resourceModelInfo) {
this.resourceModelInfo = resourceModelInfo;
}
/**
* @return Returns the resourceParameters.
*/
@JsonProperty("resourceParameters")
public String getResourceParameters() {
return resourceParameters;
}
/**
* @param resourceParameters The resourceParameters to set.
*/
@JsonProperty("resourceParameters")
public void setResourceParameters(String resourceParameters) {
this.resourceParameters = resourceParameters;
}
/**
* @return Returns the operationType.
*/
@JsonProperty("operationType")
public String getOperationType() {
return operationType;
}
/**
* @param operationType The operationType to set.
*/
@JsonProperty("operationType")
public void setOperationType(String operationType) {
this.operationType = operationType;
}
/**
* @return Returns the resourceInstancenUuid.
*/
@JsonProperty("resourceInstancenUuid")
public String getResourceInstancenUuid() {
return resourceInstancenUuid;
}
/**
* @param resourceInstancenUuid The resourceInstancenUuid to set.
*/
@JsonProperty("resourceInstancenUuid")
public void setResourceInstancenUuid(String resourceInstancenUuid) {
this.resourceInstancenUuid = resourceInstancenUuid;
}
@Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
String jsonStr = "";
try {
jsonStr = mapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
logger.error("JsonProcessingException", e);
}
return jsonStr;
}
}
|