package be.iminds.ilabt.jfed.highlevel.jobs.states;

import be.iminds.ilabt.jfed.experiment.SfaExperimentPart;
import be.iminds.ilabt.jfed.highlevel.jobs.Job;
import be.iminds.ilabt.jfed.highlevel.jobs.SingleCallState;
import be.iminds.ilabt.jfed.highlevel.tasks.DeleteSliversAtAuthorityTask;
import be.iminds.ilabt.jfed.highlevel.tasks.HighLevelTaskFactory;

/**
 * User: twalcari
 * Date: 12/4/2015
 * Time: 15:30
 */
public class StopExperimentAtAuthorityPartState extends SingleCallState<DeleteSliversAtAuthorityTask> {

    protected StopExperimentAtAuthorityPartState(Job<?> job, SfaExperimentPart experimentPart, HighLevelTaskFactory hltf) {
        super(String.format("Delete all active resources at %s", experimentPart.getName()),
                hltf.deleteSliversAtAuthority(experimentPart.getExperiment().getSlice(), experimentPart.getConnectSfaAuthority()));
    }
}
