Class Socks5ByteStream
- java.lang.Object
-
- rocks.xmpp.extensions.bytestreams.s5b.model.Socks5ByteStream
-
public final class Socks5ByteStream extends Object
The implementation of the<query/>
element in thehttp://jabber.org/protocol/bytestreams
namespace.- See Also:
- XEP-0065: SOCKS5 Bytestreams, XML Schema
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Socks5ByteStream.Mode
The transport mode.
-
Constructor Summary
Constructors Constructor Description Socks5ByteStream()
Creates an empty<query/>
element.Socks5ByteStream(String sessionId, Collection<StreamHost> streamHosts, Jid requester, Jid target)
Creates a<query/>
element with an<streamhost/>
child elements.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Socks5ByteStream
activate(String sessionId, Jid jid)
Creates a<query/>
element with an<activate/>
child element.String
getDestinationAddress()
Gets the DST.ADDR, i.e. the hash of the SID + requester JID + target JID.Socks5ByteStream.Mode
getMode()
Gets the mode.String
getSessionId()
Gets the session id.List<StreamHost>
getStreamHosts()
Gets the stream hosts.Jid
getStreamHostUsed()
Gets the used stream host.static String
hash(String sessionId, Jid requesterJid, Jid targetJid)
Creates the hexadecimal-encoded SHA-1 hash for usage in SOCKS5 negotiation.static Socks5ByteStream
streamHostUsed(String sessionId, Jid jid)
Creates a<query/>
element with an<streamhost-used/>
child element.String
toString()
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
http://jabber.org/protocol/bytestreams- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Socks5ByteStream
public Socks5ByteStream()
Creates an empty<query/>
element.
-
Socks5ByteStream
public Socks5ByteStream(String sessionId, Collection<StreamHost> streamHosts, Jid requester, Jid target)
Creates a<query/>
element with an<streamhost/>
child elements.- Parameters:
sessionId
- The session id.streamHosts
- The stream hosts.requester
- The requester.target
- The target.
-
-
Method Detail
-
activate
public static Socks5ByteStream activate(String sessionId, Jid jid)
Creates a<query/>
element with an<activate/>
child element.- Parameters:
sessionId
- The session id.jid
- The JID.- Returns:
- The query element.
-
streamHostUsed
public static Socks5ByteStream streamHostUsed(String sessionId, Jid jid)
Creates a<query/>
element with an<streamhost-used/>
child element.- Parameters:
sessionId
- session id.jid
- The JID.- Returns:
- The query element.
-
hash
public static String hash(String sessionId, Jid requesterJid, Jid targetJid)
Creates the hexadecimal-encoded SHA-1 hash for usage in SOCKS5 negotiation.- Parameters:
sessionId
- The session idrequesterJid
- The requester JIDtargetJid
- The target JID.- Returns:
- The hexadecimal-encoded SHA-1 hash.
- See Also:
- 6.3.2 Target Establishes SOCKS5 Connection with Proxy
-
getStreamHosts
public final List<StreamHost> getStreamHosts()
Gets the stream hosts.- Returns:
- The stream hosts.
-
getSessionId
public final String getSessionId()
Gets the session id.- Returns:
- The session id.
-
getStreamHostUsed
public final Jid getStreamHostUsed()
Gets the used stream host.- Returns:
- The used stream host.
-
getDestinationAddress
public final String getDestinationAddress()
Gets the DST.ADDR, i.e. the hash of the SID + requester JID + target JID.- Returns:
- The DST.ADDR hash.
-
getMode
public final Socks5ByteStream.Mode getMode()
Gets the mode.- Returns:
- The mode.
-
-