Search in sources :

Example 1 with DistributionJobStatus

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;
}
Also used : JobStatus(org.xwiki.job.event.status.JobStatus) DistributionJobStatus(org.xwiki.extension.distribution.internal.job.DistributionJobStatus) DistributionJobStatus(org.xwiki.extension.distribution.internal.job.DistributionJobStatus)

Example 2 with DistributionJobStatus

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);
    }
}
Also used : DistributionRequest(org.xwiki.extension.distribution.internal.job.DistributionRequest) DistributionJobStatus(org.xwiki.extension.distribution.internal.job.DistributionJobStatus)

Example 3 with DistributionJobStatus

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();
    }
}
Also used : DistributionJobStatus(org.xwiki.extension.distribution.internal.job.DistributionJobStatus)

Aggregations

DistributionJobStatus (org.xwiki.extension.distribution.internal.job.DistributionJobStatus)3 DistributionRequest (org.xwiki.extension.distribution.internal.job.DistributionRequest)1 JobStatus (org.xwiki.job.event.status.JobStatus)1