java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.ConfigReseedHelper
Helper for reseed configuration page rendering and form processing.
Field Summary
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 TypeMethodDescriptiongetAuth()Retrieve whether proxy authentication is enabled.Retrieve whether proxy reseeding is enabled.getHost()Retrieve the configured proxy host for reseeding.Retrieve the configured proxy password for reseeding.Retrieve the configured SSL proxy password for reseeding.getPort()Retrieve the configured proxy port for reseeding.Retrieve the configured reseed URLs as a newline-separated string.getSauth()Retrieve whether SSL proxy authentication is enabled.getShost()Retrieve the configured SSL proxy host for reseeding.getSport()Retrieve the configured SSL proxy port for reseeding.Retrieve the configured SSL proxy username for reseeding.Retrieve the configured proxy username for reseeding.modeChecked(int mode) Check whether the given SSL mode matches the current configuration.pmodeChecked(int mode) Check whether the given proxy mode matches the current proxy configuration.The reseed URLs the reseed job is currently working through.booleanDetermine if any HTTP reseed URLs are configured.booleanDetermine if any HTTPS reseed URLs are configured.booleanDetermine if both HTTP and HTTPS reseed URLs are available.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.
Constructor Details
ConfigReseedHelper
public ConfigReseedHelper()Create a new helper for reseed configuration.
Method Details
getPort
Retrieve the configured proxy port for reseeding.- Returns:
- the proxy port, or empty string if not set
getHost
Retrieve the configured proxy host for reseeding.- Returns:
- the proxy host, or empty string if not set
getUsername
Retrieve the configured proxy username for reseeding.- Returns:
- the proxy username
getNofilter_password
Retrieve the configured proxy password for reseeding.- Returns:
- the proxy password
getSport
Retrieve the configured SSL proxy port for reseeding.- Returns:
- the SSL proxy port
getShost
Retrieve the configured SSL proxy host for reseeding.- Returns:
- the SSL proxy host
getSusername
Retrieve the configured SSL proxy username for reseeding.- Returns:
- the SSL proxy username
getNofilter_spassword
Retrieve the configured SSL proxy password for reseeding.- Returns:
- the SSL proxy password
modeChecked
Check whether the given SSL mode matches the current configuration.- Parameters:
mode- the mode to check (0=optional, 1=required, 2=disabled)- Returns:
- the CHECKED constant if mode matches, empty string otherwise
pmodeChecked
Check whether the given proxy mode matches the current proxy configuration.- Parameters:
mode- the proxy mode to check (0=disabled, 1=HTTP, 2=SOCKS4, 3=SOCKS5, 4=INTERNAL)- Returns:
- the CHECKED constant if mode matches, empty string otherwise
getEnable
Retrieve whether proxy reseeding is enabled.- Returns:
- the CHECKED constant if enabled, empty string otherwise
getAuth
Retrieve whether proxy authentication is enabled.- Returns:
- the CHECKED constant if auth enabled, empty string otherwise
getSauth
Retrieve whether SSL proxy authentication is enabled.- Returns:
- the CHECKED constant if auth enabled, empty string otherwise
reseedList
getReseedURL
Retrieve the configured reseed URLs as a newline-separated string.- Returns:
- the reseed URLs, one per line
shouldShowSelect
public boolean shouldShowSelect()Determine if both HTTP and HTTPS reseed URLs are available.- Returns:
- true only if we have both http and https URLs
shouldShowHTTPProxy
public boolean shouldShowHTTPProxy()Determine if any HTTP reseed URLs are configured.- Returns:
- true only if we have a http URL
shouldShowHTTPSProxy
public boolean shouldShowHTTPSProxy()Determine if any HTTPS reseed URLs are configured.- Returns:
- true only if we have a https URL