sonu gupta | 1bb37b8 | 2016-11-11 16:51:18 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2016-present Open Networking Laboratory |
| 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 org.onosproject.yms.app.ydt.exceptions; |
| 18 | |
| 19 | /** |
| 20 | * Represents base class for exceptions in YDT operations. |
| 21 | */ |
| 22 | public class YdtException extends RuntimeException { |
| 23 | |
| 24 | private static final long serialVersionUID = 20160211L; |
| 25 | |
| 26 | /** |
| 27 | * Creates a new YDT exception with given message. |
| 28 | * |
| 29 | * @param message the detail of exception in string |
| 30 | */ |
| 31 | public YdtException(String message) { |
| 32 | super(message); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Creates a new YDT exception from given message and cause. |
| 37 | * |
| 38 | * @param message the detail of exception in string |
| 39 | * @param cause underlying cause of the error |
| 40 | */ |
| 41 | public YdtException(String message, Throwable cause) { |
| 42 | super(message, cause); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Creates a new YDT exception from cause. |
| 47 | * |
| 48 | * @param cause underlying cause of the error |
| 49 | */ |
| 50 | public YdtException(Throwable cause) { |
| 51 | super(cause); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Creates a new YDT exception from given parameters. |
| 56 | * |
| 57 | * @param keyword identify error scenario whether it is many or few |
| 58 | * @param name name of the node |
| 59 | * @param count supported count value |
| 60 | */ |
| 61 | public YdtException(String keyword, String name, int count) { |
| 62 | super("Too " + keyword + " key parameter in " + name + ". Expected " + |
| 63 | "count " + count + "."); |
| 64 | } |
| 65 | } |