org.alfresco.repo.transfer
Class RepoTransferReceiverImpl

java.lang.Object
  extended by org.alfresco.repo.transfer.RepoTransferReceiverImpl
All Implemented Interfaces:
TransferReceiver

public class RepoTransferReceiverImpl
extends java.lang.Object
implements TransferReceiver


Nested Class Summary
 class RepoTransferReceiverImpl.AsyncCommitCommand
          This embedded class is used to push requests for asynchronous commits onto a different thread
 
Constructor Summary
RepoTransferReceiverImpl()
           
 
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 init()
           
 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 contentFileId, java.io.InputStream contentStream)
           
 void saveSnapshot(java.lang.String transferId, java.io.InputStream openStream)
          Store the specified snapshot file into the transfer staging area.
 void setActionService(ActionService actionService)
           
 void setBehaviourFilter(BehaviourFilter behaviourFilter)
           
 void setInboundTransferRecordsPath(java.lang.String inboundTransferRecordsPath)
           
 void setManifestProcessorFactory(ManifestProcessorFactory manifestProcessorFactory)
           
 void setNodeService(NodeService nodeService)
           
 void setProgressMonitor(TransferProgressMonitor progressMonitor)
           
 void setRootStagingDirectory(java.lang.String rootStagingDirectory)
           
 void setSearchService(SearchService searchService)
           
 void setTenantService(TenantService tenantService)
           
 void setTransactionService(TransactionService transactionService)
           
 void setTransferLockFolderPath(java.lang.String transferLockFolderPath)
           
 void setTransferTempFolderPath(java.lang.String transferTempFolderPath)
           
 java.lang.String start()
          Asks the receiver to setup a new transfer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepoTransferReceiverImpl

public RepoTransferReceiverImpl()
Method Detail

init

public void init()

getStagingFolder

public java.io.File getStagingFolder(java.lang.String transferId)
Specified by:
getStagingFolder in interface TransferReceiver
Returns:

getTempFolder

public NodeRef getTempFolder(java.lang.String transferId)
Specified by:
getTempFolder in interface TransferReceiver
Returns:

start

public java.lang.String start()
Description copied from interface: TransferReceiver
Asks the receiver to setup a new transfer.

Specified by:
start in interface TransferReceiver
Returns:
The identifier of the new transfer

end

public void end(java.lang.String transferId)
Description copied from interface: TransferReceiver
Asks the receiver to end (and clean up) the specified transfer

Specified by:
end in interface TransferReceiver
Parameters:
transferId - The transfer to end

cancel

public void cancel(java.lang.String transferId)
            throws TransferException
Description copied from interface: TransferReceiver
Abort

Specified by:
cancel in interface TransferReceiver
Throws:
TransferException

prepare

public void prepare(java.lang.String transferId)
             throws TransferException
Description copied from interface: TransferReceiver
Prepare

Specified by:
prepare in interface TransferReceiver
Throws:
TransferException

nudgeLock

public void nudgeLock(java.lang.String transferId)
               throws TransferException
Description copied from interface: TransferReceiver
Nudge the transfer lock (to prevent it expiring) if the supplied transferId matches that referenced by the lock.

Specified by:
nudgeLock in interface TransferReceiver
Throws:
TransferException - if the lock doesn't exist or doesn't correspond to the supplied transferId.

saveSnapshot

public void saveSnapshot(java.lang.String transferId,
                         java.io.InputStream openStream)
                  throws TransferException
Description copied from interface: TransferReceiver
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.

Specified by:
saveSnapshot in interface TransferReceiver
Parameters:
transferId - The identifier of the transfer with which this snapshot is associated
openStream - The open stream that holds the snapshot file.
Throws:
TransferException - If an error occurs while saving the snapshot file.

saveContent

public void saveContent(java.lang.String transferId,
                        java.lang.String contentFileId,
                        java.io.InputStream contentStream)
                 throws TransferException
Specified by:
saveContent in interface TransferReceiver
Throws:
TransferException

commitAsync

public void commitAsync(java.lang.String transferId)
Description copied from interface: TransferReceiver
Commit asynchronously

Specified by:
commitAsync in interface TransferReceiver

commit

public void commit(java.lang.String transferId)
            throws TransferException
Description copied from interface: TransferReceiver
Commit

Specified by:
commit in interface TransferReceiver
Throws:
TransferException

getStatus

public TransferProgress getStatus(java.lang.String transferId)
                           throws TransferException
Specified by:
getStatus in interface TransferReceiver
Throws:
TransferException

setSearchService

public void setSearchService(SearchService searchService)
Parameters:
searchService - the searchService to set

setTransactionService

public void setTransactionService(TransactionService transactionService)
Parameters:
transactionService - the transactionService to set

setTenantService

public void setTenantService(TenantService tenantService)

setTransferLockFolderPath

public void setTransferLockFolderPath(java.lang.String transferLockFolderPath)
Parameters:
transferLockFolderPath - the transferLockFolderPath to set

setTransferTempFolderPath

public void setTransferTempFolderPath(java.lang.String transferTempFolderPath)
Parameters:
transferTempFolderPath - the transferTempFolderPath to set

setRootStagingDirectory

public void setRootStagingDirectory(java.lang.String rootStagingDirectory)
Parameters:
rootStagingDirectory - the rootTransferFolder to set

setInboundTransferRecordsPath

public void setInboundTransferRecordsPath(java.lang.String inboundTransferRecordsPath)
Parameters:
inboundTransferRecordsPath - the inboundTransferRecordsPath to set

setNodeService

public void setNodeService(NodeService nodeService)
Parameters:
nodeService - the nodeService to set

setManifestProcessorFactory

public void setManifestProcessorFactory(ManifestProcessorFactory manifestProcessorFactory)
Parameters:
manifestProcessorFactory - the manifestProcessorFactory to set

setBehaviourFilter

public void setBehaviourFilter(BehaviourFilter behaviourFilter)
Parameters:
behaviourFilter - the behaviourFilter to set

getProgressMonitor

public TransferProgressMonitor getProgressMonitor()
Specified by:
getProgressMonitor in interface TransferReceiver
Returns:
the progressMonitor

setProgressMonitor

public void setProgressMonitor(TransferProgressMonitor progressMonitor)
Parameters:
progressMonitor - the progressMonitor to set

setActionService

public void setActionService(ActionService actionService)


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