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 import fr.paris.lutece.plugins.grubusiness.business.demand.Demand; 42 import fr.paris.lutece.plugins.grubusiness.business.notification.Event; 43 44 /** 45 * NotificationEvent class, object to log events as delivery success or failure. 46 * 47 */ 48 @JsonRootName( value = "notificationEvent" ) 49 @JsonPropertyOrder( { 50 "date", "msg_id", "demand", "event" 51 } ) 52 public class NotificationEvent 53 { 54 // Variables declarations 55 private int _nId; 56 private Long _lNotificationDate; 57 private String _strMsgId; 58 private Demand _demand; 59 private Event _event; 60 61 /** 62 * Gives the notification id 63 * 64 * @return the notification id 65 */ 66 @JsonIgnore 67 public int getId( ) 68 { 69 return _nId; 70 } 71 72 /** 73 * Sets the notification id 74 * 75 * @param nId 76 * the id to set 77 */ 78 public void setId( int nId ) 79 { 80 _nId = nId; 81 } 82 83 /** 84 * Returns the Demand 85 * 86 * @return the Demand 87 */ 88 @JsonProperty( "demand" ) 89 public Demand getDemand( ) 90 { 91 return _demand; 92 } 93 94 /** 95 * Sets the Demand. 96 * 97 * @param demand 98 * the Demand to set 99 */ 100 @JsonProperty( "demand" ) 101 public void setDemand( Demand demand ) 102 { 103 _demand = demand; 104 } 105 106 /** 107 * Returns the NotificationDate. 108 * 109 * @return The NotificationDate 110 */ 111 @JsonProperty( "date" ) 112 public Long getNotificationDate( ) 113 { 114 return _lNotificationDate; 115 } 116 117 /** 118 * Sets the NotificationDate. 119 * 120 * @param lNotificationDate 121 */ 122 @JsonProperty( "date" ) 123 public void setNotificationDate( Long lNotificationDate ) 124 { 125 _lNotificationDate = lNotificationDate; 126 } 127 128 /** 129 * get msg id 130 * 131 * @return the message id 132 */ 133 @JsonProperty( "msg_id" ) 134 public String getMsgId( ) 135 { 136 return _strMsgId; 137 } 138 139 /** 140 * set message Id 141 * 142 * @param strMsgId 143 */ 144 @JsonProperty( "msg_id" ) 145 public void setMsgId( String strMsgId ) 146 { 147 this._strMsgId = strMsgId; 148 } 149 150 /** 151 * get event 152 * 153 * @return the event 154 */ 155 @JsonProperty( "event" ) 156 public Event getEvent( ) 157 { 158 return _event; 159 } 160 161 /** 162 * set event 163 * 164 * @param event 165 */ 166 @JsonProperty( "event" ) 167 public void setEvent( Event event ) 168 { 169 this._event = event; 170 } 171 }