class NetDbRenderer extends Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class | NetDbRenderer.RAComparatorComparator for router addresses by transport then host. |
| Modifier and Type | Field and Description |
|---|---|
int | localLSCountLocal ls count. |
static int | LOOKUP_WAITLookup wait. |
static int | LS_LOOKUP_WAIT |
| Constructor and Description |
|---|
NetDbRenderer(RouterContext ctx)Construct a new instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean | enableReverseLookups()enableReverseLookups. |
String | getPeerProfileTier(Hash peer,
boolean fullname)Gets the peer profile tier name. |
boolean | isFloodfill()Whether floodfill. |
void | precacheIntroducerInfos()Precaches RouterInfo for all known introducers by querying the network database. |
Map<String,String> | precacheReverseDNSLookups(Collection<RouterInfo> routers)precacheReverseDNSLookups. |
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)render router info html. |
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 static final int LS_LOOKUP_WAIT
public NetDbRenderer(RouterContext ctx)
public boolean enableReverseLookups()
public String getPeerProfileTier(Hash peer, boolean fullname)
peer - the peerfullname - if true, return full name; else CSS classpublic boolean isFloodfill()
public void precacheIntroducerInfos()
public Map<String,String> precacheReverseDNSLookups(Collection<RouterInfo> routers)
public 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 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
IOExceptionpublic 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