Class STUN
java.lang.Object
org.jivesoftware.smack.packet.Stanza
org.jivesoftware.smack.packet.IQ
org.jivesoftware.smack.packet.SimpleIQ
org.jivesoftware.smackx.jingleold.nat.STUN
- All Implemented Interfaces:
Element, IqView, NamedElement, StanzaView, TopLevelStreamElement, XmlElement, XmlLangElement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classIQProvider for RTP Bridge packets.static classProvides easy abstract to store STUN Server Addresses and Ports.Nested classes/interfaces inherited from class IQ
IQ.IQChildElementXmlStringBuilder, IQ.ResponseType, IQ.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringElement name of the stanza extension.static final StringElement name of the stanza extension.static final StringNamespace of the stanza extension.Fields inherited from class IQ
IQ_ELEMENT, QUERY_ELEMENTFields inherited from class Stanza
DEFAULT_LANGUAGE, ITEM, language, TEXT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet Public Ip returned from the XMPP server.Get a list of STUN Servers recommended by the Server.static STUNgetSTUNServer(XMPPConnection connection) Get a new STUN Server Address and port from the server.static booleanserviceAvailable(XMPPConnection connection) Check if the server support STUN Service.Methods inherited from class SimpleIQ
getIQChildElementBuilderMethods inherited from class IQ
createErrorResponse, createErrorResponse, createResultIQ, getChildElementName, getChildElementNamespace, getChildElementQName, getChildElementXML, getElementName, getType, setType, toString, toXMLMethods inherited from class Stanza
addCommonAttributes, addExtension, addExtensions, appendErrorIfExists, getDefaultLanguage, getError, getExtension, getExtension, getExtensionElement, getExtensions, getExtensions, getExtensions, getExtensions, getExtensionsMap, getFrom, getLanguage, getNamespace, getStanzaId, getTo, hasExtension, hasExtension, hasStanzaIdSet, logCommonAttributes, overrideExtension, removeExtension, setError, setFrom, setNewStanzaId, setStanzaId, setTo, throwIfNoStanzaIdMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IqView
isRequestIQ, isResponseIQMethods inherited from interface StanzaView
getError, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getStanzaId, getTo, hasExtension, hasExtension, hasExtensionMethods inherited from interface XmlElement
getQName
-
Field Details
-
DOMAIN
-
ELEMENT_NAME
-
NAMESPACE
-
-
Constructor Details
-
STUN
public STUN()Creates a STUN IQ.
-
-
Method Details
-
getServers
Get a list of STUN Servers recommended by the Server.- Returns:
- the list of STUN servers
-
getPublicIp
-
getSTUNServer
public static STUN getSTUNServer(XMPPConnection connection) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException Get a new STUN Server Address and port from the server. If a error occurs or the server don't support STUN Service, null is returned.- Parameters:
connection- TODO javadoc me please- Returns:
- the STUN server address
- Throws:
SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.XMPPException.XMPPErrorException- if there was an XMPP error returned.SmackException.NoResponseException- if there was no response from the remote entity.
-
serviceAvailable
public static boolean serviceAvailable(XMPPConnection connection) throws XMPPException, SmackException, InterruptedException Check if the server support STUN Service.- Parameters:
connection- the connection- Returns:
- true if the server support STUN
- Throws:
SmackException- if Smack detected an exceptional situation.XMPPException- if an XMPP protocol error was received.InterruptedException- if the calling thread was interrupted.
-