net.i2p.router
Class CommSystemFacade

java.lang.Object
  extended by net.i2p.router.CommSystemFacade
All Implemented Interfaces:
Service
Direct Known Subclasses:
CommSystemFacadeImpl, VMCommSystem

public abstract class CommSystemFacade
extends java.lang.Object
implements Service

Manages the communication subsystem between peers, including connections, listeners, transports, connection keys, etc.


Field Summary
static short STATUS_DIFFERENT
          We are behind a symmetric NAT which will make our 'from' address look differently when we talk to multiple people
static short STATUS_HOSED
          Our detection system is broken (SSU bind port failed)
static short STATUS_OK
          These must be increasing in "badness" (see TransportManager.java), but UNKNOWN must be last.
static short STATUS_REJECT_UNSOLICITED
          We are able to talk to peers that we initiate communication with, but cannot receive unsolicited connections
static short STATUS_UNKNOWN
          Our reachability is unknown
 
Constructor Summary
CommSystemFacade()
           
 
Method Summary
 int countActivePeers()
           
 int countActiveSendPeers()
           
 java.util.Set<RouterAddress> createAddresses()
          Create the set of RouterAddress structures based on the router's config
 java.lang.String getCountry(Hash peer)
           
 java.lang.String getCountryName(java.lang.String code)
           
 long getFramedAveragePeerClockSkew(int percentToInclude)
          Return framed average clock skew of connected peers in seconds, or null if we cannot answer.
 byte[] getIP(Hash dest)
           
 java.lang.Long getMedianPeerClockSkew()
          Median clock skew of connected peers in seconds, or null if we cannot answer.
 java.util.List getMostRecentErrorMessages()
           
 short getReachabilityStatus()
          Determine under what conditions we are remotely reachable.
 boolean haveHighOutboundCapacity()
           
 boolean haveInboundCapacity(int pct)
           
 boolean haveOutboundCapacity(int pct)
           
 boolean isBacklogged(Hash dest)
           
 boolean isEstablished(Hash dest)
           
 void notifyReplaceAddress(RouterAddress UDPAddr)
          Tell other transports our address changed
abstract  void processMessage(OutNetMessage msg)
           
 void queueLookup(byte[] ip)
           
 void recheckReachability()
           
 java.lang.String renderPeerHTML(Hash peer)
           
 void renderStatusHTML(java.io.Writer out)
           
 void renderStatusHTML(java.io.Writer out, java.lang.String urlBase, int sortFlags)
           
 boolean wasUnreachable(Hash dest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.i2p.router.Service
restart, shutdown, startup
 

Field Detail

STATUS_OK

public static final short STATUS_OK
These must be increasing in "badness" (see TransportManager.java), but UNKNOWN must be last. We are able to receive unsolicited connections

See Also:
Constant Field Values

STATUS_DIFFERENT

public static final short STATUS_DIFFERENT
We are behind a symmetric NAT which will make our 'from' address look differently when we talk to multiple people

See Also:
Constant Field Values

STATUS_REJECT_UNSOLICITED

public static final short STATUS_REJECT_UNSOLICITED
We are able to talk to peers that we initiate communication with, but cannot receive unsolicited connections

See Also:
Constant Field Values

STATUS_HOSED

public static final short STATUS_HOSED
Our detection system is broken (SSU bind port failed)

See Also:
Constant Field Values

STATUS_UNKNOWN

public static final short STATUS_UNKNOWN
Our reachability is unknown

See Also:
Constant Field Values
Constructor Detail

CommSystemFacade

public CommSystemFacade()
Method Detail

processMessage

public abstract void processMessage(OutNetMessage msg)

renderStatusHTML

public void renderStatusHTML(java.io.Writer out,
                             java.lang.String urlBase,
                             int sortFlags)
                      throws java.io.IOException
Throws:
java.io.IOException

renderStatusHTML

public void renderStatusHTML(java.io.Writer out)
                      throws java.io.IOException
Specified by:
renderStatusHTML in interface Service
Throws:
java.io.IOException

createAddresses

public java.util.Set<RouterAddress> createAddresses()
Create the set of RouterAddress structures based on the router's config


countActivePeers

public int countActivePeers()

countActiveSendPeers

public int countActiveSendPeers()

haveInboundCapacity

public boolean haveInboundCapacity(int pct)

haveOutboundCapacity

public boolean haveOutboundCapacity(int pct)

haveHighOutboundCapacity

public boolean haveHighOutboundCapacity()

getMostRecentErrorMessages

public java.util.List getMostRecentErrorMessages()

getMedianPeerClockSkew

public java.lang.Long getMedianPeerClockSkew()
Median clock skew of connected peers in seconds, or null if we cannot answer. CommSystemFacadeImpl overrides this.


getFramedAveragePeerClockSkew

public long getFramedAveragePeerClockSkew(int percentToInclude)
Return framed average clock skew of connected peers in seconds, or null if we cannot answer. CommSystemFacadeImpl overrides this.


getReachabilityStatus

public short getReachabilityStatus()
Determine under what conditions we are remotely reachable.


recheckReachability

public void recheckReachability()

isBacklogged

public boolean isBacklogged(Hash dest)

wasUnreachable

public boolean wasUnreachable(Hash dest)

isEstablished

public boolean isEstablished(Hash dest)

getIP

public byte[] getIP(Hash dest)

queueLookup

public void queueLookup(byte[] ip)

getCountry

public java.lang.String getCountry(Hash peer)

getCountryName

public java.lang.String getCountryName(java.lang.String code)

renderPeerHTML

public java.lang.String renderPeerHTML(Hash peer)

notifyReplaceAddress

public void notifyReplaceAddress(RouterAddress UDPAddr)
Tell other transports our address changed