Package org.netxms.client
Class TcpProxy
java.lang.Object
org.netxms.client.TcpProxy
TCP proxy object
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedTcpProxy(NXCSession session, int channelId) Create new TCP proxy object.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidAbort TCP proxy session due to external error.voidclose()Close proxy session.protected intGet channel IDGet last exception generated when flushing output buffer.Get input stream for this TCP proxy.Get output stream for this TCP proxy.intGet current size threshold.intGet current time threshold.booleanisClosed()Check if proxy session is closed.protected voidClose 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 Details- 
TcpProxyCreate new TCP proxy object.- Parameters:
- session- underlying NetXMS client session
- channelId- proxy channel ID
- Throws:
- IOException- when input or output stream cannot be created
 
 
- 
- 
Method Details- 
closepublic void close()Close proxy session. Calling this method will also close both input and output streams.
- 
localCloseprotected void localClose()Close local resources associated with proxy session. Should only be called by remote proxy session closure notification handler.
- 
abortAbort TCP proxy session due to external error. Next attempt to read from this proxy input stream will throw IOException.- Parameters:
- cause- cause for abort
 
- 
isClosedpublic boolean isClosed()Check if proxy session is closed.- Returns:
- true if proxy session is closed
 
- 
getInputStreamGet input stream for this TCP proxy.- Returns:
- input stream for this TCP proxy
 
- 
getOutputStreamGet output stream for this TCP proxy.- Returns:
- output stream for this TCP proxy
 
- 
getChannelIdprotected int getChannelId()Get channel ID- Returns:
- channel ID
 
- 
getFlushExceptionGet last exception generated when flushing output buffer.- Returns:
- last exception generated when flushing output buffer or null
 
- 
getSizeThresholdpublic int getSizeThreshold()Get current size threshold.- Returns:
- current size threshold
 
- 
getTimeThresholdpublic int getTimeThreshold()Get current time threshold.- Returns:
- current time threshold
 
- 
setBufferingThresholdspublic 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 bytes
- timeThreshold- time threshold in milliseconds
 
- 
sendSend data to destination- Parameters:
- data- data block
- Throws:
- IOException- when client cannot send data to the server or channel is already closed
- NXCException- when NetXMS server cannot accept or forward data
 
- 
processRemoteDataprotected void processRemoteData(byte[] data) Process data received from remote end- Parameters:
- data- data received
 
 
-