Package tigase.socks5
Class Stream
java.lang.Object
tigase.socks5.Stream
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
activate()
Tries to activate stream and each of servicevoid
Assign connection to streamvoid
close()
Close streamgetConnection
(Socks5ConnectionType connectionType) Returns connection with specified typeReturns stream data for keytigase.xmpp.jid.JID
Get bare JID of requesterReturns another connections of streamgetSID()
Returns stream idtigase.xmpp.jid.JID
Get bare JID of targetint
Returns bytes transferred by this streamint
Returns hashCode for streamvoid
proxy
(ByteBuffer buf, Socks5IOService con) Forward data to another servicevoid
Set stream datavoid
setRequester
(tigase.xmpp.jid.JID requester) Set bare JID of requestervoid
setTarget
(tigase.xmpp.jid.JID target) Set bare JID of targettoString()
-
Constructor Details
-
Stream
-
-
Method Details
-
getSID
Returns stream id- Returns:
-
getRequester
public tigase.xmpp.jid.JID getRequester()Get bare JID of requester -
setRequester
public void setRequester(tigase.xmpp.jid.JID requester) Set bare JID of requester- Parameters:
requester
-
-
getTarget
public tigase.xmpp.jid.JID getTarget()Get bare JID of target -
setTarget
public void setTarget(tigase.xmpp.jid.JID target) Set bare JID of target -
setData
Set stream data- Parameters:
key
-value
-
-
getData
Returns stream data for key- Parameters:
key
-- Returns:
-
addConnection
Assign connection to stream- Parameters:
con
-
-
getConnection
Returns connection with specified type- Parameters:
connectionType
-- Returns:
-
proxy
Forward data to another service- Parameters:
buf
-con
-- Throws:
IOException
-
activate
public boolean activate()Tries to activate stream and each of service- Returns:
-
close
public void close()Close stream -
hashCodeForStream
public int hashCodeForStream()Returns hashCode for stream- Returns:
-
getSecondConnection
Returns another connections of stream- Parameters:
con
-- Returns:
-
getTransferredBytes
public int getTransferredBytes()Returns bytes transferred by this stream- Returns:
-
toString
-