Updating licenses in all files
[appc.git] / appc-dispatcher / appc-request-handler / appc-request-handler-core / src / main / java / org / openecomp / appc / requesthandler / impl / DmaapOutgoingMessage.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright (C) 2017 Amdocs
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21  */
22
23 package org.openecomp.appc.requesthandler.impl;
24
25
26
27 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
28 import com.fasterxml.jackson.annotation.JsonProperty;
29 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
30
31 /**
32  * This class represents a message being sent out to DMaaP by APPC as async response.
33  * note the structure of this class must be adapted to the sync message sent to DMaaP represened in org.openecomp.appc.listener.LCM.domainmodel.DmaapOutgoingMessage
34  *
35  */
36 @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
37 @JsonIgnoreProperties(ignoreUnknown = true)
38 public class DmaapOutgoingMessage {
39
40     @JsonProperty("version")
41     private String version;
42
43     @JsonProperty("type")
44     private String type;
45
46     @JsonProperty("correlation-id")
47     private String correlationID;
48
49     private final static String defaultCambriaPartition = "MSO";
50     @JsonProperty("cambria.partition")
51     private String cambriaPartition = defaultCambriaPartition;
52
53     @JsonProperty("rpc-name")
54     private String rpcName;
55
56     @JsonProperty("body")
57     private Body body;
58
59     public DmaapOutgoingMessage() {
60     }
61
62     public String getVersion() {
63         return version;
64     }
65
66     public void setVersion(String version) {
67         this.version = version;
68     }
69
70     public String getType() {
71         return type;
72     }
73
74     public void setType(String type) {
75         this.type = type;
76     }
77
78     public String getCorrelationID() {
79         return correlationID;
80     }
81
82     public void setCorrelationID(String correlationID) {
83         this.correlationID = correlationID;
84     }
85
86     public String getCambriaPartition() {
87         return cambriaPartition;
88     }
89
90     public void setCambriaPartition(String cambriaPartition) {
91         this.cambriaPartition = cambriaPartition;
92     }
93
94     public String getRpcName() {
95         return rpcName;
96     }
97
98     public void setRpcName(String rpcName) {
99         this.rpcName = rpcName;
100     }
101
102     public Body getBody() {
103         return body;
104     }
105
106     public void setBody(Body body) {
107         this.body = body;
108     }
109
110     @Override
111     public String toString() {
112         return "DmaapOutgoingMessage{" +
113                 "cambriaPartition='" + cambriaPartition + '\'' +
114                 ", rpcName='" + rpcName + '\'' +
115                 ", body=" + body +
116                 '}';
117     }
118
119     @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
120     @JsonIgnoreProperties(ignoreUnknown = true)
121     public static class Body {
122         public Body() {
123         }
124
125         public Body(Object output) {
126             this.output = output;
127         }
128
129         @JsonProperty("output")
130         private Object output;
131
132         public Object getOutput() {
133             return output;
134         }
135
136         public void setOutput(Object body) {
137             this.output = body;
138         }
139
140         @Override
141         public String toString() {
142             return "Body{" +
143                     "output=" + output +
144                     '}';
145         }
146     }
147 }
148