/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import connectors.AdministratorSF;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import peaconnector.PeaConnector;
import peaconnector.RemoteException;

/**
 *
 * @author Budai Attila
 */
public class Connector {

    private PeaConnector pc;
    private AdministratorSF dfs;
    private static Connector INSTANCE = null;

    private Connector() throws RemoteException {
        try {
            pc = new PeaConnector(new URL("http://localhost/Pea/peaserv.php"), "desktop");

        } catch (MalformedURLException ex) {
            //Logger.getLogger(Connector.class.getName()).log(Level.SEVERE, null, ex);
            }
        dfs = new AdministratorSF(pc);
    }

    public static Connector getINSTANCE() throws RemoteException {
        if (INSTANCE == null) {
            INSTANCE = new Connector();
        }
        return INSTANCE;
    }

    public AdministratorSF getDfs() {
        return dfs;
    }

    public PeaConnector getPc() {
        return pc;
    }
}
