java.lang.Object
org.klomp.snark.web.I2PSnarkServlet.FooterContext
Enclosing class:
I2PSnarkServlet

static class I2PSnarkServlet.FooterContextextends Object
Aggregated footer state, replacing a twelve-parameter signature. Package-visible for testing.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final DHT
    The DHT for the debug row, null when DHT is disabled.
    (package private) final boolean
    At least one listed torrent has a connected peer.
    (package private) final boolean
    The router is connected to the I2P network.
    (package private) final boolean
    At least one listed torrent has a non-zero upload rate.
    (package private) final boolean
    No torrents are loaded.
    (package private) final String
    The peer parameter controlling peer display, may be null.
    (package private) final boolean
    Running without a parent I2P router.
    (package private) final long[]
    Rate and transfer counters indexed by the STAT_* constants.
    (package private) final int
    Number of torrents on the page.
    (package private) final long
    Summed ETA of the listed torrents in seconds, 0 if not computable.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FooterContext(long[] stats, long totalETA, int total, boolean isConnected, boolean noSnarks, boolean hasPeers, boolean isUploading, DHT dht, boolean standalone, String peerParam)
    Collects the values the footer renders, so callers do not pass twelve arguments.
  • Method Summary

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • stats

      final long[] stats
      Rate and transfer counters indexed by the STAT_* constants.
    • totalETA

      final long totalETA
      Summed ETA of the listed torrents in seconds, 0 if not computable.
    • total

      final int total
      Number of torrents on the page.
    • isConnected

      final boolean isConnected
      The router is connected to the I2P network.
    • noSnarks

      final boolean noSnarks
      No torrents are loaded.
    • hasPeers

      final boolean hasPeers
      At least one listed torrent has a connected peer.
    • isUploading

      final boolean isUploading
      At least one listed torrent has a non-zero upload rate.
    • dht

      final DHT dht
      The DHT for the debug row, null when DHT is disabled.
    • standalone

      final boolean standalone
      Running without a parent I2P router.
    • peerParam

      final String peerParam
      The peer parameter controlling peer display, may be null.
  • Constructor Details

    • FooterContext

      FooterContext(long[] stats, long totalETA, int total, boolean isConnected, boolean noSnarks, boolean hasPeers, boolean isUploading, DHT dht, boolean standalone, String peerParam)
      Collects the values the footer renders, so callers do not pass twelve arguments.
      Parameters:
      stats - rate and transfer counters indexed by the STAT_* constants
      totalETA - summed ETA of the listed torrents in seconds
      total - number of torrents on the page
      isConnected - the router is connected to the I2P network
      noSnarks - no torrents are loaded
      hasPeers - at least one listed torrent has a connected peer
      isUploading - at least one listed torrent has a non-zero upload rate
      dht - the DHT for the debug row, null when disabled
      standalone - running without a parent I2P router
      peerParam - the peer parameter controlling peer display, may be null