Fixes in ScheduledPublishingPolicyImpl 69/29169/2
authorburdziak <olaf.burdziakowski@nokia.com>
Thu, 25 Jan 2018 13:18:47 +0000 (14:18 +0100)
committerPatrick Brady <pb071s@att.com>
Thu, 25 Jan 2018 19:04:33 +0000 (19:04 +0000)
Change-Id: I2055da6942f0487ed543df260ee541632cff6f5e
Issue-ID: APPC-515
Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
appc-metric/appc-metric-bundle/src/main/java/org/onap/appc/metricservice/policy/impl/ScheduledPublishingPolicyImpl.java

index 8933150..84bc011 100644 (file)
@@ -77,7 +77,7 @@ public class ScheduledPublishingPolicyImpl implements ScheduledPublishingPolicy
 
             }else if(properties.getProperty("schedule.policy.metric.period")==null && properties.getProperty("schedule.policy.metric.start.time")!=null){
                 this.startTime=getConfigStartTime("00:00:00",properties);
-                this.period=(24*60*60*1000)-1;
+                this.period=(24*60*60*1000l)-1;
                 logger.info("Metric Properties read from configuration Start Time :"+this.startTime+", Period :"+this.period);
 
             }else{
@@ -101,7 +101,7 @@ public class ScheduledPublishingPolicyImpl implements ScheduledPublishingPolicy
     private long getConfigPeriod(Properties properties) {
         String period=properties.getProperty("schedule.policy.metric.period");
         logger.info("Metric period : " +period);
-        long periodInMs=Integer.parseInt(period)*1000;
+        long periodInMs=Integer.parseInt(period)*1000l;
         logger.info("Metric period in long : " +periodInMs);
         return periodInMs;
     }
@@ -109,9 +109,9 @@ public class ScheduledPublishingPolicyImpl implements ScheduledPublishingPolicy
     private long getTimeInMs(String time) {
         String[] strings=time.split(":");
         if(strings.length==3) {
-            long hour = Integer.parseInt(strings[0]) * 60 * 60 * 1000;
-            long min = Integer.parseInt(strings[1]) * 60 * 1000;
-            long sec = Integer.parseInt(strings[2]) * 1000;
+            long hour = Integer.parseInt(strings[0]) * 60 * 60 * 1000l;
+            long min = Integer.parseInt(strings[1]) * 60 * 1000l;
+            long sec = Integer.parseInt(strings[2]) * 1000l;
             return hour+min+sec;
         }else{
             return 0;