mohamedrahilr | 63a921c | 2019-02-27 19:48:25 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019-present Open Networking Foundation |
| 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.workflow.api; |
| 18 | |
| 19 | |
jaegonkim | 13b25cb | 2019-03-22 06:23:23 +0900 | [diff] [blame] | 20 | import com.fasterxml.jackson.databind.JsonNode; |
| 21 | |
| 22 | import java.net.URI; |
| 23 | import java.util.List; |
mohamedrahilr | 63a921c | 2019-02-27 19:48:25 +0530 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Workflow DataModel exception class. |
| 27 | */ |
| 28 | public class WorkflowDataModelException extends WorkflowException { |
| 29 | |
jaegonkim | 13b25cb | 2019-03-22 06:23:23 +0900 | [diff] [blame] | 30 | private URI workflowId; |
| 31 | private JsonNode parameterJson; |
| 32 | private List<String> errorMsgs; |
mohamedrahilr | 63a921c | 2019-02-27 19:48:25 +0530 | [diff] [blame] | 33 | |
| 34 | /** |
jaegonkim | 13b25cb | 2019-03-22 06:23:23 +0900 | [diff] [blame] | 35 | * Default Constructor for Workflow DataModel Exception. |
mohamedrahilr | 63a921c | 2019-02-27 19:48:25 +0530 | [diff] [blame] | 36 | * |
| 37 | * @param msg exception message |
| 38 | */ |
| 39 | public WorkflowDataModelException(String msg) { |
| 40 | |
| 41 | super(msg); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Constructor for Workflow DataModel Exception. |
| 46 | * |
jaegonkim | 13b25cb | 2019-03-22 06:23:23 +0900 | [diff] [blame] | 47 | * @param workflowId id of workflow |
| 48 | * @param parameterJson paramter json data model |
| 49 | * @param errorMsgs error message for json data model |
mohamedrahilr | 63a921c | 2019-02-27 19:48:25 +0530 | [diff] [blame] | 50 | */ |
jaegonkim | 13b25cb | 2019-03-22 06:23:23 +0900 | [diff] [blame] | 51 | public WorkflowDataModelException(URI workflowId, JsonNode parameterJson, List<String> errorMsgs) { |
| 52 | super("Invalid workflow data model: " + |
| 53 | " workflow: " + workflowId.toString() + |
| 54 | ", parameter json: " + parameterJson.toString() + |
| 55 | ", errors: " + errorMsgs); |
| 56 | this.workflowId = workflowId; |
| 57 | this.parameterJson = parameterJson; |
| 58 | this.errorMsgs = errorMsgs; |
mohamedrahilr | 63a921c | 2019-02-27 19:48:25 +0530 | [diff] [blame] | 59 | } |
mohamedrahilr | 63a921c | 2019-02-27 19:48:25 +0530 | [diff] [blame] | 60 | } |