Class RTPBridge
java.lang.Object
org.jivesoftware.smack.packet.Stanza
org.jivesoftware.smack.packet.IQ
org.jivesoftware.smackx.jingleold.nat.RTPBridge
- All Implemented Interfaces:
Element, IqView, NamedElement, StanzaView, TopLevelStreamElement, XmlElement, XmlLangElement
RTPBridge IQ Stanza used to request and retrieve a RTPBridge Candidates that can be used for a Jingle Media Transmission between two parties that are behind NAT.
This Jingle Bridge has all the needed information to establish a full UDP Channel (Send and Receive) between two parties.
This transport method should be used only if other transport methods are not allowed. Or if you want a more reliable transport.
High Level Usage Example:
RTPBridge rtpBridge = RTPBridge.getRTPBridge(connection, sessionID);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classIQProvider for RTP Bridge packets.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
ConstructorsConstructorDescriptionCreates a RTPBridge Stanza without Session ID.Creates a RTPBridge Instance with defined Session ID.Creates a RTPBridge Instance with defined Session ID.RTPBridge(org.jivesoftware.smackx.jingleold.nat.RTPBridge.BridgeAction action) Creates a RTPBridge Instance with defined Session ID. -
Method Summary
Modifier and TypeMethodDescriptionGet the attributes string.getHostA()Get the Host A IP Address.getHostB()Get the Host B IP Address.getIp()Get the RTP Bridge IP.protected IQ.IQChildElementXmlStringBuilderGet the Child Element XML of the PacketgetName()Get the name of the Candidate.getPass()Get the RTP Agent Pass.intgetPortA()Get Side A receive port.intgetPortB()Get Side B receive port.static StringgetPublicIP(XMPPConnection xmppConnection) Get Public Address from the Server.static RTPBridgegetRTPBridge(XMPPConnection connection, String sessionID) Get a new RTPBridge Candidate from the server.getSid()Get the Session ID of the Stanza (usually same as Jingle Session ID).static RTPBridgerelaySession(XMPPConnection connection, String sessionID, String pass, TransportCandidate proxyCandidate, TransportCandidate localCandidate) Check if the server support RTPBridge Service.static booleanserviceAvailable(XMPPConnection connection) Check if the server support RTPBridge Service.voidSet the Host A IP Address.voidSet the Host B IP Address.voidSet the RTP Bridge IP.voidSet the name of the Candidate.voidSet the RTP Agent Pass.voidsetPortA(int portA) Set Side A receive port.voidsetPortB(int portB) Set Side B receive port.voidSet the Session ID of the Stanza (usually same as Jingle Session ID).Methods 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
-
NAME
-
ELEMENT_NAME
-
NAMESPACE
-
-
Constructor Details
-
RTPBridge
-
RTPBridge
Creates a RTPBridge Instance with defined Session ID.- Parameters:
action- TODO javadoc me please
-
RTPBridge
-
RTPBridge
public RTPBridge()Creates a RTPBridge Stanza without Session ID.
-
-
Method Details
-
getAttributes
-
getSid
-
setSid
-
getHostA
-
setHostA
-
getHostB
-
setHostB
-
getPortA
-
setPortA
-
getPortB
-
setPortB
-
getIp
-
setIp
-
getPass
-
setPass
-
getName
-
setName
-
getIQChildElementBuilder
protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder str) Get the Child Element XML of the Packet- Specified by:
getIQChildElementBuilderin classIQ- Parameters:
str- a pre-created builder which already has the child element and the 'xmlns' attribute set.- Returns:
- the Child Element XML of the Packet
-
getRTPBridge
public static RTPBridge getRTPBridge(XMPPConnection connection, String sessionID) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException Get a new RTPBridge Candidate from the server. If a error occurs or the server don't support RTPBridge Service, null is returned.- Parameters:
connection- TODO javadoc me pleasesessionID- TODO javadoc me please- Returns:
- the new RTPBridge
- 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 SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException Check if the server support RTPBridge Service.- Parameters:
connection- TODO javadoc me please- Returns:
- true if the server supports the RTPBridge service
- Throws:
XMPPException.XMPPErrorException- if there was an XMPP error returned.SmackException.NoResponseException- if there was no response from the remote entity.SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.
-
relaySession
public static RTPBridge relaySession(XMPPConnection connection, String sessionID, String pass, TransportCandidate proxyCandidate, TransportCandidate localCandidate) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException Check if the server support RTPBridge Service.- Parameters:
connection- TODO javadoc me pleasesessionID- the session id.pass- the password.proxyCandidate- the proxy candidate.localCandidate- the local candidate.- Returns:
- the RTPBridge
- 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.
-
getPublicIP
public static String getPublicIP(XMPPConnection xmppConnection) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException Get Public Address from the Server.- Parameters:
xmppConnection- TODO javadoc me please- Returns:
- public IP String or null if not found
- 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.
-