class NetDbRenderer extends Object
| Modifier and Type | Field and Description |
|---|---|
int | localLSCountNumber of local lease sets, set during lease set rendering. |
static int | LOOKUP_WAITHow long to wait for a router lookup before giving up. |
static int | LS_LOOKUP_WAITHow long to wait for a remote lease set lookup. |
| Constructor and Description |
|---|
NetDbRenderer(RouterContext ctx)Create a renderer bound to the given context. |
| Modifier and Type | Method and Description |
|---|---|
String | getPeerProfileTier(Hash peer,
boolean fullname)Peer profile tier name or CSS class. |
boolean | isFloodfill()Whether the router is a floodfill. |
Map<String,String> | precacheReverseDNSLookups(Collection<RouterInfo> routers)Pre-resolves reverse DNS for the given routers, returning the cached
results and queuing the rest for background staggered lookups. |
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 | renderLeaseSetListFragment(Writer out,
boolean debug)Renders the leaseset listing and keyspace estimate for the contentonly
fragment mode of the netdb page, reusing the full lease list render. |
void | renderLocalLeaseSetList(Writer out)Renders the local (per-client) leaseset listing, wrapping the lease
tables in the #lsWrapper div so the netdb page refreshes them with the
same contentonly fragment path as the remote listing. |
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, in ordered chunks
of BATCH_SIZE. |
void | renderRoutersToWriter(Collection<RouterInfo> routers,
Writer out,
boolean isLocal,
int page,
int pageSize)Renders a list of RouterInfo objects to the given Writer. |
void | renderRoutersToWriter(Collection<RouterInfo> routers,
Writer out,
boolean isLocal,
int page,
int pageSize,
boolean applyPagination)Renders a list of RouterInfo objects to the 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 static final int LS_LOOKUP_WAIT
public NetDbRenderer(RouterContext ctx)
ctx - the router contextpublic String getPeerProfileTier(Hash peer, boolean fullname)
peer - the peerfullname - if true, return full name; else CSS classpublic boolean isFloodfill()
public Map<String,String> precacheReverseDNSLookups(Collection<RouterInfo> routers)
routers - routers whose primary IPs 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 infoIOException - if an I/O error occurspublic 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 clientIOException - if an I/O error occurspublic void renderLeaseSetListFragment(Writer out, boolean debug) throws IOException
out - outputdebug - if true, show debug infoIOException - if an I/O error occurspublic void renderLocalLeaseSetList(Writer out) throws IOException
out - outputIOException - if an I/O error occurspublic 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 - if an I/O error occurs