package ctbrec.ui.sites.camsoda;

import java.io.IOException;

import ctbrec.sites.camsoda.Camsoda;
import ctbrec.ui.sites.AbstractSiteUi;
import ctbrec.ui.sites.ConfigUI;
import ctbrec.ui.tabs.TabProvider;

public class CamsodaSiteUi extends AbstractSiteUi {

    private CamsodaTabProvider tabProvider;
    private CamsodaConfigUI configUi;
    private Camsoda camsoda;

    public CamsodaSiteUi(Camsoda camsoda) {
        this.camsoda = camsoda;
        tabProvider = new CamsodaTabProvider(camsoda);
        configUi = new CamsodaConfigUI(camsoda);
    }

    @Override
    public TabProvider getTabProvider() {
        return tabProvider;
    }

    @Override
    public ConfigUI getConfigUI() {
        return configUi;
    }

    @Override
    public synchronized boolean login() throws IOException {
        boolean automaticLogin = camsoda.login();
        return automaticLogin;
    }
}
