aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2020-02-07 17:14:39 -0500
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-02-07 17:19:04 -0500
commitd0ec4426cbe4da7dbf94a4faf6e36c032a81c395 (patch)
tree80dad5b6047dda91c0272aab40d5fc576070ac2c /adapters/mso-openstack-adapters
parent6db24e72ecbf4f5c63085085c10dc656568b563b (diff)
Initial commit to check client alive
Initial commit to check client alive Issue-ID: SO-2653 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: Ib9f4cf7f5815bd9b8d0d42417f3e5fd83382547a
Diffstat (limited to 'adapters/mso-openstack-adapters')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java9
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java1
2 files changed, 6 insertions, 4 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
index fb7e925d88..7cc7c02f23 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
@@ -34,12 +34,15 @@ import org.springframework.stereotype.Component;
@Profile("!test")
public class AuditStackService {
+ private static final String MSO_AUDIT_LOCK_TIME = "mso.audit.lock-time";
+
private static final Logger logger = LoggerFactory.getLogger(AuditStackService.class);
private static final String DEFAULT_AUDIT_LOCK_TIME = "60000";
private static final String DEFAULT_MAX_CLIENTS_FOR_TOPIC = "10";
+
@Autowired
public Environment env;
@@ -60,7 +63,7 @@ public class AuditStackService {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
client.subscribe("InventoryAddAudit")
- .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME)))
+ .lockDuration(Long.parseLong(env.getProperty(MSO_AUDIT_LOCK_TIME, DEFAULT_AUDIT_LOCK_TIME)))
.handler(auditCreateStack::executeExternalTask).open();
}
}
@@ -70,7 +73,7 @@ public class AuditStackService {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
client.subscribe("InventoryDeleteAudit")
- .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME)))
+ .lockDuration(Long.parseLong(env.getProperty(MSO_AUDIT_LOCK_TIME, DEFAULT_AUDIT_LOCK_TIME)))
.handler(auditDeleteStack::executeExternalTask).open();
}
}
@@ -80,7 +83,7 @@ public class AuditStackService {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
client.subscribe("InventoryQueryAudit")
- .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME)))
+ .lockDuration(Long.parseLong(env.getProperty(MSO_AUDIT_LOCK_TIME, DEFAULT_AUDIT_LOCK_TIME)))
.handler(auditQueryStack::executeExternalTask).open();
}
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java
index 5261f8ae19..4ab4d14dac 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java
@@ -43,7 +43,6 @@ public class CreateInventoryService {
@PostConstruct
public void auditAAIInventory() throws Exception {
-
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
client.subscribe("InventoryCreate")
.lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", "60000")))