com.healthmarketscience.rmiio
Interface RemoteStreamMonitor<StreamServerType>

All Known Implementing Classes:
RemoteInputStreamMonitor, RemoteOutputStreamMonitor

public interface RemoteStreamMonitor<StreamServerType>

Interface for monitoring the progress of a remote stream, such as RemoteInputStream or RemoteOutputStream.

Author:
James Ahlborn

Method Summary
 void bytesMoved(StreamServerType stream, int numBytes, boolean isReattempt)
          Called when some bytes are transferred over the wire by the given stream.
 void bytesSkipped(StreamServerType stream, long numBytes, boolean isReattempt)
          Called when some bytes are skipped for transfer over the wire by the given stream.
 void closed(StreamServerType stream, boolean clean)
          Called when the given stream is closed.
 void failure(StreamServerType stream, Exception e)
          Called when an IOException is thrown by one of the stream methods.
 void localBytesMoved(StreamServerType stream, int numBytes)
          Called when some bytes are moved to/from the local stream.
 void localBytesSkipped(StreamServerType stream, long numBytes)
          Called when some bytes from the local stream are skipped.
 

Method Detail

failure

void failure(StreamServerType stream,
             Exception e)
Called when an IOException is thrown by one of the stream methods.

Parameters:
stream - the stream on which the exception was thrown
e - the thrown exception

bytesMoved

void bytesMoved(StreamServerType stream,
                int numBytes,
                boolean isReattempt)
Called when some bytes are transferred over the wire by the given stream. Note, as some streams use compression over the wire, the total number of bytes moved/skipped may not equal the total number of local bytes moved/skipped.

Parameters:
stream - the stream for which the bytes are being transferred
numBytes - number of bytes transferred
isReattempt - indicates if this is the first attempt (false) or a subsequent attempt (true)

bytesSkipped

void bytesSkipped(StreamServerType stream,
                  long numBytes,
                  boolean isReattempt)
Called when some bytes are skipped for transfer over the wire by the given stream. Will not be called for output streams. Note, as some streams use compression over the wire, the total number of bytes moved/skipped may not equal the total number of local bytes moved/skipped.

Parameters:
stream - the stream for which the bytes are being skipped
numBytes - number of actual bytes skipped
isReattempt - indicates if this is the first attempt (false) or a subsequent attempt (true)

localBytesMoved

void localBytesMoved(StreamServerType stream,
                     int numBytes)
Called when some bytes are moved to/from the local stream. Note, as some streams use compression over the wire, the total number of bytes moved/skipped may not equal the total number of local bytes moved/skipped.

Parameters:
stream - the remote stream for which the bytes are being moved
numBytes - number of bytes moved

localBytesSkipped

void localBytesSkipped(StreamServerType stream,
                       long numBytes)
Called when some bytes from the local stream are skipped. Will not be called for output streams. Note, as some streams use compression over the wire, the total number of bytes moved/skipped may not equal the total number of local bytes moved/skipped.

Parameters:
stream - the stream for which the bytes are being skipped
numBytes - number of actual bytes skipped

closed

void closed(StreamServerType stream,
            boolean clean)
Called when the given stream is closed. The clean parameter indicates whether or not the transfer completed successfully.

Parameters:
stream - the stream for which the bytes are being skipped
clean - true iff all data was sent successfully over the wire and the stream was closed, false otherwise.


Copyright © 2006–2016 Health Market Science. All rights reserved.