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 static org.waarp.common.database.DbConstant.*;
25
26 /**
27 * Stop or Cancel one request JSON packet
28 */
29 public class StopOrCancelJsonPacket extends JsonPacket {
30
31 protected String requester;
32 protected String requested;
33 protected long specialid = ILLEGALVALUE;
34
35 /**
36 * @return the requester
37 */
38 public final String getRequester() {
39 return requester;
40 }
41
42 /**
43 * @param requester the requester to set
44 */
45 public final void setRequester(final String requester) {
46 this.requester = requester;
47 }
48
49 /**
50 * @return the requested
51 */
52 public final String getRequested() {
53 return requested;
54 }
55
56 /**
57 * @param requested the requested to set
58 */
59 public final void setRequested(final String requested) {
60 this.requested = requested;
61 }
62
63 /**
64 * @return the specialid
65 */
66 public final long getSpecialid() {
67 return specialid;
68 }
69
70 /**
71 * @param specialid the specialid to set
72 */
73 public final void setSpecialid(final long specialid) {
74 this.specialid = specialid;
75 }
76
77 @Override
78 public final void setRequestUserPacket() {
79 setRequestUserPacket(LocalPacketFactory.STOPPACKET);
80 }
81
82 public final void setStop() {
83 setRequestUserPacket(LocalPacketFactory.STOPPACKET);
84 }
85
86 public final void setCancel() {
87 setRequestUserPacket(LocalPacketFactory.CANCELPACKET);
88 }
89 }