2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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.adapters.sdnc.client;
26 import java.io.StringWriter;
28 import javax.xml.bind.JAXBContext;
29 import javax.xml.bind.Marshaller;
30 import javax.xml.bind.annotation.XmlAccessType;
31 import javax.xml.bind.annotation.XmlAccessorType;
32 import javax.xml.bind.annotation.XmlElement;
33 import javax.xml.bind.annotation.XmlRootElement;
34 import javax.xml.bind.annotation.XmlType;
36 import org.onap.so.logger.ErrorCode;
37 import org.onap.so.logger.MessageEnum;
38 import org.slf4j.Logger;
39 import org.slf4j.LoggerFactory;
42 * <p>Java class for anonymous complex type.
44 * <p>The following schema fragment specifies the expected content contained within this class.
49 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
51 * <element ref="{http://org.onap/workflow/sdnc/adapter/schema/v1}CallbackHeader"/>
52 * <element name="RequestData" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
55 * </complexContent>
61 //SDNCAdapter to BPEL Async response
62 @XmlAccessorType(XmlAccessType.FIELD)
63 @XmlType(name = "", propOrder = {
67 @XmlRootElement(name = "SDNCAdapterCallbackRequest")
68 public class SDNCAdapterCallbackRequest {
70 @XmlElement(name = "CallbackHeader", required = true)
71 protected CallbackHeader callbackHeader;
72 @XmlElement(name = "RequestData")
73 protected Object requestData;
75 private static Logger logger = LoggerFactory.getLogger(SDNCAdapterCallbackRequest.class);
78 * Gets the value of the callbackHeader property.
82 * {@link CallbackHeader }
85 public CallbackHeader getCallbackHeader() {
86 return callbackHeader;
90 * Sets the value of the callbackHeader property.
94 * {@link CallbackHeader }
97 public void setCallbackHeader(CallbackHeader value) {
98 this.callbackHeader = value;
102 * Gets the value of the requestData property.
109 public Object getRequestData() {
114 * Sets the value of the requestData property.
121 public void setRequestData(Object value) {
122 this.requestData = value;
126 public String toString() {
128 JAXBContext ctx = JAXBContext.newInstance("org.onap.so.adapters.sdnc.client");
129 Marshaller m = ctx.createMarshaller();
130 m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
131 m.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
132 StringWriter w = new StringWriter();
138 logger.error("{} {} {}", MessageEnum.RA_MARSHING_ERROR.toString(), ErrorCode.DataError.getValue(),
139 "Exception - MARSHING_ERROR", e);