1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.nxqd.event;
17
18 import java.util.StringTokenizer;
19 /**
20 *
21 * @author <a href="mailto:webhiker@sourceforge.net">webhiker</a>
22 * @version 1.0
23 */
24 public abstract class NxqdEvent extends Object {
25
26 private long id;
27 private int type;
28 private String name;
29 private String source;
30
31 public NxqdEvent() {
32 }
33
34 public void setDetail(final String s) {
35 StringTokenizer tok = new StringTokenizer(s,";");
36 id = Long.parseLong(tok.nextToken());
37 type = Integer.parseInt(tok.nextToken());
38 name = tok.nextToken();
39 if (tok.hasMoreTokens()) {
40 source = tok.nextToken();
41 }
42 else {
43 source = "";
44 }
45 }
46
47 public long getId() {
48 return id;
49 }
50
51 /**
52 * The <code>getType</code> method returns the event type of this event.
53 * The value returned depends on what type of underlying event object it is.
54 *
55 * @return an <code>int</code> value
56 */
57 public int getType() {
58 return type;
59 }
60
61 /**
62 * The <code>getName</code> method returns the name of the
63 * resource which generated the event.
64 *
65 * @return a <code>String</code> value
66 */
67 public String getName() {
68 return name;
69 }
70
71 /**
72 * The <code>getSource</code> method is used to hold additional data use by the
73 * <code>NxqdContainerEvent</code> and <code>NxqdManagerEvent</code> objects.
74 *
75 * @return a <code>String</code> value
76 */
77 public String getSource() {
78 return source;
79 }
80
81 }
82