1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.sf.asterisk.manager.action;
18
19 /***
20 * The CommandAction sends a command line interface (CLI) command to the
21 * asterisk server.<br>
22 * For a list of supported commands type <code>help</code> on asterisk's
23 * command line.
24 *
25 * @author srt
26 * @version $Id: CommandAction.java,v 1.5 2005/08/07 00:09:42 srt Exp $
27 */
28 public class CommandAction extends AbstractManagerAction
29 {
30 /***
31 * Serializable version identifier
32 */
33 static final long serialVersionUID = 4753117770471622025L;
34
35 protected String command;
36
37 /***
38 * Creates a new CommandAction.
39 */
40 public CommandAction()
41 {
42
43 }
44
45 /***
46 * Creates a new CommandAction with the given command.
47 *
48 * @param command the CLI command to execute.
49 * @since 0.2
50 */
51 public CommandAction(String command)
52 {
53 this.command = command;
54 }
55
56 /***
57 * Returns the name of this action, i.e. "Command".
58 */
59 public String getAction()
60 {
61 return "Command";
62 }
63
64 /***
65 * Returns the command.
66 */
67 public String getCommand()
68 {
69 return command;
70 }
71
72 /***
73 * Sets the CLI command to send to the asterisk server.
74 */
75 public void setCommand(String command)
76 {
77 this.command = command;
78 }
79 }