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

public class ProfilesHelperextends HelperBase
Helper for peer profiles page rendering and form processing.
  • Field Details

    • _full

      private int _full
      Which version of the page is shown.
    • titles

      private static final String[] titles
      Heading for each profile row.
  • Constructor Details

    • ProfilesHelper

      public ProfilesHelper()
      Starts on tab 0, which lists every profile; setFull(String) or setShow() moves the helper to a single tier before anything is rendered.
  • Method Details

    • setFull

      public void setFull(String f)
      Parses the requested tier number, ignoring anything unparsable or out of range.
      Parameters:
      f - the profile tier to show, 0 for all, clamped to 0-4 when it parses
    • setShow

      public void setShow(String show)
      Set by show=fast|highcap|floodfill|banned param (alternative to f=N). Overrides _full if present.
      Parameters:
      show - the tier name to map to the numeric tier, or null to leave _full alone
    • getSummary

      public String getSummary()
      Render and return the profile summary page.
      Returns:
      empty string, writes directly to _out
    • getProfileSummary

      public String getProfileSummary()
      Renders the profile summary fragment: the per-peer status list in either the full or the compact form, per _full.
      Returns:
      empty string, writes directly to _out
    • getBanlistCompact

      public String getBanlistCompact()
      Renders the compact banlist fragment: every blocked router and the reason, in the condensed one-line-per-entry layout.
      Returns:
      empty string, writes directly to _out
    • renderFragment

      public void renderFragment(String id) throws IOException
      Render only the named element for the contentonly fragment mode. Renders nothing for ids the current tab does not own; unknown ids produce an empty response.
      Parameters:
      id - the element id
      Throws:
      IOException - if an I/O error occurs
    • getTab

      private int getTab()
      Return the currently selected profiles tab index.
      Returns:
      0 for the short view, 1 for the full view
    • renderNavBar

      private void renderNavBar() throws IOException
      Render the profiles navigation bar.
      Throws:
      IOException - if writing the rendered bar to the response output fails