2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.client.sniro.beans;
23 import java.io.Serializable;
25 import org.onap.so.logger.MsoLogger;
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;
35 public class SniroManagerRequest implements Serializable{
37 private static final long serialVersionUID = -1541132882892163132L;
38 private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroManagerRequest.class);
41 @JsonProperty("requestInfo")
42 private String requestInformation;
44 @JsonProperty("serviceInfo")
45 private String serviceInformation;
47 @JsonProperty("placementInfo")
48 private String placementInformation;
50 @JsonProperty("licenseInfo")
51 private String licenseInformation;
54 public String getRequestInformation() {
55 return requestInformation;
57 public void setRequestInformation(String requestInformation) {
58 this.requestInformation = requestInformation;
60 public String getServiceInformation() {
61 return serviceInformation;
63 public void setServiceInformation(String serviceInformation) {
64 this.serviceInformation = serviceInformation;
66 public String getPlacementInformation() {
67 return placementInformation;
69 public void setPlacementInformation(String placementInformation) {
70 this.placementInformation = placementInformation;
72 public String getLicenseInformation() {
73 return licenseInformation;
75 public void setLicenseInformation(String licenseInformation) {
76 this.licenseInformation = licenseInformation;
80 @JsonInclude(Include.NON_NULL)
81 public String toJsonString(){
83 ObjectMapper mapper = new ObjectMapper();
84 mapper.setSerializationInclusion(Include.NON_NULL);
85 ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
87 json = ow.writeValueAsString(this);
89 log.error("Unable to convert SniroManagerRequest to string", e);
91 return json.replaceAll("\\\\", "");