2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2018 AT&T Intellectual Property. 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
13 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
23 package org.onap.so.client.sniro.beans;
25 import java.io.Serializable;
27 import com.fasterxml.jackson.annotation.JsonInclude;
28 import com.fasterxml.jackson.annotation.JsonProperty;
29 import com.fasterxml.jackson.annotation.JsonInclude.Include;
30 import com.fasterxml.jackson.databind.ObjectMapper;
31 import com.fasterxml.jackson.databind.ObjectWriter;
32 import org.slf4j.Logger;
33 import org.slf4j.LoggerFactory;
36 public class SniroManagerRequest implements Serializable{
38 private static final long serialVersionUID = -1541132882892163132L;
39 private static final Logger logger = LoggerFactory.getLogger(SniroManagerRequest.class);
41 @JsonProperty("requestInfo")
42 private RequestInfo requestInformation;
43 @JsonProperty("serviceInfo")
44 private ServiceInfo serviceInformation;
45 @JsonProperty("placementInfo")
46 private PlacementInfo placementInformation;
47 @JsonProperty("licenseInfo")
48 private LicenseInfo licenseInformation;
51 public RequestInfo getRequestInformation() {
52 return requestInformation;
54 public void setRequestInformation(RequestInfo requestInformation) {
55 this.requestInformation = requestInformation;
57 public ServiceInfo getServiceInformation() {
58 return serviceInformation;
60 public void setServiceInformation(ServiceInfo serviceInformation) {
61 this.serviceInformation = serviceInformation;
63 public PlacementInfo getPlacementInformation() {
64 return placementInformation;
66 public void setPlacementInformation(PlacementInfo placementInformation) {
67 this.placementInformation = placementInformation;
69 public LicenseInfo getLicenseInformation() {
70 return licenseInformation;
72 public void setLicenseInformation(LicenseInfo licenseInformation) {
73 this.licenseInformation = licenseInformation;
77 @JsonInclude(Include.NON_NULL)
78 public String toJsonString(){
80 ObjectMapper mapper = new ObjectMapper();
81 mapper.setSerializationInclusion(Include.NON_NULL);
82 ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
84 json = ow.writeValueAsString(this);
86 logger.error("Unable to convert SniroManagerRequest to string", e);
88 return json.replaceAll("\\\\", "");