Renamed local variable to match the regular expression
[appc.git] / appc-dispatcher / appc-dispatcher-common / execution-queue-management-lib / src / main / java / org / onap / appc / executionqueue / helper / Util.java
index 09d49de..3affb30 100644 (file)
@@ -2,9 +2,11 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications Copyright (C) 2019 Ericsson
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,7 +20,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * 
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
@@ -26,17 +27,19 @@ package org.onap.appc.executionqueue.helper;
 
 import org.onap.appc.configuration.Configuration;
 import org.onap.appc.configuration.ConfigurationFactory;
-
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicInteger;
 
 public class Util {
 
-    private int default_queue_size = 10;
-    private int default_threadpool_size = 10;
-    private String queue_size_key = "appc.dispatcher.executionqueue.backlog.size";
-    private String threadpool_size_key = "appc.dispatcher.executionqueue.threadpool.size";
+    private int defaultQueueSize = 10;
+    private int defaultThreadpoolSize = 10;
+    private String queueSizeKey = "appc.dispatcher.executionqueue.backlog.size";
+    private String threadpoolSizeKey = "appc.dispatcher.executionqueue.threadpool.size";
+    private EELFLogger logger = EELFManager.getInstance().getLogger(Util.class);
 
     private Configuration configuration;
 
@@ -49,26 +52,26 @@ public class Util {
     }
 
     public int getExecutionQueueSize() {
-        String sizeStr = configuration.getProperty(queue_size_key, String.valueOf(default_queue_size));
+        String sizeStr = configuration.getProperty(queueSizeKey, String.valueOf(defaultQueueSize));
 
-        int size = default_queue_size;
+        int size = defaultQueueSize;
         try {
             size = Integer.parseInt(sizeStr);
         } catch (NumberFormatException e) {
-
+            logger.error("Error parsing dispatcher execution queue backlog size", e);
         }
 
         return size;
     }
 
     public int getThreadPoolSize() {
-        String sizeStr = configuration.getProperty(threadpool_size_key, String.valueOf(default_threadpool_size));
+        String sizeStr = configuration.getProperty(threadpoolSizeKey, String.valueOf(defaultThreadpoolSize));
 
-        int size = default_threadpool_size;
+        int size = defaultThreadpoolSize;
         try {
             size = Integer.parseInt(sizeStr);
         } catch (NumberFormatException e) {
-
+            logger.error("Error parsing dispatcher execution queue threadpool size", e);
         }
 
         return size;