class NetDbRenderer extends Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
NetDbRenderer.RAComparator
Comparator for router addresses by transport then host.
|
| Modifier and Type | Field and Description |
|---|---|
int |
localLSCount |
static int |
LOOKUP_WAIT |
| Constructor and Description |
|---|
NetDbRenderer(RouterContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
enableReverseLookups() |
String |
getPeerProfileTier(Hash peer,
boolean fullname)
Gets the peer profile tier name.
|
boolean |
isFloodfill() |
void |
precacheIntroducerInfos()
Precaches RouterInfo for all known introducers by querying the network database.
|
Map<String,String> |
precacheReverseDNSLookups(Collection<RouterInfo> routers)
Precache reverse DNS lookups for a collection of RouterInfo entries.
|
void |
renderLeaseSet(Writer out,
String hostname,
boolean debug)
Renders a single leaseset by hostname or b32.
|
void |
renderLeaseSetHTML(Writer out,
boolean debug,
Hash client)
Renders all leasesets.
|
void |
renderLocalSummary(Writer out)
Renders the local leaseset summary header (hidden until JS shows it).
|
void |
renderRouterInfoHTML(Writer out,
int pageSize,
int page,
String routerPrefix,
String version,
String country,
String family,
String capabilities,
String ipAddress,
String sybil,
int port,
int highPort,
SigType signatureType,
EncType encryptionType,
String mtu,
String ipv6Address,
String ssuCapabilities,
String transport,
int cost,
int introducerCount)
Renders router information matching search criteria to the given writer.
|
String |
renderRouterInfosInParallel(Collection<RouterInfo> routerInfos,
boolean isLocalRouter)
Renders multiple RouterInfo objects in parallel.
|
void |
renderRoutersToWriter(Collection<RouterInfo> routers,
Writer out,
boolean isLocal,
int page,
int pageSize)
Renders a list of RouterInfo objects to given Writer.
|
void |
renderRoutersToWriter(Collection<RouterInfo> routers,
Writer out,
boolean isLocal,
int page,
int pageSize,
boolean applyPagination)
Renders a list of RouterInfo objects to given Writer.
|
void |
renderStatusHTML(Writer out,
int pageSize,
int page,
int mode)
Renders the network database status page.
|
public int localLSCount
public static final int LOOKUP_WAIT
public NetDbRenderer(RouterContext ctx)
public boolean enableReverseLookups()
public String getPeerProfileTier(Hash peer, boolean fullname)
peer - the peer hashfullname - if true, return full name; else CSS classpublic boolean isFloodfill()
public void precacheIntroducerInfos()
public Map<String,String> precacheReverseDNSLookups(Collection<RouterInfo> routers)
routers - Collection of RouterInfo objects to resolvepublic void renderLeaseSet(Writer out, String hostname, boolean debug) throws IOException
out - Writer to output HTMLhostname - the destination b32, full hash, or hostnamedebug - if true, show debug infoIOExceptionpublic void renderLeaseSetHTML(Writer out, boolean debug, Hash client) throws IOException
out - Writer to output HTMLdebug - if true, sort by distance and show debug infoclient - if non-null, render only leasesets for that clientIOExceptionpublic void renderLocalSummary(Writer out) throws IOException
IOExceptionpublic void renderRouterInfoHTML(Writer out, int pageSize, int page, String routerPrefix, String version, String country, String family, String capabilities, String ipAddress, String sybil, int port, int highPort, SigType signatureType, EncType encryptionType, String mtu, String ipv6Address, String ssuCapabilities, String transport, int cost, int introducerCount) throws IOException
out - Writer to output HTMLpageSize - number of results per pagepage - zero-based page indexrouterPrefix - optional base64 hash prefix to filter routers (null for all)version - optional version string to filter routerscountry - optional country code(s) (comma/space separated) to filter routersfamily - optional router family name to filter routerscapabilities - optional capability characters (e.g. "fK") to match allipAddress - optional IPv4 address or prefix to filter routerssybil - optional; if non-null, collects hashes for Sybil analysisport - optional port or start of range (used with highPort)highPort - optional end of port rangesignatureType - optional signature type to filter routersencryptionType - optional encryption type to filter routersmtu - optional MTU value to filter routersipv6Address - optional IPv6 address or prefix to filter routersssuCapabilities - optional SSU capability characters to matchtransport - optional transport style (e.g., "NTCP", "SSU")cost - optional cost value to filter router addressesintroducerCount - unusedIOException - if writing failspublic String renderRouterInfosInParallel(Collection<RouterInfo> routerInfos, boolean isLocalRouter)
routerInfos - collection of routers to renderisLocalRouter - true if rendering the local routerpublic void renderRoutersToWriter(Collection<RouterInfo> routers, Writer out, boolean isLocal, int page, int pageSize) throws IOException
IOExceptionpublic void renderRoutersToWriter(Collection<RouterInfo> routers, Writer out, boolean isLocal, int page, int pageSize, boolean applyPagination) throws IOException
applyPagination - whether to apply pagination internally (false if list is already paginated)IOExceptionpublic void renderStatusHTML(Writer out, int pageSize, int page, int mode) throws IOException
out - Writer to output HTMLpageSize - number of routers per pagepage - zero-based page indexmode - rendering mode:
0 = summary charts,
1 = full router infos,
2 = compact router infos,
3 = summary charts sorted by country countIOException