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.response;
18  
19  import java.util.List;
20  
21  /***
22   * Corresponds to a CommandAction.<br>
23   * 
24   * Asterisk's handling of the command action is generelly quite hairy. It sends a "Response:
25   * Follows" line followed by the raw output of the command including empty lines. At the end of the
26   * command output a line containing "--END COMMAND--" is sent. The reader parses this response into
27   * a CommandResponse object to hide these details.
28   * 
29   * @see net.sf.asterisk.manager.action.CommandAction
30   * 
31   * @author srt
32   * @version $Id: CommandResponse.java,v 1.2 2005/02/23 22:50:58 srt Exp $
33   */
34  public class CommandResponse extends ManagerResponse
35  {
36      /***
37       * Serial version identifier
38       */
39      static final long serialVersionUID = -350763332794275049L;
40  
41      protected List result;
42  
43      /***
44       * Returns a List containing strings representing the lines returned by the CLI command.
45       */
46      public List getResult()
47      {
48          return result;
49      }
50  
51      /***
52       * Sets the result.
53       */
54      public void setResult(List result)
55      {
56          this.result = result;
57      }
58  }