View Javadoc

1   /*
2    *  Copyright 2004-2006 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 org.asteriskjava.manager.event;
18  
19  /***
20   * Abstract base class for events triggered in response to a ManagerAction.<p>
21   * All ResponseEvents contain an additional action id property that links the
22   * event to the action that caused it.
23   * 
24   * @see org.asteriskjava.manager.action.ManagerAction
25   * @author srt
26   * @version $Id: ResponseEvent.java 397 2006-05-26 12:13:32Z srt $
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 user provided action id of the ManagerAction that caused 
43       * this event. If the application did not set an action id this method
44       * returns <code>null</code>.
45       * 
46       * @return the action id of the ManagerAction that caused this event or
47       *         <code>null</code> if none was set.
48       * @see org.asteriskjava.manager.action.ManagerAction#setActionId()
49       */
50      public String getActionId()
51      {
52          return actionId;
53      }
54  
55      /***
56       * Sets the action id of the ManagerAction that caused this event.
57       * 
58       * @param actionId the action id of the ManagerAction that caused this
59       *            event.
60       */
61      public void setActionId(String actionId)
62      {
63          this.actionId = actionId;
64      }
65  
66      /***
67       * Returns the internal action id of the ManagerAction that caused this
68       * event.<p>
69       * Warning: This method is internal to Asterisk-Java and should never be
70       * used in application code.
71       * 
72       * @return the internal action id of the ManagerAction that caused this
73       *         event.
74       * @since 0.2
75       */
76      public String getInternalActionId()
77      {
78          return internalActionId;
79      }
80  
81      /***
82       * Sets the internal action id of the ManagerAction that caused this event.
83       * 
84       * @param internalActionId the internal action id of the ManagerAction that
85       *            caused this event.
86       * @since 0.2
87       */
88      public void setInternalActionId(String internalActionId)
89      {
90          this.internalActionId = internalActionId;
91      }
92  }