Search in sources :

Example 21 with Job

use of org.ovirt.engine.core.common.job.Job in project ovirt-engine by oVirt.

the class EndExternalJobCommandTest method makeJob.

private Job makeJob() {
    Job job = new Job();
    job.setId(jobId);
    job.setDescription("Sample Job");
    return job;
}
Also used : Job(org.ovirt.engine.core.common.job.Job)

Example 22 with Job

use of org.ovirt.engine.core.common.job.Job in project ovirt-engine by oVirt.

the class EndExternalStepCommandTest method makeExternalTestJob.

private Job makeExternalTestJob(Guid jobId) {
    Job job = new Job();
    job.setId(jobId);
    job.setDescription("Sample Job");
    job.setExternal(true);
    return job;
}
Also used : Job(org.ovirt.engine.core.common.job.Job)

Example 23 with Job

use of org.ovirt.engine.core.common.job.Job in project ovirt-engine by oVirt.

the class AddExternalStepCommandTest method makeNonExternalTestJob.

private Job makeNonExternalTestJob(Guid jobId) {
    Job job = new Job();
    job.setId(jobId);
    job.setDescription("Sample Job");
    job.setExternal(false);
    return job;
}
Also used : Job(org.ovirt.engine.core.common.job.Job)

Example 24 with Job

use of org.ovirt.engine.core.common.job.Job in project ovirt-engine by oVirt.

the class ClearExternalJobCommandTest method makeTestJob.

private Job makeTestJob(Guid jobId) {
    Job job = new Job();
    job.setId(jobId);
    job.setDescription("Sample Job");
    job.setExternal(true);
    return job;
}
Also used : Job(org.ovirt.engine.core.common.job.Job)

Example 25 with Job

use of org.ovirt.engine.core.common.job.Job in project ovirt-engine by oVirt.

the class AbstractBackendResource method getJobIdStatus.

private CreationStatus getJobIdStatus(ActionReturnValue result) {
    Guid jobId = result.getJobId();
    if (jobId == null || jobId.equals(Guid.Empty)) {
        return CreationStatus.COMPLETE;
    } else {
        IdQueryParameters params = new IdQueryParameters(jobId);
        QueryReturnValue queryResult = runQuery(QueryType.GetJobByJobId, params);
        if (queryResult != null && queryResult.getSucceeded() && queryResult.getReturnValue() != null) {
            Job job = queryResult.getReturnValue();
            return job.getStatus() == JobExecutionStatus.STARTED ? CreationStatus.IN_PROGRESS : CreationStatus.COMPLETE;
        } else {
            // not supposed to happen
            return CreationStatus.COMPLETE;
        }
    }
}
Also used : QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) Guid(org.ovirt.engine.core.compat.Guid) Job(org.ovirt.engine.core.common.job.Job)

Aggregations

Job (org.ovirt.engine.core.common.job.Job)35 Step (org.ovirt.engine.core.common.job.Step)7 Date (java.util.Date)6 Guid (org.ovirt.engine.core.compat.Guid)6 JobExecutionStatus (org.ovirt.engine.core.common.job.JobExecutionStatus)4 ArrayList (java.util.ArrayList)3 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)3 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)3 Inject (com.google.inject.Inject)2 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Test (org.junit.Test)2 VdcObjectType (org.ovirt.engine.core.common.VdcObjectType)2 GetJobsByOffsetQueryParameters (org.ovirt.engine.core.common.queries.GetJobsByOffsetQueryParameters)2 Event (org.ovirt.engine.ui.uicompat.Event)2 EventArgs (org.ovirt.engine.ui.uicompat.EventArgs)2 IEventListener (org.ovirt.engine.ui.uicompat.IEventListener)2 TaskModelProvider (org.ovirt.engine.ui.webadmin.uicommon.model.TaskModelProvider)2