1 /*******************************************************************************
2 * Copyright (c) 2007, 2014 Massimiliano Ziccardi
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 package it.jnrpe.utils;
17
18 /**
19 * Exception thrown if the passed in threshold can't be parsed
20 * according to Nagios specifications.
21 *
22 * @author Massimiliano Ziccardi
23 *
24 */
25 public class BadThresholdException extends Exception {
26
27 /**
28 *
29 */
30 private static final long serialVersionUID = -5393970078318147210L;
31
32 /**
33 * Constructs a new exception with <code>null</code> as its detail message.
34 * The cause is not initialized, and may subsequently be initialized by a
35 * call to {@link #initCause}.
36 */
37 public BadThresholdException() {
38 super();
39 }
40
41 /**
42 * Constructs a new exception with the specified detail message and
43 * cause. <p>Note that the detail message associated with
44 * <code>cause</code> is <i>not</i> automatically incorporated in
45 * this exception's detail message.
46 *
47 * @param message the detail message (which is saved for later retrieval
48 * by the {@link #getMessage()} method).
49 * @param cause the cause (which is saved for later retrieval by the
50 * {@link #getCause()} method). (A <tt>null</tt> value is
51 * permitted, and indicates that the cause is nonexistent or
52 * unknown.)
53 */
54 public BadThresholdException(final String message, final Throwable cause) {
55 super(message, cause);
56 }
57
58 /**
59 * Constructs a new exception with the specified detail message. The
60 * cause is not initialized, and may subsequently be initialized by
61 * a call to {@link #initCause}.
62 *
63 * @param message the detail message. The detail message is saved for
64 * later retrieval by the {@link #getMessage()} method.
65 */
66 public BadThresholdException(final String message) {
67 super(message);
68 }
69
70 /**
71 * Constructs a new exception with the specified cause and a detail
72 * message of <tt>(cause==null ? null : cause.toString())</tt> (which
73 * typically contains the class and detail message of <tt>cause</tt>).
74 * This constructor is useful for exceptions that are little more than
75 * wrappers for other throwables (for example, {@link
76 * java.security.PrivilegedActionException}).
77 *
78 * @param cause the cause (which is saved for later retrieval by the
79 * {@link #getCause()} method). (A <tt>null</tt> value is
80 * permitted, and indicates that the cause is nonexistent or
81 * unknown.)
82 */
83 public BadThresholdException(final Throwable cause) {
84 super(cause);
85 }
86 }