2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.mso.adapters.network.exceptions;
25 import javax.xml.ws.WebFault;
27 import org.openecomp.mso.adapters.network.exceptions.NetworkExceptionBean;
28 import org.openecomp.mso.openstack.exceptions.MsoException;
29 import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory;
32 * This class simply extends Exception (without addition additional functionality)
33 * to provide an identifier for Network related exceptions on create, delete, query.
37 @WebFault (name="NetworkException", faultBean="org.openecomp.mso.adapters.network.exceptions.NetworkExceptionBean", targetNamespace="http://org.openecomp.mso/network")
38 public class NetworkException extends Exception {
40 private static final long serialVersionUID = 1L;
42 private NetworkExceptionBean faultInfo;
44 public NetworkException (String msg) {
46 faultInfo = new NetworkExceptionBean (msg);
49 public NetworkException (Throwable e) {
51 faultInfo = new NetworkExceptionBean (e.getMessage());
54 public NetworkException (String msg, Throwable e) {
56 faultInfo = new NetworkExceptionBean (msg);
59 public NetworkException (String msg, MsoExceptionCategory category) {
61 faultInfo = new NetworkExceptionBean (msg, category);
64 public NetworkException (String msg, MsoExceptionCategory category, Throwable e) {
66 faultInfo = new NetworkExceptionBean (msg, category);
69 public NetworkException (MsoException e) {
71 faultInfo = new NetworkExceptionBean (e.getContextMessage(), e.getCategory());
74 public NetworkExceptionBean getFaultInfo() {
78 public void setFaultInfo(NetworkExceptionBean faultInfo) {
79 this.faultInfo = faultInfo;