Package net.i2p.router.web.helpers
Class SummaryHelper
- java.lang.Object
-
- net.i2p.router.web.HelperBase
-
- net.i2p.router.web.helpers.SummaryHelper
-
public class SummaryHelper 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 Description static class
SummaryHelper.NetworkState
static class
SummaryHelper.NetworkStateMessage
State message to be displayed to the user in the summary bar.
-
Field Summary
Fields Modifier and Type Field Description (package private) static String
DEFAULT_FULL
(package private) static String
DEFAULT_FULL_ADVANCED
(package private) static String
DEFAULT_MINIMAL
(package private) static String
DEFAULT_MINIMAL_ADVANCED
(package private) static String
PROP_SUMMARYBAR
(package private) static String
THINSP
-
Fields inherited from class net.i2p.router.web.HelperBase
_context, _out, CHECKED, PROP_ADVANCED, SELECTED
-
-
Constructor Summary
Constructors Constructor Description SummaryHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowReseed()
allowReseedString
getAction()
int
getActivePeers()
How many peers we are talking to nowint
getActiveProfiles()
How many active identities have we spoken with recentlyint
getAllPeers()
subtract one for ourselves, so if we know no other peers it displays zeroint
getBanlistedPeers()
How many peers are banned.String
getConfigTable()
String
getConsoleNonce()
String
getDestinations()
Client destinations connected locally.int
getFailingPeers()
How many peers the router ranks as failing.int
getFastPeers()
How many active peers the router ranks as fast.String
getFirewallAndReseedStatus()
The firewall status and reseed status/buttonsString
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
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.SummaryHelper.NetworkStateMessage
getReachability()
String
getRequestURI()
String
getRestartStatus()
The restart status and buttonsString
getSecondKBps()
String
getShareRatio()
List<String>
getSummaryBarSections(String page)
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()
String
getUpdateNonce()
String
getUpdateStatus()
The update status and buttonsString
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.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)
-
Methods inherited from class net.i2p.router.web.HelperBase
_t, _t, _t, _x, getChecked, isAdvanced, ngettext, setContextId, storeWriter
-
-
-
-
Field Detail
-
THINSP
static final String THINSP
- See Also:
- Constant Field Values
-
PROP_SUMMARYBAR
static final String PROP_SUMMARYBAR
- See Also:
- Constant Field Values
-
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_MINIMAL
static final String DEFAULT_MINIMAL
- See Also:
- Constant Field Values
-
DEFAULT_MINIMAL_ADVANCED
static final String DEFAULT_MINIMAL_ADVANCED
- Since:
- 0.9.32
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIdent
public String getIdent()
Retrieve the shortened 4 character ident for the router located within the current JVM at the given context.
-
getVersion
public String getVersion()
Retrieve the version number of the router.
-
getUptime
public String getUptime()
Retrieve a pretty printed uptime count (ala 4d or 7h or 39m)
-
allowReseed
public boolean allowReseed()
allowReseed
-
getAllPeers
public int getAllPeers()
subtract one for ourselves, so if we know no other peers it displays zero
-
getReachability
public SummaryHelper.NetworkStateMessage getReachability()
-
getMemory
public String getMemory()
Retrieve amount of used memory.- Since:
- 0.9.32 uncommented
-
getMemoryBar
public String getMemoryBar()
- Since:
- 0.9.32
-
getActivePeers
public int getActivePeers()
How many peers we are talking to now
-
showFirewallWarning
public boolean showFirewallWarning()
Should we warn about a possible firewall problem?
-
getActiveProfiles
public int getActiveProfiles()
How many active identities have we spoken with recently
-
getFastPeers
public int getFastPeers()
How many active peers the router ranks as fast.
-
getHighCapacityPeers
public int getHighCapacityPeers()
How many active peers the router ranks as having a high capacity.
-
getWellIntegratedPeers
public int getWellIntegratedPeers()
How many active peers the router ranks as well integrated.
-
getFailingPeers
public int getFailingPeers()
How many peers the router ranks as failing.- Since:
- 0.9.32 uncommented
-
getBanlistedPeers
public int getBanlistedPeers()
How many peers are banned.- Since:
- 0.9.32 uncommented
-
getSecondKBps
public String getSecondKBps()
- Returns:
- "x.xx / y.yy {K|M}"
-
getFiveMinuteKBps
public String getFiveMinuteKBps()
- Returns:
- "x.xx / y.yy {K|M}"
-
getLifetimeKBps
public String getLifetimeKBps()
- Returns:
- "x.xx / y.yy {K|M}"
-
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)
-
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)
-
getDestinations
public String getDestinations()
Client destinations connected locally.- Returns:
- html section summary
-
getInboundTunnels
public int getInboundTunnels()
How many free inbound tunnels we have.
-
getOutboundTunnels
public int getOutboundTunnels()
How many active outbound tunnels we have.
-
getInboundClientTunnels
public int getInboundClientTunnels()
How many inbound client tunnels we have.
-
getOutboundClientTunnels
public int getOutboundClientTunnels()
How many active outbound client tunnels we have.
-
getParticipatingTunnels
public int getParticipatingTunnels()
How many tunnels we are participating in.
-
getShareRatio
public String getShareRatio()
- Since:
- 0.7.10
-
getJobLag
public String getJobLag()
How lagged our job queue is over the last minute (pretty printed with the units attached)
-
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)
-
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()
-
getInboundBacklog
public String getInboundBacklog()
-
getUpdateStatus
public String getUpdateStatus()
The update status and buttons- Since:
- 0.8.13 moved from SummaryBarRenderer
-
getRestartStatus
public String getRestartStatus()
The restart status and buttons- Since:
- 0.8.13 moved from SummaryBarRenderer
-
getFirewallAndReseedStatus
public String getFirewallAndReseedStatus()
The firewall status and reseed status/buttons- Since:
- 0.9 moved from SummaryBarRenderer
-
storeNewsHelper
public void storeNewsHelper(NewsHelper n)
-
getNewsHelper
public NewsHelper getNewsHelper()
-
saveSummaryBarSections
static void saveSummaryBarSections(RouterContext ctx, String page, Map<Integer,String> sections)
-
renderSummaryBar
public void renderSummaryBar() throws IOException
output the summary bar to _out- Throws:
IOException
-
setAction
public void setAction(String s)
-
getAction
public String getAction()
-
setConsoleNonce
public void setConsoleNonce(String s)
-
getConsoleNonce
public String getConsoleNonce()
-
setUpdateNonce
public void setUpdateNonce(String s)
-
getUpdateNonce
public String getUpdateNonce()
-
setRequestURI
public void setRequestURI(String s)
-
getRequestURI
public String getRequestURI()
- Returns:
- non-null; "/home" if (strangely) not set by jsp
-
getConfigTable
public String getConfigTable()
-
-