- Show yellow star if no outbound tunnels

This commit is contained in:
zzz
2010-02-02 15:18:22 +00:00
parent 33b7dca782
commit d4637818be
4 changed files with 19 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ class DummyTunnelManagerFacade implements TunnelManagerFacade {
public int getInboundClientTunnelCount() { return 0; }
public double getShareRatio() { return 0d; }
public int getOutboundClientTunnelCount() { return 0; }
public int getOutboundClientTunnelCount(Hash destination) { return 0; }
public long getLastParticipatingExpiration() { return -1; }
public void buildTunnels(Destination client, ClientTunnelSettings settings) {}
public TunnelPoolSettings getInboundSettings() { return null; }

View File

@@ -51,6 +51,8 @@ public interface TunnelManagerFacade extends Service {
public int getInboundClientTunnelCount();
/** how many outbound client tunnels do we have available? */
public int getOutboundClientTunnelCount();
/** how many outbound client tunnels in this pool? */
public int getOutboundClientTunnelCount(Hash destination);
public double getShareRatio();
/** When does the last tunnel we are participating in expire? */

View File

@@ -190,6 +190,21 @@ public class TunnelPoolManager implements TunnelManagerFacade {
}
return count;
}
/**
* Use to verify a tunnel pool is alive
* @since 0.7.11
*/
public int getOutboundClientTunnelCount(Hash destination) {
TunnelPool pool = null;
synchronized (_clientOutboundPools) {
pool = _clientOutboundPools.get(destination);
}
if (pool != null)
return pool.getTunnelCount();
return 0;
}
public int getParticipatingCount() { return _context.tunnelDispatcher().getParticipatingCount(); }
public long getLastParticipatingExpiration() { return _context.tunnelDispatcher().getLastParticipatingExpiration(); }