package com.yihu.hos.datacollect.service.intf;

import com.yihu.hos.web.framework.model.ActionResult;
import com.yihu.hos.datacollect.model.RsJobConfig;
import com.yihu.hos.web.framework.model.DataGridResult;

import java.util.Map;

/**
 * Created by hzp on 2015/12/25.
 */
public interface IDatacollectManager {

    /**
     * 根据JobId获取Cron表达式
     */
    public String getCronByJobId(String jobId) throws Exception;

    /**
     * 根据ID获取任务详细
     * @return
     */
    public RsJobConfig getJobById(String id) throws Exception;

    /**
     * 获取任务列表
     */
    public DataGridResult getJobList(Map<String, Object> conditionMap, int page, int rows) throws Exception;

    /**
     * 根据适配方案获取数据集列表
     */
    public DataGridResult getSchemeDataset(String schemeId, String schemeVersion, String jobId) throws Exception;

    /**
     * 根据适配方案获取字段列表
     */
    public DataGridResult getSchemeDatasetCol(String schemeId, String schemeVersion, String datasetId) throws Exception;

    /**
     * 根据任务Id获取相关数据集下拉数据
     */
    public DataGridResult getJobDatasetByJobId(String jobId) throws Exception;

    /**
     * 新增任务
     */
    public ActionResult addJob(RsJobConfig obj, String cron, String jobDataset) throws Exception;

    /**
     * 修改任务
     */
    public ActionResult updateJob(RsJobConfig obj, String cron, String jobDataset) throws Exception;

    /**
     * 修改任务
     */
    public ActionResult updateJob(RsJobConfig obj) throws Exception;


    /**
     * 删除任务
     */
    public ActionResult deleteJob(String id) throws Exception;

    /**
     * 修改任务状态
     */
    public ActionResult validJob(String jobId, String valid) throws Exception;

    /**
     * 数据集数据源管理列表（包含全部数据集）
     */
    public DataGridResult getDatasetSource(String stdVersion) throws Exception;


    /**
     * 保存数据集数据源配置
     */
    public ActionResult saveDatasetSource(String json) throws Exception;

    /**
     * 获取任务日志列表
     */
    public DataGridResult getJobLogDetail(Map<String, Object> conditionMap, int page, int rows) throws Exception;

    /**
     * 获取任务日志列表
     */
    public DataGridResult getJobLog(Map<String, Object> conditionMap, int page, int rows) throws Exception;

    /**
     * 任务详细根据数据集分组
     */
    public DataGridResult getJobLogDataset(String logId) throws Exception;
}
