[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-be / lib / openecomp-sdc-action-lib / openecomp-sdc-action-api / src / main / java / org / openecomp / sdc / action / errors / ActionException.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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.sdc.action.errors;
22
23 import org.openecomp.sdc.action.util.ActionUtil;
24
25 /**
26  * Custom Exception class for handling Action Library error scenarios.
27  */
28 public class ActionException extends RuntimeException {
29
30   private String errorCode;
31   private String description;
32   private int logResponseCode;
33
34   public ActionException() {
35
36   }
37
38   /**
39    * Instantiates a new Action exception.
40    *
41    * @param errorCode   the error code
42    * @param description the description
43    */
44   public ActionException(String errorCode, String description) {
45     this.errorCode = errorCode;
46     this.description = description;
47     this.logResponseCode = ActionUtil.getLogResponseCode(this.errorCode);
48   }
49
50   public String getErrorCode() {
51     return errorCode;
52   }
53
54   public void setErrorCode(String errorCode) {
55     this.errorCode = errorCode;
56   }
57
58   public String getDescription() {
59     return description;
60   }
61
62   public void setDescription(String description) {
63     this.description = description;
64   }
65
66   public int getLogResponseCode() {
67     return logResponseCode;
68   }
69
70   public void setLogResponseCode(int logResponseCode) {
71     this.logResponseCode = logResponseCode;
72   }
73 }