View Javadoc
1   /*
2    * This file is part of Waarp Project (named also Waarp or GG).
3    *
4    *  Copyright (c) 2019, Waarp SAS, and individual contributors by the @author
5    *  tags. See the COPYRIGHT.txt in the distribution for a full listing of
6    * individual contributors.
7    *
8    *  All Waarp Project is free software: you can redistribute it and/or
9    * modify it under the terms of the GNU General Public License as published by
10   * the Free Software Foundation, either version 3 of the License, or (at your
11   * option) any later version.
12   *
13   * Waarp is distributed in the hope that it will be useful, but WITHOUT ANY
14   * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15   * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16   *
17   *  You should have received a copy of the GNU General Public License along with
18   * Waarp . If not, see <http://www.gnu.org/licenses/>.
19   */
20  package org.waarp.openr66.protocol.localhandler.packet.json;
21  
22  import org.waarp.openr66.protocol.localhandler.packet.LocalPacketFactory;
23  
24  import java.util.Date;
25  
26  /**
27   * Export Log JSON packet
28   */
29  public class LogJsonPacket extends JsonPacket {
30    protected boolean purge;
31    protected boolean clean;
32    protected boolean statuspending;
33    protected boolean statustransfer;
34    protected boolean statusdone;
35    protected boolean statuserror;
36    protected String rule;
37    protected String request;
38    protected Date start;
39    protected Date stop;
40    protected String startid;
41    protected String stopid;
42  
43    /**
44     * @return the purge
45     */
46    public final boolean isPurge() {
47      return purge;
48    }
49  
50    /**
51     * @param purge the purge to set
52     */
53    public final void setPurge(final boolean purge) {
54      this.purge = purge;
55    }
56  
57    /**
58     * @return the clean
59     */
60    public final boolean isClean() {
61      return clean;
62    }
63  
64    /**
65     * @param clean the clean to set
66     */
67    public final void setClean(final boolean clean) {
68      this.clean = clean;
69    }
70  
71    /**
72     * @return the statuspending
73     */
74    public final boolean isStatuspending() {
75      return statuspending;
76    }
77  
78    /**
79     * @param statuspending the statuspending to set
80     */
81    public final void setStatuspending(final boolean statuspending) {
82      this.statuspending = statuspending;
83    }
84  
85    /**
86     * @return the statustransfer
87     */
88    public final boolean isStatustransfer() {
89      return statustransfer;
90    }
91  
92    /**
93     * @param statustransfer the statustransfer to set
94     */
95    public final void setStatustransfer(final boolean statustransfer) {
96      this.statustransfer = statustransfer;
97    }
98  
99    /**
100    * @return the statusdone
101    */
102   public final boolean isStatusdone() {
103     return statusdone;
104   }
105 
106   /**
107    * @param statusdone the statusdone to set
108    */
109   public final void setStatusdone(final boolean statusdone) {
110     this.statusdone = statusdone;
111   }
112 
113   /**
114    * @return the statuserror
115    */
116   public final boolean isStatuserror() {
117     return statuserror;
118   }
119 
120   /**
121    * @param statuserror the statuserror to set
122    */
123   public final void setStatuserror(final boolean statuserror) {
124     this.statuserror = statuserror;
125   }
126 
127   /**
128    * @return the rule
129    */
130   public final String getRule() {
131     return rule;
132   }
133 
134   /**
135    * @param rule the rule to set
136    */
137   public final void setRule(final String rule) {
138     this.rule = rule;
139   }
140 
141   /**
142    * @return the request
143    */
144   public final String getRequest() {
145     return request;
146   }
147 
148   /**
149    * @param request the request to set
150    */
151   public final void setRequest(final String request) {
152     this.request = request;
153   }
154 
155   /**
156    * @return the start
157    */
158   public final Date getStart() {
159     return start;
160   }
161 
162   /**
163    * @param start the start to set
164    */
165   public final void setStart(final Date start) {
166     this.start = start;
167   }
168 
169   /**
170    * @return the stop
171    */
172   public final Date getStop() {
173     return stop;
174   }
175 
176   /**
177    * @param stop the stop to set
178    */
179   public final void setStop(final Date stop) {
180     this.stop = stop;
181   }
182 
183   /**
184    * @return the startid
185    */
186   public final String getStartid() {
187     return startid;
188   }
189 
190   /**
191    * @param startid the startid to set
192    */
193   public final void setStartid(final String startid) {
194     this.startid = startid;
195   }
196 
197   /**
198    * @return the stopid
199    */
200   public final String getStopid() {
201     return stopid;
202   }
203 
204   /**
205    * @param stopid the stopid to set
206    */
207   public final void setStopid(final String stopid) {
208     this.stopid = stopid;
209   }
210 
211   @Override
212   public final void fromJson(final JsonPacket other) {
213     super.fromJson(other);
214     if (other instanceof LogJsonPacket) {
215       final LogJsonPacket other2 = (LogJsonPacket) other;
216       purge = other2.purge;
217       clean = other2.clean;
218       statuspending = other2.statuspending;
219       statustransfer = other2.statustransfer;
220       statusdone = other2.statusdone;
221       statuserror = other2.statuserror;
222       rule = other2.rule;
223       request = other2.request;
224       start = other2.start;
225       stop = other2.stop;
226       startid = other2.startid;
227       stopid = other2.stopid;
228     }
229   }
230 
231   @Override
232   public void setRequestUserPacket() {
233     setRequestUserPacket(LocalPacketFactory.LOGPACKET);
234   }
235 }