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

import be.iminds.ilabt.jfed.experiment.SfaExperimentPart;
import be.iminds.ilabt.jfed.highlevel.jobs.SingleCallState;
import be.iminds.ilabt.jfed.highlevel.tasks.HighLevelTaskFactory;
import be.iminds.ilabt.jfed.highlevel.tasks.ProvisionSliverTask;
import be.iminds.ilabt.jfed.lowlevel.api.user_spec.UserSpec;

import java.util.List;

/**
 * User: twalcari
 * Date: 12/4/2015
 * Time: 16:10
 */
public class ProvisionSliversOnAuthorityState extends SingleCallState<ProvisionSliverTask> {

    protected ProvisionSliversOnAuthorityState(SfaExperimentPart experimentPart,
                                               List<UserSpec> userSpecs, HighLevelTaskFactory hltf) {
        super(String.format("Provisioning resources on %s", experimentPart.getName()),
                hltf.provisionSliver(experimentPart.getExperiment().getSlice(),
                        experimentPart.getExperiment().getRequestedEndTime(),
                        experimentPart.getConnectSfaAuthority(),
                        userSpecs));
    }
}
