diff options
author | Prabhu Balan <prabhu.balan1@vodafone.com> | 2018-09-04 16:08:41 +0530 |
---|---|---|
committer | Prabhu201713 <prabhu.balan1@vodafone.com> | 2018-09-04 18:30:42 +0530 |
commit | 2414f56728cc61dd29807f2df2dc9d08af523973 (patch) | |
tree | 3646a45ba6f666e6349a1c7da16c6590332b9ee8 /src | |
parent | 6041103fc59c2d2c7461d2844582aee23086758f (diff) |
Fix bug reported by SONAR.
Issue-ID: EXTAPI-132
Change-Id: I57ea6dbcb618079a77cdb2c327bba795edd5f358
Signed-off-by: Prabhu Balan <prabhu.balan1@vodafone.com>
Diffstat (limited to 'src')
5 files changed, 58 insertions, 18 deletions
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java b/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java index 57cb6b5..67421ba 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java @@ -76,10 +76,10 @@ public class SoClient { return response; } catch (BackendFunctionalException e) { - LOGGER.error("error on calling " + url + " ," + e); + LOGGER.error(ERROR_ON_CALLING + url + " ," + e); return new ResponseEntity(e.getBodyResponse(),e.getHttpStatus()); } catch (ResourceAccessException e) { - LOGGER.error("error on calling " + url + " ," + e); + LOGGER.error(ERROR_ON_CALLING + url + " ," + e); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } } @@ -100,10 +100,10 @@ public class SoClient { return response; } catch (BackendFunctionalException e) { - LOGGER.error("error on calling " + url + " ," + e); + LOGGER.error(ERROR_ON_CALLING + url + " ," + e); return new ResponseEntity(e.getBodyResponse(),e.getHttpStatus()); } catch (ResourceAccessException e) { - LOGGER.error("error on calling " + url + " ," + e); + LOGGER.error(ERROR_ON_CALLING + url + " ," + e); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } } @@ -124,10 +124,10 @@ public class SoClient { return response; } catch (BackendFunctionalException e) { - LOGGER.error("error on calling " + url + " ," + e); + LOGGER.error(ERROR_ON_CALLING + url + " ," + e); return new ResponseEntity<>(e.getHttpStatus()); } catch (ResourceAccessException e) { - LOGGER.error("error on calling " + url + " ," + e); + LOGGER.error(ERROR_ON_CALLING + url + " ," + e); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } @@ -162,10 +162,10 @@ public class SoClient { return response; } catch (BackendFunctionalException e) { - LOGGER.error("error on calling " + url + " ," + e); + LOGGER.error(ERROR_ON_CALLING + url + " ," + e); return new ResponseEntity<>(e.getHttpStatus()); } catch (ResourceAccessException e) { - LOGGER.error("error on calling " + url + " ," + e); + LOGGER.error(ERROR_ON_CALLING + url + " ," + e); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } } @@ -202,7 +202,10 @@ public class SoClient { ResponseEntity<GetRequestStatusResponse> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(buildRequestHeader()), GetRequestStatusResponse.class); logResponseGet(url, response); - return response.getBody(); + if (null == response) + return null; + else + return response.getBody(); } catch (BackendFunctionalException | ResourceAccessException e) { LOGGER.error(ERROR_ON_CALLING + url + " ," + e); @@ -226,7 +229,10 @@ public GetE2ERequestStatusResponse callE2EGetRequestStatus(String operationId, S ResponseEntity<GetE2ERequestStatusResponse> response = restTemplate.exchange(callUrlFormated, HttpMethod.GET, new HttpEntity<>(buildRequestHeader()), GetE2ERequestStatusResponse.class); logE2EResponseGet(callUrlFormated, response); - return response.getBody(); + if (null == response) + return null; + else + return response.getBody(); } catch (BackendFunctionalException|ResourceAccessException e) { LOGGER.error(ERROR_ON_CALLING + callUrlFormated + " ," + e); diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateE2EServiceInstanceResponse.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateE2EServiceInstanceResponse.java index 5c41166..7c75eca 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateE2EServiceInstanceResponse.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateE2EServiceInstanceResponse.java @@ -17,6 +17,8 @@ package org.onap.nbi.apis.serviceorder.model.consumer; public class CreateE2EServiceInstanceResponse { + private ServiceResponse service; + public ServiceResponse getService() { return service; } @@ -25,6 +27,10 @@ public class CreateE2EServiceInstanceResponse { this.service = service; } - private ServiceResponse service; - -} + @Override + public String toString() { + return "CreateE2EServiceInstanceResponse{" + + "service=" + service + + '}'; + } +}
\ No newline at end of file diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java index 590bace..3389e32 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java @@ -17,6 +17,8 @@ package org.onap.nbi.apis.serviceorder.model.consumer; public class CreateServiceInstanceResponse { + private RequestReferences requestReferences; + public RequestReferences getRequestReferences() { return requestReferences; } @@ -25,5 +27,10 @@ public class CreateServiceInstanceResponse { this.requestReferences = requestReferences; } - private RequestReferences requestReferences; -} + @Override + public String toString() { + return "CreateServiceInstanceResponse{" + + "requestReferences=" + requestReferences + + '}'; + } +}
\ No newline at end of file diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/GetE2ERequestStatusResponse.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/GetE2ERequestStatusResponse.java index 42a6170..9e16181 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/GetE2ERequestStatusResponse.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/GetE2ERequestStatusResponse.java @@ -27,4 +27,10 @@ public class GetE2ERequestStatusResponse { this.operation = operation; } -} + @Override + public String toString() { + return "GetE2ERequestStatusResponse{" + + "operation=" + operation + + '}'; + } +}
\ No newline at end of file diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/OperationStatus.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/OperationStatus.java index 2cd7393..4d00e41 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/OperationStatus.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/OperationStatus.java @@ -209,5 +209,20 @@ public class OperationStatus implements Serializable { return true; } - -} + @Override + public String toString() { + return "OperationStatus{" + + "serviceId='" + serviceId + '\'' + + ", operationId='" + operationId + '\'' + + ", serviceName='" + serviceName + '\'' + + ", operation='" + operation + '\'' + + ", userId='" + userId + '\'' + + ", result='" + result + '\'' + + ", operationContent='" + operationContent + '\'' + + ", progress='" + progress + '\'' + + ", reason='" + reason + '\'' + + ", operateAt=" + operateAt + + ", finishedAt=" + finishedAt + + '}'; + } +}
\ No newline at end of file |