java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.InfoHelper
Helper for router information page rendering and form processing.
Field Summary
FieldsFields inherited from class HelperBase
_context, _log, _out, CHECKED, PROP_ADVANCED, SELECTEDModifier and TypeFieldDescriptionprotected RouterContextThe router context.protected LogThe log instance.protected WriterThe writer for output.static final StringChecked attribute for HTML checkboxes.static final StringProperty key for advanced mode.static final StringSelected attribute for HTML select options.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionbwIn()The inbound bandwidth limit in force.bwOut()The outbound bandwidth limit in force.bwShare()The share of total bandwidth offered to other routers.The CoDel queue target interval in force.The CoDel queue delay target in force.When this router was first installed.The version running when this router was first installed.The build date of the ASN database in use.Render the router status page, or write it to the output stream.The number of processor cores available to the router.The address family this router publishes, as set in its RouterInfo.The build date of the GeoIP database in use.getStats()Render the bandwidth and peer statistics section.getUdpIP()The host part of the address the transport is published under.The port the UDP transport is published under.booleanWhether this machine is too slow to run a router well.The country code of the last tunnel or peer this router saw.When an update was last installed.private voidrenderStatusHTML(Writer out) Writes the status page's HTML.voidRecord whether the page renders in full rather than as a summary.Whether development SU3 updates are offered.The update policy in force.Whether updates may be installed without a signature.Methods inherited from class HelperBase
_t, _t, _t, _x, getChecked, isAdvanced, ngettext, setContextId, storeWriterModifier and TypeMethodDescriptionTranslate a string.Translate a string with a parameter.Translate a string with two parameters.static StringMark a string for extraction by xgettext and translation.protected StringgetChecked(String prop) Get the checked attribute for a boolean property.booleanCheck if advanced mode is enabled.Translate a string with plural forms (ngettext).voidsetContextId(String contextId) Configure this bean to query a particular router context.voidstoreWriter(Writer out) Store the writer for output.
Field Details
_full
private boolean _fullSet when the full status page is shown.
Constructor Details
InfoHelper
public InfoHelper()Create a helper for the router information page.
Method Details
setFull
Record whether the page renders in full rather than as a summary.- Parameters:
f- the flag; any non-null, non-empty value counts as true
getConsole
Render the router status page, or write it to the output stream.- Returns:
- the console as HTML, or an empty string when it was written directly to the output stream instead
getStats
getUdpIP
The host part of the address the transport is published under.- Returns:
- host or "unknown"
lastCountry
The country code of the last tunnel or peer this router saw.- Returns:
- the country code, or null when none has been recorded
getUdpPort
firstInstalled
When this router was first installed.- Returns:
- the date, or null when it has never been recorded
firstVersion
The version running when this router was first installed.- Returns:
- the version, or null when it has never been recorded
lastUpdated
When an update was last installed.- Returns:
- the date, or null when no update has been installed
updatePolicy
The update policy in force.- Returns:
- the policy, or null when none has been set
updateDevSU3
Whether development SU3 updates are offered.- Returns:
- the stored setting, or null when it has never been set
updateUnsigned
Whether updates may be installed without a signature.- Returns:
- the stored setting, or "true" when it has never been set
isRouterSlow
public boolean isRouterSlow()Whether this machine is too slow to run a router well.- Returns:
- whether router slow
getCoreCount
The number of processor cores available to the router.- Returns:
- the core count
bwIn
The inbound bandwidth limit in force.- Returns:
- the limit in KB/s, or the built-in default when unset
bwOut
The outbound bandwidth limit in force.- Returns:
- the limit in KB/s, or the built-in default when unset
codelInterval
The CoDel queue target interval in force.- Returns:
- the interval in ms, or the built-in default when unset
codelTarget
The CoDel queue delay target in force.- Returns:
- the target in ms, or the built-in default when unset
getFamily
The address family this router publishes, as set in its RouterInfo.- Returns:
- the family name, or null when the RouterInfo omits it
getGeoIPBuildInfo
The build date of the GeoIP database in use.- Returns:
- the geo IP build info
getASNBuildInfo
The build date of the ASN database in use.- Returns:
- the a s n build info
renderStatusHTML
Writes the status page's HTML.- Parameters:
out- where the page is written- Throws:
IOException- if the writer fails