esmska.update
Class UpdateChecker

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

public class UpdateChecker
extends java.lang.Object

Checks for newer program or gateway version on program's website First of all you must run the checkForUpdates() method, only after it has finished the other methods will give you correct answer about updates availability.


Field Summary
static int ACTION_CHECK_FAILED
          could not check updates - network error?
static int ACTION_GATEWAY_UPDATE_AVAILABLE
          new or updated gateway script is available
static int ACTION_NO_UPDATE_AVAILABLE
          no updates found
static int ACTION_PROGRAM_AND_GATEWAY_UPDATE_AVAILABLE
          new program version and gateway script is available
static int ACTION_PROGRAM_UPDATE_AVAILABLE
          new program version is available
static int AUTO_CHECK_INTERVAL
          The interval in seconds how often to check for updates automatically
 
Method Summary
 void addActionListener(java.awt.event.ActionListener actionListener)
           
 void checkForUpdates()
          Checks for updates asynchronously and notify all added listeners after being finished.
 java.util.Set<GatewayUpdateInfo> getGatewayUpdates(boolean includeHidden)
          Get info about gateway updates
static UpdateChecker getInstance()
          Get program instance
 java.lang.String getLatestProgramVersion()
          Get latest program version available online
 boolean isGatewayUpdateAvailable(boolean includeHidden)
          Whether an gateway update is available
 boolean isProgramUpdateAvailable()
          Whether a new program update is available.
 boolean isRunning()
          Whether checking for updates is (still) running
 void removeActionListener(java.awt.event.ActionListener actionListener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_PROGRAM_UPDATE_AVAILABLE

public static final int ACTION_PROGRAM_UPDATE_AVAILABLE
new program version is available

See Also:
Constant Field Values

ACTION_GATEWAY_UPDATE_AVAILABLE

public static final int ACTION_GATEWAY_UPDATE_AVAILABLE
new or updated gateway script is available

See Also:
Constant Field Values

ACTION_PROGRAM_AND_GATEWAY_UPDATE_AVAILABLE

public static final int ACTION_PROGRAM_AND_GATEWAY_UPDATE_AVAILABLE
new program version and gateway script is available

See Also:
Constant Field Values

ACTION_NO_UPDATE_AVAILABLE

public static final int ACTION_NO_UPDATE_AVAILABLE
no updates found

See Also:
Constant Field Values

ACTION_CHECK_FAILED

public static final int ACTION_CHECK_FAILED
could not check updates - network error?

See Also:
Constant Field Values

AUTO_CHECK_INTERVAL

public static final int AUTO_CHECK_INTERVAL
The interval in seconds how often to check for updates automatically

See Also:
Constant Field Values
Method Detail

addActionListener

public void addActionListener(java.awt.event.ActionListener actionListener)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener actionListener)

getInstance

public static UpdateChecker getInstance()
Get program instance


checkForUpdates

public void checkForUpdates()
Checks for updates asynchronously and notify all added listeners after being finished. Does nothing if already running.


isRunning

public boolean isRunning()
Whether checking for updates is (still) running


isProgramUpdateAvailable

public boolean isProgramUpdateAvailable()
Whether a new program update is available. According to user preference it checks against latest stable or unstable program version.


getLatestProgramVersion

public java.lang.String getLatestProgramVersion()
Get latest program version available online


isGatewayUpdateAvailable

public boolean isGatewayUpdateAvailable(boolean includeHidden)
Whether an gateway update is available


getGatewayUpdates

public java.util.Set<GatewayUpdateInfo> getGatewayUpdates(boolean includeHidden)
Get info about gateway updates

Returns:
unmodifiable set of gateway updates info