net.i2p.router.web.helpers

## Class SidebarHelper

- java.lang.Object
- - net.i2p.router.web.HelperBase
  - - net.i2p.router.web.helpers.SidebarHelper

-     public class SidebarHelper
      extends HelperBase

  Simple helper to query the appropriate router for data necessary to render the summary sections on the router console. For the full summary bar use renderSummaryBar()

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SidebarHelper.NetworkState` Enumeration of network reachability state values.
    `static class` | `SidebarHelper.NetworkStateMessage` State message to be displayed to the user in the summary bar.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) I2PAppContext` | `ctx`
    `(package private) static String` | `DEFAULT_FULL`
    `(package private) static String` | `DEFAULT_FULL_ADVANCED`
    `(package private) static String` | `DEFAULT_FULL_NEWUSER`
    `(package private) static String` | `DEFAULT_MINIMAL`
    `(package private) static String` | `DEFAULT_MINIMAL_ADVANCED`
    `(package private) String` | `firstVersion`
    `(package private) static String` | `PROP_SUMMARYBAR`
    `(package private) static String` | `THINSP`
    `(package private) String` | `version`

    - ### Fields inherited from class net.i2p.router.web.HelperBase

      `_context, _out, CHECKED, SELECTED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SidebarHelper()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `allowReseed()` allowReseed
    `String` | `getAction()`
    `int` | `getActivePeers()` How many peers we are talking to now
    `int` | `getActiveProfiles()` How many active identities have we spoken with recently
    `int` | `getAllPeers()` subtract one for ourselves, so if we know no other peers it displays zero
    `String` | `getAvgJobLag()`
    `int` | `getAvgPeerTestTime()`
    `int` | `getAvgPeerTestTimeGood()`
    `int` | `getBanlistedPeers()` How many peers are banned.
    `String` | `getConcurrency()`
    `String` | `getConfigTable()`
    `String` | `getConsoleNonce()`
    `String` | `getCPUBar()` Render JVM CPU Load Bar
    `int` | `getCPULoad()` Retrieve CPU Load as a percentage.
    `int` | `getCPULoadAvg()` Retrieve CPU Load Average as a percentage.
    `String` | `getDestinations()` Client destinations connected locally.
    `int` | `getFastPeers()` How many active peers the router ranks as fast.
    `String` | `getFirewallAndReseedStatus()` The firewall status and reseed status/buttons
    `String` | `getFiveMinuteKBps()`
    `int` | `getHighCapacityPeers()` How many active peers the router ranks as having a high capacity.
    `String` | `getIdent()` Retrieve the shortened 4 character ident for the router located within the current JVM at the given context.
    `String` | `getInboundBacklog()`
    `int` | `getInboundClientTunnels()` How many inbound client tunnels we have.
    `String` | `getInboundTransferred()` How much data have we received since the router started (pretty printed string with 2 decimal places and the appropriate units - GB/MB/KB/bytes)
    `int` | `getInboundTunnels()` How many free inbound tunnels we have.
    `String` | `getJobLag()` How lagged our job queue is over the last minute (pretty printed with the units attached)
    `String` | `getLifetimeKBps()`
    `String` | `getMaxParticipatingTunnels()`
    `String` | `getMemory()` Retrieve amount of used memory.
    `String` | `getMemoryBar()`
    `String` | `getMessageDelay()` How long it takes us to pump out a message, averaged over the last minute (pretty printed with the units attached)
    `NewsHelper` | `getNewsHelper()`
    `int` | `getOutboundClientTunnels()` How many active outbound client tunnels we have.
    `String` | `getOutboundTransferred()` How much data have we sent since the router started (pretty printed string with 2 decimal places and the appropriate units - GB/MB/KB/bytes)
    `int` | `getOutboundTunnels()` How many active outbound tunnels we have.
    `int` | `getParticipatingTunnels()` How many tunnels we are participating in.
    `SidebarHelper.NetworkStateMessage` | `getReachability()`
    `String` | `getRequestURI()`
    `String` | `getRestartStatus()` The restart status and buttons
    `String` | `getSecondKBps()`
    `String` | `getShareRatio()`
    `int` | `getStoredRouterInfos()`
    `List<String>` | `getSummaryBarSections(String page)`
    `int` | `getSystemLoad()` Retrieve System Load Average as a percentage.
    `int` | `getTunnelBuildSuccess()` Retrieve Tunnel build success as a percentage.
    `String` | `getTunnelLag()` How long it takes us to test our tunnels, averaged over the last 10 minutes (pretty printed with the units attached)
    `String` | `getTunnelStatus()`
    `int` | `getUnreachablePeers()` How many peers are unreachable.
    `String` | `getUpdateNonce()`
    `String` | `getUpdateStatus()` The update status and buttons
    `String` | `getUptime()` Retrieve a pretty printed uptime count (ala 4d or 7h or 39m)
    `String` | `getVersion()` Retrieve the version number of the router.
    `int` | `getWellIntegratedPeers()` How many active peers the router ranks as well integrated.
    `boolean` | `isAdvanced()` Check if advanced mode is enabled.
    `boolean` | `isI2PTunnelRunning()` Are both the webapp and TCG running?
    `void` | `renderSummaryBar()` output the summary bar to _out
    `(package private) static void` | `saveSummaryBarSections(RouterContext ctx, String page, Map<Integer,String> sections)`
    `void` | `setAction(String s)`
    `void` | `setConsoleNonce(String s)`
    `void` | `setRequestURI(String s)`
    `void` | `setUpdateNonce(String s)`
    `boolean` | `showFirewallWarning()` Should we warn about a possible firewall problem?
    `void` | `storeNewsHelper(NewsHelper n)`
    `boolean` | `unifiedSidebar()`

    - ### Methods inherited from class net.i2p.router.web.HelperBase

      `_t, _t, _t, _x, getChecked, getCheckedDefaultTrue, ngettext, setContextId, storeWriter`

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

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

- - ### Field Detail

    - #### ctx

          I2PAppContext ctx

    - #### DEFAULT_FULL

          static final String DEFAULT_FULL

      See Also:
        Constant Field Values

    - #### DEFAULT_FULL_ADVANCED

          static final String DEFAULT_FULL_ADVANCED

      See Also:
        Constant Field Values

    - #### DEFAULT_FULL_NEWUSER

          static final String DEFAULT_FULL_NEWUSER

      See Also:
        Constant Field Values

    - #### DEFAULT_MINIMAL

          static final String DEFAULT_MINIMAL

      See Also:
        Constant Field Values

    - #### DEFAULT_MINIMAL_ADVANCED

          static final String DEFAULT_MINIMAL_ADVANCED

      See Also:
        Constant Field Values

    - #### firstVersion

          String firstVersion

    - #### PROP_SUMMARYBAR

          static final String PROP_SUMMARYBAR

      See Also:
        Constant Field Values

    - #### THINSP

          static final String THINSP

      See Also:
        Constant Field Values

    - #### version

          String version

  - ### Constructor Detail

    - #### SidebarHelper

          public SidebarHelper()

  - ### Method Detail

    - #### allowReseed

          public boolean allowReseed()

      allowReseed

    - #### getAction

          public String getAction()

    - #### getActivePeers

          public int getActivePeers()

      How many peers we are talking to now

    - #### getActiveProfiles

          public int getActiveProfiles()

      How many active identities have we spoken with recently

    - #### getAllPeers

          public int getAllPeers()

      subtract one for ourselves, so if we know no other peers it displays zero

    - #### getAvgJobLag

          public String getAvgJobLag()

    - #### getAvgPeerTestTime

          public int getAvgPeerTestTime()

    - #### getAvgPeerTestTimeGood

          public int getAvgPeerTestTimeGood()

    - #### getBanlistedPeers

          public int getBanlistedPeers()

      How many peers are banned.

    - #### getConcurrency

          public String getConcurrency()

    - #### getConfigTable

          public String getConfigTable()

    - #### getConsoleNonce

          public String getConsoleNonce()

    - #### getCPUBar

          public String getCPUBar()

      Render JVM CPU Load Bar

    - #### getCPULoad

          public int getCPULoad()

      Retrieve CPU Load as a percentage.

    - #### getCPULoadAvg

          public int getCPULoadAvg()

      Retrieve CPU Load Average as a percentage.

    - #### getDestinations

          public String getDestinations()

      Client destinations connected locally.
      Returns:
        html section summary

    - #### getFastPeers

          public int getFastPeers()

      How many active peers the router ranks as fast.

    - #### getFirewallAndReseedStatus

          public String getFirewallAndReseedStatus()

      The firewall status and reseed status/buttons

    - #### getFiveMinuteKBps

          public String getFiveMinuteKBps()

      Returns:
        "x.xx / y.yy {K|M}"

    - #### getHighCapacityPeers

          public int getHighCapacityPeers()

      How many active peers the router ranks as having a high capacity.

    - #### getIdent

          public String getIdent()

      Retrieve the shortened 4 character ident for the router located within the current JVM at the given context.

    - #### getInboundBacklog

          public String getInboundBacklog()

    - #### getInboundClientTunnels

          public int getInboundClientTunnels()

      How many inbound client tunnels we have.

    - #### getInboundTransferred

          public String getInboundTransferred()

      How much data have we received since the router started (pretty printed string with 2 decimal places and the appropriate units - GB/MB/KB/bytes)

    - #### getInboundTunnels

          public int getInboundTunnels()

      How many free inbound tunnels we have.

    - #### getJobLag

          public String getJobLag()

      How lagged our job queue is over the last minute (pretty printed with the units attached)

    - #### getLifetimeKBps

          public String getLifetimeKBps()

      Returns:
        "x.xx / y.yy {K|M}"

    - #### getMaxParticipatingTunnels

          public String getMaxParticipatingTunnels()

    - #### getMemory

          public String getMemory()

      Retrieve amount of used memory.

    - #### getMemoryBar

          public String getMemoryBar()

    - #### getMessageDelay

          public String getMessageDelay()

      How long it takes us to pump out a message, averaged over the last minute (pretty printed with the units attached)

    - #### getNewsHelper

          public NewsHelper getNewsHelper()

    - #### getOutboundClientTunnels

          public int getOutboundClientTunnels()

      How many active outbound client tunnels we have.

    - #### getOutboundTransferred

          public String getOutboundTransferred()

      How much data have we sent since the router started (pretty printed string with 2 decimal places and the appropriate units - GB/MB/KB/bytes)

    - #### getOutboundTunnels

          public int getOutboundTunnels()

      How many active outbound tunnels we have.

    - #### getParticipatingTunnels

          public int getParticipatingTunnels()

      How many tunnels we are participating in.

    - #### getReachability

          public SidebarHelper.NetworkStateMessage getReachability()

    - #### getRequestURI

          public String getRequestURI()

      Returns:
        non-null; "/home" if (strangely) not set by jsp

    - #### getRestartStatus

          public String getRestartStatus()

      The restart status and buttons

    - #### getSecondKBps

          public String getSecondKBps()

      Returns:
        "x.xx / y.yy {K|M}"

    - #### getShareRatio

          public String getShareRatio()

    - #### getStoredRouterInfos

          public int getStoredRouterInfos()

    - #### getSummaryBarSections

          public List<String> getSummaryBarSections(String page)

    - #### getSystemLoad

          public int getSystemLoad()

      Retrieve System Load Average as a percentage.

    - #### getTunnelBuildSuccess

          public int getTunnelBuildSuccess()

      Retrieve Tunnel build success as a percentage. Uses the maximum of 1-minute and 10-minute averages to show the better view.

    - #### getTunnelLag

          public String getTunnelLag()

      How long it takes us to test our tunnels, averaged over the last 10 minutes (pretty printed with the units attached)

    - #### getTunnelStatus

          public String getTunnelStatus()

    - #### getUnreachablePeers

          public int getUnreachablePeers()

      How many peers are unreachable.

    - #### getUpdateNonce

          public String getUpdateNonce()

    - #### getUpdateStatus

          public String getUpdateStatus()

      The update status and buttons

    - #### getUptime

          public String getUptime()

      Retrieve a pretty printed uptime count (ala 4d or 7h or 39m)

    - #### getVersion

          public String getVersion()

      Retrieve the version number of the router.

    - #### getWellIntegratedPeers

          public int getWellIntegratedPeers()

      How many active peers the router ranks as well integrated.

    - #### isAdvanced

          public boolean isAdvanced()

      Description copied from class: `HelperBase`
      Check if advanced mode is enabled.
      Overrides:
        `isAdvanced` in class `HelperBase`
      Returns:
        true if advanced mode is enabled

    - #### isI2PTunnelRunning

          public boolean isI2PTunnelRunning()

      Are both the webapp and TCG running?

    - #### renderSummaryBar

          public void renderSummaryBar()
                                throws IOException

      output the summary bar to _out
      Throws:
        `IOException`

    - #### saveSummaryBarSections

          static void saveSummaryBarSections(RouterContext ctx,
                                             String page,
                                             Map<Integer,String> sections)

    - #### setAction

          public void setAction(String s)

    - #### setConsoleNonce

          public void setConsoleNonce(String s)

    - #### setRequestURI

          public void setRequestURI(String s)

    - #### setUpdateNonce

          public void setUpdateNonce(String s)

    - #### showFirewallWarning

          public boolean showFirewallWarning()

      Should we warn about a possible firewall problem?

    - #### storeNewsHelper

          public void storeNewsHelper(NewsHelper n)

    - #### unifiedSidebar

          public boolean unifiedSidebar()