mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Replication Definition enable/disable/check support (Replication 69+70)
Ability to enable and disable replication definitions, which the executor checks, along with unit tests git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21382 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,7 +22,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
|
||||
import org.alfresco.repo.lock.JobLockService;
|
||||
@@ -30,7 +29,6 @@ import org.alfresco.repo.lock.LockAcquisitionException;
|
||||
import org.alfresco.repo.transfer.ChildAssociatedNodeFinder;
|
||||
import org.alfresco.repo.transfer.ContentClassFilter;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionDefinition;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.replication.ReplicationDefinition;
|
||||
import org.alfresco.service.cmr.replication.ReplicationService;
|
||||
@@ -168,6 +166,10 @@ public class ReplicationActionExecutor extends ActionExecuterAbstractBase {
|
||||
{
|
||||
throw new ReplicationServiceException("No payloads were specified");
|
||||
}
|
||||
if(!replicationDef.isEnabled())
|
||||
{
|
||||
throw new ReplicationServiceException("Unable to execute a disabled replication definition");
|
||||
}
|
||||
|
||||
// Lock the service - only one instance of the replication
|
||||
// should occur at a time
|
||||
@@ -226,11 +228,15 @@ public class ReplicationActionExecutor extends ActionExecuterAbstractBase {
|
||||
}
|
||||
/**
|
||||
* No matter what the event is, refresh
|
||||
* our lock on the {@link ReplicationDefinition}
|
||||
* our lock on the {@link ReplicationDefinition}, and
|
||||
* handle a cancel if it was requested.
|
||||
*/
|
||||
public void processEvent(TransferEvent event)
|
||||
{
|
||||
refreshLock();
|
||||
|
||||
// TODO - Check to see if cancel was requested
|
||||
// TODO - If it was, use TransferService.cancelAsync(transferId)
|
||||
}
|
||||
/**
|
||||
* Give up our lock on the
|
||||
|
Reference in New Issue
Block a user