public abstract class TransportResolver extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TransportResolver.Type |
Modifier and Type | Field and Description |
---|---|
protected List<TransportCandidate> |
candidates |
static int |
CHECK_TIMEOUT |
TransportResolver.Type |
type |
Modifier | Constructor and Description |
---|---|
protected |
TransportResolver()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCandidate(TransportCandidate cand)
Add a new transport candidate
|
void |
addListener(TransportResolverListener li)
Add a transport resolver listener.
|
abstract void |
cancel()
Cancel any asynchronous resolution operation.
|
void |
clear()
Clear the list of candidates and start a new resolution process.
|
protected void |
clearCandidates()
Clear the list of candidate
|
TransportCandidate |
getCandidate(int i)
Get the n-th candidate.
|
int |
getCandidateCount()
Get the number of transport candidates.
|
Iterator<TransportCandidate> |
getCandidates()
Get an iterator for the list of candidates.
|
List<TransportCandidate> |
getCandidatesList()
Get the list of candidates.
|
protected int |
getFreePort()
Obtain a free port we can use.
|
ArrayList<TransportResolverListener> |
getListenersList()
Get the list of listeners.
|
TransportCandidate |
getPreferredCandidate()
Get the candidate with the highest preference.
|
TransportResolver.Type |
getType() |
abstract void |
initialize()
Initialize the Resolver.
|
void |
initializeAndWait()
Initialize Transport Resolver and wait until it is completely uninitialized.
|
boolean |
isInitialized()
Check if the Transport Resolver is initialized.
|
boolean |
isResolved()
Return true if the resolver has finished the search for transport
candidates.
|
boolean |
isResolving()
Return true if the resolver is working.
|
void |
removeListener(TransportResolverListener li)
Removes a transport resolver listener.
|
abstract void |
resolve(JingleSession session)
Start a the resolution.
|
void |
setInitialized()
Set the Transport Resolver as initialized.
|
protected void |
setResolveEnd()
Indicate the end of the resolution process.
|
protected void |
setResolveInit()
Indicate the beginning of the resolution process.
|
void |
setType(TransportResolver.Type type) |
protected void |
triggerCandidateAdded(TransportCandidate cand)
Trigger a new candidate added event.
|
public TransportResolver.Type type
public static final int CHECK_TIMEOUT
protected final List<TransportCandidate> candidates
protected TransportResolver()
public TransportResolver.Type getType()
public void setType(TransportResolver.Type type)
public abstract void initialize() throws XMPPException, SmackException, InterruptedException
public abstract void resolve(JingleSession session) throws XMPPException, SmackException, InterruptedException
public void clear() throws XMPPException
XMPPException
public abstract void cancel() throws XMPPException
XMPPException
public boolean isResolving()
public boolean isResolved()
public void setInitialized()
public boolean isInitialized()
protected void setResolveInit()
protected void setResolveEnd()
public void addListener(TransportResolverListener li)
li
- The transport resolver listener to be added.public void removeListener(TransportResolverListener li)
li
- The transport resolver listener to be removedpublic ArrayList<TransportResolverListener> getListenersList()
protected void triggerCandidateAdded(TransportCandidate cand) throws SmackException.NotConnectedException, InterruptedException
cand
- The candidate added to the list of candidates.SmackException.NotConnectedException
InterruptedException
protected void clearCandidates()
protected void addCandidate(TransportCandidate cand) throws SmackException.NotConnectedException, InterruptedException
cand
- The candidate to addSmackException.NotConnectedException
InterruptedException
public Iterator<TransportCandidate> getCandidates()
public TransportCandidate getPreferredCandidate()
public int getCandidateCount()
public List<TransportCandidate> getCandidatesList()
public TransportCandidate getCandidate(int i)
public void initializeAndWait() throws XMPPException, SmackException, InterruptedException
protected int getFreePort()