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

public class ConfigTunnelsHelperextends HelperBase
Helper for tunnels configuration page rendering and form processing.
  • Field Details

    • HOP

      private static final String HOP
      Form field prefix of the hop settings.
      See Also:
    • TUNNEL

      private static final String TUNNEL
      Form field prefix of the tunnel settings.
      See Also:
    • WARN_LENGTH

      private static final int WARN_LENGTH
      Tunnel length that warns in the basic form.
      See Also:
    • MAX_LENGTH

      private static final int MAX_LENGTH
      Tunnel length allowed in the basic form.
      See Also:
    • MAX_ADVANCED_LENGTH

      private static final int MAX_ADVANCED_LENGTH
      Tunnel length allowed in the advanced form.
      See Also:
    • WARN_QUANTITY

      private static final int WARN_QUANTITY
      Tunnel quantity that warns in the basic form.
      See Also:
    • MAX_QUANTITY

      private static final int MAX_QUANTITY
      Tunnel quantity allowed in the basic form.
      See Also:
    • MAX_ADVANCED_QUANTITY

      private static final int MAX_ADVANCED_QUANTITY
      Tunnel quantity allowed in the advanced form.
      See Also:
    • MAX_ADVANCED_BACKUP_QUANTITY

      private static final int MAX_ADVANCED_BACKUP_QUANTITY
      Backup tunnels allowed in the advanced form.
      See Also:
    • MAX_VARIANCE

      private static final int MAX_VARIANCE
      Hop length variance allowed.
      See Also:
    • MIN_NEG_VARIANCE

      private static final int MIN_NEG_VARIANCE
      Most negative hop length variance allowed.
      See Also:
    • DUMMY2

      private static final String DUMMY2
      To fool xgettext so the following isn't tagged.
      See Also:
  • Constructor Details

    • ConfigTunnelsHelper

      public ConfigTunnelsHelper()
      Creates a helper for the tunnels config page.
  • Method Details

    • getForm

      public String getForm()
      Render the tunnel configuration form.
      Returns:
      the HTML form
    • getTunnelName

      private String getTunnelName(TunnelPoolSettings ins)
      Get display name for the tunnel.
      Parameters:
      ins - the inbound tunnel pool settings to name
      Returns:
      the tunnel name
    • renderForm

      private void renderForm(StringBuilder buf, int index, String prefix, String name, TunnelPoolSettings in, TunnelPoolSettings out)
      Renders the tuning form for one tunnel.
      Parameters:
      buf - the buffer to render into
      index - the tunnel number
      prefix - the form field prefix
      name - the tunnel name
      in - the inbound pool settings
      out - the outbound pool settings
    • renderOptions

      private void renderOptions(StringBuilder buf, int min, int max, int now, String prefix, String name)
      Renders the number options from min to max.
      Parameters:
      buf - the buffer to render into
      min - the smallest value offered
      max - the largest value offered
      now - the value selected
      prefix - the form field prefix
      name - the field name