Package tigase.socks5
Class Stream
- java.lang.Object
-
- tigase.socks5.Stream
-
public class Stream extends Object
-
-
Constructor Summary
Constructors Constructor Description Stream(String sid, Socks5ConnectionManager manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanactivate()Tries to activate stream and each of servicevoidaddConnection(Socks5IOService con)Assign connection to streamvoidclose()Close streamSocks5IOServicegetConnection(Socks5ConnectionType connectionType)Returns connection with specified typeObjectgetData(String key)Returns stream data for keytigase.xmpp.jid.JIDgetRequester()Get bare JID of requesterSocks5IOServicegetSecondConnection(Socks5IOService con)Returns another connections of streamStringgetSID()Returns stream idtigase.xmpp.jid.JIDgetTarget()Get bare JID of targetintgetTransferredBytes()Returns bytes transferred by this streaminthashCodeForStream()Returns hashCode for streamvoidproxy(ByteBuffer buf, Socks5IOService con)Forward data to another servicevoidsetData(String key, Object value)Set stream datavoidsetRequester(tigase.xmpp.jid.JID requester)Set bare JID of requestervoidsetTarget(tigase.xmpp.jid.JID target)Set bare JID of targetStringtoString()
-
-
-
Constructor Detail
-
Stream
public Stream(String sid, Socks5ConnectionManager manager)
-
-
Method Detail
-
getSID
public String 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
-
addConnection
public void addConnection(Socks5IOService con)
Assign connection to stream- Parameters:
con-
-
getConnection
public Socks5IOService getConnection(Socks5ConnectionType connectionType)
Returns connection with specified type- Parameters:
connectionType-- Returns:
-
proxy
public void proxy(ByteBuffer buf, Socks5IOService con) throws IOException
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
public Socks5IOService getSecondConnection(Socks5IOService con)
Returns another connections of stream- Parameters:
con-- Returns:
-
getTransferredBytes
public int getTransferredBytes()
Returns bytes transferred by this stream- Returns:
-
-