com.sun.im.provider
Class ByteStreamFilter

java.lang.Object
  extended bycom.sun.im.provider.ByteStreamFilter

public abstract class ByteStreamFilter
extends java.lang.Object

Streamed content filtering provider All binary data of files exchanged by users through the server are transferred as follows: First a byte stream is created. it is identified by a sender, a recipient, and a stream id. Once the stream is open, the binary data is sent in chunks or blocks. After all the the data blocks have beedn sent, the originator closes the byte stream.

A ByteStreamFilter is a server plugin module that can be used to control, alter or discard all byte stream data going through the server. the module is invoked at byte stream creation, destruction and for each block of data. A filter module may hold one or more blocks before resubmitting them, or making another decision about what to do.


Constructor Summary
ByteStreamFilter()
           
 
Method Summary
 void closeStream(ByteStream stream)
          called when a new byte stream is closed
 void openStream(java.lang.String to, java.lang.String from, ByteStream stream)
          called when a new byte stream is open
 void processData(ByteStream stream, ByteStreamBlock block)
          process a binary data block contained in a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteStreamFilter

public ByteStreamFilter()
Method Detail

processData

public void processData(ByteStream stream,
                        ByteStreamBlock block)
process a binary data block contained in a stream. This method needs to be overriden in order tyo perform actual filtering.

Parameters:
stream - byte stream handle

openStream

public void openStream(java.lang.String to,
                       java.lang.String from,
                       ByteStream stream)
called when a new byte stream is open

Parameters:
from - data originator address, uses xmpp address format
to - data recipient address, uses xmpp address format
stream - byte stream handle

closeStream

public void closeStream(ByteStream stream)
called when a new byte stream is closed

Parameters:
stream - byte stream handle