package eu.dnetlib.enabling.ui.common.utils;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

import eu.dnetlib.enabling.ui.common.services.AuthenticationService;
import eu.dnetlib.enabling.ui.common.services.AuthenticationServiceAsync;
import eu.dnetlib.enabling.ui.common.services.IndexService;
import eu.dnetlib.enabling.ui.common.services.IndexServiceAsync;
import eu.dnetlib.enabling.ui.common.services.LookupService;
import eu.dnetlib.enabling.ui.common.services.LookupServiceAsync;
import eu.dnetlib.enabling.ui.common.services.ManagerService;
import eu.dnetlib.enabling.ui.common.services.ManagerServiceAsync;
import eu.dnetlib.enabling.ui.common.services.RegistryService;
import eu.dnetlib.enabling.ui.common.services.RegistryServiceAsync;




public class GWTStubs {
	public static final LookupServiceAsync lookupService = (LookupServiceAsync) GWT.create(LookupService.class);
	public static final RegistryServiceAsync registryService = (RegistryServiceAsync) GWT.create(RegistryService.class);
	public static final AuthenticationServiceAsync authService = (AuthenticationServiceAsync) GWT.create(AuthenticationService.class);
	public static final AuthenticationServiceAsync repoAuthService = (AuthenticationServiceAsync) GWT.create(AuthenticationService.class);
	public static final IndexServiceAsync indexService = (IndexServiceAsync) GWT.create(IndexService.class);
	public static final ManagerServiceAsync msroService = (ManagerServiceAsync) GWT.create(ManagerService.class);

	static {
		((ServiceDefTarget) lookupService).setServiceEntryPoint(GWTConstants.LOOKUP_SERVLET_URL);
		((ServiceDefTarget) registryService).setServiceEntryPoint(GWTConstants.REGISTRY_SERVLET_URL);
		((ServiceDefTarget) authService).setServiceEntryPoint(GWTConstants.AUTHENTICATION_SERVLET_URL);
		((ServiceDefTarget) repoAuthService).setServiceEntryPoint(GWTConstants.REPO_AUTHENTICATION_SERVLET_URL);
		((ServiceDefTarget) indexService).setServiceEntryPoint(GWTConstants.INDEX_SERVLET_URL);
		((ServiceDefTarget) msroService).setServiceEntryPoint(GWTConstants.MSRO_SERVLET_URL);
	}
}
