net.i2p.router.web

## Class UpdateHandler

- java.lang.Object
- - net.i2p.router.web.UpdateHandler

-     public class UpdateHandler
      extends Object

  Handles the request to update the router by firing one or more `EepGet` calls to download the latest signed update file and display the status to anyone who asks.

  After the download completes the signed update file is verified with `TrustedUpdate`, and if it's authentic the payload of the signed update file is unpacked and the router is restarted to complete the update process.

  This is like a FormHandler but we don't extend it, as we don't have the message area, etc.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected RouterContext` | `_context`
    `protected Log` | `_log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UpdateHandler()`
    `UpdateHandler(RouterContext ctx)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `setContextId(String contextId)` Configure this bean to query a particular router context
    `void` | `setUpdateAction(String val)` These two can be set in either order, so call checkUpdateAction() twice
    `void` | `setUpdateNonce(String nonce)`
    `static ConsoleUpdateManager` | `updateManager(RouterContext ctx)`

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

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

- - ### Field Detail

    - #### _context

          protected RouterContext _context

    - #### _log

          protected Log _log

  - ### Constructor Detail

    - #### UpdateHandler

          public UpdateHandler()

    - #### UpdateHandler

          public UpdateHandler(RouterContext ctx)

  - ### Method Detail

    - #### setContextId

          public void setContextId(String contextId)

      Configure this bean to query a particular router context
      Parameters:
        `contextId` - beginning few characters of the routerHash, or null to pick the first one we come across.

    - #### setUpdateAction

          public void setUpdateAction(String val)

      These two can be set in either order, so call checkUpdateAction() twice

    - #### setUpdateNonce

          public void setUpdateNonce(String nonce)

    - #### updateManager

          public static ConsoleUpdateManager updateManager(RouterContext ctx)

      Returns:
        null if not found