blob: 6755e7540e40ebb7fde7179b5cc0d8f17c36e57a [file] [log] [blame]
Carmelo Casconeb5324e72018-11-25 02:26:32 -08001/*
2 * Copyright 2018-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
Carmelo Cascone36d5e7a2019-09-25 01:02:53 -070017package org.onosproject.pipelines.fabric.impl.behaviour.pipeliner;
Carmelo Casconeb5324e72018-11-25 02:26:32 -080018
19import org.onosproject.net.flowobjective.ObjectiveError;
20
21/**
22 * Signals an exception when translating a flow objective.
23 */
24class FabricPipelinerException extends Exception {
25
26 private final ObjectiveError error;
27
28 /**
29 * Creates a new exception for the given message. Sets ObjectiveError to
30 * UNSUPPORTED.
31 *
32 * @param message message
33 */
34 FabricPipelinerException(String message) {
35 super(message);
36 this.error = ObjectiveError.UNSUPPORTED;
37 }
38
39 /**
40 * Creates a new exception for the given message and ObjectiveError.
41 *
42 * @param message message
43 * @param error objective error
44 */
45 FabricPipelinerException(String message, ObjectiveError error) {
46 super(message);
47 this.error = error;
48 }
49
50 /**
51 * Returns the ObjectiveError of this exception.
52 *
53 * @return objective error
54 */
55 ObjectiveError objectiveError() {
56 return error;
57 }
58}