package eu.dnetlib.enabling.database.rmi;

import java.util.Date;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.ws.wsaddressing.W3CEndpointReference;

import eu.dnetlib.common.rmi.BaseService;

@WebService
public interface DatabaseService extends BaseService {

	@WebMethod(operationName = "dumpTable")
	public W3CEndpointReference dumpTable(@WebParam(name = "db") String db, @WebParam(name = "table") String table);

	@WebMethod(operationName = "dumpTableAndLogs")
	public W3CEndpointReference dumpTableAndLogs(
			@WebParam(name = "db") String db,
			@WebParam(name = "table") String table,
			@WebParam(name = "from") Date from,
			@WebParam(name = "until") Date until);

	@WebMethod(operationName = "importFromEPR")
	public boolean importFromEPR(@WebParam(name = "db") String db, @WebParam(name = "epr") W3CEndpointReference epr, @WebParam(name = "xslt") String xslt);

	@WebMethod(operationName = "searchSQL")
	public W3CEndpointReference searchSQL(@WebParam(name = "db") String db, @WebParam(name = "sql") String sql);
	
	@WebMethod(operationName = "alternativeSearchSQL")
	public W3CEndpointReference alternativeSearchSQL(@WebParam(name = "db") String db, @WebParam(name = "sql") String sql, @WebParam(name = "sqlForSize") String sqlForSize);

	@WebMethod(operationName = "updateSQL")
	public boolean updateSQL(@WebParam(name = "db") String db, @WebParam(name = "sql") String sql);	

	@WebMethod(operationName = "xsltSearchSQL")
	public W3CEndpointReference xsltSearchSQL(@WebParam(name = "db") String db, @WebParam(name = "sql") String sql, @WebParam(name = "xslt") String xslt);

	@WebMethod(operationName = "alternativeXsltSearchSQL")
	public W3CEndpointReference alternativeXsltSearchSQL(@WebParam(name = "db") String db, @WebParam(name = "sql") String sql, @WebParam(name = "sqlForSize") String sqlForSize, @WebParam(name = "xslt") String xslt);

	@WebMethod(operationName = "contains")
	public boolean contains(@WebParam(name = "db") String db, @WebParam(name = "table") String table, @WebParam(name = "column") String column, @WebParam(name = "value") String value);

}
