DMAAP-MR - Merge MR repos
[dmaap/messagerouter/messageservice.git] / src / main / java / org / onap / dmaap / dmf / mr / CambriaApiException.java
1 /*******************************************************************************
2  *  ============LICENSE_START=======================================================
3  *  org.onap.dmaap
4  *  ================================================================================
5  *  Copyright © 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  *        http://www.apache.org/licenses/LICENSE-2.0
11 *  
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *  ============LICENSE_END=========================================================
18  *  
19  *  ECOMP is a trademark and service mark of AT&T Intellectual Property.
20  *  
21  *******************************************************************************/
22 package org.onap.dmaap.dmf.mr;
23
24 import com.att.nsa.apiServer.NsaAppException;
25 import org.json.JSONObject;
26 import org.onap.dmaap.dmf.mr.exception.ErrorResponse;
27
28 public class CambriaApiException extends NsaAppException
29 {
30         /*
31          * defined long type constant serialVersionUID
32          */
33         private static final long serialVersionUID = 1L;
34         
35         private transient ErrorResponse errRes;
36         /**
37          * Implements constructor CambriaApiException
38          * @param jsonObject
39          * 
40          */
41         public CambriaApiException ( JSONObject jsonObject )
42         {
43                 super ( jsonObject );
44         }
45
46         /**
47          * Implements constructor CambriaApiException
48          * @param status
49          * @param msg
50          */
51         public CambriaApiException ( int status, String msg )
52         {
53                 super ( status, msg );
54         }
55
56         /**
57          * Implements constructor CambriaApiException
58          * @param status
59          * @param jsonObject
60          */
61         public CambriaApiException ( int status, JSONObject jsonObject )
62         {
63                 super ( status, jsonObject );
64         }
65         
66         public CambriaApiException (ErrorResponse errRes)
67         {
68                 super(errRes.getHttpStatusCode(),errRes.getErrorMessage());
69                 this.errRes = errRes;
70         }
71         
72         public ErrorResponse getErrRes() {
73                 return errRes;
74         }
75
76         public void setErrRes(ErrorResponse errRes) {
77                 this.errRes = errRes;
78         }
79 }