package be.iminds.ilabt.jfed.experiment;

import be.iminds.ilabt.jfed.experiment.Experiment;
import be.iminds.ilabt.jfed.experiment.ExperimentController;
import be.iminds.ilabt.jfed.highlevel.jobs.JobFactory;

import be.iminds.ilabt.jfed.lowlevel.GeniUserProvider;
import be.iminds.ilabt.jfed.lowlevel.TestbedInfoSource;
import be.iminds.ilabt.jfed.preferences.JFedCorePreferences;

import javax.inject.Inject;
import javax.inject.Singleton;

/**
 * User: twalcari
 * Date: 2/5/2015
 * Time: 11:09
 */
@Singleton
public class ExperimentControllerFactory {

    private final JobFactory jobFactory;
    private final TestbedInfoSource testbedInfoSource;
    private final JFedCorePreferences jFedPreferences;
    private final GeniUserProvider geniUserProvider;


    @Inject
    public ExperimentControllerFactory(JobFactory jobFactory, TestbedInfoSource testbedInfoSource, JFedCorePreferences jFedPreferences, GeniUserProvider geniUserProvider) {
        this.jobFactory = jobFactory;
        this.testbedInfoSource = testbedInfoSource;
        this.jFedPreferences = jFedPreferences;
        this.geniUserProvider = geniUserProvider;
    }

    public ExperimentController createExperimentController(Experiment experiment){
        return new ExperimentController(experiment,  jobFactory, testbedInfoSource, jFedPreferences, geniUserProvider);
    }

}
