public final class CheckForUpdates extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
CheckForUpdates.UpdateResult
Returns the result of an update check.
|
Modifier and Type | Field and Description |
---|---|
static long |
ONE_DAY |
static long |
ONE_MINUTE |
protected static String |
PROPERTY_DEBUG_HTTP_GET |
protected static String |
PROPERTY_PREFS_NAME |
protected static String |
PROPERTY_QUERY_URL |
Constructor and Description |
---|
CheckForUpdates(TreeLogger logger,
String entryPoint)
Create an update checker which will poll a server URL and log a message
about an update if available.
|
Modifier and Type | Method and Description |
---|---|
CheckForUpdates.UpdateResult |
check(long minCheckMillis)
Check for updates and log to the logger if they are available.
|
static FutureTask<CheckForUpdates.UpdateResult> |
checkForUpdatesInBackgroundThread(TreeLogger logger,
long minCheckMillis) |
static String |
computeEntryPoint()
Find the first method named "main" on the call stack and use its class as
the entry point.
|
static CheckForUpdates |
createUpdateChecker(TreeLogger logger) |
static CheckForUpdates |
createUpdateChecker(TreeLogger logger,
String entryPoint) |
static void |
logUpdateAvailable(TreeLogger logger,
CheckForUpdates.UpdateResult result) |
static void |
logUpdateAvailable(TreeLogger logger,
FutureTask<CheckForUpdates.UpdateResult> updater) |
public static final long ONE_DAY
public static final long ONE_MINUTE
protected static final String PROPERTY_DEBUG_HTTP_GET
protected static final String PROPERTY_PREFS_NAME
protected static final String PROPERTY_QUERY_URL
public CheckForUpdates(TreeLogger logger, String entryPoint)
logger
- TreeLogger to useentryPoint
- the name of the main entry point used for this executionpublic static FutureTask<CheckForUpdates.UpdateResult> checkForUpdatesInBackgroundThread(TreeLogger logger, long minCheckMillis)
public static String computeEntryPoint()
public static CheckForUpdates createUpdateChecker(TreeLogger logger)
public static CheckForUpdates createUpdateChecker(TreeLogger logger, String entryPoint)
public static void logUpdateAvailable(TreeLogger logger, FutureTask<CheckForUpdates.UpdateResult> updater)
public static void logUpdateAvailable(TreeLogger logger, CheckForUpdates.UpdateResult result)
public CheckForUpdates.UpdateResult check(long minCheckMillis)
Copyright © 2018. All rights reserved.