View Javadoc

1   /*
2    * Copyright  2004-2005 Stefan Reuter
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   *
16   */
17  package net.sf.asterisk.manager.event;
18  
19  /***
20   * Abstract base class for events triggered in response to a ManagerAction.<br>
21   * All ResponseEvents contain an additional action id property that links the
22   * event to the action that caused it.
23   * 
24   * @see net.sf.asterisk.manager.action.ManagerAction
25   * @author srt
26   * @version $Id: ResponseEvent.java,v 1.3 2005/07/16 00:16:02 srt Exp $
27   */
28  public abstract class ResponseEvent extends ManagerEvent
29  {
30      private String actionId;
31      private String internalActionId;
32  
33      /***
34       * @param source
35       */
36      public ResponseEvent(Object source)
37      {
38          super(source);
39      }
40  
41      /***
42       * Returns the action id of the ManagerAction that caused this event.
43       * 
44       * @return the action id of the ManagerAction that caused this event.
45       */
46      public String getActionId()
47      {
48          return actionId;
49      }
50  
51      /***
52       * Sets the action id of the ManagerAction that caused this event.
53       * 
54       * @param actionId the action id of the ManagerAction that caused this
55       *            event.
56       */
57      public void setActionId(String actionId)
58      {
59          this.actionId = actionId;
60      }
61  
62      /***
63       * Returns the internal action id of the ManagerAction that caused this
64       * event.
65       * 
66       * @return the internal action id of the ManagerAction that caused this
67       *         event.
68       * @since 0.2
69       */
70      public String getInternalActionId()
71      {
72          return internalActionId;
73      }
74  
75      /***
76       * Sets the internal action id of the ManagerAction that caused this event.
77       * 
78       * @param internalActionId the internal action id of the ManagerAction that
79       *            caused this event.
80       * @since 0.2
81       */
82      public void setInternalActionId(String internalActionId)
83      {
84          this.internalActionId = internalActionId;
85      }
86  }