Merge "Reorder modifiers"
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / openecomp / mso / bpmn / common / recipe / ResourceRecipeRequest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2018 Huawei Technologies Co., Ltd. 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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.openecomp.mso.bpmn.common.recipe;
22
23 import org.openecomp.mso.logger.MsoLogger;
24
25 import com.fasterxml.jackson.annotation.JsonProperty;
26 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
27 import com.fasterxml.jackson.annotation.JsonRootName;
28 import com.fasterxml.jackson.core.JsonProcessingException;
29 import com.fasterxml.jackson.databind.ObjectMapper;
30 import com.fasterxml.jackson.databind.SerializationFeature;
31
32 /**
33  * java object of the resource recipe , it
34  * will be passed to the Camunda process
35  */
36 @JsonPropertyOrder({"resourceInput", "host", "requestId", "requestAction", "serviceInstanceId", "serviceType", "recipeParams"})
37 @JsonRootName("variables")
38 public class ResourceRecipeRequest {
39
40         private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
41         
42     @JsonProperty("resourceInput")
43     private BpmnParam resourceInput;
44
45     @JsonProperty("host")
46     private BpmnParam host;
47
48     @JsonProperty("mso-request-id")
49     private BpmnParam requestId;
50
51     @JsonProperty("requestAction")
52     private BpmnParam requestAction;
53
54     @JsonProperty("serviceInstanceId")
55     private BpmnParam serviceInstanceId;
56
57     @JsonProperty("serviceType")
58     private BpmnParam serviceType;
59
60     @JsonProperty("recipeParams")
61     private BpmnParam recipeParams;
62
63     @JsonProperty("mso-service-request-timeout")
64     private BpmnParam recipeTimeout;
65     
66     @JsonProperty("resourceInput")
67     public BpmnParam getResourceInput() {
68         return resourceInput;
69     }
70
71     @JsonProperty("resourceInput")
72     public void setResourceInput(BpmnParam resourceInput) {
73         this.resourceInput = resourceInput;
74     }
75
76     @JsonProperty("host")
77     public BpmnParam getHost() {
78         return host;
79     }
80
81     @JsonProperty("host")
82     public void setHost(BpmnParam host) {
83         this.host = host;
84     }
85
86     @JsonProperty("mso-request-id")
87     public BpmnParam getRequestId() {
88         return requestId;
89     }
90
91     @JsonProperty("mso-request-id")
92     public void setRequestId(BpmnParam requestId) {
93         this.requestId = requestId;
94     }
95
96     @JsonProperty("requestAction")
97     public BpmnParam getRequestAction() {
98         return requestAction;
99     }
100
101     @JsonProperty("requestAction")
102     public void setRequestAction(BpmnParam requestAction) {
103         this.requestAction = requestAction;
104     }
105
106     @JsonProperty("serviceInstanceId")
107     public BpmnParam getServiceInstanceId() {
108         return serviceInstanceId;
109     }
110
111     @JsonProperty("serviceInstanceId")
112     public void setServiceInstanceId(BpmnParam serviceInstanceId) {
113         this.serviceInstanceId = serviceInstanceId;
114     }
115
116     @JsonProperty("serviceType")
117     public BpmnParam getServiceType() {
118         return serviceType;
119     }
120
121     @JsonProperty("serviceType")
122     public void setServiceType(BpmnParam serviceType) {
123         this.serviceType = serviceType;
124     }
125
126     @JsonProperty("recipeParams")
127     public BpmnParam getRecipeParams() {
128         return recipeParams;
129     }
130
131     @JsonProperty("recipeParams")
132     public void setRecipeParams(BpmnParam recipeParams) {
133         this.recipeParams = recipeParams;
134     }
135
136     @JsonProperty("mso-service-request-timeout")
137     public BpmnParam getRecipeTimeout() {
138                 return recipeTimeout;
139         }
140     
141     @JsonProperty("mso-service-request-timeout")
142         public void setRecipeTimeout(BpmnParam recipeTimeout) {
143                 this.recipeTimeout = recipeTimeout;
144         }
145
146         @Override
147     public String toString() {
148         ObjectMapper mapper = new ObjectMapper();
149         mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
150         String jsonStr = "ResourceRecipeRequest";
151         try {
152             jsonStr = mapper.writeValueAsString(this);
153         } catch(JsonProcessingException e) {
154                 msoLogger.error("JsonProcessingException", e);
155         }
156         return jsonStr;
157     }
158
159 }