make inbound and exploratory settings final

This commit is contained in:
zzz
2012-10-05 13:38:27 +00:00
parent 583463ab42
commit 0448537509
3 changed files with 9 additions and 17 deletions

View File

@ -20,12 +20,8 @@ public class ClientTunnelSettings {
private TunnelPoolSettings _outboundSettings;
public ClientTunnelSettings() {
_inboundSettings = new TunnelPoolSettings();
_inboundSettings.setIsInbound(true);
_inboundSettings.setIsExploratory(false);
_outboundSettings = new TunnelPoolSettings();
_outboundSettings.setIsInbound(false);
_outboundSettings.setIsExploratory(false);
_inboundSettings = new TunnelPoolSettings(false, true);
_outboundSettings = new TunnelPoolSettings(false, false);
}
public TunnelPoolSettings getInboundSettings() { return _inboundSettings; }

View File

@ -21,8 +21,8 @@ public class TunnelPoolSettings {
private int _length;
private int _lengthVariance;
private int _lengthOverride;
private boolean _isInbound;
private boolean _isExploratory;
private final boolean _isInbound;
private final boolean _isExploratory;
private boolean _allowZeroHop;
private int _IPRestriction;
private final Properties _unknownOptions;
@ -54,7 +54,9 @@ public class TunnelPoolSettings {
public static final boolean DEFAULT_ALLOW_ZERO_HOP = true;
public static final int DEFAULT_IP_RESTRICTION = 2; // class B (/16)
public TunnelPoolSettings() {
public TunnelPoolSettings(boolean isExploratory, boolean isInbound) {
_isExploratory = isExploratory;
_isInbound = isInbound;
_quantity = DEFAULT_QUANTITY;
_backupQuantity = DEFAULT_BACKUP_QUANTITY;
// _rebuildPeriod = DEFAULT_REBUILD_PERIOD;
@ -130,11 +132,9 @@ public class TunnelPoolSettings {
/** is this an inbound tunnel? */
public boolean isInbound() { return _isInbound; }
public void setIsInbound(boolean isInbound) { _isInbound = isInbound; }
/** is this an exploratory tunnel (or a client tunnel) */
public boolean isExploratory() { return _isExploratory; }
public void setIsExploratory(boolean isExploratory) { _isExploratory = isExploratory; }
// Duration is hardcoded
//public int getDuration() { return _duration; }

View File

@ -64,13 +64,9 @@ public class TunnelPoolManager implements TunnelManagerFacade {
_clientPeerSelector = new ClientPeerSelector(ctx);
ExploratoryPeerSelector selector = new ExploratoryPeerSelector(_context);
TunnelPoolSettings inboundSettings = new TunnelPoolSettings();
inboundSettings.setIsExploratory(true);
inboundSettings.setIsInbound(true);
TunnelPoolSettings inboundSettings = new TunnelPoolSettings(true, true);
_inboundExploratory = new TunnelPool(_context, this, inboundSettings, selector);
TunnelPoolSettings outboundSettings = new TunnelPoolSettings();
outboundSettings.setIsExploratory(true);
outboundSettings.setIsInbound(false);
TunnelPoolSettings outboundSettings = new TunnelPoolSettings(true, false);
_outboundExploratory = new TunnelPool(_context, this, outboundSettings, selector);
// threads will be started in startup()