Class S5bTransportMethod
- java.lang.Object
-
- rocks.xmpp.extensions.jingle.transports.model.TransportMethod
-
- rocks.xmpp.extensions.jingle.transports.s5b.model.S5bTransportMethod
-
public final class S5bTransportMethod extends TransportMethod
The implementation of the<transport/>
element in theurn:xmpp:jingle:transports:s5b:1
namespace.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
S5bTransportMethod.Candidate
The implementation of the<candidate/>
element in theurn:xmpp:jingle:transports:s5b:1
namespace.
-
Constructor Summary
Constructors Constructor Description S5bTransportMethod(String sessionId, String dstaddr, Socks5ByteStream.Mode mode, Collection<S5bTransportMethod.Candidate> candidates)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static S5bTransportMethod
activated(String sid, String cid)
Creates a transport method with a<activated/>
element.static int
calculatePriority(S5bTransportMethod.Candidate.Type type, int localPreference)
Gets the preferred priority.static S5bTransportMethod
candidateError(String sid)
Creates a transport method with a<candidate-error/>
element.static S5bTransportMethod
candidateUsed(String sid, String cid)
Creates a transport method with a<candidate-used/>
element.String
getActivated()
Gets the id of the activated candidate.List<S5bTransportMethod.Candidate>
getCandidates()
Gets the candidates, i.e. stream hosts for the transport.String
getCandidateUsed()
Gets the id of the used candidate.String
getDstAddr()
Gets the DST.ADDR field for the SOCKS5 protocol.Socks5ByteStream.Mode
getMode()
Gets the mode.String
getSessionId()
Gets the session id.boolean
isCandidateError()
Indicates, if it's a candidate error.boolean
isProxyError()
Indicates, if it's a proxy error.static S5bTransportMethod
proxyError(String sid)
Creates a transport method with a<proxy-error/>
element.
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
urn:xmpp:jingle:transports:s5b:1- See Also:
- Constant Field Values
-
-
Constructor Detail
-
S5bTransportMethod
public S5bTransportMethod(String sessionId, String dstaddr, Socks5ByteStream.Mode mode, Collection<S5bTransportMethod.Candidate> candidates)
-
-
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.
-
getMode
public final Socks5ByteStream.Mode getMode()
Gets the mode.- Returns:
- The mode.
-
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.
-
-