Class AbstractDocumentProcessor

java.lang.Object
de.elo.ix.client.devents.AbstractDocumentProcessor
All Implemented Interfaces:
byps.Remote, DocumentProcessor, de.elo.utils.net.Remote, Remote

public abstract class AbstractDocumentProcessor extends Object implements DocumentProcessor
This class helps to provide a document processor that modifies document related streams.
  • Constructor Details

    • AbstractDocumentProcessor

      public AbstractDocumentProcessor(IXConnection conn, UpDownloadEventInfo rwInfo)
      Constructor.
      Parameters:
      conn - IXConnection
      rwInfo - Parameters passed in upload or download event.
  • Method Details

    • beginDownload

      public abstract DocumentProcessor beginDownload() throws byps.RemoteException
      The Subclass returns a document processor, if document stream shall be processed.
      Returns:
      DocumentProcessor object (e.g. this) or null.
      Throws:
      byps.RemoteException
    • beginUpload

      public abstract DocumentProcessor beginUpload() throws byps.RemoteException
      The Subclass returns a document processor, if document stream shall be processed.
      Returns:
      DocumentProcessor object (e.g. this) or null.
      Throws:
      byps.RemoteException
    • processStream

      protected abstract void processStream(InputStream istream, OutputStream ostream) throws IOException
      The Subclass processes the document stream.
      Parameters:
      istream - Read from this stream.
      ostream - Write into this stream.
      Throws:
      IOException
    • createProcessingStream

      protected ContentStream createProcessingStream(ContentStream originalStream)
      Initialize a ContentStream object used as return value in process(ContentStream).
      Parameters:
      originalStream - Originial stream passed in process(ContentStream)
      Returns:
      ContentStream as destination stream.
    • process

      public ContentStream process(ContentStream originalStream) throws byps.RemoteException
      Description copied from interface: DocumentProcessor
      Process the given stream.
      Specified by:
      process in interface DocumentProcessor
      Parameters:
      originalStream - Stream to be processed.
      Returns:
      Modified stream.
      Throws:
      byps.RemoteException
    • getConn

      public IXConnection getConn()
    • getUpDownloadInfo

      public UpDownloadEventInfo getUpDownloadInfo()
    • ensureRequiredMembers

      public Sord ensureRequiredMembers(long requiredMembers) throws byps.RemoteException
      Ensure that the Sord in upDownloadInfo contains the required members. This function might create a new Sord object.
      Parameters:
      requiredMembers - Required members.
      Returns:
      Sord with required members.
      Throws:
      byps.RemoteException
    • processStreamAsync

      protected void processStreamAsync(ContentStream originalStream, ContentStream processingStream, PipedOutputStream pos) throws IOException
      Throws:
      IOException