2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (c) 2017 AT&T Intellectual Property
6 * Modifications Copyright (C) 2018 IBM.
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 * ============LICENSE_END=============================================
21 * ====================================================================
23 package org.onap.music.datastore.jsonobjects;
25 import java.io.Serializable;
28 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
29 import com.fasterxml.jackson.annotation.JsonInclude;
30 import com.fasterxml.jackson.annotation.JsonInclude.Include;
32 import org.onap.music.eelf.logging.EELFLoggerDelegate;
33 import org.onap.music.eelf.logging.format.AppMessages;
34 import org.onap.music.eelf.logging.format.ErrorSeverity;
35 import org.onap.music.eelf.logging.format.ErrorTypes;
37 import io.swagger.annotations.ApiModel;
39 @ApiModel(value = "JsonNotification", description = "Json model for callback")
40 @JsonIgnoreProperties(ignoreUnknown = true)
41 @JsonInclude(Include.NON_NULL)
42 public class JsonNotification implements Serializable {
44 private String notify_field;
45 private String endpoint;
46 private String username;
47 private String password;
48 private String notify_change;
49 private String notify_insert;
50 private String notify_delete;
51 private String operation_type;
52 private String triggerName;
53 private Map<String, String> response_body;
54 private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(JsonNotification.class);
56 public String getNotify_field() {
59 public void setNotify_field(String notify_field) {
60 this.notify_field = notify_field;
62 public String getEndpoint() {
65 public void setEndpoint(String endpoint) {
66 this.endpoint = endpoint;
68 public String getUsername() {
71 public void setUsername(String username) {
72 this.username = username;
74 public String getPassword() {
77 public void setPassword(String password) {
78 this.password = password;
80 public Map<String, String> getResponse_body() {
83 public void setResponse_body(Map<String, String> response_body) {
84 this.response_body = response_body;
86 public String getNotify_change() {
89 public void setNotify_change(String notify_change) {
90 this.notify_change = notify_change;
92 public String getNotify_insert() {
95 public void setNotify_insert(String notify_insert) {
96 this.notify_insert = notify_insert;
98 public String getNotify_delete() {
101 public void setNotify_delete(String notify_delete) {
102 this.notify_delete = notify_delete;
104 public String getOperation_type() {
105 return operation_type;
107 public void setOperation_type(String operation_type) {
108 this.operation_type = operation_type;
110 public String getTriggerName() {
113 public void setTriggerName(String triggerName) {
114 this.triggerName = triggerName;
117 public String toString() {
119 return new com.fasterxml.jackson.databind.ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(this);
120 } catch (com.fasterxml.jackson.core.JsonProcessingException e) {
121 logger.error(EELFLoggerDelegate.errorLogger, e, AppMessages.EXECUTIONINTERRUPTED, ErrorSeverity.ERROR, ErrorTypes.GENERALSERVICEERROR);
122 return notify_field+ " : "+endpoint+ " : "+username+ " : "+password+ " : "+response_body;