Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip.net
Class AutoProxyConnection

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.sip.net.ProxyConnection
      extended by net.java.sip.communicator.impl.protocol.sip.net.AutoProxyConnection

public class AutoProxyConnection
extends ProxyConnection

Implementation of the autodetect proxy connection. Tries to resolve a SIP- server by querying DNS in this order: NAPTR-SRV-A; SRV-A; A.

Author:
Ingo Bauersachs

Nested Class Summary
protected static class AutoProxyConnection.LocalNetworkUtils
          Wrapper around NetworkUtils to support Unit Tests.
 
Field Summary
 
Fields inherited from class net.java.sip.communicator.impl.protocol.sip.net.ProxyConnection
account, socketAddress, transport
 
Constructor Summary
AutoProxyConnection(SipAccountID account, String defaultTransport)
          Creates a new instance of this class.
AutoProxyConnection(SipAccountID account, String address, String defaultTransport)
          Creates a new instance of this class.
 
Method Summary
protected  boolean getNextAddressFromDns()
          Implementations must use this method to get the next address, but do not have to care about duplicate addresses.
 void reset()
          Resets the lookup to it's initial state.
protected  void setNetworkUtils(AutoProxyConnection.LocalNetworkUtils nu)
          Sets the NetworkUtils wrapper.
 
Methods inherited from class net.java.sip.communicator.impl.protocol.sip.net.ProxyConnection
create, getAddress, getNextAddress, getOutboundProxyString, getTransport, isSameInetAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoProxyConnection

public AutoProxyConnection(SipAccountID account,
                           String defaultTransport)
Creates a new instance of this class. Uses the server from the account.

Parameters:
account - the account of this SIP protocol instance
defaultTransport - the default transport to use when DNS does not provide a protocol through NAPTR or SRV

AutoProxyConnection

public AutoProxyConnection(SipAccountID account,
                           String address,
                           String defaultTransport)
Creates a new instance of this class. Uses the supplied address instead of the server address from the account.

Parameters:
account - the account of this SIP protocol instance
address - the domain on which to perform autodetection
defaultTransport - the default transport to use when DNS does not provide a protocol through NAPTR or SRV
Method Detail

setNetworkUtils

protected void setNetworkUtils(AutoProxyConnection.LocalNetworkUtils nu)
Sets the NetworkUtils wrapper. Used for Unit-Testing.

Parameters:
nu - the the NetworkUtils wrapper.

getNextAddressFromDns

protected boolean getNextAddressFromDns()
                                 throws DnssecException
Description copied from class: ProxyConnection
Implementations must use this method to get the next address, but do not have to care about duplicate addresses.

Specified by:
getNextAddressFromDns in class ProxyConnection
Returns:
True when a further address was available.
Throws:
DnssecException - when a DNSSEC validation failure occured.

reset

public void reset()
Description copied from class: ProxyConnection
Resets the lookup to it's initial state. Overriders methods have to call this method through a super-call.

Overrides:
reset in class ProxyConnection

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.