Package org.netxms.client
Class TcpProxy
- java.lang.Object
-
- org.netxms.client.TcpProxy
-
public class TcpProxy extends Object
TCP proxy object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTcpProxy(NXCSession session, int channelId)TODO
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close proxy session.protected intgetChannelId()Get channel IDInputStreamgetInputStream()Get input stream for this TCP proxy.OutputStreamgetOutputStream()Get output stream for this TCP proxy.intgetSizeThreshold()Get current size threshold.intgetTimeThreshold()Get current time threshold.booleanisClosed()Check if proxy session is closed.protected voidlocalClose()Close local resources associated with proxy session.protected voidprocessRemoteData(byte[] data)Process data received from remote endvoidsend(byte[] data)Send data to destinationvoidsetBufferingThresholds(int sizeThreshold, int timeThreshold)Set write buffering thresholds.
-
-
-
Constructor Detail
-
TcpProxy
protected TcpProxy(NXCSession session, int channelId) throws IOException
TODO- Parameters:
session- TODOchannelId- TODO- Throws:
IOException- TODO
-
-
Method Detail
-
close
public void close()
Close proxy session. Calling this method will also close both input and output streams.
-
localClose
protected void localClose()
Close local resources associated with proxy session. Should only be called by remote proxy session closure notification handler.
-
isClosed
public boolean isClosed()
Check if proxy session is closed.- Returns:
- true if proxy session is closed
-
getInputStream
public InputStream getInputStream()
Get input stream for this TCP proxy.- Returns:
- input stream for this TCP proxy
-
getOutputStream
public OutputStream getOutputStream()
Get output stream for this TCP proxy.- Returns:
- output stream for this TCP proxy
-
getChannelId
protected int getChannelId()
Get channel ID- Returns:
- channel ID
-
getSizeThreshold
public int getSizeThreshold()
Get current size threshold.- Returns:
- current size threshold
-
getTimeThreshold
public int getTimeThreshold()
Get current time threshold.- Returns:
- current time threshold
-
setBufferingThresholds
public void setBufferingThresholds(int sizeThreshold, int timeThreshold)Set write buffering thresholds. If these parameters are non-zero, proxy object will buffer outgoing data until it reach size threshold, but not longer that time threshold.- Parameters:
sizeThreshold- data size threshold in bytestimeThreshold- time threshold in milliseconds
-
send
public void send(byte[] data) throws IOException, NXCExceptionSend data to destination- Parameters:
data- data block- Throws:
IOException- TODONXCException- TODO
-
processRemoteData
protected void processRemoteData(byte[] data)
Process data received from remote end- Parameters:
data- data received
-
-