public final class S5bTransportMethod extends TransportMethod
The implementation of the <transport/>
element in the urn:xmpp:jingle:transports:s5b:1
namespace.
Modifier and Type | Class and Description |
---|---|
static class |
S5bTransportMethod.Candidate
The implementation of the
<candidate/> element in the urn:xmpp:jingle:transports:s5b:1 namespace. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAMESPACE
urn:xmpp:jingle:transports:s5b:1
|
Constructor and Description |
---|
S5bTransportMethod(java.lang.String sessionId,
java.lang.String dstaddr,
Socks5ByteStream.Mode mode,
java.util.Collection<S5bTransportMethod.Candidate> candidates) |
Modifier and Type | Method and Description |
---|---|
static S5bTransportMethod |
activated(java.lang.String sid,
java.lang.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(java.lang.String sid)
Creates a transport method with a
<candidate-error/> element. |
static S5bTransportMethod |
candidateUsed(java.lang.String sid,
java.lang.String cid)
Creates a transport method with a
<candidate-used/> element. |
java.lang.String |
getActivated()
Gets the id of the activated candidate.
|
java.util.List<S5bTransportMethod.Candidate> |
getCandidates()
Gets the candidates, i.e. stream hosts for the transport.
|
java.lang.String |
getCandidateUsed()
Gets the id of the used candidate.
|
java.lang.String |
getDstAddr()
Gets the DST.ADDR field for the SOCKS5 protocol.
|
Socks5ByteStream.Mode |
getMode()
Gets the mode.
|
java.lang.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(java.lang.String sid)
Creates a transport method with a
<proxy-error/> element. |
public static final java.lang.String NAMESPACE
urn:xmpp:jingle:transports:s5b:1
public S5bTransportMethod(java.lang.String sessionId, java.lang.String dstaddr, Socks5ByteStream.Mode mode, java.util.Collection<S5bTransportMethod.Candidate> candidates)
public static S5bTransportMethod candidateUsed(java.lang.String sid, java.lang.String cid)
Creates a transport method with a <candidate-used/>
element.
sid
- The session id.cid
- The candidate id.public static S5bTransportMethod candidateError(java.lang.String sid)
Creates a transport method with a <candidate-error/>
element.
sid
- The session id.public static S5bTransportMethod proxyError(java.lang.String sid)
Creates a transport method with a <proxy-error/>
element.
sid
- The session id.public static S5bTransportMethod activated(java.lang.String sid, java.lang.String cid)
Creates a transport method with a <activated/>
element.
sid
- The session id.cid
- The id of the activated candidate.public static int calculatePriority(S5bTransportMethod.Candidate.Type type, int localPreference)
Gets the preferred priority. Note that the calculated priority is only a recommendation.
type
- The type.localPreference
- The local preference, should be between 0 and 65535.public final java.lang.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
public final java.lang.String getSessionId()
Gets the session id.
public final Socks5ByteStream.Mode getMode()
Gets the mode.
public final java.util.List<S5bTransportMethod.Candidate> getCandidates()
Gets the candidates, i.e. stream hosts for the transport.
public final java.lang.String getCandidateUsed()
Gets the id of the used candidate.
public final java.lang.String getActivated()
Gets the id of the activated candidate.
public final boolean isCandidateError()
Indicates, if it’s a candidate error.
public final boolean isProxyError()
Indicates, if it’s a proxy error.
Copyright © 2014–2019 XMPP.rocks. All rights reserved.