esmska.update
Class Statistics

java.lang.Object
  extended by esmska.update.Statistics

public class Statistics
extends java.lang.Object

Class handling everything needed about collecting and posting program usage statistics.


Constructor Summary
Statistics()
           
 
Method Summary
static net.sf.json.JSONObject collectUsageInfo()
          Collect program usage info and return it as a JSON object.
static void refreshUUID()
          If the UUID hasn't already been changed this month, changes it.
static void sendUsageInfo()
          Send program usage info to Esmska server if appropriate (check with shouldSend())
static boolean shouldSend()
          Decide whether to send statistics to Esmska server or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Statistics

public Statistics()
Method Detail

refreshUUID

public static void refreshUUID()
If the UUID hasn't already been changed this month, changes it. Otherwise does nothing.


collectUsageInfo

public static net.sf.json.JSONObject collectUsageInfo()
Collect program usage info and return it as a JSON object.


sendUsageInfo

public static void sendUsageInfo()
Send program usage info to Esmska server if appropriate (check with shouldSend())


shouldSend

public static boolean shouldSend()
Decide whether to send statistics to Esmska server or not. We don't want to send stats too often so that the server is not overloaded. The current decision algorithm:

Returns:
whether it is appropriate to send stats now or not