Containerization feature of SO
[so.git] / bpmn / so-bpmn-tasks / src / main / java / org / onap / so / client / sniro / beans / SniroManagerRequest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 AT&T Intellectual Property. 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.onap.so.client.sniro.beans;
22
23 import java.io.Serializable;
24
25 import org.onap.so.logger.MsoLogger;
26
27 import com.fasterxml.jackson.annotation.JsonInclude;
28 import com.fasterxml.jackson.annotation.JsonProperty;
29 import com.fasterxml.jackson.annotation.JsonRawValue;
30 import com.fasterxml.jackson.annotation.JsonInclude.Include;
31 import com.fasterxml.jackson.databind.ObjectMapper;
32 import com.fasterxml.jackson.databind.ObjectWriter;
33
34
35 public class SniroManagerRequest implements Serializable{
36
37         private static final long serialVersionUID = -1541132882892163132L;
38         private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroManagerRequest.class);
39
40         @JsonRawValue
41         @JsonProperty("requestInfo")
42         private String requestInformation;
43         @JsonRawValue
44         @JsonProperty("serviceInfo")
45         private String serviceInformation;
46         @JsonRawValue
47         @JsonProperty("placementInfo")
48         private String placementInformation;
49         @JsonRawValue
50         @JsonProperty("licenseInfo")
51         private String licenseInformation;
52
53
54         public String getRequestInformation() {
55                 return requestInformation;
56         }
57         public void setRequestInformation(String requestInformation) {
58                 this.requestInformation = requestInformation;
59         }
60         public String getServiceInformation() {
61                 return serviceInformation;
62         }
63         public void setServiceInformation(String serviceInformation) {
64                 this.serviceInformation = serviceInformation;
65         }
66         public String getPlacementInformation() {
67                 return placementInformation;
68         }
69         public void setPlacementInformation(String placementInformation) {
70                 this.placementInformation = placementInformation;
71         }
72         public String getLicenseInformation() {
73                 return licenseInformation;
74         }
75         public void setLicenseInformation(String licenseInformation) {
76                 this.licenseInformation = licenseInformation;
77         }
78
79
80         @JsonInclude(Include.NON_NULL)
81         public String toJsonString(){
82                 String json = "";
83                 ObjectMapper mapper = new ObjectMapper();
84                 mapper.setSerializationInclusion(Include.NON_NULL);
85                 ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
86                 try{
87                         json = ow.writeValueAsString(this);
88                 }catch (Exception e){
89                         log.error("Unable to convert SniroManagerRequest to string", e);
90                 }
91                 return json.replaceAll("\\\\", "");
92         }
93
94
95 }