summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-04-08 11:21:31 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-08 11:21:31 +0000
commite757e801c665a1758cf4c976b24df13adda38b2b (patch)
tree9bd6b9b3f72db830c5c235456644991aa0f85eb0
parent70ff098fd488850655ad7ac98ad06712f0340552 (diff)
parent198dcad3901704a0b68a545e4cc7dbc4b5343413 (diff)
Merge "Fixed recent Sonar blocker issues"
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java5
3 files changed, 9 insertions, 13 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
index 6d4deeb0f1..eb003cdda6 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
@@ -233,7 +233,8 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
StackInfo stackStatus = getStackStatus(cloudSiteId, cloudOwner, tenantId, canonicalName, pollForCompletion, timeoutMinutes, backout);
if (HeatStatus.CREATED.equals(stackStatus.getStatus())) {
- multicloudAaiUpdate(cloudSiteId, cloudOwner, tenantId, genericVnfId, vfModuleId, multicloudResponseBody.getWorkloadId(), pollForCompletion, timeoutMinutes);
+ String workloadId = multicloudResponseBody == null ? null : multicloudResponseBody.getWorkloadId();
+ multicloudAaiUpdate(cloudSiteId, cloudOwner, tenantId, genericVnfId, vfModuleId, workloadId, pollForCompletion, timeoutMinutes);
}
return stackStatus;
@@ -398,6 +399,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
if (multicloudClient == null) {
if (logger.isDebugEnabled())
logger.debug("Multicloud client could not be initialized");
+ return;
}
Response response = multicloudClient.post(multicloudRequest);
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
index 750b7ace35..083a6b6e1f 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
@@ -130,19 +130,12 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
ExecutionServiceInput executionServiceInput = (ExecutionServiceInput) execution
.getVariable("executionServiceInput");
- //CDSProcessingListener cdsProcessingListener = new AbstractCDSProcessingBBUtils();
-
- CDSProcessingClient cdsClient = null;
- CountDownLatch countDownLatch;
- try {
- cdsClient = new CDSProcessingClient(this);
- countDownLatch = cdsClient.sendRequest(executionServiceInput);
+ try(CDSProcessingClient cdsClient = new CDSProcessingClient(this)) {
+ CountDownLatch countDownLatch = cdsClient.sendRequest(executionServiceInput);
countDownLatch.await(props.getTimeout(), TimeUnit.SECONDS);
- } catch (InterruptedException ex) {
+ } catch (InterruptedException ex){
logger.error("Caught exception in sendRequestToCDSClient in AbstractCDSProcessingBBUtils : ", ex);
Thread.currentThread().interrupt();
- } finally {
- cdsClient.close();
}
if (cdsResponse != null) {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java
index c4804c05c2..e13d1e4dda 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java
@@ -2,6 +2,8 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Ericsson. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -85,8 +87,7 @@ public class MonitorVnfmDeleteJobTask extends MonitorVnfmJobTask {
+ (deleteVnfResponse != null ? deleteVnfResponse.getJobId() : "null") + "Unable to retrieve OperationStatus";
LOGGER.error(message);
exceptionUtil.buildAndThrowWorkflowException(execution, 1214, message);
- }
- if (operationStatusOption.isPresent()) {
+ } else if (operationStatusOption != null && operationStatusOption.isPresent()) {
final OperationStateEnum operationStatus = operationStatusOption.get();
if (operationStatus != OperationStateEnum.COMPLETED) {
final String message =