java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.ConfigPeerHelper
Helper for peer configuration page rendering and form processing.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intMost peers listed on the page, however many are configured.Fields 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 TypeMethodDescriptionGet the blocklist summary HTML.booleanDetermine whether the given peer hash is banned.private static byte[]toIPBytes(BigInteger bi) Convert a (non-negative) two's complement IP to exactly 16 bytes.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
MAX_DISPLAY
private static final int MAX_DISPLAYMost peers listed on the page, however many are configured.- See Also:
Constructor Details
ConfigPeerHelper
public ConfigPeerHelper()Constructs a new ConfigPeerHelper.
Method Details
getBlocklistSummary
Get the blocklist summary HTML.- Returns:
- the blocklist summary HTML
isBanned
Determine whether the given peer hash is banned.- Parameters:
h- the peer hash to check- Returns:
- true if banned, false otherwise
toIPBytes
Convert a (non-negative) two's complement IP to exactly 16 bytes.- Parameters:
bi- the IP address as a non-negative integer- Returns:
- the address as exactly 16 big-endian bytes, zero-padded