mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Replication/Transfer tidy up:
- TransferFailureException: TransferEndEvent getEndEvent() -> TransferEventError getErrorEvent() - Client cancel only processed on first request from client git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22406 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -268,7 +268,8 @@ public class ReplicationActionExecutor extends ActionExecuterAbstractBase {
|
|||||||
{
|
{
|
||||||
TransferEventError failureEndEvent = ((TransferFailureException)e).getErrorEvent();
|
TransferEventError failureEndEvent = ((TransferFailureException)e).getErrorEvent();
|
||||||
writeDefinitionReports(replicationDef, failureEndEvent.getSourceReport(), failureEndEvent.getDestinationReport());
|
writeDefinitionReports(replicationDef, failureEndEvent.getSourceReport(), failureEndEvent.getDestinationReport());
|
||||||
throw new ReplicationServiceException("Error executing transfer - " + e.getCause().getMessage(), e);
|
Throwable cause = (e.getCause() == null) ? e : e.getCause();
|
||||||
|
throw new ReplicationServiceException("Error executing transfer - " + cause.getMessage(), cause);
|
||||||
}
|
}
|
||||||
writeDefinitionReports(replicationDef, null, null);
|
writeDefinitionReports(replicationDef, null, null);
|
||||||
throw new ReplicationServiceException("Error executing transfer - " + e.getMessage(), e);
|
throw new ReplicationServiceException("Error executing transfer - " + e.getMessage(), e);
|
||||||
|
@@ -728,9 +728,8 @@ public class TransferServiceImpl2 implements TransferService2
|
|||||||
logger.debug("TransferException - unable to transfer", failureException);
|
logger.debug("TransferException - unable to transfer", failureException);
|
||||||
TransferEventError errorEvent = new TransferEventError();
|
TransferEventError errorEvent = new TransferEventError();
|
||||||
errorEvent.setTransferState(TransferEvent.TransferState.ERROR);
|
errorEvent.setTransferState(TransferEvent.TransferState.ERROR);
|
||||||
TransferFailureException endException = new TransferFailureException(errorEvent);
|
errorEvent.setException(failureException);
|
||||||
errorEvent.setMessage(endException.getMessage());
|
errorEvent.setMessage(failureException.getMessage());
|
||||||
errorEvent.setException(endException);
|
|
||||||
endEventImpl = errorEvent;
|
endEventImpl = errorEvent;
|
||||||
}
|
}
|
||||||
else if (cancelled)
|
else if (cancelled)
|
||||||
@@ -832,7 +831,7 @@ public class TransferServiceImpl2 implements TransferService2
|
|||||||
if (endEvent instanceof TransferEventError)
|
if (endEvent instanceof TransferEventError)
|
||||||
{
|
{
|
||||||
TransferEventError endError = (TransferEventError)endEvent;
|
TransferEventError endError = (TransferEventError)endEvent;
|
||||||
throw (TransferFailureException)endError.getException();
|
throw new TransferFailureException(endError);
|
||||||
}
|
}
|
||||||
return endEvent;
|
return endEvent;
|
||||||
}
|
}
|
||||||
@@ -1044,8 +1043,9 @@ public class TransferServiceImpl2 implements TransferService2
|
|||||||
TransferStatus status = transferMonitoring.get(transferHandle);
|
TransferStatus status = transferMonitoring.get(transferHandle);
|
||||||
if(status != null)
|
if(status != null)
|
||||||
{
|
{
|
||||||
if(status.cancelMe)
|
if(!status.cancelInProgress && status.cancelMe)
|
||||||
{
|
{
|
||||||
|
status.cancelInProgress = true;
|
||||||
throw new TransferCancelledException();
|
throw new TransferCancelledException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1394,6 +1394,7 @@ public class TransferServiceImpl2 implements TransferService2
|
|||||||
private class TransferStatus
|
private class TransferStatus
|
||||||
{
|
{
|
||||||
boolean cancelMe = false;
|
boolean cancelMe = false;
|
||||||
|
boolean cancelInProgress = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user