Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / 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  * Modifications Copyright (c) 2019 Samsung
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.so.bpmn.common.recipe;
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 import org.slf4j.Logger;
32 import org.slf4j.LoggerFactory;
33
34 /**
35  * java object of the resource recipe , it will be passed to the Camunda process
36  */
37 @JsonPropertyOrder({"resourceInput", "host", "requestId", "requestAction", "serviceInstanceId", "serviceType",
38         "recipeParams"})
39 @JsonRootName("variables")
40 public class ResourceRecipeRequest {
41
42     private static Logger logger = LoggerFactory.getLogger(ResourceRecipeRequest.class);
43
44     @JsonProperty("resourceInput")
45     private BpmnParam resourceInput;
46
47     @JsonProperty("host")
48     private BpmnParam host;
49
50     @JsonProperty("mso-request-id")
51     private BpmnParam requestId;
52
53     @JsonProperty("requestAction")
54     private BpmnParam requestAction;
55
56     @JsonProperty("serviceInstanceId")
57     private BpmnParam serviceInstanceId;
58
59     @JsonProperty("serviceType")
60     private BpmnParam serviceType;
61
62     @JsonProperty("recipeParams")
63     private BpmnParam recipeParams;
64
65     @JsonProperty("mso-service-request-timeout")
66     private BpmnIntegerParam recipeTimeout;
67
68     @JsonProperty("resourceInput")
69     public BpmnParam getResourceInput() {
70         return resourceInput;
71     }
72
73     @JsonProperty("resourceInput")
74     public void setResourceInput(BpmnParam resourceInput) {
75         this.resourceInput = resourceInput;
76     }
77
78     @JsonProperty("host")
79     public BpmnParam getHost() {
80         return host;
81     }
82
83     @JsonProperty("host")
84     public void setHost(BpmnParam host) {
85         this.host = host;
86     }
87
88     @JsonProperty("mso-request-id")
89     public BpmnParam getRequestId() {
90         return requestId;
91     }
92
93     @JsonProperty("mso-request-id")
94     public void setRequestId(BpmnParam requestId) {
95         this.requestId = requestId;
96     }
97
98     @JsonProperty("requestAction")
99     public BpmnParam getRequestAction() {
100         return requestAction;
101     }
102
103     @JsonProperty("requestAction")
104     public void setRequestAction(BpmnParam requestAction) {
105         this.requestAction = requestAction;
106     }
107
108     @JsonProperty("serviceInstanceId")
109     public BpmnParam getServiceInstanceId() {
110         return serviceInstanceId;
111     }
112
113     @JsonProperty("serviceInstanceId")
114     public void setServiceInstanceId(BpmnParam serviceInstanceId) {
115         this.serviceInstanceId = serviceInstanceId;
116     }
117
118     @JsonProperty("serviceType")
119     public BpmnParam getServiceType() {
120         return serviceType;
121     }
122
123     @JsonProperty("serviceType")
124     public void setServiceType(BpmnParam serviceType) {
125         this.serviceType = serviceType;
126     }
127
128     @JsonProperty("recipeParams")
129     public BpmnParam getRecipeParams() {
130         return recipeParams;
131     }
132
133     @JsonProperty("recipeParams")
134     public void setRecipeParams(BpmnParam recipeParams) {
135         this.recipeParams = recipeParams;
136     }
137
138     @JsonProperty("mso-service-request-timeout")
139     public BpmnIntegerParam getRecipeTimeout() {
140         return recipeTimeout;
141     }
142
143     @JsonProperty("mso-service-request-timeout")
144     public void setRecipeTimeout(BpmnIntegerParam recipeTimeout) {
145         this.recipeTimeout = recipeTimeout;
146     }
147
148     @Override
149     public String toString() {
150         ObjectMapper mapper = new ObjectMapper();
151         mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
152         String jsonStr = "ResourceRecipeRequest";
153         try {
154             jsonStr = mapper.writeValueAsString(this);
155         } catch (JsonProcessingException e) {
156             logger.error("JsonProcessingException", e);
157         }
158         return jsonStr;
159     }
160 }