org.littleshoot.util
Class SrvCandidateProvider

java.lang.Object
  extended by org.littleshoot.util.SrvCandidateProvider
All Implemented Interfaces:
CandidateProvider<InetSocketAddress>

public class SrvCandidateProvider
extends Object
implements CandidateProvider<InetSocketAddress>

Generic class for accessing "candidate" URLs for a service to use that performs lookups using DNS SRV records. These are known to occasionally fail, so this class will keep trying.


Constructor Summary
SrvCandidateProvider(SrvUtil srvUtil, String srvAddress)
          Constructs a new registrar candidate provider.
SrvCandidateProvider(SrvUtil srvUtil, String srvAddress, InetSocketAddress defaultAddress)
          Constructs a new registrar candidate provider.
 
Method Summary
 InetSocketAddress getCandidate()
          Accessor for a single candidate.
 Collection<InetSocketAddress> getCandidates()
          Accessor for the Collection of candidates for the task at hand.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SrvCandidateProvider

public SrvCandidateProvider(SrvUtil srvUtil,
                            String srvAddress)
Constructs a new registrar candidate provider.

Parameters:
srvUtil - The SRV lookup utility class.
srvAddress - The address for looking up DNS SRV records.

SrvCandidateProvider

public SrvCandidateProvider(SrvUtil srvUtil,
                            String srvAddress,
                            InetSocketAddress defaultAddress)
Constructs a new registrar candidate provider.

Parameters:
srvUtil - The SRV lookup utility class.
srvAddress - The address for looking up DNS SRV records.
defaultAddress - The address to use if SRV lookups fail. If you set this to null, we'll just keep trying SRV lookups.
Method Detail

getCandidates

public Collection<InetSocketAddress> getCandidates()
Description copied from interface: CandidateProvider
Accessor for the Collection of candidates for the task at hand.

Specified by:
getCandidates in interface CandidateProvider<InetSocketAddress>
Returns:
The Collection of candidates for the task at hand.

getCandidate

public InetSocketAddress getCandidate()
Description copied from interface: CandidateProvider
Accessor for a single candidate.

Specified by:
getCandidate in interface CandidateProvider<InetSocketAddress>
Returns:
A single candidate.


Copyright © 2011-2013 LittleShoot. All Rights Reserved.