Merge "New logging interface"
[music.git] / src / main / java / org / onap / music / datastore / jsonobjects / JsonNotification.java
1 /*
2  * ============LICENSE_START==========================================
3  * org.onap.music
4  * ===================================================================
5  *  Copyright (c) 2017 AT&T Intellectual Property
6  * ===================================================================
7  *  Licensed under the Apache License, Version 2.0 (the "License");
8  *  you may not use this file except in compliance with the License.
9  *  You may obtain a copy of the License at
10  * 
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  *  Unless required by applicable law or agreed to in writing, software
14  *  distributed under the License is distributed on an "AS IS" BASIS,
15  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  *  See the License for the specific language governing permissions and
17  *  limitations under the License.
18  * 
19  * ============LICENSE_END=============================================
20  * ====================================================================
21  */
22 package org.onap.music.datastore.jsonobjects;
23
24 import java.io.Serializable;
25 import java.util.Map;
26
27 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
28 import com.fasterxml.jackson.annotation.JsonInclude;
29 import com.fasterxml.jackson.annotation.JsonInclude.Include;
30
31 import io.swagger.annotations.ApiModel;
32
33 @ApiModel(value = "JsonNotification", description = "Json model for callback")
34 @JsonIgnoreProperties(ignoreUnknown = true)
35 @JsonInclude(Include.NON_NULL) 
36 public class JsonNotification implements Serializable {
37         
38         private String notify_field;
39     private String endpoint;
40     private String username;
41     private String password;
42     private String notify_change;
43     private String notify_insert;
44     private String notify_delete;
45     private String operation_type;
46     private String triggerName;
47     private Map<String, String> response_body;
48     
49         public String getNotify_field() {
50                 return notify_field;
51         }
52         public void setNotify_field(String notify_field) {
53                 this.notify_field = notify_field;
54         }
55         public String getEndpoint() {
56                 return endpoint;
57         }
58         public void setEndpoint(String endpoint) {
59                 this.endpoint = endpoint;
60         }
61         public String getUsername() {
62                 return username;
63         }
64         public void setUsername(String username) {
65                 this.username = username;
66         }
67         public String getPassword() {
68                 return password;
69         }
70         public void setPassword(String password) {
71                 this.password = password;
72         }
73         public Map<String, String> getResponse_body() {
74                 return response_body;
75         }
76         public void setResponse_body(Map<String, String> response_body) {
77                 this.response_body = response_body;
78         }
79         public String getNotify_change() {
80                 return notify_change;
81         }
82         public void setNotify_change(String notify_change) {
83                 this.notify_change = notify_change;
84         }
85         public String getNotify_insert() {
86                 return notify_insert;
87         }
88         public void setNotify_insert(String notify_insert) {
89                 this.notify_insert = notify_insert;
90         }
91         public String getNotify_delete() {
92                 return notify_delete;
93         }
94         public void setNotify_delete(String notify_delete) {
95                 this.notify_delete = notify_delete;
96         }
97         public String getOperation_type() {
98                 return operation_type;
99         }
100         public void setOperation_type(String operation_type) {
101                 this.operation_type = operation_type;
102         }
103         public String getTriggerName() {
104                 return triggerName;
105         }
106         public void setTriggerName(String triggerName) {
107                 this.triggerName = triggerName;
108         }
109         @Override
110         public String toString() {
111                 try {
112                 return new com.fasterxml.jackson.databind.ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(this);
113             } catch (com.fasterxml.jackson.core.JsonProcessingException e) {
114                         return notify_field+ " : "+endpoint+ " : "+username+ " : "+password+ " : "+response_body;
115             }
116
117         }
118         
119 }