use of org.xwiki.extension.distribution.internal.job.DistributionJobStatus in project xwiki-platform by xwiki.
the class DefaultDistributionManager method getPreviousFarmJobStatus.
@Override
public DistributionJobStatus getPreviousFarmJobStatus() {
JobStatus jobStatus = this.jobStore.getJobStatus(getFarmJobId());
DistributionJobStatus farmJobStatus;
if (jobStatus != null) {
if (jobStatus instanceof DistributionJobStatus) {
farmJobStatus = (DistributionJobStatus) jobStatus;
} else {
// RETRO-COMPATIBILITY: the status used to be a DistributionJobStatus
farmJobStatus = new DistributionJobStatus(jobStatus, this.observationManagerProvider.get(), this.loggerManagerProvider.get());
}
} else {
farmJobStatus = null;
}
return farmJobStatus;
}
use of org.xwiki.extension.distribution.internal.job.DistributionJobStatus in project xwiki-platform by xwiki.
the class DefaultDistributionManager method copyPreviousWikiJobStatus.
@Override
public void copyPreviousWikiJobStatus(String sourceWiki, String targetWiki) {
DistributionJobStatus sourceStatus = getPreviousWikiJobStatus(sourceWiki);
if (sourceStatus != null) {
DistributionJobStatus targetStatus = new DistributionJobStatus(sourceStatus, this.observationManagerProvider.get(), this.loggerManagerProvider.get());
DistributionRequest request = targetStatus.getRequest();
request.setId(getWikiJobId(targetWiki));
request.setWiki(targetWiki);
this.jobStatusStorage.store(targetStatus);
}
}
use of org.xwiki.extension.distribution.internal.job.DistributionJobStatus in project xwiki-platform by xwiki.
the class AbstractDistributionStep method initialize.
@Override
public void initialize(DistributionJob distributionJob) {
this.distributionJob = distributionJob;
// Remember previous state
DistributionJobStatus previousStatus = this.distributionJob.getPreviousStatus();
if (previousStatus != null && previousStatus.getDistributionExtension().equals(this.distributionJob.getStatus().getDistributionExtension())) {
DistributionStep previousStep = previousStatus.getStep(getId());
if (previousStep != null) {
setState(previousStep.getState());
}
}
if (getState() == null) {
prepare();
}
}
Aggregations