diff options
author | Steve Smokowski <ss835w@att.com> | 2020-02-10 13:38:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-02-10 13:38:51 +0000 |
commit | 32464a960c6d26fa6a3a1bb25475ac2c1b96e829 (patch) | |
tree | 77624b53e8685bee2334ba09c73916a18e3c9740 /adapters/mso-openstack-adapters/src/main | |
parent | 5ffc3c1db37c43b559af9c6d8b14bb8d33178572 (diff) | |
parent | d0ec4426cbe4da7dbf94a4faf6e36c032a81c395 (diff) |
Merge "Initial commit to check client alive"
Diffstat (limited to 'adapters/mso-openstack-adapters/src/main')
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"))) |