Package org.alfresco.repo.transfer
Class AbstractTransferProgressMonitor
- java.lang.Object
-
- org.alfresco.repo.transfer.AbstractTransferProgressMonitor
-
- All Implemented Interfaces:
TransferProgressMonitor
- Direct Known Subclasses:
RepoTransferProgressMonitorImpl
public abstract class AbstractTransferProgressMonitor extends java.lang.Object implements TransferProgressMonitor
- Author:
- brian
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringMSG_TRANSFER_CANCELLEDprotected static java.lang.StringMSG_TRANSFER_NOT_FOUND
-
Constructor Summary
Constructors Constructor Description AbstractTransferProgressMonitor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.io.WritercreateUnderlyingLogWriter(java.lang.String transferId)TransferProgressgetProgress(java.lang.String transferId)Read the progress of theprotected abstract TransferProgressgetProgressInternal(java.lang.String transferId)voidlogComment(java.lang.String transferId, java.lang.Object obj)log an ad-hoc messagevoidlogCreated(java.lang.String transferId, org.alfresco.service.cmr.repository.NodeRef sourceNode, org.alfresco.service.cmr.repository.NodeRef destNode, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, java.lang.String parentPath, boolean orphan)Log the creation of a new nodevoidlogDeleted(java.lang.String transferId, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef destNodeRef, java.lang.String oldPath)Log the deletion of a nodevoidlogException(java.lang.String transferId, java.lang.Object obj, java.lang.Throwable ex)log an ad-hoc message and an exceptionvoidlogMoved(java.lang.String transferId, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef destNodeRef, java.lang.String oldPath, org.alfresco.service.cmr.repository.NodeRef newParentNodeRef, java.lang.String newPath)After the transfer has completed this method reads the log.voidlogUpdated(java.lang.String transferId, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef destNodeRef, java.lang.String path)Log the creation of a new nodevoidsetTransactionService(TransactionService transactionService)protected abstract voidstoreError(java.lang.String transferId, java.lang.Throwable error)voidupdateProgress(java.lang.String transferId, int currPos)update the progress of the specified transfervoidupdateProgress(java.lang.String transferId, int currPos, int endPos)update the progress of the specified transfer and possibly change the end position.protected abstract voidupdateProgressInternal(java.lang.String transferId, int currPos)protected abstract voidupdateProgressInternal(java.lang.String transferId, int currPos, int endPos)voidupdateStatus(java.lang.String transferId, TransferProgress.Status status)update the startus of the transferprotected abstract voidupdateStatusInternal(java.lang.String transferId, TransferProgress.Status status)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.transfer.TransferProgressMonitor
getLogInputStream
-
-
-
-
Field Detail
-
MSG_TRANSFER_NOT_FOUND
protected static final java.lang.String MSG_TRANSFER_NOT_FOUND
- See Also:
- Constant Field Values
-
MSG_TRANSFER_CANCELLED
protected static final java.lang.String MSG_TRANSFER_CANCELLED
- See Also:
- Constant Field Values
-
-
Method Detail
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
-
getProgress
public TransferProgress getProgress(java.lang.String transferId) throws TransferException
Description copied from interface:TransferProgressMonitorRead the progress of the- Specified by:
getProgressin interfaceTransferProgressMonitor- Parameters:
transferId- String- Returns:
- the progress of the transfer
- Throws:
TransferException
-
getProgressInternal
protected abstract TransferProgress getProgressInternal(java.lang.String transferId)
-
updateProgress
public void updateProgress(java.lang.String transferId, int currPos, int endPos) throws TransferExceptionDescription copied from interface:TransferProgressMonitorupdate the progress of the specified transfer and possibly change the end position.- Specified by:
updateProgressin interfaceTransferProgressMonitor- Parameters:
transferId- StringcurrPos- intendPos- int- Throws:
TransferException
-
updateProgressInternal
protected abstract void updateProgressInternal(java.lang.String transferId, int currPos, int endPos)
-
updateProgress
public void updateProgress(java.lang.String transferId, int currPos) throws TransferExceptionDescription copied from interface:TransferProgressMonitorupdate the progress of the specified transfer- Specified by:
updateProgressin interfaceTransferProgressMonitor- Parameters:
transferId- StringcurrPos- int- Throws:
TransferException
-
updateProgressInternal
protected abstract void updateProgressInternal(java.lang.String transferId, int currPos)
-
updateStatus
public final void updateStatus(java.lang.String transferId, TransferProgress.Status status) throws TransferExceptionDescription copied from interface:TransferProgressMonitorupdate the startus of the transfer- Specified by:
updateStatusin interfaceTransferProgressMonitor- Parameters:
transferId- Stringstatus- TransferProgress.Status- Throws:
TransferException
-
updateStatusInternal
protected abstract void updateStatusInternal(java.lang.String transferId, TransferProgress.Status status)
-
logComment
public void logComment(java.lang.String transferId, java.lang.Object obj)Description copied from interface:TransferProgressMonitorlog an ad-hoc message- Specified by:
logCommentin interfaceTransferProgressMonitor- Parameters:
transferId- Stringobj- Object
-
logException
public void logException(java.lang.String transferId, java.lang.Object obj, java.lang.Throwable ex)Description copied from interface:TransferProgressMonitorlog an ad-hoc message and an exception- Specified by:
logExceptionin interfaceTransferProgressMonitor- Parameters:
transferId- Stringobj- Objectex- Throwable
-
storeError
protected abstract void storeError(java.lang.String transferId, java.lang.Throwable error)
-
logCreated
public void logCreated(java.lang.String transferId, org.alfresco.service.cmr.repository.NodeRef sourceNode, org.alfresco.service.cmr.repository.NodeRef destNode, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, java.lang.String parentPath, boolean orphan)Description copied from interface:TransferProgressMonitorLog the creation of a new node- Specified by:
logCreatedin interfaceTransferProgressMonitor- Parameters:
transferId- StringsourceNode- NodeRefdestNode- NodeRefparentPath- Stringorphan- boolean
-
logUpdated
public void logUpdated(java.lang.String transferId, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef destNodeRef, java.lang.String path)Description copied from interface:TransferProgressMonitorLog the creation of a new node- Specified by:
logUpdatedin interfaceTransferProgressMonitor- Parameters:
transferId- StringsourceNodeRef- NodeRefdestNodeRef- NodeRefpath- The path of the updated node
-
logMoved
public void logMoved(java.lang.String transferId, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef destNodeRef, java.lang.String oldPath, org.alfresco.service.cmr.repository.NodeRef newParentNodeRef, java.lang.String newPath)Description copied from interface:TransferProgressMonitorAfter the transfer has completed this method reads the log.- Specified by:
logMovedin interfaceTransferProgressMonitor- Parameters:
transferId- StringsourceNodeRef- NodeRefdestNodeRef- NodeRefoldPath- StringnewParentNodeRef- NodeRefnewPath- String
-
logDeleted
public void logDeleted(java.lang.String transferId, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef destNodeRef, java.lang.String oldPath)Description copied from interface:TransferProgressMonitorLog the deletion of a node- Specified by:
logDeletedin interfaceTransferProgressMonitor- Parameters:
transferId- StringsourceNodeRef- NodeRefdestNodeRef- NodeRefoldPath- The path of the deleted node
-
createUnderlyingLogWriter
protected abstract java.io.Writer createUnderlyingLogWriter(java.lang.String transferId)
-
-