|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jivesoftware.smackx.jingle.nat.TransportResolver
org.jivesoftware.smackx.jingle.nat.STUNResolver
public class STUNResolver
Transport resolver using the JSTUN library, to discover public IP and use it as a candidate. The goal of this resolver is to take possible to establish and manage out-of-band connections between two XMPP entities, even if they are behind Network Address Translators (NATs) or firewalls.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jivesoftware.smackx.jingle.nat.TransportResolver |
|---|
TransportResolver.Type |
| Field Summary | |
|---|---|
static java.lang.String |
STUNSERVERS_FILENAME
|
| Fields inherited from class org.jivesoftware.smackx.jingle.nat.TransportResolver |
|---|
CHECK_TIMEOUT, type |
| Constructor Summary | |
|---|---|
STUNResolver()
Constructor with default STUN server. |
|
STUNResolver(int defaultPort)
Constructor with a default port. |
|
| Method Summary | |
|---|---|
void |
cancel()
Cancel any operation. |
void |
clear()
Clear the list of candidates and start the resolution again. |
java.lang.String |
getCurrentServerName()
Get the name of the current STUN server. |
int |
getCurrentServerPort()
Get the port of the current STUN server. |
void |
initialize()
Initialize the resolver. |
boolean |
isResolving()
Return true if the service is working. |
java.util.ArrayList |
loadSTUNServers()
Load a list of services: STUN servers and ports. |
java.util.ArrayList |
loadSTUNServers(java.io.InputStream stunConfigStream)
Load the STUN configuration from a stream. |
void |
resolve(JingleSession session)
Resolve the IP and obtain a valid transport method. |
void |
setSTUNService(java.lang.String ip,
int port)
Set the STUN server name and port |
| Methods inherited from class org.jivesoftware.smackx.jingle.nat.TransportResolver |
|---|
addListener, getCandidate, getCandidateCount, getCandidates, getCandidatesList, getListenersList, getPreferredCandidate, getType, initializeAndWait, isInitialized, isResolved, removeListener, setInitialized, setType |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String STUNSERVERS_FILENAME
| Constructor Detail |
|---|
public STUNResolver()
public STUNResolver(int defaultPort)
defaultPort - Port to use by default.| Method Detail |
|---|
public boolean isResolving()
isResolving in class TransportResolverTransportResolver.isResolving()
public void setSTUNService(java.lang.String ip,
int port)
ip - the STUN server nameport - the STUN server portpublic java.lang.String getCurrentServerName()
public int getCurrentServerPort()
public java.util.ArrayList loadSTUNServers(java.io.InputStream stunConfigStream)
stunConfigStream - An InputStream with the configuration file.
public java.util.ArrayList loadSTUNServers()
iphone-stun.freenet.de:3478
larry.gloo.net:3478
stun.xten.net:3478
stun.fwdnet.net
stun.fwd.org (no DNS SRV record)
stun01.sipphone.com (no DNS SRV record)
stun.softjoys.com (no DNS SRV record)
stun.voipbuster.com (no DNS SRV record)
stun.voxgratia.org (no DNS SRV record)
stun.noc.ams-ix.net
This list should be contained in a file in the "META-INF" directory
public void resolve(JingleSession session)
throws XMPPException
resolve in class TransportResolverXMPPException
public void initialize()
throws XMPPException
initialize in class TransportResolverXMPPException
public void cancel()
throws XMPPException
cancel in class TransportResolverXMPPExceptionTransportResolver.cancel()
public void clear()
throws XMPPException
clear in class TransportResolverXMPPExceptionTransportResolver.clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||