Applying license changes to all files
[appc.git] / appc-oam / appc-oam-bundle / src / main / java / org / openecomp / appc / oam / messageadapter / DmaapOutgoingMessage.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
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
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
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  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.openecomp.appc.oam.messageadapter;
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 represented 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("type")
41     private String type;
42
43     @JsonProperty("correlation-id")
44     private String correlationID;
45
46     private final static String defaultCambriaPartition = "MSO";
47     @JsonProperty("cambria.partition")
48     private String cambriaPartition = defaultCambriaPartition;
49
50     @JsonProperty("rpc-name")
51     private String rpcName;
52
53     @JsonProperty("body")
54     private Body body;
55
56     public DmaapOutgoingMessage() {
57     }
58
59     public String getType() {
60         return type;
61     }
62
63     public void setType(String type) {
64         this.type = type;
65     }
66
67     public String getCorrelationID() {
68         return correlationID;
69     }
70
71     public void setCorrelationID(String correlationID) {
72         this.correlationID = correlationID;
73     }
74
75     public String getCambriaPartition() {
76         return cambriaPartition;
77     }
78
79     public void setCambriaPartition(String cambriaPartition) {
80         this.cambriaPartition = cambriaPartition;
81     }
82
83     public String getRpcName() {
84         return rpcName;
85     }
86
87     public void setRpcName(String rpcName) {
88         this.rpcName = rpcName;
89     }
90
91     public Body getBody() {
92         return body;
93     }
94
95     public void setBody(Body body) {
96         this.body = body;
97     }
98
99     @Override
100     public String toString() {
101         return "DmaapOutgoingMessage{" +
102                 "cambriaPartition='" + cambriaPartition + '\'' +
103                 ", rpcName='" + rpcName + '\'' +
104                 ", body=" + body +
105                 '}';
106     }
107
108     @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
109     @JsonIgnoreProperties(ignoreUnknown = true)
110     public static class Body {
111         public Body() {
112         }
113
114         public Body(Object output) {
115             this.output = output;
116         }
117
118         @JsonProperty("output")
119         private Object output;
120
121         public Object getOutput() {
122             return output;
123         }
124
125         public void setOutput(Object body) {
126             this.output = body;
127         }
128
129         @Override
130         public String toString() {
131             return "Body{" +
132                     "output=" + output +
133                     '}';
134         }
135     }
136 }
137