mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-4346 & ALF-4348 - More work on schedulable actions, and start to expose this through to the replication service
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22019 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,10 +21,12 @@ package org.alfresco.repo.replication;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.action.ActionImpl;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.scheduled.ScheduledPersistedAction;
|
||||
import org.alfresco.service.cmr.replication.ReplicationDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -48,6 +50,8 @@ public class ReplicationDefinitionImpl extends ActionImpl implements Replication
|
||||
public static final String REPLICATION_DEFINITION_LOCAL_TRANSFER_REPORT = "replicationTransferLocalReport";
|
||||
public static final String REPLICATION_DEFINITION_REMOTE_TRANSFER_REPORT = "replicationTransferRemoteReport";
|
||||
|
||||
private ScheduledPersistedAction schedule;
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* the action id
|
||||
@@ -209,4 +213,54 @@ public class ReplicationDefinitionImpl extends ActionImpl implements Replication
|
||||
public void setRemoteTransferReport(NodeRef report) {
|
||||
setParameterValue(REPLICATION_DEFINITION_REMOTE_TRANSFER_REPORT, report);
|
||||
}
|
||||
|
||||
public ScheduledPersistedAction getSchedule()
|
||||
{
|
||||
return schedule;
|
||||
}
|
||||
|
||||
public void setSchedule(ScheduledPersistedAction schedule)
|
||||
{
|
||||
this.schedule = schedule;
|
||||
}
|
||||
|
||||
public Integer getScheduleIntervalCount() {
|
||||
if(schedule == null)
|
||||
return null;
|
||||
return schedule.getScheduleIntervalCount();
|
||||
}
|
||||
|
||||
public IntervalPeriod getScheduleIntervalPeriod() {
|
||||
if(schedule == null)
|
||||
return null;
|
||||
return schedule.getScheduleIntervalPeriod();
|
||||
}
|
||||
|
||||
public Date getScheduleStart() {
|
||||
if(schedule == null)
|
||||
return null;
|
||||
return schedule.getScheduleStart();
|
||||
}
|
||||
|
||||
public void setScheduleIntervalCount(Integer count) {
|
||||
if(schedule == null)
|
||||
throw new IllegalStateException("Scheduling not enabled");
|
||||
schedule.setScheduleIntervalCount(count);
|
||||
}
|
||||
|
||||
public void setScheduleIntervalPeriod(IntervalPeriod period) {
|
||||
if(schedule == null)
|
||||
throw new IllegalStateException("Scheduling not enabled");
|
||||
schedule.setScheduleIntervalPeriod(period);
|
||||
}
|
||||
|
||||
public void setScheduleStart(Date startDate) {
|
||||
if(schedule == null)
|
||||
throw new IllegalStateException("Scheduling not enabled");
|
||||
schedule.setScheduleStart(startDate);
|
||||
}
|
||||
|
||||
public boolean isSchedulingEnabled() {
|
||||
return (schedule != null);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user