java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.ConfigTunnelsHelper
Helper for tunnels configuration page rendering and form processing.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classSort tunnels by the name of the tunnel.Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringTo fool xgettext so the following isn't tagged.private static final StringForm field prefix of the hop settings.private static final intBackup tunnels allowed in the advanced form.private static final intTunnel length allowed in the advanced form.private static final intTunnel quantity allowed in the advanced form.private static final intTunnel length allowed in the basic form.private static final intTunnel quantity allowed in the basic form.private static final intHop length variance allowed.private static final intMost negative hop length variance allowed.private static final StringForm field prefix of the tunnel settings.private static final intTunnel length that warns in the basic form.private static final intTunnel quantity that warns in the basic form.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 TypeMethodDescriptiongetForm()Render the tunnel configuration form.private StringGet display name for the tunnel.private voidrenderForm(StringBuilder buf, int index, String prefix, String name, TunnelPoolSettings in, TunnelPoolSettings out) Renders the tuning form for one tunnel.private voidrenderOptions(StringBuilder buf, int min, int max, int now, String prefix, String name) Renders the number options from min to max.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
HOP
TUNNEL
Form field prefix of the tunnel settings.- See Also:
WARN_LENGTH
private static final int WARN_LENGTHTunnel length that warns in the basic form.- See Also:
MAX_LENGTH
private static final int MAX_LENGTHTunnel length allowed in the basic form.- See Also:
MAX_ADVANCED_LENGTH
private static final int MAX_ADVANCED_LENGTHTunnel length allowed in the advanced form.- See Also:
WARN_QUANTITY
private static final int WARN_QUANTITYTunnel quantity that warns in the basic form.- See Also:
MAX_QUANTITY
private static final int MAX_QUANTITYTunnel quantity allowed in the basic form.- See Also:
MAX_ADVANCED_QUANTITY
private static final int MAX_ADVANCED_QUANTITYTunnel quantity allowed in the advanced form.- See Also:
MAX_ADVANCED_BACKUP_QUANTITY
private static final int MAX_ADVANCED_BACKUP_QUANTITYBackup tunnels allowed in the advanced form.- See Also:
MAX_VARIANCE
MIN_NEG_VARIANCE
private static final int MIN_NEG_VARIANCEMost negative hop length variance allowed.- See Also:
DUMMY2
To fool xgettext so the following isn't tagged.- See Also:
Constructor Details
ConfigTunnelsHelper
public ConfigTunnelsHelper()Creates a helper for the tunnels config page.
Method Details
getForm
getTunnelName
Get display name for the tunnel.- Parameters:
ins- the inbound tunnel pool settings to name- Returns:
- the tunnel name
renderForm
private void renderForm(StringBuilder buf, int index, String prefix, String name, TunnelPoolSettings in, TunnelPoolSettings out) Renders the tuning form for one tunnel.- Parameters:
buf- the buffer to render intoindex- the tunnel numberprefix- the form field prefixname- the tunnel namein- the inbound pool settingsout- the outbound pool settings
renderOptions
private void renderOptions(StringBuilder buf, int min, int max, int now, String prefix, String name) Renders the number options from min to max.- Parameters:
buf- the buffer to render intomin- the smallest value offeredmax- the largest value offerednow- the value selectedprefix- the form field prefixname- the field name