Package com.install4j.api.update
Class UpdateScheduleRegistry
java.lang.Object
com.install4j.api.update.UpdateScheduleRegistry
Administrates an update schedule for your application. This class is intended to be called by
your application. You have to call
setUpdateSchedule(UpdateSchedule)
} at some point and
then call checkAndReset()
each time you start up your application (or whenever it is convenient)
to find out if you should check for an update. Note that no updater is started automatically, you have to
start a suitable updater with the ApplicationLauncher
class.-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks if you should check for an update.static void
Tells the registry that the current time should be set as the last update check date.static Date
Returns the date you last calledcheckAndReset()
and got a return value oftrue
.static UpdateSchedule
Returns the configured update schedule.static void
setUpdateSchedule
(UpdateSchedule updateSchedule) Sets the new update schedule.
-
Method Details
-
checkAndReset
public static boolean checkAndReset()Checks if you should check for an update. If the configured update schedule and the last time you checked for an update require a new check, this method returns true and sets the time for the last update check to the current time.- Returns:
- if you should start an updater with the
ApplicationLauncher
class
-
setUpdateSchedule
Sets the new update schedule.- Parameters:
updateSchedule
- the update schedule
-
getUpdateSchedule
Returns the configured update schedule.- Returns:
- the update schedule or
null
if no update schedule has been configured so far
-
getLastUpdateCheckDate
Returns the date you last calledcheckAndReset()
and got a return value oftrue
.- Returns:
- the last update check date
-
checkedForUpdate
public static void checkedForUpdate()Tells the registry that the current time should be set as the last update check date. Usually, you do not need to call this method sincecheckAndReset()
sets it automatically if required.
-