blob: 7d175290ae4db241ff004c393d871c10590f4ee9 [file] [log] [blame]
mohamedrahilr63a921c2019-02-27 19:48:25 +05301/*
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
17package org.onosproject.workflow.api;
18
19
jaegonkim13b25cb2019-03-22 06:23:23 +090020import com.fasterxml.jackson.databind.JsonNode;
21
22import java.net.URI;
23import java.util.List;
mohamedrahilr63a921c2019-02-27 19:48:25 +053024
25/**
26 * Workflow DataModel exception class.
27 */
28public class WorkflowDataModelException extends WorkflowException {
29
jaegonkim13b25cb2019-03-22 06:23:23 +090030 private URI workflowId;
31 private JsonNode parameterJson;
32 private List<String> errorMsgs;
mohamedrahilr63a921c2019-02-27 19:48:25 +053033
34 /**
jaegonkim13b25cb2019-03-22 06:23:23 +090035 * Default Constructor for Workflow DataModel Exception.
mohamedrahilr63a921c2019-02-27 19:48:25 +053036 *
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 *
jaegonkim13b25cb2019-03-22 06:23:23 +090047 * @param workflowId id of workflow
48 * @param parameterJson paramter json data model
49 * @param errorMsgs error message for json data model
mohamedrahilr63a921c2019-02-27 19:48:25 +053050 */
jaegonkim13b25cb2019-03-22 06:23:23 +090051 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;
mohamedrahilr63a921c2019-02-27 19:48:25 +053059 }
mohamedrahilr63a921c2019-02-27 19:48:25 +053060}