Class RTPBridge

  • All Implemented Interfaces:
    org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.FullyQualifiedElement, org.jivesoftware.smack.packet.IqView, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.StanzaView, org.jivesoftware.smack.packet.TopLevelStreamElement, org.jivesoftware.smack.packet.XmlLangElement

    public class RTPBridge
    extends org.jivesoftware.smack.packet.IQ
    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 Classes 
      Modifier and Type Class Description
      static class  RTPBridge.Provider
      IQProvider for RTP Bridge packets.
      • Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ

        org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder, org.jivesoftware.smack.packet.IQ.ResponseType, org.jivesoftware.smack.packet.IQ.Type
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ELEMENT_NAME
      Element name of the stanza extension.
      static java.lang.String NAME
      Element name of the stanza extension.
      static java.lang.String NAMESPACE
      Namespace of the stanza extension.
      • Fields inherited from class org.jivesoftware.smack.packet.IQ

        IQ_ELEMENT, QUERY_ELEMENT
      • Fields inherited from class org.jivesoftware.smack.packet.Stanza

        DEFAULT_LANGUAGE, ITEM, language, TEXT
    • Constructor Summary

      Constructors 
      Constructor Description
      RTPBridge()
      Creates a RTPBridge Stanza without Session ID.
      RTPBridge​(java.lang.String sid)
      Creates a RTPBridge Instance with defined Session ID.
      RTPBridge​(java.lang.String sid, org.jivesoftware.smackx.jingleold.nat.RTPBridge.BridgeAction bridgeAction)
      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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAttributes()
      Get the attributes string.
      java.lang.String getHostA()
      Get the Host A IP Address.
      java.lang.String getHostB()
      Get the Host B IP Address.
      java.lang.String getIp()
      Get the RTP Bridge IP.
      protected org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder​(org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder str)
      Get the Child Element XML of the Packet
      java.lang.String getName()
      Get the name of the Candidate.
      java.lang.String getPass()
      Get the RTP Agent Pass.
      int getPortA()
      Get Side A receive port.
      int getPortB()
      Get Side B receive port.
      static java.lang.String getPublicIP​(org.jivesoftware.smack.XMPPConnection xmppConnection)
      Get Public Address from the Server.
      static RTPBridge getRTPBridge​(org.jivesoftware.smack.XMPPConnection connection, java.lang.String sessionID)
      Get a new RTPBridge Candidate from the server.
      java.lang.String getSid()
      Get the Session ID of the Stanza (usually same as Jingle Session ID).
      static RTPBridge relaySession​(org.jivesoftware.smack.XMPPConnection connection, java.lang.String sessionID, java.lang.String pass, TransportCandidate proxyCandidate, TransportCandidate localCandidate)
      Check if the server support RTPBridge Service.
      static boolean serviceAvailable​(org.jivesoftware.smack.XMPPConnection connection)
      Check if the server support RTPBridge Service.
      void setHostA​(java.lang.String hostA)
      Set the Host A IP Address.
      void setHostB​(java.lang.String hostB)
      Set the Host B IP Address.
      void setIp​(java.lang.String ip)
      Set the RTP Bridge IP.
      void setName​(java.lang.String name)
      Set the name of the Candidate.
      void setPass​(java.lang.String pass)
      Set the RTP Agent Pass.
      void setPortA​(int portA)
      Set Side A receive port.
      void setPortB​(int portB)
      Set Side B receive port.
      void setSid​(java.lang.String sid)
      Set the Session ID of the Stanza (usually same as Jingle Session ID).
      • Methods inherited from class org.jivesoftware.smack.packet.IQ

        createErrorResponse, createErrorResponse, createErrorResponse, createResultIQ, getChildElementName, getChildElementNamespace, getChildElementQName, getChildElementXML, getElementName, getType, isRequestIQ, isResponseIQ, setType, toString, toXML
      • Methods inherited from class org.jivesoftware.smack.packet.Stanza

        addCommonAttributes, addExtension, addExtensions, appendErrorIfExists, getDefaultLanguage, getError, getExtension, getExtension, getExtension, getExtensionElement, getExtensions, getExtensions, getExtensions, getExtensions, getExtensionsMap, getFrom, getLanguage, getNamespace, getStanzaId, getTo, hasExtension, hasExtension, hasStanzaIdSet, logCommonAttributes, overrideExtension, removeExtension, removeExtension, setError, setError, setFrom, setLanguage, setNewStanzaId, setStanzaId, setStanzaId, setTo, throwIfNoStanzaId
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.jivesoftware.smack.packet.Element

        toXML, toXML
      • Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement

        getQName
      • Methods inherited from interface org.jivesoftware.smack.packet.StanzaView

        getError, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getStanzaId, getTo, hasExtension, hasExtension, hasExtension
    • Field Detail

      • NAME

        public static final java.lang.String NAME
        Element name of the stanza extension.
        See Also:
        Constant Field Values
      • ELEMENT_NAME

        public static final java.lang.String ELEMENT_NAME
        Element name of the stanza extension.
        See Also:
        Constant Field Values
      • NAMESPACE

        public static final java.lang.String NAMESPACE
        Namespace of the stanza extension.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RTPBridge

        public RTPBridge​(java.lang.String sid)
        Creates a RTPBridge Instance with defined Session ID.
        Parameters:
        sid - TODO javadoc me please
      • RTPBridge

        public RTPBridge​(org.jivesoftware.smackx.jingleold.nat.RTPBridge.BridgeAction action)
        Creates a RTPBridge Instance with defined Session ID.
        Parameters:
        action - TODO javadoc me please
      • RTPBridge

        public RTPBridge​(java.lang.String sid,
                         org.jivesoftware.smackx.jingleold.nat.RTPBridge.BridgeAction bridgeAction)
        Creates a RTPBridge Instance with defined Session ID.
        Parameters:
        sid - TODO javadoc me please
        bridgeAction - TODO javadoc me please
      • RTPBridge

        public RTPBridge()
        Creates a RTPBridge Stanza without Session ID.
    • Method Detail

      • getAttributes

        public java.lang.String getAttributes()
        Get the attributes string.
        Returns:
        the attributes.
      • getSid

        public java.lang.String getSid()
        Get the Session ID of the Stanza (usually same as Jingle Session ID).
        Returns:
        the session ID
      • setSid

        public void setSid​(java.lang.String sid)
        Set the Session ID of the Stanza (usually same as Jingle Session ID).
        Parameters:
        sid - TODO javadoc me please
      • getHostA

        public java.lang.String getHostA()
        Get the Host A IP Address.
        Returns:
        the Host A IP Address
      • setHostA

        public void setHostA​(java.lang.String hostA)
        Set the Host A IP Address.
        Parameters:
        hostA - TODO javadoc me please
      • getHostB

        public java.lang.String getHostB()
        Get the Host B IP Address.
        Returns:
        the Host B IP Address
      • setHostB

        public void setHostB​(java.lang.String hostB)
        Set the Host B IP Address.
        Parameters:
        hostB - TODO javadoc me please
      • getPortA

        public int getPortA()
        Get Side A receive port.
        Returns:
        the side A receive port
      • setPortA

        public void setPortA​(int portA)
        Set Side A receive port.
        Parameters:
        portA - TODO javadoc me please
      • getPortB

        public int getPortB()
        Get Side B receive port.
        Returns:
        the side B receive port
      • setPortB

        public void setPortB​(int portB)
        Set Side B receive port.
        Parameters:
        portB - TODO javadoc me please
      • getIp

        public java.lang.String getIp()
        Get the RTP Bridge IP.
        Returns:
        the RTP Bridge IP
      • setIp

        public void setIp​(java.lang.String ip)
        Set the RTP Bridge IP.
        Parameters:
        ip - TODO javadoc me please
      • getPass

        public java.lang.String getPass()
        Get the RTP Agent Pass.
        Returns:
        the RTP Agent Pass
      • setPass

        public void setPass​(java.lang.String pass)
        Set the RTP Agent Pass.
        Parameters:
        pass - TODO javadoc me please
      • getName

        public java.lang.String getName()
        Get the name of the Candidate.
        Returns:
        the name of the Candidate
      • setName

        public void setName​(java.lang.String name)
        Set the name of the Candidate.
        Parameters:
        name - TODO javadoc me please
      • getIQChildElementBuilder

        protected org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder​(org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder str)
        Get the Child Element XML of the Packet
        Specified by:
        getIQChildElementBuilder in class org.jivesoftware.smack.packet.IQ
        Returns:
        the Child Element XML of the Packet
      • getRTPBridge

        public static RTPBridge getRTPBridge​(org.jivesoftware.smack.XMPPConnection connection,
                                             java.lang.String sessionID)
                                      throws org.jivesoftware.smack.SmackException.NotConnectedException,
                                             java.lang.InterruptedException
        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 please
        sessionID - TODO javadoc me please
        Returns:
        the new RTPBridge
        Throws:
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • serviceAvailable

        public static boolean serviceAvailable​(org.jivesoftware.smack.XMPPConnection connection)
                                        throws org.jivesoftware.smack.SmackException.NoResponseException,
                                               org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                               org.jivesoftware.smack.SmackException.NotConnectedException,
                                               java.lang.InterruptedException
        Check if the server support RTPBridge Service.
        Parameters:
        connection - TODO javadoc me please
        Returns:
        true if the server supports the RTPBridge service
        Throws:
        org.jivesoftware.smack.XMPPException.XMPPErrorException - if there was an XMPP error returned.
        org.jivesoftware.smack.SmackException.NoResponseException - if there was no response from the remote entity.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • relaySession

        public static RTPBridge relaySession​(org.jivesoftware.smack.XMPPConnection connection,
                                             java.lang.String sessionID,
                                             java.lang.String pass,
                                             TransportCandidate proxyCandidate,
                                             TransportCandidate localCandidate)
                                      throws org.jivesoftware.smack.SmackException.NotConnectedException,
                                             java.lang.InterruptedException
        Check if the server support RTPBridge Service.
        Parameters:
        connection - TODO javadoc me please
        sessionID - the session id.
        pass - the password.
        proxyCandidate - the proxy candidate.
        localCandidate - the local candidate.
        Returns:
        the RTPBridge
        Throws:
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • getPublicIP

        public static java.lang.String getPublicIP​(org.jivesoftware.smack.XMPPConnection xmppConnection)
                                            throws org.jivesoftware.smack.SmackException.NotConnectedException,
                                                   java.lang.InterruptedException
        Get Public Address from the Server.
        Parameters:
        xmppConnection - TODO javadoc me please
        Returns:
        public IP String or null if not found
        Throws:
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.