public class CommSystemFacadeImpl extends CommSystemFacade
CommSystemFacade.StatusROUTER_BUNDLE_NAME, STATUS_DIFFERENT, STATUS_DISCONNECTED, STATUS_HOSED, STATUS_IPV4_DISABLED_IPV6_FIREWALLED, STATUS_IPV4_DISABLED_IPV6_OK, STATUS_IPV4_DISABLED_IPV6_UNKNOWN, STATUS_IPV4_FIREWALLED_IPV6_OK, STATUS_IPV4_FIREWALLED_IPV6_UNKNOWN, STATUS_IPV4_OK_IPV6_FIREWALLED, STATUS_IPV4_OK_IPV6_UNKNOWN, STATUS_IPV4_SNAT_IPV6_OK, STATUS_IPV4_SNAT_IPV6_UNKNOWN, STATUS_IPV4_UNKNOWN_IPV6_FIREWALLED, STATUS_IPV4_UNKNOWN_IPV6_OK, STATUS_OK, STATUS_REJECT_UNSOLICITED, STATUS_UNKNOWN| Constructor and Description |
|---|
CommSystemFacadeImpl(RouterContext context) |
| Modifier and Type | Method and Description |
|---|---|
int |
countActivePeers()
How many peers are we currently connected to, that we have
sent a message to or received a message from in the last five minutes.
|
int |
countActiveSendPeers()
How many peers are we currently connected to, that we have
sent a message to in the last minute.
|
List<RouterAddress> |
createAddresses()
Create the list of RouterAddress structures based on the router's config
|
void |
forceDisconnect(net.i2p.data.Hash peer)
Tell the comm system to disconnect from this peer.
|
String |
getCountry(net.i2p.data.Hash peer)
Uses the transport IP first because that lookup is fast,
then the IP from the netDb.
|
String |
getCountryName(String c)
full name for a country code, or the code if we don't know the name
|
DHSessionKeyBuilder.Factory |
getDHFactory()
Hook for pluggable transport creation.
|
Set<net.i2p.data.Hash> |
getEstablished()
Get all the peers we are connected to.
|
long |
getFramedAveragePeerClockSkew(int percentToInclude)
Return framed average clock skew of connected peers in seconds, or null if we cannot answer.
|
byte[] |
getIP(net.i2p.data.Hash peer) |
String |
getLocalizedStatusString()
getStatus().toStatusString(), translated if available.
|
List<String> |
getMostRecentErrorMessages() |
String |
getOurCountry() |
CommSystemFacade.Status |
getStatus()
Determine under what conditions we are remotely reachable.
|
SortedMap<String,Transport> |
getTransports() |
X25519KeyFactory |
getXDHFactory()
Factory for making X25519 key pairs.
|
boolean |
haveHighOutboundCapacity() |
boolean |
haveInboundCapacity(int pct) |
boolean |
haveOutboundCapacity(int pct) |
void |
initGeoIP()
Router must call after netdb is initialized
|
boolean |
isBacklogged(net.i2p.data.Hash peer) |
boolean |
isDummy()
Is everything disabled for testing?
|
boolean |
isEstablished(net.i2p.data.Hash peer) |
boolean |
isInStrictCountry()
Are we in a strict country
|
boolean |
isInStrictCountry(net.i2p.data.Hash peer)
Are they in a strict country.
|
boolean |
isInStrictCountry(RouterInfo ri)
Are they in a strict country
|
void |
mayDisconnect(net.i2p.data.Hash peer)
Tell the comm system that we may disconnect from this peer.
|
void |
notifyRemoveAddress(boolean ipv6)
Tell other transports our address changed
|
void |
notifyRemoveAddress(RouterAddress address)
Tell other transports our address changed
|
void |
notifyReplaceAddress(RouterAddress udpAddr)
UDP changed addresses, tell NTCP and restart
All the work moved to NTCPTransport.externalAddressReceived()
|
void |
processMessage(OutNetMessage msg)
Send the message out
|
void |
queueLookup(byte[] ip) |
void |
recheckReachability()
Deprecated.
unused
|
void |
registerTransport(Transport t)
Pluggable transports.
|
String |
renderPeerHTML(net.i2p.data.Hash peer)
Provide a consistent "look" for displaying router IDs in the console
|
void |
renderStatusHTML(Writer out,
String urlBase,
int sortFlags)
As of 0.9.31, only outputs UPnP status
Warning - blocking, very slow, queries the active UPnP router,
will take many seconds if it has vanished.
|
void |
restart()
Perform a soft restart.
|
void |
shutdown()
Cannot be restarted after calling this.
|
void |
startup()
Instruct the service that it should start normal operation.
|
void |
unregisterTransport(Transport t)
Pluggable transports.
|
boolean |
wasUnreachable(net.i2p.data.Hash peer) |
getMedianPeerClockSkew, getReachabilityStatus, renderStatusHTMLpublic CommSystemFacadeImpl(RouterContext context)
public void startup()
Servicepublic void shutdown()
public void restart()
Servicepublic int countActivePeers()
countActivePeers in class CommSystemFacadepublic int countActiveSendPeers()
countActiveSendPeers in class CommSystemFacadepublic boolean haveInboundCapacity(int pct)
haveInboundCapacity in class CommSystemFacadepublic boolean haveOutboundCapacity(int pct)
haveOutboundCapacity in class CommSystemFacadepublic boolean haveHighOutboundCapacity()
haveHighOutboundCapacity in class CommSystemFacadepublic long getFramedAveragePeerClockSkew(int percentToInclude)
CommSystemFacadegetFramedAveragePeerClockSkew in class CommSystemFacadepercentToInclude - 1-100public void processMessage(OutNetMessage msg)
processMessage in class CommSystemFacadepublic boolean isBacklogged(net.i2p.data.Hash peer)
isBacklogged in class CommSystemFacadepublic boolean isEstablished(net.i2p.data.Hash peer)
isEstablished in class CommSystemFacadepublic Set<net.i2p.data.Hash> getEstablished()
CommSystemFacadegetEstablished in class CommSystemFacadepublic boolean wasUnreachable(net.i2p.data.Hash peer)
wasUnreachable in class CommSystemFacadepublic byte[] getIP(net.i2p.data.Hash peer)
getIP in class CommSystemFacadepublic void mayDisconnect(net.i2p.data.Hash peer)
mayDisconnect in class CommSystemFacadepublic void forceDisconnect(net.i2p.data.Hash peer)
forceDisconnect in class CommSystemFacadepublic List<String> getMostRecentErrorMessages()
getMostRecentErrorMessages in class CommSystemFacadepublic CommSystemFacade.Status getStatus()
CommSystemFacadegetStatus in class CommSystemFacadepublic String getLocalizedStatusString()
getLocalizedStatusString in class CommSystemFacade@Deprecated public void recheckReachability()
recheckReachability in class CommSystemFacadepublic void renderStatusHTML(Writer out, String urlBase, int sortFlags) throws IOException
renderStatusHTML in class CommSystemFacadeIOExceptionpublic SortedMap<String,Transport> getTransports()
getTransports in class CommSystemFacadepublic List<RouterAddress> createAddresses()
CommSystemFacadecreateAddresses in class CommSystemFacadepublic void notifyReplaceAddress(RouterAddress udpAddr)
notifyReplaceAddress in class CommSystemFacadeudpAddr - may be null; or udpAddr's host/IP may be nullpublic void notifyRemoveAddress(RouterAddress address)
notifyRemoveAddress in class CommSystemFacadeaddress - non-null; but address's host/IP may be nullpublic void notifyRemoveAddress(boolean ipv6)
notifyRemoveAddress in class CommSystemFacadepublic void registerTransport(Transport t)
registerTransport in class CommSystemFacadepublic void unregisterTransport(Transport t)
unregisterTransport in class CommSystemFacadepublic DHSessionKeyBuilder.Factory getDHFactory()
getDHFactory in class CommSystemFacadepublic X25519KeyFactory getXDHFactory()
getXDHFactory in class CommSystemFacadepublic void initGeoIP()
initGeoIP in class CommSystemFacadepublic void queueLookup(byte[] ip)
queueLookup in class CommSystemFacadeip - ipv4 or ipv6public String getOurCountry()
getOurCountry in class CommSystemFacadepublic boolean isInStrictCountry()
isInStrictCountry in class CommSystemFacadepublic boolean isInStrictCountry(net.i2p.data.Hash peer)
isInStrictCountry in class CommSystemFacadepeer - non-nullpublic boolean isInStrictCountry(RouterInfo ri)
isInStrictCountry in class CommSystemFacaderi - non-nullpublic String getCountry(net.i2p.data.Hash peer)
getCountry in class CommSystemFacadepeer - not ourselves - use getOurCountry() for thatpublic String getCountryName(String c)
getCountryName in class CommSystemFacadepublic String renderPeerHTML(net.i2p.data.Hash peer)
renderPeerHTML in class CommSystemFacadepublic boolean isDummy()
isDummy in class CommSystemFacade