reorder the modifier
[appc.git] / appc-oam / appc-oam-bundle / src / main / java / org / onap / appc / oam / messageadapter / DmaapOutgoingMessage.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017-2018 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  * ============LICENSE_END=========================================================
22  */
23
24 package org.onap.appc.oam.messageadapter;
25
26 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
27 import com.fasterxml.jackson.annotation.JsonInclude;
28 import com.fasterxml.jackson.annotation.JsonProperty;
29
30 /**
31  * This class represents a message being sent out to DMaaP by APPC as async response.
32  * note the structure of this class must be adapted to the sync message sent to DMaaP represented in org.onap.appc.listener.LCM.domainmodel.DmaapOutgoingMessage
33  *
34  */
35 @JsonInclude(JsonInclude.Include.NON_NULL)
36 @JsonIgnoreProperties(ignoreUnknown = true)
37 public class DmaapOutgoingMessage {
38
39     @JsonProperty("type")
40     private String type;
41
42     @JsonProperty("correlation-id")
43     private String correlationID;
44
45     private static final String defaultCambriaPartition = "MSO";
46     @JsonProperty("cambria.partition")
47     private String cambriaPartition = defaultCambriaPartition;
48
49     @JsonProperty("rpc-name")
50     private String rpcName;
51
52     @JsonProperty("body")
53     private Body body;
54
55     public DmaapOutgoingMessage() {
56     }
57
58     public String getType() {
59         return type;
60     }
61
62     public void setType(String type) {
63         this.type = type;
64     }
65
66     public String getCorrelationID() {
67         return correlationID;
68     }
69
70     public void setCorrelationID(String correlationID) {
71         this.correlationID = correlationID;
72     }
73
74     public String getCambriaPartition() {
75         return cambriaPartition;
76     }
77
78     public void setCambriaPartition(String cambriaPartition) {
79         this.cambriaPartition = cambriaPartition;
80     }
81
82     public String getRpcName() {
83         return rpcName;
84     }
85
86     public void setRpcName(String rpcName) {
87         this.rpcName = rpcName;
88     }
89
90     public Body getBody() {
91         return body;
92     }
93
94     public void setBody(Body body) {
95         this.body = body;
96     }
97
98     @Override
99     public String toString() {
100         return "DmaapOutgoingMessage{" +
101                 "cambriaPartition='" + cambriaPartition + '\'' +
102                 ", rpcName='" + rpcName + '\'' +
103                 ", body=" + body +
104                 '}';
105     }
106     @JsonInclude(JsonInclude.Include.NON_NULL)
107     @JsonIgnoreProperties(ignoreUnknown = true)
108     public static class Body {
109         public Body() {
110         }
111
112         public Body(Object output) {
113             this.output = output;
114         }
115
116         @JsonProperty("output")
117         private Object output;
118
119         public Object getOutput() {
120             return output;
121         }
122
123         public void setOutput(Object body) {
124             this.output = body;
125         }
126
127         @Override
128         public String toString() {
129             return "Body{" +
130                     "output=" + output +
131                     '}';
132         }
133     }
134 }
135