package com.njcn.gather.systemops.database.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.gather.systemops.database.pojo.param.DatabaseBackupParam;
import com.njcn.gather.systemops.database.pojo.po.DatabaseOperationTask;
import com.njcn.gather.systemops.database.pojo.vo.DatabaseTaskCreateVO;
import com.njcn.gather.systemops.database.pojo.vo.DatabaseTaskVO;

/**
 * 数据库运维任务服务。
 */
public interface DatabaseOperationTaskService extends IService<DatabaseOperationTask> {

    DatabaseTaskCreateVO createBackupTask(DatabaseBackupParam.CreateParam param);

    Page<DatabaseTaskVO> listBackupTasks(DatabaseBackupParam.TaskQueryParam param);

    DatabaseTaskVO getStatus(String taskId);

    boolean stopBackupTask(DatabaseBackupParam.StopParam param);

    DatabaseTaskCreateVO restartBackupTask(DatabaseBackupParam.RestartParam param);

    boolean deleteTask(String taskId, String confirmText);

    boolean existsRunningTask(String connectionId);
}
