java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.WizardHelper

public class WizardHelperextends HelperBase
The new user wizard.

This bean has SESSION scope so the results may be retrieved. All necessary methods are synchronized.

  • Field Details

    • PROP_COMPLETE

      public static final String PROP_COMPLETE
      Session property recording that the welcome wizard already ran.
      See Also:
    • BW_SCALE

      public static final float BW_SCALE
      Fraction of the measured bandwidth applied to the limiter settings.
      See Also:
  • Constructor Details

    • WizardHelper

      public WizardHelper()
      A session-scoped bean with no test run yet: the listener, the runner and the cached status are all filled in as the bandwidth test runs.
  • Method Details

    • setContextId

      public void setContextId(String contextId)
      Overriden to only do this once.
      Overrides:
      setContextId in class HelperBase
      Parameters:
      contextId - beginning few characters of the routerHash, or null to pick the first one we come across.
    • complete

      public void complete()
      Record that the setup wizard has been finished, so it is not shown again.
    • isNDTComplete

      public boolean isNDTComplete()
      Whether the NDT bandwidth test listener reports the test as finished.
      Returns:
      whether n d t complete
    • isNDTRunning

      public boolean isNDTRunning()
      Whether the NDT bandwidth test is in progress.
      Returns:
      whether n d t running
    • isNDTSuccessful

      public boolean isNDTSuccessful()
      Whether the NDT bandwidth test completed and moved any bandwidth in both directions.
      Returns:
      whether n d t successful
    • getTestStatus

      public String getTestStatus()
      Return the current NDT bandwidth test status.
      Returns:
      HTML-escaped status string or ""
    • getCompletionStatus

      public String getCompletionStatus()
      Return the NDT test completion status.
      Returns:
      HTML-escaped status string or ""
    • getDetailStatus

      public String getDetailStatus()
      Return detailed NDT test status information.
      Returns:
      HTML-escaped status string or ""
    • getUpBandwidth

      public long getUpBandwidth()
      Return the measured upload bandwidth.
      Returns:
      bytes per second or 0
    • getDownBandwidth

      public long getDownBandwidth()
      Return the measured download bandwidth.
      Returns:
      bytes per second or 0
    • getServerLocation

      public String getServerLocation()
      Return the NDT test server location.
      Returns:
      HTML-escaped location or ""
    • getInboundBurstRate

      public String getInboundBurstRate()
      To populate form with. Uses the test result if available, else the current setting Adapted from ConfigNetHelper.
      Returns:
      the inbound bandwidth limit in decimal KB/sec, rounded to an integer
    • getOutboundBurstRate

      public String getOutboundBurstRate()
      To populate form with. Uses the test result if available, else the current setting Adapted from ConfigNetHelper.
      Returns:
      the outbound bandwidth limit in decimal KB/sec, rounded to an integer
    • getInboundBurstRateBits

      public String getInboundBurstRateBits()
      Copied from ConfigNetHelper.
      Returns:
      the inbound burst rate in bits per second and the per-month maximum
    • getOutboundBurstRateBits

      public String getOutboundBurstRateBits()
      Copied from ConfigNetHelper.
      Returns:
      the outbound burst rate in bits per second and the per-month maximum
    • getShareRateBits

      public String getShareRateBits()
      Copied from ConfigNetHelper.
      Returns:
      the shared bandwidth in bits per second and the per-month maximum
    • getShareBandwidth

      public int getShareBandwidth()
      Adapted from ConfigNetHelper.
      Returns:
      in binary KBytes per second
    • startNDT

      boolean startNDT()
      Start the test. Called from the Handler.
      Returns:
      whether the test was started; false if one is already running
    • cancelNDT

      boolean cancelNDT()
      Cancel the test. Called from the Handler.
      Returns:
      whether a running test was cancelled