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.action;
18  
19  /***
20   * The HangupAction causes the pbx to hang up a given channel.
21   * 
22   * @author srt
23   * @version $Id: HangupAction.java,v 1.4 2005/11/08 10:14:09 srt Exp $
24   */
25  public class HangupAction extends AbstractManagerAction
26  {
27      /***
28       * Serializable version identifier
29       */
30      static final long serialVersionUID = 3479615884618713986L;
31  
32      private String channel;
33  
34      /***
35       * Creates a new empty HangupAction.
36       */
37      public HangupAction()
38      {
39  
40      }
41  
42      /***
43       * Creates a new HangupAction that hangs up the given channel.
44       * 
45       * @param channel the name of the channel to hangup.
46       * @since 0.2
47       */
48      public HangupAction(String channel)
49      {
50          this.channel = channel;
51      }
52  
53      /***
54       * Returns the name of this action, i.e. "Hangup".
55       */
56      public String getAction()
57      {
58          return "Hangup";
59      }
60  
61      /***
62       * Returns the name of the channel to hangup.
63       * 
64       * @return the name of the channel to hangup.
65       */
66      public String getChannel()
67      {
68          return channel;
69      }
70  
71      /***
72       * Sets the name of the channel to hangup.
73       * 
74       * @param channel the name of the channel to hangup.
75       */
76      public void setChannel(String channel)
77      {
78          this.channel = channel;
79      }
80  }