1b9fde7a885f391ceefb6bd3f1fd6a2a7c65124a
[so.git] / adapters / mso-network-adapter / src / main / java / org / openecomp / mso / adapters / network / exceptions / NetworkException.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * OPENECOMP - MSO
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.mso.adapters.network.exceptions;
22
23
24
25 import javax.xml.ws.WebFault;
26
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;
30
31 /**
32  * This class simply extends Exception (without addition additional functionality)
33  * to provide an identifier for Network related exceptions on create, delete, query.
34  * 
35  *
36  */
37 @WebFault (name="NetworkException", faultBean="org.openecomp.mso.adapters.network.exceptions.NetworkExceptionBean", targetNamespace="http://org.openecomp.mso/network")
38 public class NetworkException extends Exception {
39
40         private static final long serialVersionUID = 1L;
41
42         private NetworkExceptionBean faultInfo;
43         
44         public NetworkException (String msg) {
45                 super(msg);
46                 faultInfo = new NetworkExceptionBean (msg);
47         }
48         
49         public NetworkException (Throwable e) {
50                 super(e);
51                 faultInfo = new NetworkExceptionBean (e.getMessage());
52         }
53         
54         public NetworkException (String msg, Throwable e) {
55                 super (msg, e);
56                 faultInfo = new NetworkExceptionBean (msg);
57         }
58
59         public NetworkException (String msg, MsoExceptionCategory category) {
60                 super(msg);
61                 faultInfo = new NetworkExceptionBean (msg, category);
62         }
63         
64         public NetworkException (String msg, MsoExceptionCategory category, Throwable e) {
65                 super (msg, e);
66                 faultInfo = new NetworkExceptionBean (msg, category);
67         }
68         
69         public NetworkException (MsoException e) {
70                 super (e);
71                 faultInfo = new NetworkExceptionBean (e.getContextMessage(), e.getCategory());
72         }
73         
74         public NetworkExceptionBean getFaultInfo() {
75                 return faultInfo;
76         }
77
78         public void setFaultInfo(NetworkExceptionBean faultInfo) {
79                 this.faultInfo = faultInfo;
80         }
81 }