package eu.dnetlib.enabling.cron.rmi;

import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import eu.dnetlib.common.rmi.BaseService;

/**
 * CronService is a simple SOAP interface that exports the configured 
 * schedulable actions, and allows to manage them.
 * 
 * @author claudio
 *
 */
@WebService
public interface CronService extends BaseService {

	@WebMethod(operationName = "timeToNextRun")
	public String timeToNextRun(@WebParam(name = "action") String action);

	@WebMethod(operationName = "trigger")
	public void trigger(@WebParam(name = "action") String action);
	
	@WebMethod
	public List<String> getActions();
	
	@WebMethod(operationName = "setEnabled")
	public void setEnabled(@WebParam(name = "action") String action, @WebParam(name = "enable") boolean enable);
	
	@WebMethod(operationName = "isEnabled")
	public boolean isEnabled(@WebParam(name = "action") String action);	
	
	@WebMethod(operationName = "setCronExpression")
	public void setCronExpression(@WebParam(name = "action") String action, @WebParam(name = "cronExpression") String cronExpression);
	
	@WebMethod(operationName = "getCronExpression")
	public String getCronExpression(@WebParam(name = "action") String action);	
	
}
