f6f1e68bdaba8ee4b32c8bd8147957a433f835ab
[so.git] / adapters / mso-tenant-adapter / src / main / java / org / openecomp / mso / adapters / tenant / exceptions / TenantException.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.tenant.exceptions;
22
23
24
25 import javax.xml.ws.WebFault;
26
27 import org.openecomp.mso.adapters.tenant.exceptions.TenantExceptionBean;
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 Tenant related exceptions on create, delete, query.
34  * 
35  *
36  */
37 @WebFault (name="TenantException", faultBean="org.openecomp.mso.adapters.tenant.exceptions.TenantExceptionBean", targetNamespace="http://org.openecomp.mso/tenant")
38 public class TenantException extends Exception {
39
40         private static final long serialVersionUID = 1L;
41
42         private TenantExceptionBean faultInfo;
43         
44         public TenantException (String msg) {
45                 super(msg);
46                 faultInfo = new TenantExceptionBean (msg);
47         }
48         
49         public TenantException (String msg, Throwable e) {
50                 super (msg, e);
51                 faultInfo = new TenantExceptionBean (msg);
52         }
53
54         public TenantException (String msg, MsoExceptionCategory category) {
55                 super(msg);
56                 faultInfo = new TenantExceptionBean (msg, category);
57         }
58         
59         public TenantException (String msg, MsoExceptionCategory category, Throwable e) {
60                 super (msg, e);
61                 faultInfo = new TenantExceptionBean (msg, category);
62         }
63         
64         public TenantException (MsoException e) {
65                 super (e);
66                 faultInfo = new TenantExceptionBean (e.getContextMessage(), e.getCategory());
67         }
68
69         public TenantExceptionBean getFaultInfo() {
70                 return faultInfo;
71         }
72
73         public void setFaultInfo(TenantExceptionBean faultInfo) {
74                 this.faultInfo = faultInfo;
75         }
76 }