use of org.ovirt.engine.core.common.job.Step in project ovirt-engine by oVirt.
the class TaskStatusColumn method getTooltip.
@Override
public SafeHtml getTooltip(EntityModel jobOrStep) {
JobExecutionStatus jobExecutionStatus = null;
if (jobOrStep.getEntity() instanceof Job) {
jobExecutionStatus = ((Job) jobOrStep.getEntity()).getStatus();
} else if (jobOrStep.getEntity() instanceof Step) {
jobExecutionStatus = ((Step) jobOrStep.getEntity()).getStatus();
} else {
return null;
}
String tooltipContent = EnumTranslator.getInstance().translate(jobExecutionStatus);
return SafeHtmlUtils.fromString(tooltipContent);
}
use of org.ovirt.engine.core.common.job.Step in project ovirt-engine by oVirt.
the class ImportVmFromExternalProviderCommand method createConversionStepContext.
protected CommandContext createConversionStepContext(StepEnum step) {
CommandContext commandCtx = null;
try {
Map<String, String> values = Collections.singletonMap(VdcObjectType.VM.name().toLowerCase(), getVmName());
Step conversionStep = executionHandler.addSubStep(getExecutionContext(), getExecutionContext().getJob().getStep(StepEnum.EXECUTING), step, ExecutionMessageDirector.resolveStepMessage(step, values));
ExecutionContext ctx = new ExecutionContext();
ctx.setStep(conversionStep);
ctx.setMonitored(true);
commandCtx = cloneContext().withoutCompensationContext().withExecutionContext(ctx).withoutLock();
} catch (RuntimeException e) {
log.error("Failed to create command context of converting VM '{}': {}", getVmName(), e.getMessage());
log.debug("Exception", e);
}
return commandCtx;
}
use of org.ovirt.engine.core.common.job.Step in project ovirt-engine by oVirt.
the class GlusterAsyncCommandBase method endStepJob.
protected void endStepJob(JobExecutionStatus status, Map<String, String> stepMessageMap, boolean exitStatus) {
GlusterAsyncTask asyncTask = getGlusterVolume().getAsyncTask();
// Gluster Task will be associated with only one step ( REBALANCING_VOLUME or REMOVING_BRICK)
Step step = stepDao.getStepsByExternalId(asyncTask.getTaskId()).get(0);
step.setStatus(status);
step.setEndTime(new Date());
step.setDescription(ExecutionMessageDirector.resolveStepMessage(getStepType(), stepMessageMap));
jobRepository.updateStep(step);
ExecutionContext finalContext = executionHandler.createFinalizingContext(step.getId());
executionHandler.endTaskStepAndJob(finalContext, exitStatus);
}
use of org.ovirt.engine.core.common.job.Step in project ovirt-engine by oVirt.
the class LiveMigrateDiskCommand method createStepsContext.
private CommandContext createStepsContext(StepEnum step) {
Step addedStep = executionHandler.addSubStep(getExecutionContext(), getExecutionContext().getJob().getStep(StepEnum.EXECUTING), step, ExecutionMessageDirector.resolveStepMessage(step, Collections.emptyMap()));
ExecutionContext ctx = new ExecutionContext();
ctx.setStep(addedStep);
ctx.setMonitored(true);
CommandContext commandCtx = ExecutionHandler.createDefaultContextForTasks(getContext(), null).withExecutionContext(ctx);
return commandCtx;
}
use of org.ovirt.engine.core.common.job.Step in project ovirt-engine by oVirt.
the class EndExternalStepCommandTest method makeExternalTestStep.
private Step makeExternalTestStep(Guid id, Guid stepId) {
Step step = new Step();
step.setId(stepId);
step.setJobId(id);
step.setDescription("Sample Step");
step.setExternal(true);
return step;
}
Aggregations