aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-11-02 15:18:19 +0000
committerGerrit Code Review <gerrit@onap.org>2020-11-02 15:18:19 +0000
commit39f149a33356ea0759d07a65e211dc3ffbab885c (patch)
tree3c43b8bc2f7d59aaeb8d4c60cb2a4ff7f1d622d6
parentd82267f79a4c486fb3ad6d59d93347353bf93e23 (diff)
parent342703276a0b5e1a031890010dfae5b5a8ab0d66 (diff)
Merge "Fixed the lock times and populated error variable"
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java10
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java6
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java2
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java2
-rw-r--r--common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java10
5 files changed, 10 insertions, 20 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java
index b176892192..4e0c4ad8a6 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java
@@ -62,13 +62,13 @@ public class TaskServices {
public void createtAAIInventory() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("InventoryCreate").lockDuration(externalTaskServiceUtils.getLongLockDuration())
+ client.subscribe("InventoryCreate").lockDuration(externalTaskServiceUtils.getLockDurationMedium())
.handler(createInventory::executeExternalTask).open();
}
}
@PostConstruct
- public void auditAAIInventory() throws Exception {
+ public void deleteAAIInventory() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
externalTaskServiceUtils.createExternalTaskClient().subscribe("InventoryDelete")
.lockDuration(externalTaskServiceUtils.getLockDurationMedium())
@@ -80,7 +80,7 @@ public class TaskServices {
public void openstackInvoker() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("OpenstackAdapterInvoke").lockDuration(externalTaskServiceUtils.getLockDuration())
+ client.subscribe("OpenstackAdapterInvoke").lockDuration(externalTaskServiceUtils.getLockDurationShort())
.handler(stackService::executeExternalTask).open();
}
}
@@ -89,7 +89,7 @@ public class TaskServices {
public void openstackPoller() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("OpenstackAdapterPolling").lockDuration(externalTaskServiceUtils.getLockDuration())
+ client.subscribe("OpenstackAdapterPolling").lockDuration(externalTaskServiceUtils.getLockDurationMedium())
.handler(pollService::executeExternalTask).open();
}
}
@@ -98,7 +98,7 @@ public class TaskServices {
public void openstackRollback() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("OpenstackAdapterRollback").lockDuration(externalTaskServiceUtils.getLockDuration())
+ client.subscribe("OpenstackAdapterRollback").lockDuration(externalTaskServiceUtils.getLockDurationShort())
.handler(rollbackService::executeExternalTask).open();
}
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
index 9ff50e8644..6a5381cf3e 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
@@ -68,7 +68,7 @@ public class PollService extends ExternalTaskUtils {
public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
mdcSetup.setupMDC(externalTask);
- logger.trace("Executing External Task Poll Service");
+ logger.debug("Starting External Task Poll Service");
Map<String, Object> variables = new HashMap<>();
MutableBoolean success = new MutableBoolean();
String errorMessage = null;
@@ -103,11 +103,11 @@ public class PollService extends ExternalTaskUtils {
}
} catch (Exception e) {
logger.error("Error during External Task Poll Service", e);
- errorMessage = e.getMessage();
+ errorMessage = e.toString();
+ variables.put("openstackAdapterErrorMessage", errorMessage);
}
variables.put("OpenstackPollSuccess", success.booleanValue());
- variables.put("openstackAdapterErrorMessage", errorMessage);
if (success.isTrue()) {
externalTaskService.complete(externalTask, variables);
logger.debug("The External Task Id: {} Successful", externalTask.getId());
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java
index 15e6ff581d..c25d752cc4 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java
@@ -39,7 +39,7 @@ public class RollbackService extends ExternalTaskUtils {
public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
mdcSetup.setupMDC(externalTask);
- logger.trace("Executing External Task Rollback Service");
+ logger.debug("Starting External Task Rollback Service");
Map<String, Object> variables = new HashMap<>();
boolean success = false;
boolean pollRollbackStatus = false;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java
index 5196ffffda..c9fa30d949 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java
@@ -91,7 +91,7 @@ public class StackService extends ExternalTaskUtils {
Map<String, Object> variables = new HashMap<>();
mdcSetup.setupMDC(externalTask);
String xmlRequest = externalTask.getVariable("openstackAdapterTaskRequest");
- logger.debug("Executing External Task Stack Service. {}", xmlRequest);
+ logger.debug("Starting External Task Stack Service. {}", xmlRequest);
MutableBoolean success = new MutableBoolean();
MutableBoolean backout = new MutableBoolean();
String response = "";
diff --git a/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java b/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java
index c601b88ae5..1a8307e8bc 100644
--- a/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java
+++ b/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java
@@ -64,16 +64,6 @@ public class ExternalTaskServiceUtils {
return Integer.parseInt(env.getProperty("workflow.topics.maxClients", "10"));
}
- public Long getLockDuration() {
- Long lockDuration = Long.parseLong(env.getProperty("mso.audit.lock-time", "60000"));
- return lockDuration;
- }
-
- public Long getLongLockDuration() {
- Long lockDuration = Long.parseLong(env.getProperty("mso.long.lock-time", "600000"));
- return lockDuration;
- }
-
@ScheduledLogging
@Scheduled(fixedDelay = 30000)
public void checkAllClientsActive() {