UpdateScheduleRegistry (install4j API)
Date: 2009-06-17

Overview | Package | Class | Tree | Deprecated | Index | Help
| install4j API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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 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.

Author:
  ej-technologies GmbH

Method Summary
`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 called `checkAndReset()` and got a return value of `true`.
`static UpdateSchedule` | `getUpdateSchedule()` Returns the configured update schedule.
`static void` | `setUpdateSchedule(UpdateSchedule updateSchedule)` Sets the new update schedule.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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 called `checkAndReset()` and got a return value of `true`.

  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 since `checkAndReset()` sets it automatically if required.

Overview | Package | Class | Tree | Deprecated | Index | Help
| install4j API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD