com.aelitis.azureus.core.proxy.impl
Class AEProxyAddressMapperImpl

java.lang.Object
  extended by com.aelitis.azureus.core.proxy.impl.AEProxyAddressMapperImpl
All Implemented Interfaces:
AEProxyAddressMapper

public class AEProxyAddressMapperImpl
extends Object
implements AEProxyAddressMapper

Author:
parg

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.aelitis.azureus.core.proxy.AEProxyAddressMapper
AEProxyAddressMapper.AppliedPortMapping, AEProxyAddressMapper.PortMapping
 
Field Summary
protected  boolean enabled
           
protected  Map<String,String> map
           
protected  long next_value
           
protected  String prefix
           
protected  Map<String,String> reverse_map
           
protected static AEProxyAddressMapper singleton
           
protected  AEMonitor this_mon
           
 
Fields inherited from interface com.aelitis.azureus.core.proxy.AEProxyAddressMapper
MAP_PROPERTY_DISABLE_AZ_MESSAGING, MAP_PROPERTY_PROTOCOL_QUALIFIER
 
Constructor Summary
protected AEProxyAddressMapperImpl()
           
 
Method Summary
 AEProxyAddressMapper.AppliedPortMapping applyPortMapping(InetAddress address, int port)
           
 String externalise(String address)
           
 URL externalise(URL url)
           
static AEProxyAddressMapper getSingleton()
           
 String internalise(String address)
          SOCKS 5 is limited to 255 char DNS names.
 URL internalise(URL url)
           
 AEProxyAddressMapper.PortMapping registerPortMapping(int local_port, String ip)
           
 AEProxyAddressMapper.PortMapping registerPortMapping(int local_port, String ip, Map<String,Object> properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleton

protected static final AEProxyAddressMapper singleton

enabled

protected boolean enabled

prefix

protected String prefix

next_value

protected long next_value

map

protected final Map<String,String> map

reverse_map

protected final Map<String,String> reverse_map

this_mon

protected final AEMonitor this_mon
Constructor Detail

AEProxyAddressMapperImpl

protected AEProxyAddressMapperImpl()
Method Detail

getSingleton

public static AEProxyAddressMapper getSingleton()

internalise

public String internalise(String address)
Description copied from interface: AEProxyAddressMapper
SOCKS 5 is limited to 255 char DNS names. So for longer ones (e.g. I2P 'names') we have to replace then with somethin shorter to get through the SOCKS layer and then remap them on the otherside. These functions are only active if a SOCKS proxy is enabled and looping back (in process is the assumption)

Specified by:
internalise in interface AEProxyAddressMapper
Returns:

externalise

public String externalise(String address)
Specified by:
externalise in interface AEProxyAddressMapper

internalise

public URL internalise(URL url)
Specified by:
internalise in interface AEProxyAddressMapper

externalise

public URL externalise(URL url)
Specified by:
externalise in interface AEProxyAddressMapper

registerPortMapping

public AEProxyAddressMapper.PortMapping registerPortMapping(int local_port,
                                                            String ip)
Specified by:
registerPortMapping in interface AEProxyAddressMapper

registerPortMapping

public AEProxyAddressMapper.PortMapping registerPortMapping(int local_port,
                                                            String ip,
                                                            Map<String,Object> properties)
Specified by:
registerPortMapping in interface AEProxyAddressMapper

applyPortMapping

public AEProxyAddressMapper.AppliedPortMapping applyPortMapping(InetAddress address,
                                                                int port)
Specified by:
applyPortMapping in interface AEProxyAddressMapper