Class S5bTransportMethod

    • Method Detail

      • candidateUsed

        public static S5bTransportMethod candidateUsed​(String sid,
                                                       String cid)
        Creates a transport method with a <candidate-used/> element.
        Parameters:
        sid - The session id.
        cid - The candidate id.
        Returns:
        The transport method.
      • candidateError

        public static S5bTransportMethod candidateError​(String sid)
        Creates a transport method with a <candidate-error/> element.
        Parameters:
        sid - The session id.
        Returns:
        The transport method.
      • proxyError

        public static S5bTransportMethod proxyError​(String sid)
        Creates a transport method with a <proxy-error/> element.
        Parameters:
        sid - The session id.
        Returns:
        The transport method.
      • activated

        public static S5bTransportMethod activated​(String sid,
                                                   String cid)
        Creates a transport method with a <activated/> element.
        Parameters:
        sid - The session id.
        cid - The id of the activated candidate.
        Returns:
        The transport method.
      • calculatePriority

        public static int calculatePriority​(S5bTransportMethod.Candidate.Type type,
                                            int localPreference)
        Gets the preferred priority. Note that the calculated priority is only a recommendation.
        Parameters:
        type - The type.
        localPreference - The local preference, should be between 0 and 65535.
        Returns:
        The calculated preferred priority.
      • getDstAddr

        public final String getDstAddr()
        Gets the DST.ADDR field for the SOCKS5 protocol. In XMPP this is SHA-1 hash of session id + requester JID + receiver JID
        Returns:
        The DST.ADDR field.
      • getSessionId

        public final String getSessionId()
        Gets the session id.
        Returns:
        The session id.
      • getCandidates

        public final List<S5bTransportMethod.Candidate> getCandidates()
        Gets the candidates, i.e. stream hosts for the transport.
        Returns:
        The candidates.
      • getCandidateUsed

        public final String getCandidateUsed()
        Gets the id of the used candidate.
        Returns:
        The id or null.
      • getActivated

        public final String getActivated()
        Gets the id of the activated candidate.
        Returns:
        The id or null.
      • isCandidateError

        public final boolean isCandidateError()
        Indicates, if it's a candidate error.
        Returns:
        If it's a candidate error.
      • isProxyError

        public final boolean isProxyError()
        Indicates, if it's a proxy error.
        Returns:
        If it's a proxy error.