org.alfresco.service.cmr.transfer
Interface TransferReceiver

All Known Implementing Classes:
RepoTransferReceiverImpl

public interface TransferReceiver


Method Summary
 void cancel(java.lang.String transferId)
          Abort
 void commit(java.lang.String transferId)
          Commit
 void commitAsync(java.lang.String transferId)
          Commit asynchronously
 void end(java.lang.String transferId)
          Asks the receiver to end (and clean up) the specified transfer
 TransferProgressMonitor getProgressMonitor()
           
 java.io.File getStagingFolder(java.lang.String transferId)
           
 TransferProgress getStatus(java.lang.String transferId)
           
 NodeRef getTempFolder(java.lang.String transferId)
           
 void nudgeLock(java.lang.String transferId)
          Nudge the transfer lock (to prevent it expiring) if the supplied transferId matches that referenced by the lock.
 void prepare(java.lang.String transferId)
          Prepare
 void saveContent(java.lang.String transferId, java.lang.String contentId, java.io.InputStream contentStream)
           
 void saveSnapshot(java.lang.String transferId, java.io.InputStream snapshotStream)
          Store the specified snapshot file into the transfer staging area.
 java.lang.String start()
          Asks the receiver to setup a new transfer.
 

Method Detail

getStagingFolder

java.io.File getStagingFolder(java.lang.String transferId)
Parameters:
transferId -
Returns:

getTempFolder

NodeRef getTempFolder(java.lang.String transferId)
Parameters:
transferId -
Returns:

start

java.lang.String start()
                       throws TransferException
Asks the receiver to setup a new transfer.

Returns:
The identifier of the new transfer
Throws:
TransferException - if an error occurred while setting up the transfer

end

void end(java.lang.String transferId)
         throws TransferException
Asks the receiver to end (and clean up) the specified transfer

Parameters:
transferId - The transfer to end
Throws:
TransferException - If the process of ending the transfer fails

nudgeLock

void nudgeLock(java.lang.String transferId)
               throws TransferException
Nudge the transfer lock (to prevent it expiring) if the supplied transferId matches that referenced by the lock.

Parameters:
transferId -
Throws:
TransferException - if the lock doesn't exist or doesn't correspond to the supplied transferId.

saveSnapshot

void saveSnapshot(java.lang.String transferId,
                  java.io.InputStream snapshotStream)
                  throws TransferException
Store the specified snapshot file into the transfer staging area. The specified transfer must currently be the holder of the transfer lock, otherwise an exception is thrown. This operation does not close the supplied stream, so the caller must do it as appropriate. The caller should assume that the supplied stream has been fully read when this operation returns.

Parameters:
transferId - The identifier of the transfer with which this snapshot is associated
snapshotStream - The open stream that holds the snapshot file.
Throws:
TransferException - If an error occurs while saving the snapshot file.

saveContent

void saveContent(java.lang.String transferId,
                 java.lang.String contentId,
                 java.io.InputStream contentStream)
                 throws TransferException
Throws:
TransferException

prepare

void prepare(java.lang.String transferId)
             throws TransferException
Prepare

Parameters:
transferId -
Throws:
TransferException

cancel

void cancel(java.lang.String transferId)
            throws TransferException
Abort

Parameters:
transferId -
Throws:
TransferException

commitAsync

void commitAsync(java.lang.String transferId)
                 throws TransferException
Commit asynchronously

Parameters:
transferId -
Throws:
TransferException

commit

void commit(java.lang.String transferId)
            throws TransferException
Commit

Parameters:
transferId -
Throws:
TransferException

getStatus

TransferProgress getStatus(java.lang.String transferId)
                           throws TransferException
Throws:
TransferException

getProgressMonitor

TransferProgressMonitor getProgressMonitor()


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.