Search in sources :

Example 26 with ExecutionContext

use of org.ovirt.engine.core.bll.job.ExecutionContext in project ovirt-engine by oVirt.

the class EndExternalStepCommand method executeCommand.

@Override
protected void executeCommand() {
    ExecutionContext context = new ExecutionContext();
    context.setJob(job);
    context.setStep(step);
    context.setMonitored(true);
    context.setExecutionMethod(ExecutionMethod.AsStep);
    executionHandler.endStep(context, step, getParameters().getStatus());
    setSucceeded(true);
}
Also used : ExecutionContext(org.ovirt.engine.core.bll.job.ExecutionContext)

Example 27 with ExecutionContext

use of org.ovirt.engine.core.bll.job.ExecutionContext in project ovirt-engine by oVirt.

the class CommandHelper method buildCommand.

public static CommandBase<?> buildCommand(ActionType actionType, ActionParametersBase parameters, ExecutionContext executionContext, CommandStatus cmdStatus) {
    ExecutionContext cmdExecutionContext = executionContext == null ? new ExecutionContext() : executionContext;
    CommandBase<?> command = CommandsFactory.createCommand(actionType, parameters, new CommandContext(new EngineContext()).withExecutionContext(cmdExecutionContext));
    command.setCommandStatus(cmdStatus, false);
    return command;
}
Also used : ExecutionContext(org.ovirt.engine.core.bll.job.ExecutionContext) CommandContext(org.ovirt.engine.core.bll.context.CommandContext) EngineContext(org.ovirt.engine.core.bll.context.EngineContext)

Aggregations

ExecutionContext (org.ovirt.engine.core.bll.job.ExecutionContext)27 Step (org.ovirt.engine.core.common.job.Step)14 CommandContext (org.ovirt.engine.core.bll.context.CommandContext)9 HashMap (java.util.HashMap)4 EngineContext (org.ovirt.engine.core.bll.context.EngineContext)3 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)3 EngineException (org.ovirt.engine.core.common.errors.EngineException)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 CommandMultiAsyncTasks (org.ovirt.engine.core.bll.CommandMultiAsyncTasks)1 HostProviderProxy (org.ovirt.engine.core.bll.host.provider.HostProviderProxy)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 RunVmParams (org.ovirt.engine.core.common.action.RunVmParams)1 SetStoragePoolStatusParameters (org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters)1 VdsActionParameters (org.ovirt.engine.core.common.action.VdsActionParameters)1 AddVdsActionParameters (org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters)1 InstallVdsParameters (org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters)1 EndedTaskInfo (org.ovirt.engine.core.common.asynctasks.EndedTaskInfo)1 EntityInfo (org.ovirt.engine.core.common.asynctasks.EntityInfo)1 GlusterAsyncTask (org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask)1