Package com.install4j.api.update
Class UpdateScheduleRegistry
- java.lang.Object
-
- com.install4j.api.update.UpdateScheduleRegistry
-
public class UpdateScheduleRegistry extends java.lang.Object
Administrates an update schedule for your application. This class is intended to be called by your application. You have to callsetUpdateSchedule(UpdateSchedule)
} at some point and then callcheckAndReset()
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 theApplicationLauncher
class.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
checkAndReset()
Checks if you should check for an update.static void
checkedForUpdate()
Tells the registry that the current time should be set as the last update check date.static java.util.Date
getLastUpdateCheckDate()
Returns the date you last calledcheckAndReset()
and got a return value oftrue
.static UpdateSchedule
getUpdateSchedule()
Returns the configured update schedule.static void
setUpdateSchedule(UpdateSchedule updateSchedule)
Sets the new update schedule.
-
-
-
Method Detail
-
checkAndReset
public static boolean checkAndReset()
Checks if you should check for an update. If the configured update schedule and 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
public static void setUpdateSchedule(UpdateSchedule updateSchedule)
Sets the new update schedule.- Parameters:
updateSchedule
- the update schedule
-
getUpdateSchedule
public static UpdateSchedule getUpdateSchedule()
Returns the configured update schedule.- Returns:
- the update schedule or
null
if no update schedule has been configured so far
-
getLastUpdateCheckDate
public static java.util.Date 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.
-
-