1 /**
2 * AUTOHIT 2003
3 * Copyright Erich P Gatejen (c) 1989,1997,2003,2004
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Additional license information can be found in the documentation.
19 * @author Erich P Gatejen
20 */
21 package autohit.server.command;
22
23 import autohit.common.channels.Atom;
24 import autohit.common.channels.Receipt;
25
26 /**
27 * A command response Atom. It carries a response to a command.
28 * * @author Erich P. Gatejen
29 * @version 1.0
30 * <i>Version History</i>
31 * <code>EPG - Initial - 17Sep03</code>
32 */
33 public class CommandResponseAtom extends Atom {
34
35 final static long serialVersionUID = 1;
36
37 /**
38 * Numeric values
39 */
40 public final static int UNKNOWN_RESPONSE = 0;
41
42 /**
43 * Unique ID
44 */
45 public int id;
46
47 /**
48 * Receipt (optional)
49 */
50 public Receipt rr;
51
52 /**
53 * Default constructor. Default priority of ROUTINE. Null object.
54 * Generic type. Timestamped. You may need to set ri to a
55 * response injector, though the handler may use a default.
56 */
57 public CommandResponseAtom() {
58 super();
59 numeric = UNKNOWN_RESPONSE;
60 type = Atom.TYPE_CONTROL;
61 }
62
63 /**
64 * Use this constructor, as it is the most convenient
65 * @param n the command numeric
66 * @param text text of the response
67 * @param p the priority
68 * @param sourceCommandID unique id of source command
69 * @param r receipt for command. May be null if none was issued.
70 */
71 public CommandResponseAtom(int n, String text, int p, int sourceCommandID, Receipt r) {
72 super(Atom.TYPE_EVENT,p,n,(Object)text);
73 id = sourceCommandID;
74 rr = r;
75 }
76 }
|