java.lang.Object
net.i2p.router.web.helpers.ClientSKMDebugHelper
Renders every client ratchet session key manager as one table, with a thead/tbody/tfoot section per client as on the update manager page, so the columns align across all clients. Inbound tag sets, outbound sessions and outbound tag sets share the column grid. Cells that do not apply to a row's kind show an em-dash. The tfoot carries the client's session counters. Clients whose SKM has no ratchet part (plain ElGamal) keep their own tag-status rendering below the table.
Field Summary
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionprivate static voidappendRatchet(RouterContext ctx, StringBuilder sections, String title, RatchetSKM rskm) Appends one ratchet's debug rows under a title.(package private) static StringbuildSection(String title, List<String[]> rows, String summary) Build one thead/tbody/tfoot section with the default english columns and no peer rendering.(package private) static StringbuildSection(String title, List<String[]> rows, String summary, String columns, int peerCol, java.util.function.Function<String, String> peerRenderer) Build one thead/tbody/tfoot section.private static StringclientTitle(RouterContext ctx, Destination dest, Hash h) The client's nickname when its inbound tunnel has one, otherwise the base32 destination.private static Stringcolumns(RouterContext ctx) The column header row, translated.private static voidlegacySection(Writer out, String title, SessionKeyManager skm) Pre-ratchet SKMs keep their own tag-status rendering.Turns a base64 key-hash cell into a destination reference: the peer of a client session is a destination, never a router, so no router-info markup (flag, bandwidth) applies and there is nothing to look up.static voidrender(RouterContext ctx, Writer out) Write the consolidated table, one section per distinct client ratchet SKM (unwrapping the muxed variants), plus the legacy status section for each client whose SKM has no ratchet part (plain ElGamal).
Field Details
COLUMNS
The column headers of the debug page's tables- See Also:
Constructor Details
ClientSKMDebugHelper
private ClientSKMDebugHelper()Static helpers only, no instances.
Method Details
columns
The column header row, translated.- Parameters:
ctx- the router context for the translation bundle- Returns:
- the header row html
render
Write the consolidated table, one section per distinct client ratchet SKM (unwrapping the muxed variants), plus the legacy status section for each client whose SKM has no ratchet part (plain ElGamal).- Parameters:
ctx- the router contextout- where to write- Throws:
IOException- if writing to out fails
appendRatchet
private static void appendRatchet(RouterContext ctx, StringBuilder sections, String title, RatchetSKM rskm) Appends one ratchet's debug rows under a title.- Parameters:
ctx- the router contextsections- the page sections being builttitle- the heading for this ratchetrskm- the ratchet to report on
peerRenderer
Turns a base64 key-hash cell into a destination reference: the peer of a client session is a destination, never a router, so no router-info markup (flag, bandwidth) applies and there is nothing to look up. Shows the short hash with the full hash as title. Falls back to the label itself when it is not a hash (e.g. the "null" key).- Returns:
- a function mapping the cell text to html
legacySection
private static void legacySection(Writer out, String title, SessionKeyManager skm) throws IOException Pre-ratchet SKMs keep their own tag-status rendering.- Parameters:
out- where the section HTML is writtentitle- the client title, already HTML-escaped, used in the headingskm- the key manager that renders its own status HTML- Throws:
IOException- if the writer fails partway through the section
clientTitle
The client's nickname when its inbound tunnel has one, otherwise the base32 destination.- Parameters:
ctx- the router context whose tunnel manager is asked for the settingsdest- the client's destination, shown as base32 when there is no nicknameh- the client's hash, used to look up the inbound tunnel settings- Returns:
- the escaped nickname, or the base32 destination wrapped in a span
buildSection
Build one thead/tbody/tfoot section with the default english columns and no peer rendering. Package-visible for testing.- Parameters:
title- the client title htmlrows- unified rows fromRatchetSKM.getDebugRows()summary- the counters line, or null for no tfoot- Returns:
- the section html, never null
buildSection
static String buildSection(String title, List<String[]> rows, String summary, String columns, int peerCol, java.util.function.Function<String, String> peerRenderer) Build one thead/tbody/tfoot section. The title is pre-escaped html. The cell at peerCol is passed through peerRenderer (trusted html, e.g. a router-info reference) instead of being escaped. Package-visible for testing.- Parameters:
title- the client title htmlrows- unified rows fromRatchetSKM.getDebugRows()summary- the counters line, or null for no tfootcolumns- the translated header row htmlpeerCol- index of the peer column, or -1 for nonepeerRenderer- renders the peer cell html, or null to escape it- Returns:
- the section html, never null