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.fastagi;
18  
19  /***
20   * An InvalidCommandSyntaxException is thrown when the reader receives a reply
21   * with status code 520.
22   * 
23   * @author srt
24   * @version $Id: InvalidCommandSyntaxException.java,v 1.1 2005/03/11 19:34:55 srt Exp $
25   */
26  public class InvalidCommandSyntaxException extends AGIException
27  {
28      /***
29       * Serial version identifier.
30       */
31      private static final long serialVersionUID = 3257002168165807929L;
32  
33      private String synopsis;
34      private String usage;
35  
36      /***
37       * Creates a new InvalidCommandSyntaxException with the given synopsis and
38       * usage.
39       * 
40       * @param synopsis the synopsis of the command.
41       * @param usage the usage of the command.
42       */
43      public InvalidCommandSyntaxException(String synopsis, String usage)
44      {
45          super("Invalid command syntax: " + synopsis);
46          this.synopsis = synopsis;
47          this.usage = usage;
48      }
49  
50      /***
51       * Returns the synopsis of the command that was called with invalid syntax.
52       * 
53       * @return the synopsis of the command that was called with invalid syntax.
54       */
55      public String getSynopsis()
56      {
57          return synopsis;
58      }
59  
60      /***
61       * Returns a description of the command that was called with invalid syntax.
62       * 
63       * @return a description of the command that was called with invalid syntax.
64       */
65      public String getUsage()
66      {
67          return usage;
68      }
69  }