Package esmska.update
Class UpdateChecker
- java.lang.Object
-
- esmska.update.UpdateChecker
-
public class UpdateChecker extends java.lang.ObjectChecks for newer program or gateway version on program's website First of all you must run thecheckForUpdates()method, only after it has finished the other methods will give you correct answer about updates availability.
-
-
Field Summary
Fields Modifier and Type Field Description static intACTION_CHECK_FAILEDcould not check updates - network error?static intACTION_GATEWAY_UPDATE_AVAILABLEnew or updated gateway script is availablestatic intACTION_NO_UPDATE_AVAILABLEno updates foundstatic intACTION_PROGRAM_AND_GATEWAY_UPDATE_AVAILABLEnew program version and gateway script is availablestatic intACTION_PROGRAM_UPDATE_AVAILABLEnew program version is availablestatic intAUTO_CHECK_INTERVALThe interval in seconds how often to check for updates automatically
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionListener(java.awt.event.ActionListener actionListener)voidcheckForUpdates()Checks for updates asynchronously and notify all added listeners after being finished.java.util.Set<GatewayUpdateInfo>getGatewayUpdates(boolean includeHidden)Get info about gateway updatesstatic UpdateCheckergetInstance()Get program instancejava.lang.StringgetLatestProgramVersion()Get latest program version available onlinebooleanisGatewayUpdateAvailable(boolean includeHidden)Whether an gateway update is availablebooleanisProgramUpdateAvailable()Whether a new program update is available.booleanisRunning()Whether checking for updates is (still) runningvoidremoveActionListener(java.awt.event.ActionListener actionListener)
-
-
-
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
-
-