1 /* 2 * Copyright (c) 2002-2024, City of Paris 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright notice 10 * and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright notice 13 * and the following disclaimer in the documentation and/or other materials 14 * provided with the distribution. 15 * 16 * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * POSSIBILITY OF SUCH DAMAGE. 31 * 32 * License 1.0 33 */ 34 package fr.paris.lutece.plugins.grubusiness.business.notification; 35 36 import com.fasterxml.jackson.annotation.JsonIgnore; 37 import com.fasterxml.jackson.annotation.JsonProperty; 38 import com.fasterxml.jackson.annotation.JsonPropertyOrder; 39 import com.fasterxml.jackson.annotation.JsonRootName; 40 41 /** 42 * NotificationEvent class, object to log events as delivery success or failure. 43 * 44 */ 45 @JsonRootName( value = "event" ) 46 @JsonPropertyOrder( { 47 "id", "event_date", "type", "status", "redelivry", "message" 48 } ) 49 public class Event 50 { 51 // Variables declarations 52 private int _nId; 53 private Long _lEventDate; 54 private String _strType; 55 private String _strStatus; 56 private String _strReason; 57 private String _strMessage; 58 private int _nRedelivry; 59 60 /** 61 * Gives the notification id 62 * 63 * @return the notification id 64 */ 65 @JsonIgnore 66 public int getId( ) 67 { 68 return _nId; 69 } 70 71 /** 72 * Sets the notification id 73 * 74 * @param nId 75 * the id to set 76 */ 77 public void setId( int nId ) 78 { 79 _nId = nId; 80 } 81 82 /** 83 * Returns the Notification Event Date. 84 * 85 * @return The NotificationDate 86 */ 87 @JsonProperty( "event_date" ) 88 public Long getEventDate( ) 89 { 90 return _lEventDate; 91 } 92 93 /** 94 * Sets the NotificationDate. 95 * 96 * @param lEventDate 97 */ 98 @JsonProperty( "event_date" ) 99 public void setEventDate( Long lEventDate ) 100 { 101 _lEventDate = lEventDate; 102 } 103 104 /** 105 * get type of event 106 * 107 * @return the type 108 */ 109 public String getType( ) 110 { 111 return _strType; 112 } 113 114 /** 115 * set type 116 * 117 * @param _strType 118 */ 119 public void setType( String _strType ) 120 { 121 this._strType = _strType; 122 } 123 124 /** 125 * get the status 126 * 127 * @return the status 128 */ 129 public String getStatus( ) 130 { 131 return _strStatus; 132 } 133 134 /** 135 * set the status 136 * 137 * @param _strStatus 138 */ 139 public void setStatus( String _strStatus ) 140 { 141 this._strStatus = _strStatus; 142 } 143 144 /** 145 * get the reason 146 * 147 * @return the reason 148 */ 149 public String getReason( ) 150 { 151 return _strReason; 152 } 153 154 /** 155 * set the reason 156 * 157 * @param _strReason 158 */ 159 public void setReason( String _strReason ) 160 { 161 this._strReason = _strReason; 162 } 163 164 /** 165 * get the message 166 * 167 * @return the message 168 */ 169 public String getMessage( ) 170 { 171 return _strMessage; 172 } 173 174 /** 175 * set the message 176 * 177 * @param _strMessage 178 */ 179 public void setMessage( String _strMessage ) 180 { 181 this._strMessage = _strMessage; 182 } 183 184 /** 185 * get the nb of times that the message has been redelivred 186 * 187 * @return the redelivry number 188 */ 189 public int getRedelivry( ) 190 { 191 return _nRedelivry; 192 } 193 194 /** 195 * set redelivry nb 196 * 197 * @param nRedelivry 198 */ 199 public void setRedelivry( int nRedelivry ) 200 { 201 this._nRedelivry = nRedelivry; 202 } 203 204 }