1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  package org.xnap.plugin.gift.net.event;
21  
22  /***
23   * ControlEvent
24   *
25   * @author <a href="mailto:tvanlessen@taval.de">Tammo van Lessen</a>
26   * @version CVS $Id: ControlEvent.java,v 1.1 2003/10/05 00:20:32 squig Exp $
27   */
28  public class ControlEvent extends Event {
29      
30  
31      public static final int STARTED = 0;
32      public static final int FINISHED = 1;
33      public static final String[] ACTIONS = { "started", "finished" };
34  
35      
36  
37      private String status;
38      private int action;
39  
40      
41  
42      /***
43       * Constructor for ControlEvent.
44       *
45       * @param action the action
46       */
47      public ControlEvent(int action) {
48          super();
49          this.action = action;
50          this.status = null;
51      }
52  
53      /***
54       * Creates a new ControlEvent object.
55       *
56       * @param action DOCUMENT ME!
57       * @param status DOCUMENT ME!
58       */
59      public ControlEvent(int action, String status) {
60          super();
61          this.action = action;
62          this.status = status;
63      }
64  
65      
66  
67      /***
68       * Sets the action.
69       *
70       * @param action The action to set
71       */
72      public void setAction(int action) {
73          this.action = action;
74      }
75  
76      /***
77       * Returns the action.
78       *
79       * @return int
80       */
81      public int getAction() {
82          return action;
83      }
84  
85      /***
86       * Sets the status.
87       *
88       * @param status The status to set
89       */
90      public void setStatus(String status) {
91          this.status = status;
92      }
93  
94      /***
95       * Returns the status.
96       *
97       * @return String
98       */
99      public String getStatus() {
100         return status;
101     }
102 
103     /***
104      * @see java.lang.Object#toString()
105      */
106     public String toString() {
107         return ACTIONS[action] + "@" + getClass().getName();
108     }
109 }