net.i2p.router.update

## Class DevSU3UpdateHandler

- java.lang.Object
- - net.i2p.router.update.DevSU3UpdateHandler

- All Implemented Interfaces:
    Checker, Updater

      class DevSU3UpdateHandler
      extends Object
      implements Checker, Updater

  Handles the request to update the router by firing off an `EepGet` call to download the latest su3 file and display the status.

  After the download completes the su3 is verified, and the zip is extracted and copied to the router directory, and if configured the router is restarted to complete the update process.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DevSU3UpdateHandler(RouterContext ctx, ConsoleUpdateManager mgr)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `UpdateTask` | `check(UpdateType type, UpdateMethod method, String id, String currentVersion, long maxTime)` Check for updates.
    `List<URI>` | `getUpdateSources()`
    `UpdateTask` | `update(UpdateType type, UpdateMethod method, List<URI> updateSources, String id, String newVersion, long maxTime)` Start a download and return a handle to the download task.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DevSU3UpdateHandler

          public DevSU3UpdateHandler(RouterContext ctx,
                                     ConsoleUpdateManager mgr)

  - ### Method Detail

    - #### check

          public UpdateTask check(UpdateType type,
                                  UpdateMethod method,
                                  String id,
                                  String currentVersion,
                                  long maxTime)

      Description copied from interface: `Checker`
      Check for updates. Should not block. If any are found, call back to UpdateManager.notifyUpdateAvailable().
      Specified by:
        `check` in interface `Checker`
      Parameters:
        `currentVersion` - ignored, we use current router version
        `type` - update type
        `method` - update method
        `id` - plugin name or ignored
        `maxTime` - how long you have
      Returns:
        active task or null if unable to check

    - #### getUpdateSources

          public List<URI> getUpdateSources()

      Returns:
        null if none

    - #### update

          public UpdateTask update(UpdateType type,
                                   UpdateMethod method,
                                   List<URI> updateSources,
                                   String id,
                                   String newVersion,
                                   long maxTime)

      Start a download and return a handle to the download task. Should not block.
      Specified by:
        `update` in interface `Updater`
      Parameters:
        `id` - plugin name or ignored
        `maxTime` - how long you have
        `type` - update type
        `method` - update method
        `updateSources` - Where to get the new version from
        `newVersion` - new version to download
      Returns:
        active task or null if unable to download