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