aboutsummaryrefslogtreecommitdiffstats
path: root/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java
diff options
context:
space:
mode:
Diffstat (limited to 'aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java')
-rw-r--r--aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java97
1 files changed, 53 insertions, 44 deletions
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java
index ff182f2d..9fac977d 100644
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java
@@ -3,14 +3,14 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,53 +25,62 @@ import org.onap.ccsdk.sli.adaptors.aai.data.ErrorResponse;
public class AAIServiceException extends Exception {
- /**
- *
- */
- private static final long serialVersionUID = -9039257722542999522L;
-
- protected ErrorResponse errorResponse = null;
- protected int returnCode = -1;
+ /**
+ *
+ */
+ private static final long serialVersionUID = -9039257722542999522L;
- public AAIServiceException() {
+ protected final ErrorResponse errorResponse;
+ protected final int returnCode;
- }
+ public AAIServiceException() {
+ returnCode = -1;
+ errorResponse = null;
+ }
- public AAIServiceException(String message) {
- super(message);
- }
+ public AAIServiceException(String message) {
+ super(message);
+ returnCode = -1;
+ errorResponse = null;
+ }
- public AAIServiceException(Throwable cause) {
- super(cause);
- }
+ public AAIServiceException(Throwable cause) {
+ super(cause);
+ returnCode = -1;
+ errorResponse = null;
+ }
- public AAIServiceException(String message, Throwable cause) {
- super(message, cause);
- }
+ public AAIServiceException(String message, Throwable cause) {
+ super(message, cause);
+ returnCode = -1;
+ errorResponse = null;
+ }
- public AAIServiceException(String message, Throwable cause,
- boolean enableSuppression, boolean writableStackTrace) {
- super(message, cause, enableSuppression, writableStackTrace);
- }
+ public AAIServiceException(String message, Throwable cause,
+ boolean enableSuppression, boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ returnCode = -1;
+ errorResponse = null;
+ }
- public AAIServiceException(int returnCode, ErrorResponse errorresponse) {
- this.errorResponse = errorresponse;
- this.returnCode = returnCode;
- }
-
- public ErrorResponse getErrorResponse() {
- return errorResponse;
- }
+ public AAIServiceException(int returnCode, ErrorResponse errorresponse) {
+ this.errorResponse = errorresponse;
+ this.returnCode = returnCode;
+ }
- public int getReturnCode() {
- return returnCode;
- }
-
- public String getMessage() {
- if(errorResponse != null) {
- return errorResponse.getRequestError().getServiceException().getText();
- } else {
- return super.getMessage();
- }
- }
+ public ErrorResponse getErrorResponse() {
+ return errorResponse;
+ }
+
+ public int getReturnCode() {
+ return returnCode;
+ }
+
+ public String getMessage() {
+ if(errorResponse != null) {
+ return errorResponse.getRequestError().getServiceException().getText();
+ } else {
+ return super.getMessage();
+ }
+ }
}