Change nexus values to properties
[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  * openECOMP : APP-C
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights
6  *                                              reserved.
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  */
21
22 package org.openecomp.appc.requesthandler.impl;
23
24
25
26 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
27 import com.fasterxml.jackson.annotation.JsonProperty;
28 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
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 represened in org.openecomp.appc.listener.LCM.domainmodel.DmaapOutgoingMessage
33  *
34  */
35 @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
36 @JsonIgnoreProperties(ignoreUnknown = true)
37 public class DmaapOutgoingMessage {
38
39     private final static String defaultCambriaPartition = "MSO";
40     @JsonProperty("cambria.partition")
41     private String cambriaPartition = defaultCambriaPartition;
42
43     @JsonProperty("rpc-name")
44     private String rpcName;
45
46     @JsonProperty("body")
47     private Body body;
48
49     public DmaapOutgoingMessage() {
50     }
51
52     public String getCambriaPartition() {
53         return cambriaPartition;
54     }
55
56     public void setCambriaPartition(String cambriaPartition) {
57         this.cambriaPartition = cambriaPartition;
58     }
59
60     public String getRpcName() {
61         return rpcName;
62     }
63
64     public void setRpcName(String rpcName) {
65         this.rpcName = rpcName;
66     }
67
68     public Body getBody() {
69         return body;
70     }
71
72     public void setBody(Body body) {
73         this.body = body;
74     }
75
76     @Override
77     public String toString() {
78         return "DmaapOutgoingMessage{" +
79                 "cambriaPartition='" + cambriaPartition + '\'' +
80                 ", rpcName='" + rpcName + '\'' +
81                 ", body=" + body +
82                 '}';
83     }
84
85     @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
86     @JsonIgnoreProperties(ignoreUnknown = true)
87     public static class Body {
88         public Body() {
89         }
90
91         public Body(Object output) {
92             this.output = output;
93         }
94
95         @JsonProperty("output")
96         private Object output;
97
98         public Object getOutput() {
99             return output;
100         }
101
102         public void setOutput(Object body) {
103             this.output = body;
104         }
105
106         @Override
107         public String toString() {
108             return "Body{" +
109                     "output=" + output +
110                     '}';
111         }
112     }
113 }
114