package be.iminds.ilabt.jfed;

import be.iminds.ilabt.jfed.lowlevel.BasicTestbedInfoSource;
import be.iminds.ilabt.jfed.lowlevel.TestbedInfoSource;
import be.iminds.ilabt.jfed.lowlevel.authority.AuthorityFinder;

import be.iminds.ilabt.jfed.preferences.JFedPreferences;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;

import javax.inject.Singleton;
import java.util.Collections;

/**
 * User: twalcari
 * Date: 1/13/2015
 * Time: 11:40
 */
public class EmptyTestbedInfoSourceModule extends AbstractModule {
    final TestbedInfoSource testbedInfoSource = BasicTestbedInfoSource.createFromTestbeds(Collections.emptyList());

    public EmptyTestbedInfoSourceModule() {
    }

    @Override
    protected void configure() {
    }

    @Provides
    @Singleton
    private AuthorityFinder provideAuthorityFinder(TestbedInfoSource testbedInfoSource, JFedPreferences jFedPreferences) {
        return new AuthorityFinder(testbedInfoSource, jFedPreferences);
    }

    @Provides
    @Singleton
    private TestbedInfoSource provideTestbedInfoSource() {
        return testbedInfoSource;
    }
}
