Yuta HIGUCHI | 4d0f89a | 2016-09-14 15:40:39 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Yuta HIGUCHI | 4d0f89a | 2016-09-14 15:40:39 -0700 | [diff] [blame] | 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 org.onosproject.net.behaviour.protection; |
| 17 | |
| 18 | |
| 19 | |
| 20 | /** |
| 21 | * Base class for Protection related Exceptions. |
| 22 | */ |
| 23 | public abstract class ProtectionException extends Exception { |
| 24 | |
| 25 | private static final long serialVersionUID = 5230741971525527020L; |
| 26 | |
| 27 | /** |
| 28 | * Exception thrown when specified configuration was invalid. |
| 29 | */ |
| 30 | public static class InvalidConfigException extends ProtectionException { |
| 31 | |
| 32 | private static final long serialVersionUID = 6532157856911418461L; |
| 33 | |
| 34 | /** |
| 35 | * {@link InvalidConfigException}. |
| 36 | */ |
| 37 | public InvalidConfigException() { |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * {@link InvalidConfigException}. |
| 42 | * |
| 43 | * @param message describing error |
| 44 | */ |
| 45 | public InvalidConfigException(String message) { |
| 46 | super(message); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * {@link InvalidConfigException}. |
| 51 | * |
| 52 | * @param cause of this Exception |
| 53 | */ |
| 54 | public InvalidConfigException(Throwable cause) { |
| 55 | super(cause); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * {@link InvalidConfigException}. |
| 60 | * |
| 61 | * @param message describing error |
| 62 | * @param cause of this Exception |
| 63 | */ |
| 64 | public InvalidConfigException(String message, Throwable cause) { |
| 65 | super(message, cause); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Default constructor. |
| 71 | */ |
| 72 | protected ProtectionException() {} |
| 73 | |
| 74 | /** |
| 75 | * Creates an exception. |
| 76 | * @param message describing error |
| 77 | */ |
| 78 | protected ProtectionException(String message) { |
| 79 | super(message); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Creates an exception. |
| 84 | * @param cause of this Exception |
| 85 | */ |
| 86 | protected ProtectionException(Throwable cause) { |
| 87 | super(cause); |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Creates an exception. |
| 92 | * @param message describing error |
| 93 | * @param cause of this Exception |
| 94 | */ |
| 95 | protected ProtectionException(String message, Throwable cause) { |
| 96 | super(message, cause); |
| 97 | } |
| 98 | |
| 99 | } |